17 #include "CLHEP/Random/RandExponential.h"
18 #include "CLHEP/Random/RandFlat.h"
32 produces<HepMCProduct>(
"unsmeared");
33 produces<GenEventInfoProduct>();
45 cout <<
" ExpoRandomPtGunProducer : Begin New Event Generation" << endl;
61 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(HepMC::FourVector(0., 0., 0.));
66 for (
unsigned int ip = 0; ip <
fPartIDs.size(); ++ip) {
72 while (pt < fMinPt || pt >
fMaxPt) {
80 double mass = PData->mass().value();
82 double mom = pt /
sin(theta);
83 double px = pt *
cos(phi);
84 double py = pt *
sin(phi);
85 double pz = mom *
cos(theta);
86 double energy2 = mom * mom + mass *
mass;
91 HepMC::FourVector
p(px, py, pz, energy);
93 Part->suggest_barcode(barcode);
95 Vtx->add_particle_out(Part);
99 HepMC::FourVector ap(-px, -py, -pz, energy);
100 int APartID = -PartID;
101 if (PartID == 22 || PartID == 23) {
107 APart->suggest_barcode(barcode);
109 Vtx->add_particle_out(APart);
113 fEvt->add_vertex(Vtx);
115 fEvt->set_signal_process_id(20);
122 BProduct->addHepMCData(
fEvt);
131 cout <<
" FlatRandomPtGunProducer : Event Generation Done " << endl;
EventNumber_t event() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ExpoRandomPtGunProducer(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
~ExpoRandomPtGunProducer() override
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
std::vector< int > fPartIDs
HepPDT::ParticleData ParticleData
void produce(Event &e, const EventSetup &es) override
T getParameter(std::string const &) const
StreamID streamID() const