31 #include "SToGSConfig.hh"
38 fWhichGenerator(
"GPS",
"G4Macros/GPSPointLike.mac"),
39 fWhichGeometry(
"factory",
"DetectorFactory/Generics/Target"),
40 fWhichPhysics(
"stogs_m",
"general0;emstandard_opt0;"),
41 fWhichActionManager(
"PrintOut",
"run;event;track;step"),
44 G4cout << G4endl <<
" ------ INF ------ from UserActionManager::UserActionManager with " << filename << G4endl;
47 std::ifstream file(filename);
48 if ( file.is_open() == false ) {
49 G4cout <<
" ** SToGS WARNING ** Cannot open file, Default parameters to be used "<< G4endl;
52 std::string aline; getline(file,aline);
53 while ( file.good() && !file.eof() ) {
55 if ( aline[0] ==
'#' ){
60 std::string key, which, option; std::istringstream decode(aline); decode >> key;
62 if ( key ==
"actions:" ) {
63 decode >> which >> option;
66 if ( key ==
"setup:" ) {
67 decode >> which >> option;
70 if ( key ==
"physics:" ) {
71 decode >> which >> option;
74 if ( key ==
"generator:" ) {
75 decode >> which >> option;
78 if ( key ==
"nbthread:" ) {
88 if ( fImplementation == 0x0 ) {
89 G4cout <<
" *** SToGS ERROR *** Action Manager is not known *** SToGS ERROR *** " << G4endl;
95 G4cout <<
" ActionManager has been initiated with " << G4endl;
101 G4cout <<
" ------ END ------ from UserActionManager::UserActionManager " << G4endl;
106 #ifdef HAS_STOGS_ROOT_EVENTS
112 if ( fWhichActionManager.first ==
"printout" ) {
115 if ( fWhichActionManager.first ==
"ascii" ) {
116 fImplementation =
new SToGS::Ascii(fWhichActionManager.second);
118 #ifdef HAS_STOGS_ROOT_EVENTS
119 if ( fWhichActionManager.first ==
"stogstree" ) {
125 if ( fWhichActionManager.first.contains(MYACT_) ) {
126 fImplementation =
new MYACT_CLASSTYPE(fWhichActionManager.second);
129 return fImplementation;
136 G4VUserDetectorConstruction *detectorconstruction = 0x0;
137 if ( fWhichGeometry.first ==
"factory" ) {
141 return detectorconstruction;
148 G4VUserPhysicsList *physics_list = 0x0;
150 if ( fWhichPhysics.first ==
"stogs_m" ) {
SToGS::UserActionInitialization * ProvideUserActionInitialization()
depending of the configuration file, it returns the adapted UserActionInitialization ...
Extract informations from Geant4 using SToGS sensitives and write hits in ascii files.
UserActionManager(G4String configurationfile="")
std::pair< G4String, G4String > fWhichGenerator
In principle in Geant4.10, geometry and physics are golbal so they are not provided by G4VUserActionI...
virtual G4VUserPhysicsList * GetPhysicsList() const
Return the physics list depending of the configuration file.
This class allows to select different physics using the information stores in the file given to the c...
This is the ActionInitialization class to handle PrintOut at different levels (run, events ...) from a unique AllAction event Class.
std::pair< G4String, G4String > fWhichGeometry
The BaseROOTEvents is use to init G4 kernel with the actions defined in BaseROOTEventsUserAction.
Base class to manage SToGS user's hooks + the generator.
to load a setup from the factory
std::pair< G4String, G4String > fWhichActionManager
Real stuff the G4VUserActionInitialization should deal with.
std::pair< G4String, G4String > SetWhichGenerator(G4String which_gene, G4String option)
once allocated the generator associated with a UserActionInititialization could be changed here befor...
virtual G4VUserDetectorConstruction * GetDetectorConstruction() const
Return the detector depending of the configuration file.
std::pair< G4String, G4String > fWhichPhysics