12 #include <TLorentzVector.h>
17 #include <TDatabasePDG.h>
24 #include <HepMC/GenEvent.h>
25 #include <HepMC/GenVertex.h>
44 _tree_quarkonia =
new TNtuple(
"tree_quarkonia",
"quarkonia info",
"ev:px:py:pz:e:pt:eta:phi:invmass:ndaughter:d1d2angle");
58 PHHepMCGenEventMap * geneventmap = findNode::getClass<PHHepMCGenEventMap>(topNode,
"PHHepMCGenEventMap");
61 std::cout <<
PHWHERE<<
" - Fatal error - missing node PHHepMCGenEventMap"<<std::endl;
68 std::cout <<
PHWHERE<<
" - Fatal error - node PHHepMCGenEventMap missing subevent with embedding ID "<<
_embedding_id;
69 std::cout <<
". Print PHHepMCGenEventMap:";
74 HepMC::GenEvent* theEvent = genevt->
getEvent();
76 for (HepMC::GenEvent::particle_const_iterator
p = theEvent->particles_begin();
77 p != theEvent->particles_end(); ++
p)
80 TParticlePDG * pdg_p = TDatabasePDG::Instance()->GetParticle( (*p)->pdg_id() );
83 if (TString(pdg_p->GetName()) ==
"J/psi" && (*p)->end_vertex() && (*p)->status() == 2 )
87 float px = (*p)->momentum().px();
88 float py = (*p)->momentum().py();
89 float pz = (*p)->momentum().pz();
90 float pe = (*p)->momentum().e();
91 float pt = sqrt(pow((*p)->momentum().px(),2) + pow((*p)->momentum().py(),2));
92 float eta = (*p)->momentum().eta();
93 float phi = (*p)->momentum().phi();
94 float invmass = (*p)->momentum().m();
97 float ndaughter = (*p)->end_vertex()->particles_out_size();
101 if ( ndaughter == 2 )
103 HepMC::GenVertex::particles_out_const_iterator p_d1 = (*p)->end_vertex()->particles_out_const_begin();
104 HepMC::GenVertex::particles_out_const_iterator p_d2 = p_d1 + 1;
106 TLorentzVector v_d1((*p_d1)->momentum().px(),(*p_d1)->momentum().py(),(*p_d1)->momentum().pz(),(*p_d1)->momentum().e());
107 TLorentzVector v_d2((*p_d2)->momentum().px(),(*p_d2)->momentum().py(),(*p_d2)->momentum().pz(),(*p_d2)->momentum().e());
109 d1d2angle = v_d1.Angle(v_d2.Vect());
112 float quarkonia_data[70] = {(float)
_ievent,px,py,pz,pe,pt,eta,phi,invmass,ndaughter,d1d2angle};