39 #include "HepMC/HeavyIon.h" 74 produces<edm::GenHIEvent>();
77 if (doParticleInfo_) {
107 int nChargedPtCut = 0;
108 int nChargedPtCutMR = 0;
113 double TotEnergy = 0;
119 if (
mix.size() < 1) {
120 throw cms::Exception(
"MatchVtx") <<
"Mixing has " <<
mix.size() <<
" sub-events, should have been at least 1" 126 if (doParticleInfo_) {
127 HepMC::GenEvent::particle_const_iterator
begin = evt->particles_begin();
128 HepMC::GenEvent::particle_const_iterator
end = evt->particles_end();
129 for (HepMC::GenEvent::particle_const_iterator it = begin; it !=
end; ++it) {
130 if ((*it)->status() != 1)
132 int pdg_id = (*it)->pdg_id();
134 int charge =
static_cast<int>(part->charge());
138 float pt = (*it)->momentum().perp();
139 float eta = (*it)->momentum().eta();
140 float energy = (*it)->momentum().e();
145 if (fabs(eta) < 1.0) {
150 if (fabs(eta) < 0.5) {
162 const HepMC::HeavyIon*
hi = evt->heavy_ion();
165 ncoll = ncoll + hi->Ncoll();
166 nhard = nhard + hi->Ncoll_hard();
167 int np = hi->Npart_proj() + hi->Npart_targ();
170 b = hi->impact_parameter();
171 phi = hi->event_plane_angle();
172 ecc = hi->eccentricity();
177 if (TotEnergy != 0) {
178 EtMR = TotEnergy / 2;
181 if (nChargedMR != 0) {
182 meanPtMR /= nChargedMR;
189 b, npart, ncoll, nhard, phi, ecc, nCharged, nChargedMR, meanPt, meanPtMR, EtMR, nChargedPtCut, nChargedPtCutMR));
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > hepmcSrc_
bool getData(T &iHolder) const
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &, const edm::EventSetup &) override
HepPDT::ParticleData ParticleData
edm::ESHandle< ParticleDataTable > pdt
const HepMC::GenEvent * GetEvent() const
T const * product() const
~GenHIEventProducer() override
GenHIEventProducer(const edm::ParameterSet &)