33 produces<HepMCProduct>();
47 cout <<
" FlatRandomPtGunSource : Begin New Event Generation" << endl ;
56 fEvt =
new HepMC::GenEvent() ;
62 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(HepMC::FourVector(0.,0.,0.));
67 for (
unsigned int ip=0; ip<
fPartIDs.size(); ++ip)
76 double mass = PData->mass().value() ;
78 double mom = pt/
sin(theta) ;
79 double px = pt*
cos(phi) ;
80 double py = pt*
sin(phi) ;
81 double pz = mom*
cos(theta) ;
82 double energy2= mom*mom + mass*
mass ;
84 HepMC::FourVector
p(px,py,pz,energy) ;
87 Part->suggest_barcode( barcode ) ;
89 Vtx->add_particle_out(Part);
93 HepMC::FourVector ap(-px,-py,-pz,energy) ;
94 int APartID = -PartID ;
95 if ( PartID == 22 || PartID == 23 )
101 APart->suggest_barcode( barcode ) ;
103 Vtx->add_particle_out(APart) ;
108 fEvt->add_vertex(Vtx) ;
110 fEvt->set_signal_process_id(20) ;
118 BProduct->addHepMCData(
fEvt );
125 cout <<
" FlatRandomPtGunSource : Event Generation Done " << endl;
std::vector< int > fPartIDs
T getUntrackedParameter(std::string const &, T const &) const
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
CLHEP::RandFlat * fRandomGenerator
virtual ~FlatRandomPtGunSource()
FlatRandomPtGunSource(const ParameterSet &, const InputSourceDescription &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Cos< T >::type cos(const T &t)
HepPDT::ParticleData ParticleData
ESHandle< HepPDT::ParticleDataTable > fPDGTable
virtual bool produce(Event &e)