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.
event & generator actions - just run action then I can test
- Loading branch information
Showing
8 changed files
with
169 additions
and
3 deletions.
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,44 @@ | ||
#include "HKG4EventAction.h" | ||
|
||
#include "WCSimEventAction.hh" | ||
#include "WCSimPrimaryGeneratorAction.hh" | ||
#include "WCSimDetectorConstruction.hh" | ||
#include "WCSimRunAction.hh" | ||
|
||
using namespace HK::Ghost::G4; | ||
|
||
HKG4EventAction::HKG4EventAction() : Tool() {} | ||
|
||
bool HKG4EventAction::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; | ||
|
||
const WCSimRunAction* cp_run = | ||
static_cast<const WCSimRunAction*>(m_data->m_p_run_manager->GetUserRunAction()); | ||
const WCSimDetectorConstruction* cp_det = | ||
static_cast<const WCSimDetectorConstruction*>(m_data->m_p_run_manager->GetUserDetectorConstruction()); | ||
const WCSimPrimaryGeneratorAction* cp_gen = | ||
static_cast<const WCSimPrimaryGeneratorAction*>(m_data->m_p_run_manager->GetUserPrimaryGeneratorAction()); | ||
|
||
m_data->m_p_run_manager->SetUserAction(new WCSimEventAction(cp_run, cp_det, cp_gen)); | ||
|
||
return true; | ||
} | ||
|
||
bool HKG4EventAction::Execute() { | ||
|
||
return true; | ||
} | ||
|
||
bool HKG4EventAction::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,42 @@ | ||
#ifndef HKG4EventAction_H | ||
#define HKG4EventAction_H | ||
|
||
#include <iostream> | ||
#include <string> | ||
|
||
#include <DataModel.h> | ||
#include "Tool.h" | ||
|
||
/** | ||
* \class HKG4EventAction | ||
* | ||
* 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 HKG4EventAction : public Tool { | ||
|
||
public: | ||
|
||
HKG4EventAction(); ///< 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: | ||
}; | ||
} // 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 @@ | ||
# HKG4EventAction |
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,34 @@ | ||
#include "HKG4PrimaryGeneratorAction.h" | ||
|
||
#include "WCSimPrimaryGeneratorAction.hh" | ||
|
||
using namespace HK::Ghost::G4; | ||
|
||
HKG4PrimaryGeneratorAction::HKG4PrimaryGeneratorAction() : Tool() {} | ||
|
||
bool HKG4PrimaryGeneratorAction::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_data->m_p_run_manager->SetUserAction(new WCSimPrimaryGeneratorAction(static_cast<const WCSimDetectorConstruction*>(m_data->m_p_run_manager->GetUserDetectorConstruction()))); | ||
|
||
return true; | ||
} | ||
|
||
bool HKG4PrimaryGeneratorAction::Execute() { | ||
|
||
return true; | ||
} | ||
|
||
bool HKG4PrimaryGeneratorAction::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,42 @@ | ||
#ifndef HKG4PrimaryGeneratorAction_H | ||
#define HKG4PrimaryGeneratorAction_H | ||
|
||
#include <iostream> | ||
#include <string> | ||
|
||
#include <DataModel.h> | ||
#include "Tool.h" | ||
|
||
/** | ||
* \class HKG4PrimaryGeneratorAction | ||
* | ||
* 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 HKG4PrimaryGeneratorAction : public Tool { | ||
|
||
public: | ||
|
||
HKG4PrimaryGeneratorAction(); ///< 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: | ||
}; | ||
} // 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 @@ | ||
# HKG4PrimaryGeneratorAction |
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