38 produces<HepMCProduct>();
55 cout <<
" ExpoRandomPtGunSource : Begin New Event Generation" << endl ;
64 fEvt =
new HepMC::GenEvent() ;
71 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(HepMC::FourVector(0.,0.,0.));
76 for (
unsigned int ip=0; ip<
fPartIDs.size(); ++ip)
84 while (pt<fMinPt || pt>
fMaxPt)
92 double mass = PData->mass().value() ;
94 double mom = pt/
sin(theta) ;
95 double px = pt*
cos(phi) ;
96 double py = pt*
sin(phi) ;
97 double pz = mom*
cos(theta) ;
98 double energy2= mom*mom + mass*
mass ;
103 HepMC::FourVector
p(px,py,pz,energy) ;
106 Part->suggest_barcode( barcode ) ;
108 Vtx->add_particle_out(Part);
113 HepMC::FourVector ap(-px,-py,-pz,energy) ;
114 int APartID = -PartID ;
115 if ( PartID == 22 || PartID == 23 )
123 APart->suggest_barcode( barcode ) ;
125 Vtx->add_particle_out(APart) ;
130 fEvt->add_vertex(Vtx) ;
132 fEvt->set_signal_process_id(20) ;
140 BProduct->addHepMCData(
fEvt );
147 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
ExpoRandomPtGunSource(const ParameterSet &, const InputSourceDescription &)
CLHEP::RandFlat * fRandomGenerator
virtual ~ExpoRandomPtGunSource()
virtual bool produce(Event &e)
const T & max(const T &a, const T &b)
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
CLHEP::RandExponential * fRandomExpoGenerator
CLHEP::HepRandomEngine & fRandomEngine