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();
80 double ip = hi->impact_parameter();
81 phi0 = hi->event_plane_angle();
88 if(ip < 5.045) cbin=0;
89 else if (ip < 7.145 && ip > 5.045) cbin=1;
90 else if (ip < 15.202 && ip > 14.283) cbin=2;
98 HepMC::GenEvent::particle_const_iterator
begin = evt->particles_begin();
99 HepMC::GenEvent::particle_const_iterator
end = evt->particles_end();
100 for(HepMC::GenEvent::particle_const_iterator it = begin; it !=
end; ++it){
103 if((*it)->status() != 1)
continue;
106 int pdg_id = (*it)->pdg_id();
108 int charge =
static_cast<int>(part->charge());
109 if(charge==0)
continue;
111 float eta = (*it)->momentum().eta();
112 float phi = (*it)->momentum().phi();
113 float pt = (*it)->momentum().perp();
115 dnchdeta[cbin]->Fill(eta);
116 dnchdpt[cbin]->Fill(pt);
120 if(p > pi) p = p - 2*
pi;
121 if(p < -1*pi) p = p + 2*
pi;
122 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
#define DEFINE_FWK_MODULE(type)
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
void getData(T &iHolder) const
virtual void endRun(const edm::Run &, const edm::EventSetup &)
virtual ~HiBasicGenTest()
HiBasicGenTest(const edm::ParameterSet &)
HepPDT::ParticleData ParticleData