EIC 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 <utility> // std::pair, std::make_pair
9 
10 #include <array>
11 
12 class PHCompositeNode;
13 class JetEvalStack;
14 class TTree;
15 class TH1;
16 
18 class MyJetAnalysis : public SubsysReco
19 {
20  public:
22  const std::string &recojetname = "AntiKt_Tower_r04",
23  const std::string &truthjetname = "AntiKt_Truth_r04",
24  const std::string &outputfilename = "myjetanalysis.root");
25 
26  virtual ~MyJetAnalysis();
27 
29  void
30  setEtaRange(double low, double high)
31  {
32  m_etaRange.first = low;
33  m_etaRange.second = high;
34  }
36  void
37  setPtRange(double low, double high)
38  {
39  m_ptRange.first = low;
40  m_ptRange.second = high;
41  }
42  void use_initial_vertex(const bool b = true) {initial_vertex = b;}
43  int Init(PHCompositeNode *topNode);
44  int InitRun(PHCompositeNode *topNode);
45  int process_event(PHCompositeNode *topNode);
46  int End(PHCompositeNode *topNode);
47 
48  private:
50  std::shared_ptr<JetEvalStack> m_jetEvalStack;
51 
52  std::string m_recoJetName;
53  std::string m_truthJetName;
54  std::string m_outputFileName;
55 
57  std::pair<double, double> m_etaRange;
58 
60  std::pair<double, double> m_ptRange;
61 
63  bool initial_vertex = false;
64 
67 
72 
74  TTree *m_T;
75 
76  int m_event;
77  int m_id;
79  float m_eta;
80  float m_phi;
81  float m_e;
82  float m_pt;
83 
84  int m_truthID;
86  float m_truthEta;
87  float m_truthPhi;
88  float m_truthE;
89  float m_truthPt;
90 
93 
94  enum
95  {
98  };
99  std::array<float, kMaxMatchedTrack> m_trackdR;
100  std::array<float, kMaxMatchedTrack> m_trackpT;
101 };
102 
103 #endif // MYJETANALYSIS_H