49 produces<HepMCProduct>(
"unsmeared");
67 std::cout <<
" FYI: MSTU(10)=1 is ENFORCED in Py6-PGuns, for technical reasons" << std::endl;
84 call_pyinit(
"NONE",
"",
"", 0.0);
97 for (
int iprt =
fPartIDs.size(); iprt < pyjets.n; iprt++)
99 int parent = pyjets.k[2][iprt];
104 parentPart->set_status(2);
106 HepMC::GenVertex* DecVtx =
new HepMC::GenVertex(
107 HepMC::FourVector(pyjets.v[0][iprt], pyjets.v[1][iprt], pyjets.v[2][iprt], pyjets.v[3][iprt]));
108 DecVtx->add_particle_in(parentPart);
112 HepMC::FourVector
pmom(pyjets.p[0][iprt], pyjets.p[1][iprt], pyjets.p[2][iprt], pyjets.p[3][iprt]);
115 if (pyjets.k[0][iprt] >= 1 && pyjets.k[0][iprt] <= 10) {
117 }
else if (pyjets.k[0][iprt] >= 11 && pyjets.k[0][iprt] <= 20) {
119 }
else if (pyjets.k[0][iprt] >= 21 && pyjets.k[0][iprt] <= 30) {
121 }
else if (pyjets.k[0][iprt] >= 31 && pyjets.k[0][iprt] <= 100) {
122 dstatus = pyjets.k[0][iprt];
125 new HepMC::GenParticle(pmom, HepPID::translatePythiatoPDT(pyjets.k[1][iprt]), dstatus);
126 daughter->suggest_barcode(iprt + 1);
127 DecVtx->add_particle_out(daughter);
131 for (iprt1 = iprt + 1; iprt1 < pyjets.n; iprt1++)
133 if (pyjets.k[2][iprt1] != parent)
136 HepMC::FourVector pmomN(pyjets.p[0][iprt1], pyjets.p[1][iprt1], pyjets.p[2][iprt1], pyjets.p[3][iprt1]);
139 if (pyjets.k[0][iprt1] >= 1 && pyjets.k[0][iprt1] <= 10) {
141 }
else if (pyjets.k[0][iprt1] >= 11 && pyjets.k[0][iprt1] <= 20) {
143 }
else if (pyjets.k[0][iprt1] >= 21 && pyjets.k[0][iprt1] <= 30) {
145 }
else if (pyjets.k[0][iprt1] >= 31 && pyjets.k[0][iprt1] <= 100) {
146 dstatus = pyjets.k[0][iprt1];
149 new HepMC::GenParticle(pmomN, HepPID::translatePythiatoPDT(pyjets.k[1][iprt1]), dstatus);
150 daughterN->suggest_barcode(iprt1 + 1);
151 DecVtx->add_particle_out(daughterN);
157 fEvt->add_vertex(DecVtx);
169 fEvt->set_beam_particles(
nullptr,
nullptr);
190 std::unique_ptr<HepMCProduct> bare_product(
new HepMCProduct());
193 bare_product->addHepMCData(
fEvt);
205 int py6PID = HepPID::translatePDTtoPythia(particleID);
207 int pythiaCode =
pycomp_(py6PID);
209 int has_antipart = pydat2.kchg[3 - 1][pythiaCode - 1];
210 int particleID2 = has_antipart ? -1 * particleID : particleID;
211 int py6PID2 = has_antipart ? -1 * py6PID : py6PID;
212 double the = 2. * atan(
exp(eta));
214 if (phi > 2. * M_PI) {
215 phi = phi - 2. *
M_PI;
219 pyjets.p[4][ip - 1] = pyjets.p[4][ip - 2];
221 py1ent_(ip, py6PID2, ee, the, phi);
223 double px = pyjets.p[0][ip - 1];
224 double py = pyjets.p[1][ip - 1];
225 double pz = pyjets.p[2][ip - 1];
226 HepMC::FourVector ap(px, py, pz, ee);
228 APart->suggest_barcode(ip);
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void endRun(edm::Run const &, edm::EventSetup const &) override
CLHEP::HepRandomEngine * randomEngine() const
LuminosityBlockIndex index() const
void produce(edm::Event &, const edm::EventSetup &) override
void beginRun(edm::Run const &, edm::EventSetup const &) override
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
bool call_pygive(const std::string &line)
HepMC::GenParticle * addAntiParticle(int &, int &, double &, double &, double &)
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) final
Exp< T >::type exp(const T &t)
virtual void generateEvent(CLHEP::HepRandomEngine *)=0
static const std::string kPythia6
void call_pylist(int mode)
void attachPy6DecaysToGenEvent()
void loadEvent(edm::Event &)
T getParameter(std::string const &) const
void py1ent_(int &ip, int &kf, double &pe, double &the, double &phi)
Pythia6Service * fPy6Service
StreamID streamID() const
std::vector< int > fPartIDs