forked from hyperk/GHOST-WCSim
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HKG4StackingAction is now its own tool. Doing this proves that we can…
… get pointers to classes from the G4RunManager, as long as they are const
- Loading branch information
Showing
5 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "HKG4StackingAction.h" | ||
|
||
using namespace HK::Ghost::G4; | ||
|
||
HKG4StackingAction::HKG4StackingAction() : Tool() {} | ||
|
||
bool HKG4StackingAction::Initialise(std::string configfile, DataModel& data) { | ||
|
||
if(configfile != "") | ||
m_variables.Initialise(configfile); | ||
// m_variables.Print(); | ||
|
||
m_data = &data; | ||
m_log = m_data->Log; | ||
|
||
if(!m_variables.Get("verbose", m_verbose)) | ||
m_verbose = 1; | ||
|
||
m_p_UI = G4UImanager::GetUIpointer(); | ||
m_data->m_p_run_manager->SetUserAction(new WCSimStackingAction(static_cast<const WCSimDetectorConstruction*>(m_data->m_p_run_manager->GetUserDetectorConstruction()))); | ||
|
||
return true; | ||
} | ||
|
||
bool HKG4StackingAction::Execute() { | ||
|
||
return true; | ||
} | ||
|
||
bool HKG4StackingAction::Finalise() { | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#ifndef HKG4StackingAction_H | ||
#define HKG4StackingAction_H | ||
|
||
#include <iostream> | ||
#include <string> | ||
|
||
#include <DataModel.h> | ||
#include "Tool.h" | ||
|
||
#include "G4UImanager.hh" | ||
|
||
#include "WCSimStackingAction.hh" | ||
|
||
/** | ||
* \class HKG4StackingAction | ||
* | ||
* This is a blank template for a Tool used by the script to generate a new custom tool. Please fill out the | ||
* description and author information. | ||
* | ||
* $Author: B.Richards $ | ||
* $Date: 2019/05/28 10:44:00 $ | ||
*/ | ||
|
||
namespace HK { | ||
namespace Ghost { | ||
namespace G4 { | ||
class HKG4StackingAction : public Tool { | ||
|
||
public: | ||
|
||
HKG4StackingAction(); ///< Simple constructor | ||
bool Initialise(std::string configfile, | ||
DataModel& data); ///< Initialise Function for setting up Tool resources. @param | ||
///< configfile The path and name of the dynamic configuration file | ||
///< to read in. @param data A reference to the transient data | ||
///< class used to pass information between Tools. | ||
bool Execute(); ///< Execute function used to perform Tool purpose. | ||
bool Finalise(); ///< Finalise funciton used to clean up resources. | ||
|
||
private: | ||
G4UImanager* m_p_UI; | ||
}; | ||
} // namespace G4 | ||
} // namespace Ghost | ||
} // namespace HK | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# HKG4StackingAction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters