ECCE @ EIC 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  PHG4Reco(const std::string &name = "PHG4RECO");
42 
44  ~PHG4Reco() override;
45 
47  int Init(PHCompositeNode *) override;
48 
49  int InitRun(PHCompositeNode *topNode) override;
50 
52  int process_event(PHCompositeNode *) override;
53 
55  int ResetEvent(PHCompositeNode *) override;
56 
58  void Print(const std::string &what = std::string()) const override;
59 
62  {
63  m_SubsystemList.push_back(subsystem);
64  }
65 
67  int ApplyCommand(const std::string &cmd);
68 
70  int StartGui();
71 
72  int InitField(PHCompositeNode *topNode);
73 
75  void set_field(const float tesla)
76  {
78  }
79 
83  void set_field_map(const std::string &fmap, const PHFieldConfig::FieldConfigTypes dim)
84  {
85  m_FieldMapFile = fmap;
87  }
88 
90  void set_field_rescale(const float rescale) { m_MagneticFieldRescale = rescale; }
91 
93  void set_force_decay(EDecayType force_decay_type)
94  {
95  m_ActiveDecayerFlag = true;
97  m_ForceDecayType = force_decay_type;
98  }
99 
102  void SetWorldSizeX(const double sx) { m_WorldSize[0] = sx; }
103  void SetWorldSizeY(const double sy) { m_WorldSize[1] = sy; }
104  void SetWorldSizeZ(const double sz) { m_WorldSize[2] = sz; }
105  double GetWorldSizeX() const { return m_WorldSize[0]; }
106  double GetWorldSizeY() const { return m_WorldSize[1]; }
107  double GetWorldSizeZ() const { return m_WorldSize[2]; }
108  void SetWorldShape(const std::string &s) { m_WorldShape = s; }
109  void SetWorldMaterial(const std::string &s) { m_WorldMaterial = s; }
110  void SetPhysicsList(const std::string &s) { m_PhysicsList = s; }
111  void set_rapidity_coverage(const double eta);
112 
114 
115  static void G4Seed(const unsigned int i);
116 
117  PHG4Subsystem *getSubsystem(const std::string &name);
119  void Dump_GDML(const std::string &filename);
120  void Dump_G4_GDML(const std::string &filename);
121 
122  void G4Verbosity(const int i);
123 
126  void ApplyDisplayAction();
127 
128  private:
129  static void g4guithread(void *ptr);
130  int InitUImanager();
131  void DefineMaterials();
132  void DefineRegions();
133 
134  float m_MagneticField = 0.;
136  double m_WorldSize[3];
137 
140 
143 
146 
149 
152 
155 
158 
161 
163 
165 
168 
170  std::list<PHG4Subsystem *> m_SubsystemList;
171 
172  // visualization
174 
175  // Message interface to Fun4All
177 
178  // for the G4 cmd line interface
182  std::string m_FieldMapFile;
183  std::string m_WorldShape;
184  std::string m_WorldMaterial;
185  std::string m_PhysicsList;
186 
187  // settings for the external Pythia6 decayer
188  bool m_ActiveDecayerFlag; //< turn on/off decayer
189  bool m_ActiveForceDecayFlag; //< turn on/off force decay channels
190  EDecayType m_ForceDecayType; //< forced decay channel setting
191 
194 };
195 
196 #endif