Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FastTrackingEval.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FastTrackingEval.h
1 
8 #ifndef __FastTrackingEval_H__
9 #define __FastTrackingEval_H__
10 
11 #include <fun4all/SubsysReco.h>
12 #include <string>
13 
14 //Forward declerations
15 class PHCompositeNode;
17 class SvtxClusterMap;
18 class SvtxTrackMap;
19 class TFile;
20 class TTree;
21 class TH2D;
22 
23 
24 //Brief: basic ntuple and histogram creation for sim evaluation
26 {
27  public:
28  //Default constructor
29  FastTrackingEval(const std::string &name="FastTrackingEval",
30  const std::string &filename = "g4eval.root",
31  const std::string &trackmapname = "SvtxTrackMap");
32 
33  //Initialization, called for initialization
34  int Init(PHCompositeNode *);
35 
36  //Process Event, called for each event
38 
39  //End, write and close files
40  int End(PHCompositeNode *);
41 
42  //Change output filename
43  void set_filename(const char* file)
44  { if(file) _outfile_name = file; }
45 
46  //Flags of different kinds of outputs
47  enum Flag
48  {
49  //all disabled
50  NONE = 0,
51  };
52 
53  //Set the flag
54  //Flags should be set like set_flag(FastTrackingEval::TRUTH, true) from macro
55  void set_flag(const Flag& flag, const bool& value)
56  {
57  if(value) _flags |= flag;
58  else _flags &= (~flag);
59  }
60 
61  //User modules
63  void reset_variables();
64 
65  private:
66  //output filename
68 
69  //name of SvtxTrackMap collection
71 
72  //Event counter
73  int _event;
74 
75  //Get all the nodes
77 
78  //flags
79  unsigned int _flags;
80 
81  //TTrees
83  int event;
84  //-- truth
85  int gtrackID;
86  int gflavor;
87  float gpx;
88  float gpy;
89  float gpz;
90  float gpt;
91  float gp;
92  float gtheta;
93  float geta;
94  float gphi;
95  float gvx;
96  float gvy;
97  float gvz;
98 
99  //-- reco
100  int trackID;
101  int charge;
102  int nhits;
103  float px;
104  float py;
105  float pz;
106  float pt;
107  float p;
108  float theta;
109  float eta;
110  float phi;
111  float dca2d;
112 
113  //Histos
116 
117  //Node pointers
120 
121 };
122 
123 #endif //* __FastTrackingEval_H__ *//