48 produces<HepMCProduct>();
61 cout <<
" MultiParticleInConeGunSource : Begin New Event Generation" << endl ;
70 fEvt =
new HepMC::GenEvent() ;
77 HepMC::GenVertex* Vtx =
new HepMC::GenVertex(HepMC::FourVector(0.,0.,0.));
82 for (
unsigned int ip=0; ip<
fPartIDs.size(); ++ip)
91 double mass = PData->mass().value() ;
93 double mom = pt/
sin(theta) ;
94 double px = pt*
cos(phi) ;
95 double py = pt*
sin(phi) ;
96 double pz = mom*
cos(theta) ;
97 double energy2= mom*mom + mass*
mass ;
100 HepMC::FourVector
p(px,py,pz,energy) ;
103 Part->suggest_barcode( barcode ) ;
105 Vtx->add_particle_out(Part);
110 for (
unsigned iPic=0; iPic!=
fInConeIds.size();iPic++){
117 double dEta = dR*
cos(alpha);
126 double etaIc = eta+dEta;
127 double phiIc = phi+
dPhi;
129 const unsigned int maxL=100;
132 if (phiIc > 3.14159265358979323846) phiIc-=2*3.14159265358979323846;
133 else if(phiIc <-3.14159265358979323846) phiIc+=2*3.14159265358979323846;
135 if (
abs(phiIc)<3.14159265358979323846)
break;
148 cout <<
" MultiParticleInConeGunSource : could not produce a particle "
162 double massIc= PDataIc->mass().value() ;
163 double momIc = momR * mom;
164 double energyIc =
sqrt(momIc*momIc + massIc*massIc);
166 double thetaIc = 2.*atan(
exp(-etaIc)) ;
167 double pxIc = momIc*
sin(thetaIc)*
cos(phiIc);
168 double pyIc = momIc*
sin(thetaIc)*
sin(phiIc);
169 double pzIc = momIc*
cos(thetaIc);
171 HepMC::FourVector pIc(pxIc,pyIc,pzIc,energyIc) ;
173 PartIc->suggest_barcode( barcode ) ;
175 Vtx->add_particle_out(PartIc);
181 fEvt->add_vertex(Vtx) ;
183 fEvt->set_signal_process_id(20) ;
191 BProduct->addHepMCData(
fEvt );
196 cout <<
" MultiParticleInConeGunSource : Event Generation Done " << endl;
std::vector< int > fPartIDs
virtual ~MultiParticleInConeGunSource()
T getUntrackedParameter(std::string const &, T const &) const
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
CLHEP::RandFlat * fRandomGenerator
MultiParticleInConeGunSource(const ParameterSet &, const InputSourceDescription &)
double dPhi(double phi1, double phi2)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< int > fInConeIds
Cos< T >::type cos(const T &t)
HepPDT::ParticleData ParticleData
ESHandle< HepPDT::ParticleDataTable > fPDGTable
unsigned int fInConeMaxTry
virtual bool produce(Event &e)