Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4Reco.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4Reco.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4MAIN_PHG4RECO_H
4 #define G4MAIN_PHG4RECO_H
5 
7 
8 #include <fun4all/SubsysReco.h>
9 
10 #include <phfield/PHFieldConfig.h>
11 
12 #include <list>
13 #include <string> // for string
14 
15 // Forward declerations
16 class G4RunManager;
18 class G4UImanager;
19 class G4UImessenger;
20 class G4VisManager;
21 class PHCompositeNode;
22 class PHG4DisplayAction;
23 class PHG4PhenixDetector;
29 class PHG4Subsystem;
30 class PHG4UIsession;
31 
37 class PHG4Reco : public SubsysReco
38 {
39  public:
41  {
45 
46  }; // Decayer Option for User to Choose: 0 - GEANT 4 Internal Decayer (with momentum conservation issues), 1, PYTHIA 6 Decayer, 2 - EvtGen Decayer
47 
49  explicit PHG4Reco(const std::string &name = "PHG4RECO");
50 
52  ~PHG4Reco() override;
53 
55  int Init(PHCompositeNode *) override;
56 
57  int InitRun(PHCompositeNode *topNode) override;
58 
60  int process_event(PHCompositeNode *) override;
61 
63  int ResetEvent(PHCompositeNode *) override;
64 
66  void Print(const std::string &what = std::string()) const override;
67 
70  {
71  m_SubsystemList.push_back(subsystem);
72  }
73 
75  int ApplyCommand(const std::string &cmd);
76 
78  int StartGui();
79 
80  int InitField(PHCompositeNode *topNode);
81 
83  void set_field(const float tesla)
84  {
85  m_MagneticField = tesla;
86  }
87 
92  {
93  m_FieldMapFile = fmap;
95  }
96 
98  void set_field_rescale(const float rescale) { m_MagneticFieldRescale = rescale; }
99 
100  void set_force_decay(EDecayType force_decay_type)
101  {
102  m_ActiveForceDecayFlag = true;
103  m_ForceDecayType = force_decay_type;
104  }
105 
107 
109  void export_geometry(bool b, const std::string &filename = "sPHENIXGeom.root")
110  {
113  }
114 
117  void SetWorldSizeX(const double sx) { m_WorldSize[0] = sx; }
118  void SetWorldSizeY(const double sy) { m_WorldSize[1] = sy; }
119  void SetWorldSizeZ(const double sz) { m_WorldSize[2] = sz; }
120  double GetWorldSizeX() const { return m_WorldSize[0]; }
121  double GetWorldSizeY() const { return m_WorldSize[1]; }
122  double GetWorldSizeZ() const { return m_WorldSize[2]; }
126  void set_rapidity_coverage(const double eta);
127 
129 
130  static void G4Seed(const unsigned int i);
131 
134  void Dump_GDML(const std::string &filename);
135  void Dump_G4_GDML(const std::string &filename);
136 
137  void G4Verbosity(const int i);
138 
141  void ApplyDisplayAction();
142 
144  {
146  if (!EvtGenDecayFile.empty()) CustomizeDecay = true;
147  }
148 
149  private:
150  static void g4guithread(void *ptr);
151  int InitUImanager();
152  void DefineMaterials();
153  void DefineRegions();
154 
155  float m_MagneticField = 0.;
157  double m_WorldSize[3]{1000., 1000., 1000.};
158 
161 
163  G4RunManager *m_RunManager = nullptr;
164 
167 
170 
173 
176 
179 
182 
184 
186 
189 
191  std::list<PHG4Subsystem *> m_SubsystemList;
192 
193  // visualization
194  G4VisManager *m_VisManager = nullptr;
195 
196  // Message interface to Fun4All
197  G4UImessenger *m_Fun4AllMessenger = nullptr;
198 
199  // for the G4 cmd line interface
200  G4UImanager *m_UImanager = nullptr;
201  double m_EtaCoverage = 1.0;
206  std::string m_PhysicsList = "FTFP_BERT";
207 
208  bool m_ExportGeometry = false;
209  std::string m_ExportGeomFilename = "sPHENIXGeom.root";
210 
211  // settings for the external Pythia6 decayer
212  // bool m_ActiveDecayerFlag = true; //< turn on/off decayer
213  bool m_ActiveForceDecayFlag = false; //< turn on/off force decay channels
214 
215  DecayerOptions m_Decayer = kEvtGenDecayer; // Here we use EvtGen as default
217  bool CustomizeDecay = false;
218 
219  EDecayType m_ForceDecayType = kAll; //< forced decay channel setting
220 
222  bool m_disableUserActions = false;
223 };
224 
225 #endif