40 #include "HepMC/HeavyIon.h"
76 produces<edm::GenHIEvent>();
78 pdtToken_ = esConsumes<ParticleDataTable, edm::DefaultRecord>();
80 if (doParticleInfo_) {
98 if (!(pdt.isValid())) {
111 int nChargedPtCut = 0;
112 int nChargedPtCutMR = 0;
117 double TotEnergy = 0;
120 iEvent.getByToken(hepmcSrc_, hepmc);
123 if (
mix.size() < 1) {
124 throw cms::Exception(
"MatchVtx") <<
"Mixing has " <<
mix.size() <<
" sub-events, should have been at least 1"
130 if (doParticleInfo_) {
131 HepMC::GenEvent::particle_const_iterator begin = evt->particles_begin();
132 HepMC::GenEvent::particle_const_iterator
end = evt->particles_end();
133 for (HepMC::GenEvent::particle_const_iterator it = begin; it !=
end; ++it) {
134 if ((*it)->status() != 1)
136 int pdg_id = (*it)->pdg_id();
138 int charge = static_cast<int>(
part->charge());
142 float pt = (*it)->momentum().perp();
143 float eta = (*it)->momentum().eta();
144 float energy = (*it)->momentum().e();
149 if (fabs(
eta) < 1.0) {
154 if (fabs(
eta) < 0.5) {
166 const HepMC::HeavyIon*
hi = evt->heavy_ion();
169 ncoll = ncoll +
hi->Ncoll();
170 nhard = nhard +
hi->Ncoll_hard();
171 int np =
hi->Npart_proj() +
hi->Npart_targ();
174 b =
hi->impact_parameter();
175 phi =
hi->event_plane_angle();
176 ecc =
hi->eccentricity();
181 if (TotEnergy != 0) {
182 EtMR = TotEnergy / 2;
185 if (nChargedMR != 0) {
186 meanPtMR /= nChargedMR;
193 b,
npart, ncoll, nhard, phi, ecc,
nCharged, nChargedMR, meanPt, meanPtMR, EtMR, nChargedPtCut, nChargedPtCutMR));