Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHAJMaker.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHAJMaker.h
1 
9 #ifndef PHAJMAKER_H__
10 #define PHAJMAKER_H__
11 
12 #include <fun4all/SubsysReco.h>
13 #include <fun4all/Fun4AllServer.h>
15 #include <map>
16 #include <set>
17 #include <string>
18 #include <vector>
19 
20 #include "PJTranslator.h"
21 
22 #ifndef __CINT__
23 #include "JetAnalyzer.hh"
24 #include "AjParameters.hh"
25 #endif // __CINT__
26 
27 #include "TH1.h"
28 #include "TH2.h"
29 #include "TH3.h"
30 #include "TString.h"
31 #include "TChain.h"
32 
33 class PHCompositeNode;
35 class SvtxTrackMap;
36 class TF1;
37 
38 #include <assert.h>
39 #include <iostream>
40 #include <cmath>
41 
42 /* namespace fastjet { */
43 /* class PseudoJet; */
44 /* class JetDefinition; */
45 /* class SISConePlugin; */
46 /* class ClusterSequence; */
47 /* } */
48 
49 
50 class PHAJMaker: public SubsysReco
51 {
52  // ------------------------------------------------------
53  // ------------------- PUBLIC --------------------------
54  // ------------------------------------------------------
55  public:
56 
69  PHAJMaker( const std::string &name = "PHAJMaker",
70  double R = 0.4,
71  double jet_ptmin = 10.0, double jet_ptmax = 100.0,
72  double LeadPtMin = 20.0, double SubLeadPtMin = 10,
73  double max_track_rap = 1.0, double PtConsLo=0.2, double PtConsHi=2.0,
74  double dPhiCut = 0.4
75  );
76 
78  int Init(PHCompositeNode *);
79 
82 
85  bool Has10Gev;
86 
87  // Getters and Setters
88  // -------------------
90  inline double GetR ( ) { return R; };
92  inline void SetR ( const double newv ) { R=newv; };
93 
95  inline double GetJet_ptmin ( ) { return jet_ptmin; };
97  inline void SetJet_ptmin ( const double newv ) { jet_ptmin=newv; };
98 
100  inline double GetJet_ptmax ( ) { return jet_ptmax; };
102  inline void SetJet_ptmax ( const double newv ) { jet_ptmax=newv; };
103 
105  inline double GetMax_rap ( ) { return max_rap; };
107  inline void SetMax_rap ( const double newv ) { max_rap=newv; };
108 
110  inline double GetGhost_maxrap ( ) { return ghost_maxrap; };
112  inline void SetGhost_maxrap ( const double newv ) { ghost_maxrap=newv; };
113 
115  inline double GetDPhiCut ( ) { return dPhiCut; };
117  inline void SetDPhiCut ( const double newv ) { dPhiCut=newv; };
118 
120  virtual ~PHAJMaker();
121 
124 #ifndef __CINT__
125  inline double CalcAj ( std::vector<fastjet::PseudoJet>& jets ){
126  if ( jets.size()!=2 ){
127  throw ( -1 );
128  return -1e10;
129  }
130  return fabs (( jets.at(0).pt()-jets.at(1).pt() ) / ( jets.at(0).pt()+jets.at(1).pt() ));
131  }
132 
133  // Objects will be handed by _reference_! Obviates need for setter
135  inline fastjet::JetDefinition& GetJet_def () { return jet_def; }
137  inline fastjet::Selector& GetLoConsSelector () { return slo; }
139  inline fastjet::Selector& GetHiConsSelector () { return shi; }
140 
142  inline fastjet::Selector& GetJetSelector () { return sjet; }
143 
145  inline fastjet::GhostedAreaSpec& GetArea_spec () { return area_spec; }
147  inline fastjet::AreaDefinition& GetArea_def () { return area_def; }
148 
149 
151  inline JetAnalyzer* GetJAhi() {return pJAhi; };
153  inline JetAnalyzer* GetJAlo() {return pJAlo; };
154 
156  inline std::vector<fastjet::PseudoJet> GetJAhiResult() {return JAhiResult; };
158  inline std::vector<fastjet::PseudoJet> GetJAloResult() {return JAloResult; };
159 
161  inline std::vector<fastjet::PseudoJet> GetLoConstituents() {return pLo; };
163  inline std::vector<fastjet::PseudoJet> GetHiConstituents() {return pHi; };
164 
165 
167  inline std::vector<fastjet::PseudoJet> GetDiJetsHi() {return DiJetsHi; };
169  inline std::vector<fastjet::PseudoJet> GetDiJetsLo() {return DiJetsLo; };
170 
171 
172 #endif // __CINT__
173 
174  //void save_jets_to_nodetree();
175 
176 
177 
178  // ------------------------------------------------------
179  // ------------------- PRIVATE --------------------------
180  // ------------------------------------------------------
181  private:
182 
185  TH2D* AJ_hi;
186  TH2D* AJ_lo;
187 
188  double R;
189  double jet_ptmin;
190  double jet_ptmax;
191  double LeadPtMin;
192  double SubLeadPtMin;
193  double max_rap;
194  double ghost_maxrap;
195 
196  double max_track_rap;
197  double PtConsLo;
198  double PtConsHi;
199 
200  double dPhiCut;
201 
202 #ifndef __CINT__
203  fastjet::JetDefinition jet_def;
204  fastjet::JetDefinition other_jet_def;
205 
206  fastjet::Selector select_track_rap;
207  fastjet::Selector select_lopt;
208  fastjet::Selector select_hipt;
209 
210  fastjet::Selector slo;
211  fastjet::Selector shi;
212 
213 // Relevant jet candidates
214  fastjet::Selector select_jet_rap;
215  fastjet::Selector select_jet_pt_min;
216  fastjet::Selector select_jet_pt_max;
217  fastjet::Selector sjet;
218 
219  fastjet::GhostedAreaSpec area_spec;
220  fastjet::AreaDefinition area_def;
221 
225 
226  std::vector<fastjet::PseudoJet> pHi;
227  std::vector<fastjet::PseudoJet> pLo;
228 
229  std::vector<fastjet::PseudoJet> JAhiResult;
230  std::vector<fastjet::PseudoJet> JAloResult;
231  std::vector<fastjet::PseudoJet> OtherJAloResult;
232 
233  std::vector<fastjet::PseudoJet> DiJetsHi;
234  std::vector<fastjet::PseudoJet> DiJetsLo;
235  std::vector<fastjet::PseudoJet> OtherDiJetsLo;
236 
237 #endif // __CINT__
238 
239 
240 };
241 
242 #endif