15 #include <g4jets/Jet.h>
16 #include <g4jets/JetMap.h>
20 #include <trackbase_historic/SvtxVertex.h>
21 #include <trackbase_historic/SvtxVertexMap.h>
23 #include <particleflowreco/ParticleFlowElementContainer.h>
24 #include <particleflowreco/ParticleFlowElement.h>
29 #include <HepMC/GenEvent.h>
30 #include <HepMC/GenVertex.h>
58 m_tree =
new TTree(
"tree",
"A tree with tracks in jets");
68 topNode,
"PHHepMCGenEventMap");
72 <<
" - Fatal error - missing node PHHepMCGenEventMap"
81 <<
" - Fatal error - node PHHepMCGenEventMap missing subevent with embedding ID "
83 std::cout <<
". Print PHHepMCGenEventMap:";
90 if(!jetevalstack or !svtxevalstack)
92 std::cout <<
"No eval stacks, can't continue." << std::endl;
107 std::cout <<
"No particle flow elements on node tree, can't continue."
119 float truth_vx = first_point->
get_x();
120 float truth_vy = first_point->get_y();
121 float truth_vz = first_point->get_z();
127 Jet *truthjet = iter->second;
130 if(fabs(truthjet->
get_eta()) > 2)
138 std::set<PHG4Particle*> truthjetconst =
139 jettrutheval->all_truth_particles(truthjet);
143 int truthpid = truthpart->get_pid();
144 int fabstruthpid = fabs(truthpid);
145 if(! (fabstruthpid == 211 or fabstruthpid == 321 or fabstruthpid == 2212 or fabstruthpid == 11 or fabstruthpid == 13))
157 Jet* matchedrecojet =
nullptr;
158 float mindr = std::numeric_limits<float>::max();
159 for (
JetMap::Iter riter = reco_jets->begin(); riter != reco_jets->end();
162 Jet* mjet = riter->second;
170 matchedrecojet = mjet;
180 m_recojete = std::numeric_limits<float>::max();
193 for(
auto citer = matchedrecojet->
begin_comp(); citer != matchedrecojet->
end_comp(); ++citer)
198 if(!(type == ParticleFlowElement::PFLOWTYPE::MATCHED_CHARGED_HADRON or
199 type == ParticleFlowElement::PFLOWTYPE::UNMATCHED_CHARGED_HADRON))
288 const float& phi1,
const float& phi2)
290 float deta = eta1-eta2;
291 float dphi = phi1-phi2;
293 { dphi -= 2. * M_PI; }
295 { dphi += 2. * M_PI; }
297 return sqrt(pow(deta,2) + pow(dphi,2));