Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AnaSvtxTracksForGenFit.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file AnaSvtxTracksForGenFit.h
1 #ifndef __AnaSvtxTracksForGenFit_H__
2 #define __AnaSvtxTracksForGenFit_H__
3 
4 #include <fun4all/SubsysReco.h>
5 #include <string>
6 
7 //Forward declerations
8 class PHCompositeNode;
10 class SvtxClusterMap;
11 class SvtxEvalStack;
12 class TFile;
13 class TTree;
14 
15 
16 //Brief: basic ntuple and histogram creation for sim evaluation
18 {
19  public:
20  //Default constructor
21  AnaSvtxTracksForGenFit(const std::string &name="AnaSvtxTracksForGenFit");
22 
23  //Initialization, called for initialization
24  int Init(PHCompositeNode *);
25 
26  //Process Event, called for each event
28 
29  //End, write and close files
30  int End(PHCompositeNode *);
31 
32  //Change output filename
33  void set_filename(const char* file)
34  { if(file) _outfile = file; }
35 
36  //Flags of different kinds of outputs
37  enum Flag
38  {
39  //all disabled
40  NONE = 0,
41  };
42 
43  //Set the flag
44  //Flags should be set like set_flag(AnaSvtxTracksForGenFit::TRUTH, true) from macro
45  void set_flag(const Flag& flag, const bool& value)
46  {
47  if(value) _flags |= flag;
48  else _flags &= (~flag);
49  }
50 
51  //User modules
53  void reset_variables();
54 
55  private:
56  //output filename
58 
59  //Event counter
60  int _event;
61 
62  //Get all the nodes
63  void GetNodes(PHCompositeNode *);
64 
65  //flags
66  unsigned int _flags;
67 
68  //TTrees
69  TTree* _tracks;
70  int event;
71  //-- truth
72  int gtrackID;
73  int gflavor;
74  float gpx;
75  float gpy;
76  float gpz;
77  float gvx;
78  float gvy;
79  float gvz;
80  //-- reco
81  int trackID;
82  int charge;
83  int nhits;
84  float px;
85  float py;
86  float pz;
87  float dca2d;
88  //-- clusters
89  int clusterID[7];
90  int layer[7];
91  float x[7];
92  float y[7];
93  float z[7];
94  float size_dphi[7];
95  float size_dz[7];
96 
97  //Node pointers
99  SvtxClusterMap* _clustermap;
100 
101  // eval stack
103 
104 };
105 
106 #endif //* __AnaSvtxTracksForGenFit_H__ *//