1 #include "HepMC/GenEvent.h"
2 #include "HepMC/GenParticle.h"
8 #include "HepMC/GenEvent.h"
9 #include "HepMC/HeavyIon.h"
15 using namespace HepMC;
19 generatorToken_ = consumes<edm::HepMCProduct> (
32 for (
int ibin = 0; ibin < 3; ibin++) {
33 dnchdeta[ibin] = ibooker.
book1D(Form(
"dnchdeta%d", ibin),
";#eta;dN^{ch}/d#eta",
36 dnchdpt[ibin] = ibooker.
book1D(Form(
"dnchdpt%d", ibin),
";p_{T};dN^{ch}/dp_{T}",
39 b[ibin] = ibooker.
book1D(Form(
"b%d",ibin),
";b[fm];events", 100, 0.0, 20.0);
40 dnchdphi[ibin] = ibooker.
book1D(Form(
"dnchdphi%d", ibin),
";#phi;dN^{ch}/d#phi",
43 ibooker.
tag(dnchdeta[ibin], 1+ibin*4);
44 ibooker.
tag(dnchdpt[ibin], 2+ibin*4);
45 ibooker.
tag(
b[ibin], 3+ibin*4);
46 ibooker.
tag(dnchdphi[ibin], 4+ibin*4);
49 rp = ibooker.
book1D(
"phi0",
";#phi_{RP};events", 100, -3.2, 3.2);
64 const HepMC::GenEvent *evt = mc->GetEvent();
65 const HepMC::HeavyIon *hi = evt->heavy_ion();
72 double ip = hi->impact_parameter();
73 phi0 = hi->event_plane_angle();
80 if(ip < 5.045) cbin=0;
81 else if (ip < 7.145 && ip > 5.045) cbin=1;
82 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 &)
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void getData(T &iHolder) const
MonitorElement * book1D(Args &&...args)
void tag(MonitorElement *, unsigned int)
virtual ~HiBasicGenTest()
HiBasicGenTest(const edm::ParameterSet &)
HepPDT::ParticleData ParticleData
void setCurrentFolder(const std::string &fullpath)
void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c)
Geom::Phi< T > phi() const