13 #include <TLorentzVector.h>
18 #include <TDatabasePDG.h>
23 #include <g4jets/JetMap.h>
24 #include <g4jets/Jet.h>
28 #include <HepMC/GenEvent.h>
29 #include <HepMC/GenVertex.h>
59 _h1 =
new TH1D(
"h1",
"", 100, 0, 100.0);
60 _h2 =
new TH2D(
"h2",
"", 100, 0, 100.0, 40, -2, +2);
61 _h2_b =
new TH2D(
"h2_b",
"", 100, 0, 100.0, 40, -2, +2);
62 _h2_c =
new TH2D(
"h2_c",
"", 100, 0, 100.0, 40, -2, +2);
63 _h2all =
new TH2D(
"h2all",
"", 100, 0, 100.0, 40, -2, +2);
65 _ntp_gamma =
new TNtuple(
"ntp_gamma",
"truth shower => best cluster",
"ev:px:py:pz:pt:eta:phi");
76 PHHepMCGenEventMap * geneventmap = findNode::getClass<PHHepMCGenEventMap>(topNode,
"PHHepMCGenEventMap");
79 std::cout <<
PHWHERE<<
" - Fatal error - missing node PHHepMCGenEventMap"<<std::endl;
86 std::cout <<
PHWHERE<<
" - Fatal error - node PHHepMCGenEventMap missing subevent with embedding ID "<<
_embedding_id;
87 std::cout <<
". Print PHHepMCGenEventMap:";
92 HepMC::GenEvent* theEvent = genevt->
getEvent();
95 for (HepMC::GenEvent::particle_const_iterator
p = theEvent->particles_begin();
96 p != theEvent->particles_end(); ++
p)
98 TParticlePDG * pdg_p = TDatabasePDG::Instance()->GetParticle(
102 if (TString(pdg_p->GetName()) ==
"gamma" && !(*p)->end_vertex() && (*p)->status() == 1 )
104 if((*p)->momentum().perp()>5.)
_h2->Fill((*p)->momentum().perp(), (*p)->momentum().pseudoRapidity());
105 if((*p)->momentum().perp()>5.)
_h1->Fill((*p)->momentum().perp());
107 if((*p)->momentum().perp()>5.) {
108 const float px = (*p)->momentum().x(),
109 py = (*p)->momentum().y(),
110 pz = (*p)->momentum().z(),
111 pt = (*p)->momentum().perp(),
112 eta = (*p)->momentum().pseudoRapidity(),
113 phi = (*p)->momentum().phi();
132 std::cout << __PRETTY_FUNCTION__ <<
" DVP PASSED " <<
_total_pass
133 <<
" events" << std::endl;