36 produces<HepMCProduct>();
37 produces<GenEventInfoProduct>();
54 cout <<
" ExpoRandomPtGunProducer : Begin New Event Generation" << endl ;
63 fEvt =
new HepMC::GenEvent() ;
70 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(HepMC::FourVector(0.,0.,0.));
75 for (
unsigned int ip=0; ip<
fPartIDs.size(); ++ip)
83 while (pt<fMinPt || pt>
fMaxPt)
91 double mass = PData->mass().value() ;
93 double mom = pt/
sin(theta) ;
94 double px = pt*
cos(phi) ;
95 double py = pt*
sin(phi) ;
96 double pz = mom*
cos(theta) ;
97 double energy2= mom*mom + mass*mass ;
102 HepMC::FourVector
p(px,py,pz,energy) ;
105 Part->suggest_barcode( barcode ) ;
107 Vtx->add_particle_out(Part);
112 HepMC::FourVector ap(-px,-py,-pz,energy) ;
113 int APartID = -PartID ;
114 if ( PartID == 22 || PartID == 23 )
122 APart->suggest_barcode( barcode ) ;
124 Vtx->add_particle_out(APart) ;
129 fEvt->add_vertex(Vtx) ;
131 fEvt->set_signal_process_id(20) ;
139 BProduct->addHepMCData(
fEvt );
149 cout <<
" FlatRandomPtGunProducer : Event Generation Done " << endl;
T getParameter(std::string const &) const
EventNumber_t event() const
ExpoRandomPtGunProducer(const ParameterSet &pset)
CLHEP::HepRandomEngine & fRandomEngine
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
CLHEP::RandExponential * fRandomExpoGenerator
virtual ~ExpoRandomPtGunProducer()
ESHandle< HepPDT::ParticleDataTable > fPDGTable
const T & max(const T &a, const T &b)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
CLHEP::RandFlat * fRandomGenerator
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
std::vector< int > fPartIDs
HepPDT::ParticleData ParticleData
virtual void produce(Event &e, const EventSetup &es) override