17 #include "CLHEP/Random/RandFlat.h"
29 produces<HepMCProduct>(
"unsmeared");
30 produces<GenEventInfoProduct>();
42 cout <<
" FlatRandomPtGunProducer : Begin New Event Generation" << endl;
57 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(HepMC::FourVector(0., 0., 0.));
62 for (
unsigned int ip = 0; ip <
fPartIDs.size(); ++ip) {
68 double mass = PData->mass().value();
70 double mom = pt /
sin(theta);
71 double px = pt *
cos(phi);
72 double py = pt *
sin(phi);
73 double pz = mom *
cos(theta);
74 double energy2 = mom * mom + mass *
mass;
76 HepMC::FourVector
p(px, py, pz, energy);
78 Part->suggest_barcode(barcode);
80 Vtx->add_particle_out(Part);
83 HepMC::FourVector ap(-px, -py, -pz, energy);
84 int APartID = -PartID;
85 if (PartID == 22 || PartID == 23) {
89 APart->suggest_barcode(barcode);
91 Vtx->add_particle_out(APart);
95 fEvt->add_vertex(Vtx);
97 fEvt->set_signal_process_id(20);
104 BProduct->addHepMCData(
fEvt);
113 cout <<
" FlatRandomPtGunProducer : Event Generation Done " << endl;
EventNumber_t event() const
void produce(Event &e, const EventSetup &es) override
~FlatRandomPtGunProducer() override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
FlatRandomPtGunProducer(const ParameterSet &pset)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
Exp< T >::type exp(const T &t)
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
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
T getParameter(std::string const &) const
StreamID streamID() const