34 produces<HepMCProduct>();
36 cout <<
"Internal FlatRandomEGun is initialzed" << endl ;
51 cout <<
" FlatRandomEGunSource : Begin New Event Generation" << endl ;
60 fEvt =
new HepMC::GenEvent() ;
67 HepMC::GenVertex* Vtx =
new HepMC::GenVertex( HepMC::FourVector(0.,0.,0.));
72 for (
unsigned int ip=0; ip<
fPartIDs.size(); ip++)
80 double mass = PData->mass().value() ;
81 double mom2 = energy*energy - mass*mass ;
92 double px = mom*
sin(theta)*
cos(phi) ;
93 double py = mom*
sin(theta)*
sin(phi) ;
94 double pz = mom*
cos(theta) ;
96 HepMC::FourVector
p(px,py,pz,energy) ;
99 Part->suggest_barcode( barcode ) ;
101 Vtx->add_particle_out(Part);
105 HepMC::FourVector ap(-px,-py,-pz,energy) ;
106 int APartID = -PartID ;
107 if ( PartID == 22 || PartID == 23 )
113 APart->suggest_barcode( barcode ) ;
115 Vtx->add_particle_out(APart) ;
119 fEvt->add_vertex(Vtx) ;
121 fEvt->set_signal_process_id(20) ;
130 BProduct->addHepMCData(
fEvt );
138 cout <<
" FlatRandomEGunSource : Event Generation Done " << endl;
std::vector< int > fPartIDs
T getUntrackedParameter(std::string const &, T const &) const
Sin< T >::type sin(const T &t)
CLHEP::RandFlat * fRandomGenerator
Geom::Theta< T > theta() const
Exp< T >::type exp(const T &t)
FlatRandomEGunSource(const ParameterSet &, const InputSourceDescription &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Cos< T >::type cos(const T &t)
virtual bool produce(Event &e)
HepPDT::ParticleData ParticleData
virtual ~FlatRandomEGunSource()
ESHandle< HepPDT::ParticleDataTable > fPDGTable