39 #include "HepMC/HeavyIon.h"
76 produces<edm::GenHIEvent>();
77 hepmcSrc_ = iConfig.
getParameter<std::vector<std::string> >(
"generators");
104 if(!(pdt.isValid())) iSetup.
getData(pdt);
115 int nChargedPtCut = 0;
116 int nChargedPtCutMR = 0;
121 double TotEnergy = 0;
123 for(
size_t ihep = 0; ihep < hepmcSrc_.size(); ++ihep){
127 const HepMC::GenEvent* evt = hepmc->GetEvent();
129 HepMC::GenEvent::particle_const_iterator
begin = evt->particles_begin();
130 HepMC::GenEvent::particle_const_iterator
end = evt->particles_end();
131 for(HepMC::GenEvent::particle_const_iterator it = begin; it !=
end; ++it){
132 if((*it)->status() != 1)
continue;
133 int pdg_id = (*it)->pdg_id();
135 int charge =
static_cast<int>(part->charge());
137 if(charge == 0)
continue;
138 float pt = (*it)->momentum().perp();
139 float eta = (*it)->momentum().eta();
140 float energy = (*it)->momentum().e();
156 if(fabs(eta) > 0.5)
continue;
161 const HepMC::HeavyIon* hi = evt->heavy_ion();
164 ncoll = ncoll + hi->Ncoll();
165 nhard = nhard + hi->Ncoll_hard();
166 int np = hi->Npart_proj() + hi->Npart_targ();
169 b = hi->impact_parameter();
170 phi = hi->event_plane_angle();
171 ecc = hi->eccentricity();
181 meanPtMR /= nChargedMR;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
edm::ESHandle< ParticleDataTable > pdt
void getData(T &iHolder) const
virtual void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< std::string > hepmcSrc_
HepPDT::ParticleData ParticleData
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned int nCharged(const GenJet &jet)
GenHIEventProducer(const edm::ParameterSet &)