38 produces<HepMCProduct>();
39 produces<GenEventInfoProduct>();
56 cout <<
" ExpoRandomPtGunProducer : Begin New Event Generation" << endl ;
65 fEvt =
new HepMC::GenEvent() ;
72 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(HepMC::FourVector(0.,0.,0.));
77 for (
unsigned int ip=0; ip<
fPartIDs.size(); ++ip)
85 while (pt<fMinPt || pt>
fMaxPt)
93 double mass = PData->mass().value() ;
95 double mom = pt/
sin(theta) ;
96 double px = pt*
cos(phi) ;
97 double py = pt*
sin(phi) ;
98 double pz = mom*
cos(theta) ;
99 double energy2= mom*mom + mass*mass ;
104 HepMC::FourVector
p(px,py,pz,energy) ;
107 Part->suggest_barcode( barcode ) ;
109 Vtx->add_particle_out(Part);
114 HepMC::FourVector ap(-px,-py,-pz,energy) ;
115 int APartID = -PartID ;
116 if ( PartID == 22 || PartID == 23 )
124 APart->suggest_barcode( barcode ) ;
126 Vtx->add_particle_out(APart) ;
131 fEvt->add_vertex(Vtx) ;
133 fEvt->set_signal_process_id(20) ;
141 BProduct->addHepMCData(
fEvt );
151 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
Exp< T >::type exp(const T &t)
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)
std::vector< int > fPartIDs
HepPDT::ParticleData ParticleData
virtual void produce(Event &e, const EventSetup &es)