Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ResonanceJetTagging.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ResonanceJetTagging.h
1 #ifndef RESONANCEJETTAGGING_H__
2 #define RESONANCEJETTAGGING_H__
3 
4 #include <jetbase/Jetv2.h>
5 
6 #include <fun4all/SubsysReco.h>
7 
8 #include <fastjet/JetDefinition.hh>
9 
10 #include <map> // for map
11 #include <string> // for string
12 #include <utility> // for pair
13 #include <vector>
14 
16 class PHCompositeNode;
17 class SvtxTrack;
18 class PHG4Particlev2;
19 class PHG4Particle;
21 class JetContainerv1;
22 
23 namespace CLHEP
24 {
25  class Hep3Vector;
26 }
27 namespace HepMC
28 {
29  class GenParticle;
30 }
31 namespace fastjet
32 {
33  class PseudoJet;
34 }
35 
38 {
39  public:
40  enum ALGO
41  {
42  ANTIKT = 0,
43  KT = 1,
45  };
46 
47  enum RECOMB
48  {
49  E_SCHEME = 0,
50  PT_SCHEME = 1,
52  ET_SCHEME = 3,
54  };
55 
56  enum TAG
57  {
58  D0 = 0,
59  D0TOK3PI = 1,
60  DPLUS = 2,
61  DSTAR = 3,
62  JPSY = 4,
63  K0 = 5,
64  GAMMA = 6,
65  ELECTRON = 7,
66  LAMBDAC = 8
67  };
68 
70  ResonanceJetTagging(const std::string &name = "ResonanceJetTagging", const TAG tag = TAG::D0, const std::string &KFparticle_Container_name = "");
71 
72  // Destructor
73  virtual ~ResonanceJetTagging();
74 
76  int Init(PHCompositeNode *);
77 
80 
82  int End(PHCompositeNode *);
83 
84  // Particle flow
85  void setParticleFlowEtaAcc(double etamin, double etamax)
86  {
89  }
94 
95  // tracks
96  void setTrackPtAcc(double ptmin, double ptmax)
97  {
98  m_track_minpt = ptmin;
99  m_track_maxpt = ptmax;
100  }
101  void setTrackMinPt(double ptmin) { m_track_minpt = ptmin; }
102  void setTrackMaxPt(double ptmax) { m_track_maxpt = ptmax; }
103  double getTrackMinPt() { return m_track_minpt; }
104  double getTrackMaxPt() { return m_track_maxpt; }
105 
106  void setTrackEtaAcc(double etamin, double etamax)
107  {
110  }
113  double getTrackMinEta() { return m_track_mineta; }
114  double getTrackMaxEta() { return m_track_maxeta; }
115 
116  // EMCal clusters
117  void setEMCalClusterPtAcc(double ptmin, double ptmax)
118  {
119  m_EMCal_cluster_minpt = ptmin;
120  m_EMCal_cluster_maxpt = ptmax;
121  }
122  void setEMCalClusterMinPt(double ptmin) { m_EMCal_cluster_minpt = ptmin; }
123  void setEMCalClusterMaxPt(double ptmax) { m_EMCal_cluster_maxpt = ptmax; }
126 
127  void setEMCalClusterEtaAcc(double etamin, double etamax)
128  {
131  }
136 
137  // HCal clusters
138  void setHCalClusterPtAcc(double ptmin, double ptmax)
139  {
140  m_HCal_cluster_minpt = ptmin;
141  m_HCal_cluster_maxpt = ptmax;
142  }
143  void setHCalClusterMinPt(double ptmin) { m_HCal_cluster_minpt = ptmin; }
144  void setHCalClusterMaxPt(double ptmax) { m_HCal_cluster_maxpt = ptmax; }
147 
148  void setHCalClusterEtaAcc(double etamin, double etamax)
149  {
152  }
157 
158  // Set/Get add Tracks and Clusters
161  void setAddTracks(bool b) { m_add_tracks = b; }
162  bool getAddTracks() { return m_add_tracks; }
167 
168  // Jet settings
169  void setR(double r) { m_jetr = r; }
170  double getR(double /*r*/) { return m_jetr; }
171  void setJetAlgo(ALGO jetalgo)
172  {
173  switch (jetalgo)
174  {
175  case ALGO::ANTIKT:
177  break;
178  case ALGO::KT:
180  break;
181  case ALGO::CAMBRIDGE:
183  break;
184  }
185  }
187  void setRecombScheme(RECOMB recomb_scheme)
188  {
189  switch (recomb_scheme)
190  {
191  case RECOMB::E_SCHEME:
193  break;
194  case RECOMB::PT_SCHEME:
196  break;
197  case RECOMB::PT2_SCHEME:
199  break;
200  case RECOMB::ET_SCHEME:
202  break;
203  case RECOMB::ET2_SCHEME:
205  break;
206  }
207  }
209  void setJetParameters(double r, ALGO jetalgo, RECOMB recomb_scheme)
210  {
211  setR(r);
212  setJetAlgo(jetalgo);
213  setRecombScheme(recomb_scheme);
214  }
217  void setDoRecunstructed(bool b) { m_dorec = b; }
218  bool getDoRecunstructed() { return m_dorec; }
219  void setDoTruth(bool b) { m_dotruth = b; }
220  bool getDoTruth() { return m_dotruth; }
221 
222  private:
225 
229 
235 
241 
247 
253 
254  // jet settings variables
255  double m_jetr;
258 
261 
263  unsigned int m_jet_id = 0;
264  unsigned int m_truth_jet_id = 0;
265  bool m_dorec;
266  bool m_dotruth;
270 
272  int tagHFHadronic(PHCompositeNode *topNode);
273  void findTaggedJets(PHCompositeNode *topNode, PHG4Particlev2 *Tag, const std::vector<PHG4Particlev2*> &TagDecays);
274  void addParticleFlow(PHCompositeNode *topNode, std::vector<fastjet::PseudoJet> &particles, const std::vector<PHG4Particlev2*> &TagDecays, std::map<int, std::pair<Jet::SRC, int>> &fjMap);
275  void addTracks(PHCompositeNode *topNode, std::vector<fastjet::PseudoJet> &particles, const std::vector<PHG4Particlev2*> &TagDecays, std::map<int, std::pair<Jet::SRC, int>> &fjMap);
276  void addClusters(PHCompositeNode *topNode, std::vector<fastjet::PseudoJet> &particles, std::map<int, std::pair<Jet::SRC, int>> &fjMap);
277  void findMCTaggedJets(PHCompositeNode *topNode);
278 
280  bool isAcceptableTrack(SvtxTrack *track);
281  bool isAcceptableEMCalCluster(CLHEP::Hep3Vector &E_vec_cluster);
282  bool isAcceptableHCalCluster(CLHEP::Hep3Vector &E_vec_cluster);
283  bool isDecay(HepMC::GenParticle *particle, const std::vector<PHG4Particlev2*> &decays);
284  bool isDecay(SvtxTrack *track, const std::vector<PHG4Particlev2*> &decays);
285  int createJetNode(PHCompositeNode *topNode);
286 };
287 
288 #endif