73 bool passLoop =
false;
88 for (
int i = 0;
i < 10000;
i++) {
90 vy = (pt * dxy + vx * py) / px;
91 lxy =
sqrt(vx * vx + vy * vy);
101 mass = (
fMasterGen->particleData).m0(particleID);
103 double pp = pt /
sin(theta);
104 ee =
sqrt(pp * pp + mass * mass);
106 pz = pp *
cos(theta);
109 for (
int j = 0; j < 100; j++) {
112 if (v0 <= 0 || lxy * lxy / (coneTheta * coneTheta) > v0 * v0) {
119 passLoop = (passLxy && passLz);
125 float time =
sqrt(vx * vx + vy * vy + vz * vz);
127 if (!((
fMasterGen->particleData).isParticle(particleID))) {
132 else if (
std::abs(particleID) == 21)
133 (
fMasterGen->event).append(21, 23, 101, 102, px, py, pz, ee, mass);
142 (
fMasterGen->event).back().vProd(vx, vy, vz, time);
150 (
fMasterGen->event).
append(-particleID, 23, 0, 101, -px, -py, -pz, ee, mass);
151 }
else if (
std::abs(particleID) == 21) {
154 if ((
fMasterGen->particleData).isParticle(-particleID)) {
164 (
fMasterGen->event).back().vProd(-vx, -vy, -vz, time);
172 event() = std::make_unique<HepMC::GenEvent>();
T getParameter(std::string const &) const
edm::GeneratorFilter< gen::Py8PtAndDxyGun, gen::ExternalDecayDriver > Pythia8PtAndDxyGun
const char * classname() const override
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
bool generatePartonsAndHadronize() override
#define DEFINE_FWK_MODULE(type)
Py8PtAndDxyGun(edm::ParameterSet const &)
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
std::unique_ptr< HepMC::GenEvent > & event()
std::vector< int > fPartIDs
~Py8PtAndDxyGun() override
P8RndmEngine & randomEngine()
HepMC::Pythia8ToHepMC toHepMC
std::unique_ptr< Pythia8::Pythia > fMasterGen