32 produces<HepMCProduct>();
33 produces<GenEventInfoProduct>();
35 cout <<
"Internal FlatRandomEGun is initialzed" << endl ;
50 cout <<
" FlatRandomEGunProducer : Begin New Event Generation" << endl ;
59 fEvt =
new HepMC::GenEvent() ;
66 HepMC::GenVertex* Vtx =
new HepMC::GenVertex( HepMC::FourVector(0.,0.,0.));
71 for (
unsigned int ip=0; ip<
fPartIDs.size(); ip++)
79 double mass = PData->mass().value() ;
80 double mom2 = energy*energy - mass*mass ;
91 double px = mom*
sin(theta)*
cos(phi) ;
92 double py = mom*
sin(theta)*
sin(phi) ;
93 double pz = mom*
cos(theta) ;
95 HepMC::FourVector
p(px,py,pz,energy) ;
98 Part->suggest_barcode( barcode ) ;
100 Vtx->add_particle_out(Part);
104 HepMC::FourVector ap(-px,-py,-pz,energy) ;
105 int APartID = -PartID ;
106 if ( PartID == 22 || PartID == 23 )
112 APart->suggest_barcode( barcode ) ;
114 Vtx->add_particle_out(APart) ;
118 fEvt->add_vertex(Vtx) ;
120 fEvt->set_signal_process_id(20) ;
129 BProduct->addHepMCData(
fEvt );
140 cout <<
" FlatRandomEGunProducer : Event Generation Done " << endl;
FlatRandomEGunProducer(const ParameterSet &pset)
T getParameter(std::string const &) const
EventNumber_t event() const
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
ESHandle< HepPDT::ParticleDataTable > fPDGTable
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual ~FlatRandomEGunProducer()
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