Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FullJetFinder.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FullJetFinder.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
15 #ifndef FULLJETFINDER_H
16 #define FULLJETFINDER_H
17 
18 #include <fun4all/SubsysReco.h>
19 #include <jetbase/Jetv1.h>
21 #pragma GCC diagnostic push
22 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
23 #include <HepMC/GenEvent.h>
24 #include <HepMC/GenVertex.h>
25 #pragma GCC diagnostic pop
26 #include <particleflowreco/ParticleFlowElementv1.h>
28 
29 #include <string>
30 #include <TH1.h>
31 #include <vector>
32 
33 class PHCompositeNode;
34 class TTree;
35 
36 class FullJetFinder : public SubsysReco {
37  public:
38 
39  //note max 10 inputs allowed
40  FullJetFinder( const std::string &outputfilename = "myjetanalysis.root");
41 
42  ~FullJetFinder() override;
43 
49  int Init(PHCompositeNode *topNode) override;
50 
56  int InitRun(PHCompositeNode *topNode) override;
57 
61  int process_event(PHCompositeNode *topNode) override;
62 
64  int ResetEvent(PHCompositeNode *topNode) override;
65 
67  int EndRun(const int runnumber) override;
68 
70  int End(PHCompositeNode *topNode) override;
71 
73  int Reset(PHCompositeNode * /*topNode*/) override;
74 
75  void Print(const std::string &what = "ALL") const override;
76 
77  void GetDistanceFromVertexXY(SvtxTrack *m_dst_track, GlobalVertex *m_dst_vertex,float &val, float &err);
78 
79  void add_input(const std::string &recojetname = "AntiKt_Tower_r04", const std::string &truthjetname = "AntiKt_Truth_r04", const std::string &outputtreename = "AntiKt_r04"){
80  m_recoJetName.push_back(recojetname);
81  m_truthJetName.push_back(truthjetname);
82  m_TreeNameCollection.push_back(outputtreename);
83  m_inputs += 1;
84  jetR.push_back(std::stof(recojetname.substr(recojetname.find("r0") + 2))/10);
85  std::cout<<"pushing name "<<recojetname<<" "<<truthjetname<<" "<<outputtreename<<" jet R"<<std::stof(recojetname.substr(recojetname.find("r0") + 2))/10<<" total inputs "<<m_inputs<<std::endl;
86  }
87 
88  void doFiducialAcceptance(bool doF){doFiducial = doF;}
89 
90  void setPtRangeReco(double low, double high){m_ptRangeReco.first = low; m_ptRangeReco.second = high;}
91  void setPtRangeTruth(double low, double high){m_ptRangeTruth.first = low; m_ptRangeTruth.second = high;}
92  void doTruth(int flag){m_doTruthJets = flag; }
93 
94  class CutSelection: public PHObject{
95  public:
96  float jetptmin;
97  float jetptmax;
98  };
99 
102  float e;
103  float eta;
104  float phi;
105  } ;
106 
109  int vtx_id;
110  float e;
111  float eta;
112  float phi;
113  float pt;
114  float DCA_xy;
115  float DCA_xy_unc;
116  float sDCA_xy;
117  int n_mvtx;
118  int n_intt;
119  int n_tpc;
120  float chisq;
121  int ndf;
122  } ;
123 
125  class RecoJets{
126  public:
127  int id;
128  float area;
131  float px;
132  float py;
133  float pz;
134  float pt;
135  float eta;
136  float phi;
137  float m;
138  float e;
139  std::vector<neConstituent> neConstituents;
140  std::vector<chConstituent> chConstituents;
141 
142  using List = std::vector<RecoJets>;
143  };
144 
146  class TruthJets{
147  public:
148  int id;
149  float area;
152  float px;
153  float py;
154  float pz;
155  float pt;
156  float eta;
157  float phi;
158  float m;
159  float e;
160  std::vector<int> constituents_PDG_ID;
161 
162  using List = std::vector<TruthJets>;
163  };
164 
166  public:
167  float id;
168  float x;
169  float y;
170  float z;
171  float x_unc;
172  float y_unc;
173  float z_unc;
174  float chisq;
175  int ndf;
177  using List = std::vector<PrimaryVertex>;
178  };
179 
180  class Container: public PHObject
181  {
182  public:
183  void Reset();
188  float impactparam;
191 
192  ClassDef(Container,1)
193  };
194 
195  private:
196  int m_inputs = 0;
197  std::vector<std::string> m_TreeNameCollection;
198  std::vector<std::string> m_recoJetName;
199  std::vector<std::string> m_truthJetName;
201  std::pair<double, double> m_etaRange;
202  std::pair<double, double> m_ptRangeReco;
203  std::pair<double, double> m_ptRangeTruth;
205 
206  bool doFiducial = false;
207 
209  TTree *m_T[10];
210  std::vector<float>jetR;
211  TH1I *m_stat;
212 
215 
216  TH1D *m_chi2ndf[10];
217  TH1I *m_mvtxcl[10];
218  TH1I *m_inttcl[10];
219  TH1I *m_mtpccl[10];
220 };
221 
222 #endif // FULLJETFINDER_H