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 <g4eval/JetEvalStack.h>
7 
8 #include <array>
9 #include <limits>
10 #include <memory>
11 #include <string>
12 #include <utility> // std::pair, std::make_pair
13 
14 class PHCompositeNode;
15 class TTree;
16 class TH1;
17 
19 class MyJetAnalysis : public SubsysReco
20 {
21  public:
23  const std::string &recojetname = "AntiKt_Tower_r04",
24  const std::string &truthjetname = "AntiKt_Truth_r04",
25  const std::string &outputfilename = "myjetanalysis.root");
26 
27  ~MyJetAnalysis() override = default;
28 
30  void
31  setEtaRange(double low, double high)
32  {
33  m_etaRange.first = low;
34  m_etaRange.second = high;
35  }
37  void
38  setPtRange(double low, double high)
39  {
40  m_ptRange.first = low;
41  m_ptRange.second = high;
42  }
43  void use_initial_vertex(const bool b = true) {initial_vertex = b;}
44  int Init(PHCompositeNode *topNode) override;
45  int InitRun(PHCompositeNode *topNode) override;
46  int process_event(PHCompositeNode *topNode) override;
47  int End(PHCompositeNode *topNode) override;
48 
49  private:
51  std::shared_ptr<JetEvalStack> m_jetEvalStack;
52 
56 
58  std::pair<double, double> m_etaRange;
59 
61  std::pair<double, double> m_ptRange;
62 
64  bool initial_vertex = false;
65 
67  double m_trackJetMatchingRadius = std::numeric_limits<float>::signaling_NaN();
68 
70  TH1 *m_hInclusiveE = nullptr;
71  TH1 *m_hInclusiveEta = nullptr;
72  TH1 *m_hInclusivePhi = nullptr;
73 
75  TTree *m_T = nullptr;
76 
77  int m_event = -1;
78  int m_id = -1;
79  int m_nComponent = -1;
80  float m_eta = std::numeric_limits<float>::signaling_NaN();
81  float m_phi = std::numeric_limits<float>::signaling_NaN();
82  float m_e = std::numeric_limits<float>::signaling_NaN();
83  float m_pt = std::numeric_limits<float>::signaling_NaN();
84 
85  int m_truthID = -1;
87  float m_truthEta = std::numeric_limits<float>::signaling_NaN();
88  float m_truthPhi = std::numeric_limits<float>::signaling_NaN();
89  float m_truthE = std::numeric_limits<float>::signaling_NaN();
90  float m_truthPt = std::numeric_limits<float>::signaling_NaN();
91 
93  int m_nMatchedTrack = -1;
94 
95  enum
96  {
98  kMaxMatchedTrack = 1000
99  };
100  std::array<float, kMaxMatchedTrack> m_trackdR;
101  std::array<float, kMaxMatchedTrack> m_trackpT;
102 };
103 
104 #endif // MYJETANALYSIS_H