Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4TrackFastSimEval.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4TrackFastSimEval.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
10 #ifndef G4TRACKFASTSIM_PHG4TRACKFASTSIMEVAL_H
11 #define G4TRACKFASTSIM_PHG4TRACKFASTSIMEVAL_H
12 
13 #include <fun4all/SubsysReco.h>
14 
15 #include <map>
16 #include <string>
17 #include <vector>
18 
19 //Forward declarations
20 class PHCompositeNode;
22 class SvtxTrackMap;
23 class SvtxVertexMap;
24 class TTree;
25 class TH2D;
26 
27 //Brief: basic ntuple and histogram creation for sim evaluation
29 {
30  public:
31  //Default constructor
32  PHG4TrackFastSimEval(const std::string& name = "PHG4TrackFastSimEval",
33  const std::string& filename = "g4eval.root",
34  const std::string& trackmapname = "SvtxTrackMap");
35 
36  //Initialization, called for initialization
37  int Init(PHCompositeNode*) override;
38 
39  //Initialization, called for initialization
40  int InitRun(PHCompositeNode*) override;
41 
42  //Process Event, called for each event
43  int process_event(PHCompositeNode*) override;
44 
45  //End, write and close files
46  int End(PHCompositeNode*) override;
47 
48  //Change output filename
50  {
52  }
53 
54  // set the name of the node with the trackmap
56  {
58  }
59 
60  //User modules
61  void reset_variables();
62 
63  void AddProjection(const std::string& name);
64 
65  private:
68 
69  //Get all the nodes
71 
72  //Node pointers
76 
77  //TTrees
80 
81  //Histos
84 
85  //Event counter
87 
88  // TTree variables
90  //-- truth
93  float m_TTree_gpx;
94  float m_TTree_gpy;
95  float m_TTree_gpz;
96  float m_TTree_gvx;
97  float m_TTree_gvy;
98  float m_TTree_gvz;
99  float m_TTree_gvt;
100 
101  //-- reco
105  float m_TTree_px;
106  float m_TTree_py;
107  float m_TTree_pz;
112 
114 
115  //vertex
116  float m_TTree_vx;
117  float m_TTree_vy;
118  float m_TTree_vz;
124 
125  //output filename
127 
128  //name of SvtxTrackMap collection
130 
131  // names and index of projections
132  std::map<std::string, unsigned int> m_ProjectionNameMap;
133  // projections to cylinders and planes
134  std::vector<std::vector<float>> m_TTree_proj_vec;
135  std::vector<std::vector<float>> m_TTree_proj_p_vec;
136  // hits on reference cylinders and planes
137  std::vector<std::vector<float>> m_TTree_ref_vec;
138  std::vector<std::vector<float>> m_TTree_ref_p_vec;
139 
140 };
141 
142 #endif //* G4TRACKFASTSIM_PHG4TRACKFASTSIMEVAL_H *//