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 pdtToken_ = esConsumes<edm::Transition::BeginRun>();
29 for (
int ibin = 0; ibin < 3; ibin++) {
30 dnchdeta[ibin] = ibooker.
book1D(Form(
"dnchdeta%d", ibin),
";#eta;dN^{ch}/d#eta", 100, -6.0, 6.0);
32 dnchdpt[ibin] = ibooker.
book1D(Form(
"dnchdpt%d", ibin),
";p_{T};dN^{ch}/dp_{T}", 200, 0.0, 100.0);
34 b[ibin] = ibooker.
book1D(Form(
"b%d", ibin),
";b[fm];events", 100, 0.0, 20.0);
35 dnchdphi[ibin] = ibooker.
book1D(Form(
"dnchdphi%d", ibin),
";#phi;dN^{ch}/d#phi", 100, -3.2, 3.2);
38 rp = ibooker.
book1D(
"phi0",
";#phi_{RP};events", 100, -3.2, 3.2);
47 iEvent.getByToken(generatorToken_,
mc);
49 const HepMC::HeavyIon*
hi = evt->heavy_ion();
55 double ip =
hi->impact_parameter();
56 phi0 =
hi->event_plane_angle();
65 else if (ip < 7.145 && ip > 5.045)
67 else if (ip < 15.202 && ip > 14.283)
77 HepMC::GenEvent::particle_const_iterator begin = evt->particles_begin();
78 HepMC::GenEvent::particle_const_iterator
end = evt->particles_end();
79 for (HepMC::GenEvent::particle_const_iterator it = begin; it !=
end; ++it) {
81 if ((*it)->status() != 1)
85 int pdg_id = (*it)->pdg_id();
91 float eta = (*it)->momentum().eta();
92 float phi = (*it)->momentum().phi();
93 float pt = (*it)->momentum().perp();
95 dnchdeta[cbin]->Fill(
eta);
96 dnchdpt[cbin]->Fill(
pt);
99 double p = phi - phi0;
104 dnchdphi[cbin]->Fill(
p);
void analyze(const edm::Event &, const edm::EventSetup &) override
T getParameter(std::string const &) const
void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
HiBasicGenTest(const edm::ParameterSet &)
HepPDT::ParticleData ParticleData
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
~HiBasicGenTest() override