Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all other guns #36420

Merged
merged 2 commits into from Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions GeneratorInterface/Pythia8Interface/plugins/Py8JetGun.cc
Expand Up @@ -42,6 +42,11 @@ namespace gen {
bool Py8JetGun::generatePartonsAndHadronize() {
fMasterGen->event.reset();

int NTotParticles = fPartIDs.size();

// energy below is dummy, it is not used
(fMasterGen->event).append(990, -11, 0, 0, 2, 1 + NTotParticles, 0, 0, 0., 0., 0., 15000., 15000.);

double totPx = 0.;
double totPy = 0.;
double totPz = 0.;
Expand All @@ -50,7 +55,7 @@ namespace gen {
double phi, eta, the, ee, pp;

for (size_t i = 0; i < fPartIDs.size(); i++) {
int particleID = fPartIDs[i]; // this is PDG - need to convert to Py8 ???
int particleID = fPartIDs[i]; // this is PDG

phi = 2. * M_PI * randomEngine().flat();
the = acos(-1. + 2. * randomEngine().flat());
Expand All @@ -70,7 +75,7 @@ namespace gen {
if (!((fMasterGen->particleData).isParticle(particleID))) {
particleID = std::fabs(particleID);
}
(fMasterGen->event).append(particleID, 1, 0, 0, px, py, pz, ee, mass);
(fMasterGen->event).append(particleID, 1, 1, 0, 0, 0, 0, 0, px, py, pz, ee, mass);
int eventSize = (fMasterGen->event).size() - 1;
// -log(flat) = exponential distribution
double tauTmp = -(fMasterGen->event)[eventSize].tau0() * log(randomEngine().flat());
Expand Down
11 changes: 8 additions & 3 deletions GeneratorInterface/Pythia8Interface/plugins/Py8MassGun.cc
Expand Up @@ -51,6 +51,11 @@ namespace gen {
if (pSize > 2)
return false;

int NTotParticles = fPartIDs.size();

// energy below is dummy, it is not used
(fMasterGen->event).append(990, -11, 0, 0, 2, 1 + NTotParticles, 0, 0, 0., 0., 0., 15000., 15000.);

// Pick a flat mass range
double phi, eta, the, ee, pp;
double m0 = (fMaxM - fMinM) * randomEngine().flat() + fMinM;
Expand All @@ -77,10 +82,10 @@ namespace gen {
double pY = pAbs * sinTheta * sin(phi);
double pZ = pAbs * cosTheta;

(fMasterGen->event).append(fPartIDs[0], 1, 0, 0, pX, pY, pZ, e1, m1);
(fMasterGen->event).append(fPartIDs[1], 1, 0, 0, -pX, -pY, -pZ, e2, m2);
(fMasterGen->event).append(fPartIDs[0], 1, 1, 0, 0, 0, 0, 0, pX, pY, pZ, e1, m1);
(fMasterGen->event).append(fPartIDs[1], 1, 1, 0, 0, 0, 0, 0, -pX, -pY, -pZ, e2, m2);
} else {
(fMasterGen->event).append(fPartIDs[0], 1, 0, 0, 0.0, 0.0, 0.0, m0, m0);
(fMasterGen->event).append(fPartIDs[0], 1, 1, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0, m0, m0);
}

//now the boost (from input params)
Expand Down
23 changes: 15 additions & 8 deletions GeneratorInterface/Pythia8Interface/plugins/Py8PtAndDxyGun.cc
Expand Up @@ -53,8 +53,15 @@ namespace gen {
bool Py8PtAndDxyGun::generatePartonsAndHadronize() {
fMasterGen->event.reset();

int NTotParticles = fPartIDs.size();
if (fAddAntiParticle)
NTotParticles *= 2;

// energy below is dummy, it is not used
(fMasterGen->event).append(990, -11, 0, 0, 2, 1 + NTotParticles, 0, 0, 0., 0., 0., 15000., 15000.);

for (size_t i = 0; i < fPartIDs.size(); i++) {
int particleID = fPartIDs[i]; // this is PDG - need to convert to Py8 ???
int particleID = fPartIDs[i]; // this is PDG

double phi = 0;
double dxy = 0;
Expand Down Expand Up @@ -128,12 +135,12 @@ namespace gen {
particleID = std::abs(particleID);
}
if (1 <= std::abs(particleID) && std::abs(particleID) <= 6) // quarks
(fMasterGen->event).append(particleID, 23, 101, 0, px, py, pz, ee, mass);
(fMasterGen->event).append(particleID, 23, 1, 0, 0, 0, 101, 0, px, py, pz, ee, mass);
else if (std::abs(particleID) == 21) // gluons
(fMasterGen->event).append(21, 23, 101, 102, px, py, pz, ee, mass);
(fMasterGen->event).append(21, 23, 1, 0, 0, 0, 101, 102, px, py, pz, ee, mass);
// other
else {
(fMasterGen->event).append(particleID, 1, 0, 0, px, py, pz, ee, mass);
(fMasterGen->event).append(particleID, 1, 1, 0, 0, 0, 0, 0, px, py, pz, ee, mass);
int eventSize = (fMasterGen->event).size() - 1;
// -log(flat) = exponential distribution
double tauTmp = -(fMasterGen->event)[eventSize].tau0() * log(randomEngine().flat());
Expand All @@ -147,14 +154,14 @@ namespace gen {
//
if (fAddAntiParticle) {
if (1 <= std::abs(particleID) && std::abs(particleID) <= 6) { // quarks
(fMasterGen->event).append(-particleID, 23, 0, 101, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(-particleID, 23, 1, 0, 0, 0, 0, 101, -px, -py, -pz, ee, mass);
} else if (std::abs(particleID) == 21) { // gluons
(fMasterGen->event).append(21, 23, 102, 101, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(21, 23, 1, 0, 0, 0, 102, 101, -px, -py, -pz, ee, mass);
} else {
if ((fMasterGen->particleData).isParticle(-particleID)) {
(fMasterGen->event).append(-particleID, 1, 0, 0, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(-particleID, 1, 1, 0, 0, 0, 0, 0, -px, -py, -pz, ee, mass);
} else {
(fMasterGen->event).append(particleID, 1, 0, 0, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(particleID, 1, 1, 0, 0, 0, 0, 0, -px, -py, -pz, ee, mass);
}
int eventSize = (fMasterGen->event).size() - 1;
// -log(flat) = exponential distribution
Expand Down
21 changes: 14 additions & 7 deletions GeneratorInterface/Pythia8Interface/plugins/Py8PtGun.cc
Expand Up @@ -39,6 +39,13 @@ namespace gen {
bool Py8PtGun::generatePartonsAndHadronize() {
fMasterGen->event.reset();

int NTotParticles = fPartIDs.size();
if (fAddAntiParticle)
NTotParticles *= 2;

// energy below is dummy, it is not used
(fMasterGen->event).append(990, -11, 0, 0, 2, 1 + NTotParticles, 0, 0, 0., 0., 0., 15000., 15000.);

for (size_t i = 0; i < fPartIDs.size(); i++) {
int particleID = fPartIDs[i]; // this is PDG - need to convert to Py8 ???

Expand All @@ -61,12 +68,12 @@ namespace gen {
particleID = std::abs(particleID);
}
if (1 <= std::abs(particleID) && std::abs(particleID) <= 6) // quarks
(fMasterGen->event).append(particleID, 23, 101, 0, px, py, pz, ee, mass);
(fMasterGen->event).append(particleID, 23, 1, 0, 0, 0, 101, 0, px, py, pz, ee, mass);
else if (std::abs(particleID) == 21) // gluons
(fMasterGen->event).append(21, 23, 101, 102, px, py, pz, ee, mass);
(fMasterGen->event).append(21, 23, 1, 0, 0, 0, 101, 102, px, py, pz, ee, mass);
// other
else {
(fMasterGen->event).append(particleID, 1, 0, 0, px, py, pz, ee, mass);
(fMasterGen->event).append(particleID, 1, 1, 0, 0, 0, 0, 0, px, py, pz, ee, mass);
int eventSize = (fMasterGen->event).size() - 1;
// -log(flat) = exponential distribution
double tauTmp = -(fMasterGen->event)[eventSize].tau0() * log(randomEngine().flat());
Expand All @@ -79,14 +86,14 @@ namespace gen {
//
if (fAddAntiParticle) {
if (1 <= std::abs(particleID) && std::abs(particleID) <= 6) { // quarks
(fMasterGen->event).append(-particleID, 23, 0, 101, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(-particleID, 23, 1, 0, 0, 0, 0, 101, -px, -py, -pz, ee, mass);
} else if (std::abs(particleID) == 21) { // gluons
(fMasterGen->event).append(21, 23, 102, 101, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(21, 23, 1, 0, 0, 0, 102, 101, -px, -py, -pz, ee, mass);
} else {
if ((fMasterGen->particleData).isParticle(-particleID)) {
(fMasterGen->event).append(-particleID, 1, 0, 0, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(-particleID, 1, 1, 0, 0, 0, 0, 0, -px, -py, -pz, ee, mass);
} else {
(fMasterGen->event).append(particleID, 1, 0, 0, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(particleID, 1, 1, 0, 0, 0, 0, 0, -px, -py, -pz, ee, mass);
}
int eventSize = (fMasterGen->event).size() - 1;
// -log(flat) = exponential distribution
Expand Down
23 changes: 15 additions & 8 deletions GeneratorInterface/Pythia8Interface/plugins/Py8PtotGun.cc
Expand Up @@ -39,8 +39,15 @@ namespace gen {
bool Py8PtotGun::generatePartonsAndHadronize() {
fMasterGen->event.reset();

int NTotParticles = fPartIDs.size();
if (fAddAntiParticle)
NTotParticles *= 2;

// energy below is dummy, it is not used
(fMasterGen->event).append(990, -11, 0, 0, 2, 1 + NTotParticles, 0, 0, 0., 0., 0., 15000., 15000.);

for (size_t i = 0; i < fPartIDs.size(); i++) {
int particleID = fPartIDs[i]; // this is PDG - need to convert to Py8 ???
int particleID = fPartIDs[i]; // this is PDG

double phi = (fMaxPhi - fMinPhi) * randomEngine().flat() + fMinPhi;
double eta = (fMaxEta - fMinEta) * randomEngine().flat() + fMinEta;
Expand All @@ -60,12 +67,12 @@ namespace gen {
particleID = std::abs(particleID);
}
if (1 <= std::abs(particleID) && std::abs(particleID) <= 6) // quarks
(fMasterGen->event).append(particleID, 23, 101, 0, px, py, pz, ee, mass);
(fMasterGen->event).append(particleID, 23, 1, 0, 0, 0, 101, 0, px, py, pz, ee, mass);
else if (std::abs(particleID) == 21) // gluons
(fMasterGen->event).append(21, 23, 101, 102, px, py, pz, ee, mass);
(fMasterGen->event).append(21, 23, 1, 0, 0, 0, 101, 102, px, py, pz, ee, mass);
// other
else {
(fMasterGen->event).append(particleID, 1, 0, 0, px, py, pz, ee, mass);
(fMasterGen->event).append(particleID, 1, 1, 0, 0, 0, 0, 0, px, py, pz, ee, mass);
int eventSize = (fMasterGen->event).size() - 1;
// -log(flat) = exponential distribution
double tauTmp = -(fMasterGen->event)[eventSize].tau0() * log(randomEngine().flat());
Expand All @@ -78,14 +85,14 @@ namespace gen {
//
if (fAddAntiParticle) {
if (1 <= std::abs(particleID) && std::abs(particleID) <= 6) { // quarks
(fMasterGen->event).append(-particleID, 23, 0, 101, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(-particleID, 23, 1, 0, 0, 0, 0, 101, -px, -py, -pz, ee, mass);
} else if (std::abs(particleID) == 21) { // gluons
(fMasterGen->event).append(21, 23, 102, 101, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(21, 23, 1, 0, 0, 0, 102, 101, -px, -py, -pz, ee, mass);
} else {
if ((fMasterGen->particleData).isParticle(-particleID)) {
(fMasterGen->event).append(-particleID, 1, 0, 0, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(-particleID, 1, 1, 0, 0, 0, 0, 0, -px, -py, -pz, ee, mass);
} else {
(fMasterGen->event).append(particleID, 1, 0, 0, -px, -py, -pz, ee, mass);
(fMasterGen->event).append(particleID, 1, 1, 0, 0, 0, 0, 0, -px, -py, -pz, ee, mass);
}
int eventSize = (fMasterGen->event).size() - 1;
// -log(flat) = exponential distribution
Expand Down