Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions MC/config/common/external/generator/CoalescencePythia8.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ bool doCoal(Pythia8::Event& event, int charge, int pdgCode, float mass, bool tri
bool CoalescencePythia8(Pythia8::Event& event, std::vector<unsigned int> inputPdgList = {}, bool trivialCoal = false, double coalMomentum = 0.4, int firstDauID = -1, int lastDauId = -1, float maxRapidity = 1.)
{
const double coalescenceRadius{0.5 * 1.122462 * coalMomentum};

// if coalescence from a heavy hadron, loop only between firstDauID and lastDauID
int loopStart = firstDauID > -1 ? firstDauID : 0;
int loopEnd = lastDauId > -1 ? lastDauId : event.size() - 1;
Expand Down Expand Up @@ -152,26 +153,41 @@ bool CoalescencePythia8(Pythia8::Event& event, std::vector<unsigned int> inputPd
for (int iN{0}; iN < neutrons[iC].size(); ++iN) {
if (nuclearMask & (1 << kDeuteron)) {
coalHappened |= doCoal(event, iC, pdgList[kDeuteron], massList[kDeuteron], trivialCoal, coalescenceRadius, nuclFromDecay, protons[iC][iP], neutrons[iC][iN]);
if (nuclFromDecay && coalHappened) {
return true;
}
}
if (nuclearMask & (1 << kTriton)) {
for (int iN2{iN + 1}; iN2 < neutrons[iC].size(); ++iN2) {
coalHappened |= doCoal(event, iC, pdgList[kTriton], massList[kTriton], trivialCoal, coalescenceRadius, nuclFromDecay, protons[iC][iP], neutrons[iC][iN], neutrons[iC][iN2]);
if (nuclFromDecay && coalHappened) {
return true;
}
}
}
if (nuclearMask & (1 << kHe3)) {
for (int iP2{iP + 1}; iP2 < protons[iC].size(); ++iP2) {
coalHappened |= doCoal(event, iC, pdgList[kHe3], massList[kHe3], trivialCoal, coalescenceRadius, nuclFromDecay, protons[iC][iP], protons[iC][iP2], neutrons[iC][iN]);
if (nuclFromDecay && coalHappened) {
return true;
}
}
}
if (nuclearMask & (1 << kHyperTriton)) {
for (int iL{0}; iL < lambdas[iC].size(); ++iL) {
coalHappened |= doCoal(event, iC, pdgList[kHyperTriton], massList[kHyperTriton], trivialCoal, coalescenceRadius, nuclFromDecay, protons[iC][iP], neutrons[iC][iN], lambdas[iC][iL]);
if (nuclFromDecay && coalHappened) {
return true;
}
}
}
if (nuclearMask & (1 << kHe4)) {
for (int iP2{iP + 1}; iP2 < protons[iC].size(); ++iP2) {
for (int iN2{iN + 1}; iN2 < neutrons[iC].size(); ++iN2) {
coalHappened |= doCoal(event, iC, pdgList[kHe4], massList[kHe4], trivialCoal, coalescenceRadius, nuclFromDecay, protons[iC][iP], protons[iC][iP2], neutrons[iC][iN], neutrons[iC][iN2]);
if (nuclFromDecay && coalHappened) {
return true;
}
}
}
}
Expand Down
Loading