14 #include "CLHEP/Random/RandFlat.h" 26 throw cms::Exception(
"Configuration") <<
"Not all probabilities given for all particle types " 29 produces<HepMCProduct>(
"unsmeared");
30 produces<GenEventInfoProduct>();
68 CLHEP::HepRandomEngine* engine = &rng->
getEngine(
e.streamID());
73 <<
"Begin New Event Generation";
87 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(HepMC::FourVector(0., 0., 0.));
92 double r1 = CLHEP::RandFlat::shoot(engine, 0., 1.);
93 for (
unsigned int ip = 0; ip <
fPartIDs.size(); ip++) {
100 double r2 = CLHEP::RandFlat::shoot(engine, 0., 1.);
101 for (
int ip = 0; ip <
fBinsP_; ip++) {
113 double mom = CLHEP::RandFlat::shoot(engine,
minP,
maxP);
117 double mass = PData->mass().value();
127 Part->suggest_barcode(barcode);
128 Vtx->add_particle_out(Part);
135 APart->suggest_barcode(barcode);
136 Vtx->add_particle_out(APart);
139 fEvt->add_vertex(Vtx);
140 fEvt->set_event_number(
e.id().event());
141 fEvt->set_signal_process_id(20);
148 std::unique_ptr<HepMCProduct> BProduct(
new HepMCProduct());
149 BProduct->addHepMCData(
fEvt);
156 edm::LogVerbatim(
"IOMC") <<
" RandomMultiParticlePGunProducer : Event Generation Done ";
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
std::vector< double > fProbParticle_
Sin< T >::type sin(const T &t)
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
RandomMultiParticlePGunProducer(const ParameterSet &pset)
void produce(Event &e, const EventSetup &es) override
ESHandle< HepPDT::ParticleDataTable > fPDGTable
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
std::vector< int > fPartIDs
HepPDT::ParticleData ParticleData
std::vector< double > fProbP_
Geom::Theta< T > theta() const