34 produces<HepMCProduct>();
35 produces<GenEventInfoProduct>();
37 cout <<
"Internal FlatRandomEGun is initialzed" << endl ;
52 cout <<
" FlatRandomEGunProducer : Begin New Event Generation" << endl ;
61 fEvt =
new HepMC::GenEvent() ;
68 HepMC::GenVertex* Vtx =
new HepMC::GenVertex( HepMC::FourVector(0.,0.,0.));
73 for (
unsigned int ip=0; ip<
fPartIDs.size(); ip++)
81 double mass = PData->mass().value() ;
82 double mom2 = energy*energy - mass*mass ;
93 double px = mom*
sin(theta)*
cos(phi) ;
94 double py = mom*
sin(theta)*
sin(phi) ;
95 double pz = mom*
cos(theta) ;
97 HepMC::FourVector
p(px,py,pz,energy) ;
100 Part->suggest_barcode( barcode ) ;
102 Vtx->add_particle_out(Part);
106 HepMC::FourVector ap(-px,-py,-pz,energy) ;
107 int APartID = -PartID ;
108 if ( PartID == 22 || PartID == 23 )
114 APart->suggest_barcode( barcode ) ;
116 Vtx->add_particle_out(APart) ;
120 fEvt->add_vertex(Vtx) ;
122 fEvt->set_signal_process_id(20) ;
131 BProduct->addHepMCData(
fEvt );
142 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)
std::vector< int > fPartIDs
HepPDT::ParticleData ParticleData
virtual void produce(Event &e, const EventSetup &es) override