48 <<
" pythia did not accept MSTU(12)=12345";
51 produces<HepMCProduct>();
84 call_pyinit(
"NONE",
"",
"", 0.0);
86 std::cout <<
" FYI: MSTU(10)=1 is ENFORCED in Py6-PGuns, for technical reasons"
104 for (
int iprt=
fPartIDs.size(); iprt<pyjets.n; iprt++ )
106 int parent = pyjets.k[2][iprt];
112 parentPart->set_status( 2 );
114 HepMC::GenVertex* DecVtx =
new HepMC::GenVertex(HepMC::FourVector(pyjets.v[0][iprt],
118 DecVtx->add_particle_in( parentPart );
122 HepMC::FourVector pmom(pyjets.p[0][iprt],pyjets.p[1][iprt],
123 pyjets.p[2][iprt],pyjets.p[3][iprt] );
126 if ( pyjets.k[0][iprt] >= 1 && pyjets.k[0][iprt] <= 10 )
130 else if ( pyjets.k[0][iprt] >= 11 && pyjets.k[0][iprt] <= 20 )
134 else if ( pyjets.k[0][iprt] >= 21 && pyjets.k[0][iprt] <= 30 )
138 else if ( pyjets.k[0][iprt] >= 31 && pyjets.k[0][iprt] <= 100 )
140 dstatus = pyjets.k[0][iprt];
144 HepPID::translatePythiatoPDT( pyjets.k[1][iprt] ),
146 daughter->suggest_barcode( iprt+1 );
147 DecVtx->add_particle_out( daughter );
151 for ( iprt1=iprt+1; iprt1<pyjets.n; iprt1++ )
153 if ( pyjets.k[2][iprt1] != parent )
break;
155 HepMC::FourVector pmomN(pyjets.p[0][iprt1],pyjets.p[1][iprt1],
156 pyjets.p[2][iprt1],pyjets.p[3][iprt1] );
159 if ( pyjets.k[0][iprt1] >= 1 && pyjets.k[0][iprt1] <= 10 )
163 else if ( pyjets.k[0][iprt1] >= 11 && pyjets.k[0][iprt1] <= 20 )
167 else if ( pyjets.k[0][iprt1] >= 21 && pyjets.k[0][iprt1] <= 30 )
171 else if ( pyjets.k[0][iprt1] >= 31 && pyjets.k[0][iprt1] <= 100 )
173 dstatus = pyjets.k[0][iprt1];
177 HepPID::translatePythiatoPDT( pyjets.k[1][iprt1] ),
179 daughterN->suggest_barcode( iprt1+1 );
180 DecVtx->add_particle_out( daughterN );
186 fEvt->add_vertex( DecVtx );
200 fEvt->set_beam_particles(0,0);
225 std::auto_ptr<HepMCProduct> bare_product(
new HepMCProduct());
227 if(
fEvt) bare_product->addHepMCData(
fEvt );
229 evt.
put(bare_product);
237 double& ee,
double&
eta,
double&
phi )
240 if ( ip < 2 )
return 0;
243 int py6PID = HepPID::translatePDTtoPythia( particleID );
245 int pythiaCode =
pycomp_(py6PID);
247 int has_antipart = pydat2.kchg[3-1][pythiaCode-1];
248 int particleID2 = has_antipart ? -1 * particleID : particleID;
249 int py6PID2 = has_antipart ? -1 * py6PID : py6PID;
250 double the = 2.*atan(
exp(eta));
252 if (phi > 2.* M_PI) {phi = phi - 2.*
M_PI;}
255 pyjets.p[4][ip-1] = pyjets.p[4][ip-2];
257 py1ent_(ip, py6PID2, ee, the, phi);
259 double px = pyjets.p[0][ip-1];
260 double py = pyjets.p[1][ip-1];
261 double pz = pyjets.p[2][ip-1];
262 HepMC::FourVector ap(px,py,pz,ee) ;
265 APart->suggest_barcode( ip ) ;
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
void endRun(edm::Run const &, edm::EventSetup const &) override
void produce(edm::Event &, const edm::EventSetup &) override
void beginRun(edm::Run const &, edm::EventSetup const &) override
bool call_pygive(const std::string &line)
HepMC::GenParticle * addAntiParticle(int &, int &, double &, double &, double &)
virtual void generateEvent()=0
void call_pylist(int mode)
void attachPy6DecaysToGenEvent()
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void loadEvent(edm::Event &)
return(e1-e2)*(e1-e2)+dp *dp
void py1ent_(int &ip, int &kf, double &pe, double &the, double &phi)
Pythia6Service * fPy6Service
volatile std::atomic< bool > shutdown_flag false
std::vector< int > fPartIDs