Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MyJetAnalysis.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MyJetAnalysis.h
1 #ifndef MYJETANALYSIS_H
2 #define MYJETANALYSIS_H
3 
4 #include <fun4all/SubsysReco.h>
5 
6 #include <memory>
7 #include <string>
8 #include <vector>
9 #include <TLorentzVector.h>
10 #include <utility> // std::pair, std::make_pair
11 
12 #include <array>
13 #include <g4jets/Jet.h>
14 
15 #include <HepMC/GenEvent.h>
16 #include <HepMC/GenParticle.h>
17 
18 #include <fastjet/PseudoJet.hh>
19 
20 class PHCompositeNode;
21 class JetEvalStack;
22 class CaloEvalStack;
23 class TTree;
24 class TH1;
25 class FastJetAlgo;
26 
28 class MyJetAnalysis : public SubsysReco
29 {
30  public:
32  const std::string &recojetname = "AntiKt_Tower_r02",
33  const std::string &truthjetname = "AntiKt_Truth_r02",
34  const std::string &outputfilename = "myjetanalysis.root");
35 
36  virtual ~MyJetAnalysis();
37 
39  void
40  setEtaRange(double low, double high)
41  {
42  m_etaRange.first = low;
43  m_etaRange.second = high;
44  }
46  void
47  setPtRange(double low, double high)
48  {
49  m_ptRange.first = low;
50  m_ptRange.second = high;
51  }
52 
53  void
54  setMindR(double jetradius)
55  {
56  m_trackJetMatchingRadius = jetradius;
57  }
58  void use_initial_vertex(const bool b = true) {initial_vertex = b;}
59  int Init(PHCompositeNode *topNode);
60  int InitRun(PHCompositeNode *topNode);
61  int process_event(PHCompositeNode *topNode);
62  int process_event_bimp(PHCompositeNode *topNode);
63  int End(PHCompositeNode *topNode);
64  void initializeTrees();
65  void Clean();
66 
67  private:
69  std::shared_ptr<JetEvalStack> m_jetEvalStack;
71  std::vector<Jet*> m_inputs_smallR;
72  std::vector<Jet*> m_inputs_reco_smallR;
73  std::vector<Jet*> m_inputs_recoMatch_smallR;
74  std::vector<Jet*> m_output_largeR;
75 
79 
80  std::vector<fastjet::PseudoJet> m_truth_pseudojet;
81 
83  std::pair<double, double> m_etaRange;
84 
86  std::pair<double, double> m_ptRange;
87 
89  bool initial_vertex = false;
90 
93 
98 
100  TTree *m_T;
101  TTree *m_Treclus;
102  //TTree *m_TreEcoor;
103  std::vector<double> m_recotruthE;
104  std::vector<double> m_recotruthEta;
105  std::vector<double> m_recotruthPhi;
106  std::vector<double> m_recotruthPt;
107  std::vector<double> m_recotruthPx;
108  std::vector<double> m_recotruthPy;
109  std::vector<double> m_recotruthPz;
110  std::vector<double> m_recotruthnComponent;
111 
112  int m_event;
113  std::vector<double> m_id;
114  std::vector<double> m_nComponent;
115  std::vector<double> m_eta;
116  std::vector<double> m_phi;
117  std::vector<double> m_e;
118  std::vector<double> m_new_e;
119  std::vector<double> m_pt;
120  std::vector<double> m_px;
121  std::vector<double> m_py;
122  std::vector<double> m_pz;
123  std::vector<double> m_dR;
124  std::vector<double> m_cent;
125  std::vector<double> m_CAL_ID;
126  std::vector<double> m_Constit_E;
127  std::vector<double> m_Constit_Cent;
128  //std::vector<double> m_Embedded_Count;
129  //std::vector<double> m_Embedded_IHCAL;
130  //std::vector<double> m_Embedded_CEMC;
131  //std::vector<double> m_Embedded_OHCAL;
132  //std::vector<double> m_Background_IHCAL;
133  //std::vector<double> m_Background_CEMC;
134  //std::vector<double> m_Background_OHCAL;
135  //std::vector<double> m_Unidentified_OHCAL;
136  //std::vector<double> m_Unidentified_IHCAL;
137  //std::vector<double> m_Total_Count;
138  std::vector<double> towers_id;
139  std::vector<double> towers_primary;
140  std::vector<double> m_IHCAL_Tower_Energy;
141  std::vector<double> m_IHCAL_Cent;
142  std::vector<double> m_EMCAL_Tower_Energy;
143  std::vector<double> m_EMCAL_Cent;
144  std::vector<double> m_OHCAL_Tower_Energy;
145  std::vector<double> m_OHCAL_Cent;
146 
147  double_t dPhi;
148  double_t dPhi_temp;
149 
153 
154  float temp_eta;
155  float temp_phi;
156  float temp_e;
157  float temp_dR;
158 
162 
166 
167  std::vector<double> m_truthNComponent;
168  std::vector<double> m_truthEta;
169  std::vector<double> m_truthPhi;
170  std::vector<double> m_truthE;
171  std::vector<double> m_truthPt;
172  std::vector<double> m_truthdR;
173  std::vector<double> m_truthPx;
174  std::vector<double> m_truthPy;
175  std::vector<double> m_truthPz;
176  std::vector<double> m_truthConstitID;
177  std::vector<double> m_truthConstitE;
178  std::vector<double> m_truthConstitPt;
179 
180  std::vector<double> m_E_Matched;
181  std::vector<double> m_Phi_Matched;
182  std::vector<double> m_Eta_Matched;
183 
184  std::vector<double> m_TE_Matched;
185  std::vector<double> m_TPhi_Matched;
186  std::vector<double> m_TEta_Matched;
187 
188  //std::vector<double> m_PairedID_Truth;
189  //std::vector<double> m_PairedID_Reco;
190  //std::vector<double> m_impactparam;
191 
194 
195  enum
196  {
199  };
200  std::array<float, kMaxMatchedTrack> m_trackdR;
201  std::array<float, kMaxMatchedTrack> m_trackpT;
202  std::array<float, kMaxMatchedTrack> m_trackPID;
203 };
204 
205 #endif // MYJETANALYSIS_H