14 #include "CLHEP/Random/RandFlat.h" 17 class HepRandomEngine;
32 produces<HepMCProduct>(
"unsmeared");
33 produces<GenEventInfoProduct>();
44 LogDebug(
"FlatThetaGun") <<
"FlatRandomPtThetaGunProducer : Begin New Event Generation";
63 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(HepMC::FourVector(0.,0.,0.));
68 for (
unsigned int ip=0; ip<
fPartIDs.size(); ++ip) {
76 double mass = PData->mass().value() ;
77 double mom = pt/
sin(theta) ;
78 double px = pt*
cos(phi) ;
79 double py = pt*
sin(phi) ;
80 double pz = mom*
cos(theta) ;
81 double energy2= mom*mom + mass*
mass ;
82 double energy =
sqrt(energy2) ;
83 HepMC::FourVector
p(px,py,pz,energy) ;
85 Part->suggest_barcode( barcode ) ;
87 Vtx->add_particle_out(Part);
90 HepMC::FourVector ap(-px,-py,-pz,energy) ;
92 if ( PartID == 22 || PartID == 23 ) {
96 APart->suggest_barcode( barcode ) ;
98 Vtx->add_particle_out(APart) ;
102 fEvt->add_vertex(Vtx) ;
104 fEvt->set_signal_process_id(20) ;
110 std::unique_ptr<HepMCProduct> BProduct(
new HepMCProduct()) ;
111 BProduct->addHepMCData(
fEvt );
118 LogDebug(
"FlatThetaGun") <<
"FlatRandomPtThetaGunProducer : Event Generation Done ";
void produce(Event &e, const EventSetup &es) override
T getParameter(std::string const &) const
EventNumber_t event() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Sin< T >::type sin(const T &t)
ESHandle< HepPDT::ParticleDataTable > fPDGTable
~FlatRandomPtThetaGunProducer() override
Geom::Theta< T > theta() const
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
HepPDT::ParticleData ParticleData
StreamID streamID() const
std::vector< int > fPartIDs