File indexing completed on 2025-08-03 08:15:56
0001 #include <TreeMaker.h>
0002
0003 #include <phool/getClass.h>
0004 #include <phool/PHCompositeNode.h>
0005
0006 #include <TLorentzVector.h>
0007 #include <g4jets/JetMap.h>
0008 #include <g4jets/Jet.h>
0009 #include <jetbackground/TowerBackground.h>
0010
0011
0012
0013 int TreeMaker::GetTruthJets(PHCompositeNode *topNode)
0014 {
0015
0016
0017
0018
0019
0020 JetMap* truth2_jets = findNode::getClass<JetMap>(topNode,"AntiKt_Truth_r02");
0021
0022 for (JetMap::Iter iter = truth2_jets->begin(); iter != truth2_jets->end(); ++iter)
0023 {
0024 Jet* this_jet = iter->second;
0025 float this_e = this_jet->get_e();
0026 float this_pt = this_jet->get_pt();
0027 float this_phi = this_jet->get_phi();
0028 float this_eta = this_jet->get_eta();
0029 if (this_jet->get_pt() < 5 || fabs(this_eta) > 5) continue;
0030 b_truthjet2_e[ b_truthjet2_n ] = this_e;
0031 b_truthjet2_pt[ b_truthjet2_n ] = this_pt;
0032 b_truthjet2_eta[ b_truthjet2_n ] = this_eta;
0033 b_truthjet2_phi[ b_truthjet2_n ] = this_phi;
0034
0035 b_truthjet2_n++;
0036 }
0037
0038 JetMap* truth3_jets = findNode::getClass<JetMap>(topNode,"AntiKt_Truth_r03");
0039
0040 for (JetMap::Iter iter = truth3_jets->begin(); iter != truth3_jets->end(); ++iter)
0041 {
0042 Jet* this_jet = iter->second;
0043 float this_e = this_jet->get_e();
0044 float this_pt = this_jet->get_pt();
0045 float this_phi = this_jet->get_phi();
0046 float this_eta = this_jet->get_eta();
0047 if (this_jet->get_pt() < 5 || fabs(this_eta) > 5) continue;
0048 b_truthjet3_e[ b_truthjet3_n ] = this_e;
0049 b_truthjet3_pt[ b_truthjet3_n ] = this_pt;
0050 b_truthjet3_eta[ b_truthjet3_n ] = this_eta;
0051 b_truthjet3_phi[ b_truthjet3_n ] = this_phi;
0052
0053 b_truthjet3_n++;
0054 }
0055
0056 JetMap* truth4_jets = findNode::getClass<JetMap>(topNode,"AntiKt_Truth_r04");
0057
0058 for (JetMap::Iter iter = truth4_jets->begin(); iter != truth4_jets->end(); ++iter)
0059 {
0060 Jet* this_jet = iter->second;
0061 float this_e = this_jet->get_e();
0062 float this_pt = this_jet->get_pt();
0063 float this_phi = this_jet->get_phi();
0064 float this_eta = this_jet->get_eta();
0065 if (this_jet->get_pt() < 5 || fabs(this_eta) > 5) continue;
0066 b_truthjet4_e[ b_truthjet4_n ] = this_e;
0067 b_truthjet4_pt[ b_truthjet4_n ] = this_pt;
0068 b_truthjet4_eta[ b_truthjet4_n ] = this_eta;
0069 b_truthjet4_phi[ b_truthjet4_n ] = this_phi;
0070
0071 b_truthjet4_n++;
0072 }
0073
0074 JetMap* truth5_jets = findNode::getClass<JetMap>(topNode,"AntiKt_Truth_r05");
0075
0076 for (JetMap::Iter iter = truth5_jets->begin(); iter != truth5_jets->end(); ++iter)
0077 {
0078 Jet* this_jet = iter->second;
0079 float this_e = this_jet->get_e();
0080 float this_pt = this_jet->get_pt();
0081 float this_phi = this_jet->get_phi();
0082 float this_eta = this_jet->get_eta();
0083 if (this_jet->get_pt() < 5 || fabs(this_eta) > 5) continue;
0084 b_truthjet5_e[ b_truthjet5_n ] = this_e;
0085 b_truthjet5_pt[ b_truthjet5_n ] = this_pt;
0086 b_truthjet5_eta[ b_truthjet5_n ] = this_eta;
0087 b_truthjet5_phi[ b_truthjet5_n ] = this_phi;
0088
0089 b_truthjet5_n++;
0090 }
0091
0092 return 0;
0093
0094 }
0095
0096
0097
0098 int TreeMaker::GetRecoJets(PHCompositeNode *topNode)
0099 {
0100
0101
0102
0103
0104
0105 JetMap* nsreco2_jets = findNode::getClass<JetMap>(topNode,"AntiKt_Tower_r02");
0106
0107 for (JetMap::Iter iter = nsreco2_jets->begin(); iter != nsreco2_jets->end(); ++iter)
0108 {
0109 Jet* this_jet = iter->second;
0110 float this_e = this_jet->get_e();
0111 float this_pt = this_jet->get_pt();
0112 float this_phi = this_jet->get_phi();
0113 float this_eta = this_jet->get_eta();
0114 if (this_jet->get_pt() < 10 || fabs(this_eta) > 5) continue;
0115 b_jet2_e[ b_jet2_n ] = this_e;
0116 b_jet2_pt[ b_jet2_n ] = this_pt;
0117 b_jet2_eta[ b_jet2_n ] = this_eta;
0118 b_jet2_phi[ b_jet2_n ] = this_phi;
0119
0120 b_jet2_n++;
0121 }
0122
0123 JetMap* nsreco3_jets = findNode::getClass<JetMap>(topNode,"AntiKt_Tower_r03");
0124
0125 for (JetMap::Iter iter = nsreco3_jets->begin(); iter != nsreco3_jets->end(); ++iter)
0126 {
0127 Jet* this_jet = iter->second;
0128 float this_e = this_jet->get_e();
0129 float this_pt = this_jet->get_pt();
0130 float this_phi = this_jet->get_phi();
0131 float this_eta = this_jet->get_eta();
0132 if (this_jet->get_pt() < 10 || fabs(this_eta) > 5) continue;
0133 b_jet3_e[ b_jet3_n ] = this_e;
0134 b_jet3_pt[ b_jet3_n ] = this_pt;
0135 b_jet3_eta[ b_jet3_n ] = this_eta;
0136 b_jet3_phi[ b_jet3_n ] = this_phi;
0137
0138 b_jet3_n++;
0139 }
0140
0141 JetMap* nsreco4_jets = findNode::getClass<JetMap>(topNode,"AntiKt_Tower_r04");
0142
0143 for (JetMap::Iter iter = nsreco4_jets->begin(); iter != nsreco4_jets->end(); ++iter)
0144 {
0145 Jet* this_jet = iter->second;
0146 float this_e = this_jet->get_e();
0147 float this_pt = this_jet->get_pt();
0148 float this_phi = this_jet->get_phi();
0149 float this_eta = this_jet->get_eta();
0150 if (this_jet->get_pt() < 10 || fabs(this_eta) > 5) continue;
0151 b_jet4_e[ b_jet4_n ] = this_e;
0152 b_jet4_pt[ b_jet4_n ] = this_pt;
0153 b_jet4_eta[ b_jet4_n ] = this_eta;
0154 b_jet4_phi[ b_jet4_n ] = this_phi;
0155
0156 b_jet4_n++;
0157 }
0158
0159 JetMap* nsreco5_jets = findNode::getClass<JetMap>(topNode,"AntiKt_Tower_r05");
0160
0161 for (JetMap::Iter iter = nsreco5_jets->begin(); iter != nsreco5_jets->end(); ++iter)
0162 {
0163 Jet* this_jet = iter->second;
0164 float this_e = this_jet->get_e();
0165 float this_pt = this_jet->get_pt();
0166 float this_phi = this_jet->get_phi();
0167 float this_eta = this_jet->get_eta();
0168 if (this_jet->get_pt() < 10 || fabs(this_eta) > 5) continue;
0169 b_jet5_e[ b_jet5_n ] = this_e;
0170 b_jet5_pt[ b_jet5_n ] = this_pt;
0171 b_jet5_eta[ b_jet5_n ] = this_eta;
0172 b_jet5_phi[ b_jet5_n ] = this_phi;
0173
0174 b_jet5_n++;
0175 }
0176
0177
0178
0179
0180
0181
0182
0183 JetMap* modnsreco2_jets = findNode::getClass<JetMap>(topNode,"AntiKt_Tower_Mod_r02");
0184
0185 for (JetMap::Iter iter = modnsreco2_jets->begin(); iter != modnsreco2_jets->end(); ++iter)
0186 {
0187 Jet* this_jet = iter->second;
0188 float this_e = this_jet->get_e();
0189 float this_pt = this_jet->get_pt();
0190 float this_phi = this_jet->get_phi();
0191 float this_eta = this_jet->get_eta();
0192 if (this_jet->get_pt() < 10 || fabs(this_eta) > 5) continue;
0193 b_modjet2_e[ b_modjet2_n ] = this_e;
0194 b_modjet2_pt[ b_modjet2_n ] = this_pt;
0195 b_modjet2_eta[ b_modjet2_n ] = this_eta;
0196 b_modjet2_phi[ b_modjet2_n ] = this_phi;
0197
0198 b_modjet2_n++;
0199 }
0200
0201
0202
0203 return 0;
0204
0205 }