MillGenTree.h
Go to the documentation of this file.
1 #ifndef GARANA_MILL_GENTREE_H
2 #define GARANA_MILL_GENTREE_H
3 
7 
8 #include <vector>
9 #include <string>
10 #include <climits>
11 
12 using std::vector;
13 
14 namespace garana {
15 
16  class MillGenTree : public Mill, public FlatGenTree {
17 
18  public:
19 
21  MillGenTree(TTree* treeIn, TTree* treeOut);
22 
23  void MillTrees() override;
24 
25  private:
26 
27  bool VerifyBranches() override;
28  void FillGTruth(const GTruth* truth);
29  void FillEmptyGTruth();
30  void FillFSParticle(const vector<FSParticle>* fsp);
31 
33  //FlatGenTree* fGenOut = nullptr;
34 
35  //known branches, need to update if tree structure changes
36  // in garsoft/Ana/StructuredTree_module.cc
37  enum GenBranch {
42  };//
43 
44  std::map<std::string,GenBranch> nameToGenBranch = {
45  {"Event", kEvent},
46  {"GIndex", kGIndex},
47  {"GTruth", kGTruth},
48  {"FSParticles", kFSParticle}
49  };//
50 
51  std::map<GenBranch,bool> branchToDrawOpt = {
52  {kEvent, false},
53  {kGIndex, false},
54  {kGTruth, false},
55  {kFSParticle, false}
56  };
57 
58  // leaves for output tree (maybe there is a more sophisticated solution
59  // using inheritance from GTruth.h / FSParticle.h)
60 
61  /*vector<Int_t> fGIndex; ///index of ith entry
62 
63 
64  /// FSParticle (one per GTruth per genTree entry) //
65  vector<Int_t> fNFS; ///< number of FS particles associated with ith entry
66  vector<Int_t> fFSIndex; ///< index of FS particle associated with ith entry
67  vector<int> fFSPdg; ///< particle PDG code
68  vector<double> fFSPosX; ///< final particle x-position in lab frame [cm]
69  vector<double> fFSPosY; ///< final particle y-position in lab frame [cm]
70  vector<double> fFSPosZ; ///< final particle z-position in lab frame [cm]
71  vector<double> fFST; ///< final particle time in lab frame [ns]
72  vector<double> fFSMomX; ///< final particle 4-momentum in lab frame [GeV/c]
73  vector<double> fFSMomY; ///< final particle 4-momentum in lab frame [GeV/c]
74  vector<double> fFSMomZ; ///< final particle z-momentum in lab frame [GeV/c]
75  vector<double> fFSE; ///< final particle total energy in lab frame [GeV]
76 
77  /// GTruth (one or more per genTree entry) //
78  vector<double> fNuX; ///<
79  vector<double> fNuY; ///<
80  vector<double> fNuZ; ///<
81  vector<double> fNuT; ///<
82 
83  vector<double> fweight; ///<
84  vector<double> fprobability; ///<
85  vector<double> fXsec; ///<
86  vector<double> fDiffXsec; ///<
87  vector<int> fGPhaseSpace; ///<
88  vector<int> fProbePDG; ///<
89 
90  vector<double> fProbePx; ///<
91  vector<double> fProbePy; ///<
92  vector<double> fProbePz; ///<
93  vector<double> fProbeE; ///<
94 
95  vector<double> fTgtPx; ///<
96  vector<double> fTgtPy; ///<
97  vector<double> fTgtPz; ///<
98  vector<double> fTgtE; ///<
99 
100  vector<int> ftgtZ; ///<
101  vector<int> ftgtA; ///<
102  vector<int> ftgtPDG; ///<
103  vector<int> fHitNucPDG; ///<
104  vector<int> fHitQrkPDG; ///<
105  vector<bool> fIsSeaQuark; ///<
106  ///<
107  vector<double> fHitNucPx; ///<
108  vector<double> fHitNucPy; ///<
109  vector<double> fHitNucPz; ///<
110  vector<double> fHitNucE; ///<
111  vector<double> fHitNucPos; ///<
112 
113  vector<int> fGscatter; ///<
114  vector<int> fGint; ///<
115  vector<double> fgQ2; ///<
116  vector<double> fgq2; ///<
117  vector<double> fgW; ///<
118  vector<double> fgT; ///<
119  vector<double> fgX; ///<
120  vector<double> fgY; ///<
121 
122  vector<double> fFSleptonPx; ///<
123  vector<double> fFSleptonPy; ///<
124  vector<double> fFSleptonPz; ///<
125  vector<double> fFSleptonE; ///<
126 
127  vector<double> fFShadSystPx; ///<
128  vector<double> fFShadSystPy; ///<
129  vector<double> fFShadSystPz; ///<
130  vector<double> fFShadSystE; ///<
131 
132  vector<bool> fIsCharm; ///<
133  vector<int> fCharmHadronPdg; ///<
134  vector<bool> fIsStrange; ///<
135  vector<int> fStrangeHadronPdg; ///<
136  vector<int> fNumProton; ///<
137  vector<int> fNumNeutron; ///<
138  vector<int> fNumPi0; ///<
139  vector<int> fNumPiPlus; ///<
140  vector<int> fNumPiMinus; ///<
141  vector<int> fResNum; ///<
142  vector<int> fDecayMode; ///<*/
143  // \GTruth
144 
145 
146  };//class
147 
148 }//namespace
149 
150 #endif /* GARANA_MILL_GENTREE_H */
std::map< GenBranch, bool > branchToDrawOpt
Definition: MillGenTree.h:51
StructuredGenTree * fGenIn
Definition: MillGenTree.h:32
void MillTrees() override
Definition: MillGenTree.cxx:43
bool VerifyBranches() override
struct vector vector
void FillFSParticle(const vector< FSParticle > *fsp)
std::map< std::string, GenBranch > nameToGenBranch
Definition: MillGenTree.h:44
void FillGTruth(const GTruth *truth)