Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PHG4Reco.h
Go to the documentation of this file.
1 #ifndef PHG4Reco_h
2 #define PHG4Reco_h
3 
5 
6 #include <fun4all/SubsysReco.h>
7 
8 #include <phfield/PHFieldConfig.h>
9 
10 #include <phool/PHTimeServer.h>
11 
12 #include <list>
13 
14 // Forward declerations
15 class PHCompositeNode;
16 class G4RunManager;
18 class PHG4PhenixDetector;
22 class PHG4Subsystem;
23 class PHG4EventGenerator;
24 class G4VModularPhysicsList;
26 class G4VUserPrimaryGeneratorAction;
27 class PHG4UIsession;
28 
29 // for the G4 cmd interface and the graphics
30 class G4UImanager;
31 class G4VisManager;
32 
38 class PHG4Reco : public SubsysReco
39 {
40  public:
42  PHG4Reco(const std::string &name = "PHG4RECO");
43 
45  virtual ~PHG4Reco();
46 
48  int Init(PHCompositeNode *);
49 
50  int InitRun(PHCompositeNode *topNode);
51 
54 
57 
59  int End(PHCompositeNode *);
60 
62  void Print(const std::string &what = std::string()) const;
63 
66  {
67  subsystems_.push_back(subsystem);
68  }
69 
71  int ApplyCommand(const std::string &cmd);
72 
74  int StartGui();
75 
76  int InitField(PHCompositeNode *topNode);
77 
79  void set_field(const float tesla)
80  {
81  magfield = tesla;
82  }
83 
87  void set_field_map(const std::string &fmap, const PHFieldConfig::FieldConfigTypes dim)
88  {
89  fieldmapfile = fmap;
90  mapdim = dim;
91  }
92 
94  void set_field_rescale(const float rescale) { magfield_rescale = rescale; }
95 
96  void set_decayer_active(bool b) { active_decayer_ = b; }
97  void set_force_decay(EDecayType force_decay_type)
98  {
99  active_decayer_ = true;
100  active_force_decay_ = true;
101  force_decay_type_ = force_decay_type;
102  }
103 
105  void set_optical_photon(bool b) { optical_photon_ = b; }
106  void set_energy_threshold(double t) { energy_threshold_ = t; }
107  void set_zero_field_line(double z) { zero_field_line_ = z; }
108 
110  void save_DST_geometry(bool b) { save_DST_geometry_ = b; }
111  void SetWorldSizeX(const double sx) { WorldSize[0] = sx; }
112  void SetWorldSizeY(const double sy) { WorldSize[1] = sy; }
113  void SetWorldSizeZ(const double sz) { WorldSize[2] = sz; }
114  double GetWorldSizeX() const { return WorldSize[0]; }
115  double GetWorldSizeY() const { return WorldSize[1]; }
116  double GetWorldSizeZ() const { return WorldSize[2]; }
117  void SetWorldShape(const std::string &s) { worldshape = s; }
118  void SetWorldMaterial(const std::string &s) { worldmaterial = s; }
119  void SetPhysicsList(const std::string &s) { physicslist = s; }
120  void set_rapidity_coverage(const double eta);
121 
123 
124  static void G4Seed(const unsigned int i);
125 
126  // this is an ugly hack to get Au ions working for CAD
127  // our particle generators have pdg build in which doesn't work
128  // with ions, so the generator action has to be replaced
129  // which is hardcoded in PHG4Reco (it has to be created after
130  // the physics lists are instantiated
131  void setGeneratorAction(G4VUserPrimaryGeneratorAction *action);
132 
133  PHG4Subsystem *getSubsystem(const std::string &name);
134 
135  void Dump_GDML(const std::string &filename);
136 
137  void G4Verbosity(const int i);
138  protected:
139  int InitUImanager();
140  void DefineMaterials();
141  void DefineRegions();
142  float magfield;
144  double WorldSize[3];
145 
148 
150  G4RunManager *runManager_;
151 
154 
157 
160 
163 
166 
169 
171  typedef std::list<PHG4Subsystem *> SubsystemList;
173 
174  // visualization
175  G4VisManager *visManager;
176 
179  std::string fieldmapfile;
180  std::string worldshape;
181  std::string worldmaterial;
182  std::string physicslist;
183 
184  // settings for the external Pythia6 decayer
185  bool active_decayer_; //< turn on/off decayer
186  bool active_force_decay_; //< turn on/off force decay channels
187  EDecayType force_decay_type_; //< forced decay channel setting
188 
190 
193 
195  bool optical_photon_; //< enable process for the optical photon, default disabled
196  double energy_threshold_; //< kill low-energy tracks fast, set to 0. to disable
197  double zero_field_line_; //< z position after which the field manager will be set to nullptr, set to numbers larger than the world size to disable
198 };
199 
200 #endif
PHG4PrimaryGeneratorAction * generatorAction_
event generator (read from PHG4INEVENT node)
Definition: PHG4Reco.h:168
int End(PHCompositeNode *)
end of run method
Definition: PHG4Reco.cc:672
void set_zero_field_line(double z)
Definition: PHG4Reco.h:107
std::string fieldmapfile
Definition: PHG4Reco.h:179
G4VisManager * visManager
Definition: PHG4Reco.h:175
double GetWorldSizeZ() const
Definition: PHG4Reco.h:116
Runs G4 as a subsystem.
Definition: PHG4Reco.h:38
SubsystemList subsystems_
Definition: PHG4Reco.h:172
void SetWorldMaterial(const std::string &s)
Definition: PHG4Reco.h:118
const double s
void SetWorldShape(const std::string &s)
Definition: PHG4Reco.h:117
int ResetEvent(PHCompositeNode *)
Clean up after each event.
Definition: PHG4Reco.cc:661
int InitField(PHCompositeNode *topNode)
Definition: PHG4Reco.cc:279
void DefineMaterials()
Definition: PHG4Reco.cc:751
PHG4PhenixSteppingAction * steppingAction_
pointer to main stepping action
Definition: PHG4Reco.h:162
void G4Verbosity(const int i)
Definition: PHG4Reco.cc:1403
std::string physicslist
Definition: PHG4Reco.h:182
int InitUImanager()
Definition: PHG4Reco.cc:586
PHG4Reco(const std::string &name="PHG4RECO")
constructor
Definition: PHG4Reco.cc:118
void Dump_GDML(const std::string &filename)
Definition: PHG4Reco.cc:560
std::string worldmaterial
Definition: PHG4Reco.h:181
void set_field(const float tesla)
set default magnetic field strength with a constant magnetic field. Only valid if set_field_map() is ...
Definition: PHG4Reco.h:79
void DefineRegions()
Definition: PHG4Reco.cc:1366
static void G4Seed(const unsigned int i)
Definition: PHG4Reco.cc:725
void save_DST_geometry(bool b)
Save geometry from Geant4 to DST.
Definition: PHG4Reco.h:110
PHG4UIsession * uisession_
pointer to geant ui session
Definition: PHG4Reco.h:153
bool active_decayer_
Definition: PHG4Reco.h:185
float magfield_rescale
Definition: PHG4Reco.h:143
double _eta_coverage
Definition: PHG4Reco.h:177
virtual ~PHG4Reco()
destructor
Definition: PHG4Reco.cc:158
void set_field_map(const std::string &fmap, const PHFieldConfig::FieldConfigTypes dim)
Definition: PHG4Reco.h:87
G4RunManager * runManager_
pointer to geant run manager
Definition: PHG4Reco.h:150
EDecayType force_decay_type_
Definition: PHG4Reco.h:187
int Init(PHCompositeNode *)
full initialization
Definition: PHG4Reco.cc:175
PHG4PhenixEventAction * eventAction_
pointer to main event action
Definition: PHG4Reco.h:159
double WorldSize[3]
Definition: PHG4Reco.h:144
std::string worldshape
Definition: PHG4Reco.h:180
PHG4PhenixDetector * detector_
pointer to detector
Definition: PHG4Reco.h:156
PHTimeServer::timer _timer
module timer.
Definition: PHG4Reco.h:192
bool save_DST_geometry_
Definition: PHG4Reco.h:189
PHG4Subsystem * getSubsystem(const std::string &name)
Definition: PHG4Reco.cc:1384
void set_energy_threshold(double t)
Definition: PHG4Reco.h:106
PHG4PhenixTrackingAction * trackingAction_
pointer to main tracking action
Definition: PHG4Reco.h:165
void set_optical_photon(bool b)
speed-up options setters
Definition: PHG4Reco.h:105
void SetWorldSizeX(const double sx)
Definition: PHG4Reco.h:111
EDecayType
Definition: EDecayType.hh:41
bool optical_photon_
speed up options
Definition: PHG4Reco.h:195
int InitRun(PHCompositeNode *topNode)
Definition: PHG4Reco.cc:320
int process_event(PHCompositeNode *)
event processing method
Definition: PHG4Reco.cc:600
void SetPhysicsList(const std::string &s)
Definition: PHG4Reco.h:119
PHFieldConfig::FieldConfigTypes mapdim
Definition: PHG4Reco.h:178
void set_rapidity_coverage(const double eta)
Definition: PHG4Reco.cc:719
void set_decayer_active(bool b)
Definition: PHG4Reco.h:96
void Print(const std::string &what=std::string()) const
print info
Definition: PHG4Reco.cc:677
double GetWorldSizeX() const
Definition: PHG4Reco.h:114
void set_field_rescale(const float rescale)
set default scaling factor for input magnetic field map. If available, Field map setting on DST take ...
Definition: PHG4Reco.h:94
int StartGui()
start the gui
Definition: PHG4Reco.cc:574
this is the main detector construction class, passed to geant to construct the entire phenix detector...
bool active_force_decay_
Definition: PHG4Reco.h:186
int setupInputEventNodeReader(PHCompositeNode *)
Definition: PHG4Reco.cc:692
std::list< PHG4Subsystem * > SubsystemList
list of subsystems
Definition: PHG4Reco.h:171
float magfield
Definition: PHG4Reco.h:142
G4TBMagneticFieldSetup * field_
magnetic field
Definition: PHG4Reco.h:147
int ApplyCommand(const std::string &cmd)
interface to G4 cmd interpreter
Definition: PHG4Reco.cc:566
void setGeneratorAction(G4VUserPrimaryGeneratorAction *action)
Definition: PHG4Reco.cc:710
double zero_field_line_
Definition: PHG4Reco.h:197
double energy_threshold_
Definition: PHG4Reco.h:196
double GetWorldSizeY() const
Definition: PHG4Reco.h:115
void registerSubsystem(PHG4Subsystem *subsystem)
register subsystem
Definition: PHG4Reco.h:65
PHTimer server for accessing external information.
void set_force_decay(EDecayType force_decay_type)
Definition: PHG4Reco.h:97
string cmd
Definition: submit_bnl.py:63
void SetWorldSizeZ(const double sz)
Definition: PHG4Reco.h:113
void SetWorldSizeY(const double sy)
Definition: PHG4Reco.h:112
wrapper around PHTimer, for storage in a map
Definition: PHTimeServer.h:34