1 #include "HepMC/GenEvent.h"
2 #include "HepMC/GenParticle.h"
8 #include "HepMC/GenEvent.h"
9 #include "HepMC/HeavyIon.h"
15 using namespace HepMC;
21 generatorToken_ = consumes<edm::HepMCProduct> (
31 dbe->setCurrentFolder(
"Generator/Particles");
34 for(
int ibin=0; ibin<3; ibin++) {
35 dnchdeta[ibin] = dbe->book1D(Form(
"dnchdeta%d",ibin),
";#eta;dN^{ch}/d#eta", 100, -6.0, 6.0);
36 dnchdpt[ibin] = dbe->book1D(Form(
"dnchdpt%d",ibin),
";p_{T};dN^{ch}/dp_{T}", 200, 0.0, 100.0);
37 b[ibin] = dbe->book1D(Form(
"b%d",ibin),
";b[fm];events",100, 0.0, 20.0);
38 dnchdphi[ibin] = dbe->book1D(Form(
"dnchdphi%d",ibin),
";#phi;dN^{ch}/d#phi",100, -3.2, 3.2);
40 dbe->tag(dnchdeta[ibin]->getFullname(),1+ibin*4);
41 dbe->tag(dnchdpt[ibin]->getFullname(),2+ibin*4);
42 dbe->tag(
b[ibin]->getFullname(),3+ibin*4);
43 dbe->tag(dnchdphi[ibin]->getFullname(),4+ibin*4);
46 rp = dbe->book1D(
"phi0",
";#phi_{RP};events",100,-3.2,3.2);
47 dbe->tag(rp->getFullname(),13);
72 const HepMC::GenEvent *evt = mc->GetEvent();
73 const HepMC::HeavyIon *hi = evt->heavy_ion();
75 double ip = hi->impact_parameter();
76 double phi0 = hi->event_plane_angle();
83 if(ip < 5.045) cbin=0;
84 else if (ip < 7.145 && ip > 5.045) cbin=1;
85 else if (ip < 15.202 && ip > 14.283) cbin=2;
92 HepMC::GenEvent::particle_const_iterator
begin = evt->particles_begin();
93 HepMC::GenEvent::particle_const_iterator
end = evt->particles_end();
94 for(HepMC::GenEvent::particle_const_iterator it = begin; it !=
end; ++it){
97 if((*it)->status() != 1)
continue;
100 int pdg_id = (*it)->pdg_id();
102 int charge =
static_cast<int>(part->charge());
103 if(charge==0)
continue;
105 float eta = (*it)->momentum().eta();
106 float phi = (*it)->momentum().phi();
107 float pt = (*it)->momentum().perp();
109 dnchdeta[cbin]->Fill(eta);
110 dnchdpt[cbin]->Fill(pt);
114 if(p > pi) p = p - 2*
pi;
115 if(p < -1*pi) p = p + 2*
pi;
116 dnchdphi[cbin]->Fill(p);
virtual void analyze(const edm::Event &, const edm::EventSetup &)
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
DEFINE_FWK_MODULE(HiMixingModule)
void getData(T &iHolder) const
virtual void endRun(const edm::Run &, const edm::EventSetup &)
virtual ~HiBasicGenTest()
HiBasicGenTest(const edm::ParameterSet &)
HepPDT::ParticleData ParticleData