1 #include "HepMC/GenEvent.h"
2 #include "HepMC/GenParticle.h"
8 #include "HepMC/GenEvent.h"
9 #include "HepMC/HeavyIon.h"
15 using namespace HepMC;
29 dbe->setCurrentFolder(
"Generator/Particles");
32 for(
int ibin=0; ibin<3; ibin++) {
33 dnchdeta[ibin] = dbe->book1D(Form(
"dnchdeta%d",ibin),
";#eta;dN^{ch}/d#eta", 100, -6.0, 6.0);
34 dnchdpt[ibin] = dbe->book1D(Form(
"dnchdpt%d",ibin),
";p_{T};dN^{ch}/dp_{T}", 200, 0.0, 100.0);
35 b[ibin] = dbe->book1D(Form(
"b%d",ibin),
";b[fm];events",100, 0.0, 20.0);
36 dnchdphi[ibin] = dbe->book1D(Form(
"dnchdphi%d",ibin),
";#phi;dN^{ch}/d#phi",100, -3.2, 3.2);
38 dbe->tag(dnchdeta[ibin]->getFullname(),1+ibin*4);
39 dbe->tag(dnchdpt[ibin]->getFullname(),2+ibin*4);
40 dbe->tag(
b[ibin]->getFullname(),3+ibin*4);
41 dbe->tag(dnchdphi[ibin]->getFullname(),4+ibin*4);
44 rp = dbe->book1D(
"phi0",
";#phi_{RP};events",100,-3.2,3.2);
45 dbe->tag(rp->getFullname(),13);
70 const HepMC::GenEvent *evt = mc->GetEvent();
71 const HepMC::HeavyIon *hi = evt->heavy_ion();
73 double ip = hi->impact_parameter();
74 double phi0 = hi->event_plane_angle();
81 if(ip < 5.045) cbin=0;
82 else if (ip < 7.145 && ip > 5.045) cbin=1;
83 else if (ip < 15.202 && ip > 14.283) cbin=2;
90 HepMC::GenEvent::particle_const_iterator
begin = evt->particles_begin();
91 HepMC::GenEvent::particle_const_iterator
end = evt->particles_end();
92 for(HepMC::GenEvent::particle_const_iterator it = begin; it !=
end; ++it){
95 if((*it)->status() != 1)
continue;
98 int pdg_id = (*it)->pdg_id();
100 int charge =
static_cast<int>(part->charge());
101 if(charge==0)
continue;
103 float eta = (*it)->momentum().eta();
104 float phi = (*it)->momentum().phi();
105 float pt = (*it)->momentum().perp();
107 dnchdeta[cbin]->Fill(eta);
108 dnchdpt[cbin]->Fill(pt);
112 if(p > pi) p = p - 2*
pi;
113 if(p < -1*pi) p = p + 2*
pi;
114 dnchdphi[cbin]->Fill(p);
virtual void analyze(const edm::Event &, const edm::EventSetup &)
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const