Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BuildResonanceJetTaggingTree.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BuildResonanceJetTaggingTree.h
1 #ifndef BUILDRESONANCEJETTAGGINGTREE_H__
2 #define BUILDRESONANCEJETTAGGINGTREE_H__
3 
4 #include <resonancejettagging/ResonanceJetTagging.h>
5 
6 #include <fun4all/SubsysReco.h>
7 
9 
10 #pragma GCC diagnostic push
11 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
12 #include <HepMC/GenEvent.h>
13 #pragma GCC diagnostic pop
14 
15 #include <vector>
16 
18 class PHCompositeNode;
19 class TFile;
20 class TTree;
21 class TH1I;
22 class PHG4Particle;
24 class SvtxEvalStack;
25 class SvtxTrackEval;
26 
29 {
30  public:
31 
33  BuildResonanceJetTaggingTree(const std::string &name = "BuildResonanceJetTaggingTree", const std::string &fname = "BuildResonanceJetTaggingTree.root", const ResonanceJetTagging::TAG tag = ResonanceJetTagging::TAG::D0);
34 
35  // Destructor
37 
39  int Init(PHCompositeNode *);
40 
43 
45  int End(PHCompositeNode *);
46  int loopHFHadronic(PHCompositeNode *topNode);
47  void findMatchedTruthD0(PHCompositeNode *topNode, Jet *&mcTagJet, HepMC::GenParticle *&mcTag, std::vector<int> decays);
48  HepMC::GenParticle *getMother(PHCompositeNode *topNode, PHG4Particle *g4daughter);
49  bool isReconstructed(int index, std::vector<int> indexRecVector);
50 
51  void initializeVariables();
52  void initializeTrees();
53  void resetTreeVariables();
54 
55  void setDoRecunstructed(bool b) { m_dorec = b; }
56  bool getDoRecunstructed() { return m_dorec; }
57  void setDoTruth(bool b) { m_dotruth = b; }
58  bool getDoTruth() { return m_dotruth; }
59 
60  void setTagContainerName(const std::string &tagContName) { m_tagcontainer_name = tagContName; }
62  void setJetContainerName(const std::string &jetContName) { m_jetcontainer_name = jetContName; }
64  void setTruthJetContainerName(const std::string &jetContName) { m_truth_jetcontainer_name = jetContName; }
66 
67  private:
68 
71  HepMC::GenEvent* getGenEventFromNode(PHCompositeNode *topNode, const std::string &name);
79  bool m_dorec;
80  bool m_dotruth;
84 
87 
89  int m_tag_pdg;
90 
92  TFile *m_outfile = nullptr;
93  TH1I *m_eventcount_h = nullptr;
94  TTree *m_taggedjettree = nullptr;
95  TTree *m_runinfo = nullptr;
96  // Tagged-Jet reconstructed variables
97  float m_reco_tag_px = NAN;
98  float m_reco_tag_py = NAN;
99  float m_reco_tag_pz = NAN;
100  float m_reco_tag_pt = NAN;
101  float m_reco_tag_eta = NAN;
102  float m_reco_tag_phi = NAN;
103  float m_reco_tag_m = NAN;
104  float m_reco_tag_e = NAN;
105  float m_reco_jet_px = NAN;
106  float m_reco_jet_py = NAN;
107  float m_reco_jet_pz = NAN;
108  float m_reco_jet_pt = NAN;
109  float m_reco_jet_eta = NAN;
110  float m_reco_jet_phi = NAN;
111  float m_reco_jet_m = NAN;
112  float m_reco_jet_e = NAN;
113  //Truth info
114  float m_truth_tag_px = NAN;
115  float m_truth_tag_py = NAN;
116  float m_truth_tag_pz = NAN;
117  float m_truth_tag_pt = NAN;
118  float m_truth_tag_eta = NAN;
119  float m_truth_tag_phi = NAN;
120  float m_truth_tag_m = NAN;
121  float m_truth_tag_e = NAN;
122  float m_truth_jet_px = NAN;
123  float m_truth_jet_py = NAN;
124  float m_truth_jet_pz = NAN;
125  float m_truth_jet_pt = NAN;
126  float m_truth_jet_eta = NAN;
127  float m_truth_jet_phi = NAN;
128  float m_truth_jet_m = NAN;
129  float m_truth_jet_e = NAN;
130 
131  float m_intlumi = NAN;
132  float m_nprocessedevents = NAN;
133  float m_nacceptedevents = NAN;
135  float m_xsecacceptedevents = NAN;
136 
137 };
138 
139 #endif