28std::pair<ParticleType, ParticleOrigin>
71 for (
const auto& temp: partProdVtx->
particles_in()) {
if (temp) parent = temp;}
73 const int parentPDG = parent?parent->pdg_id():0;
92 partOrig =
defOrigOfTau(truthParticleContainer, thePart, parentPDG, outCome);
104 return std::make_pair(
Neutrino, partOrig);
110 if (isPartHadr)
return std::make_pair(
Hadron, partOrig);
143 partOrig =
defOrigOfTau(truthParticleContainer, thePart, parentPDG, outCome);
156 return std::make_pair(partType, partOrig);
194 if (ancestor == ancestorParent) {
break; }
196 ancestorParent = ancestor;
201 if (ancestorParent) {
202 pPDG = ancestorParent->
pdgId();
204 ancestor = ancestorParent;
213 ancestor = ancestorParent;
217 const int ancestorPDG = ancestor->
pdgId();
224 auto DP = DecayProducts(partProdVtx);
229 const int NumOfgluon = DP.apd(
MC::GLUON);
230 const int NumOfElNeut = DP.apd(
MC::NU_E);
232 const int NumOfMuPl = DP.pd(-
MC::MUON);
233 const int NumOfMuMin = DP.pd(
MC::MUON);
234 const int NumOfMuNeut = DP.apd(
MC::NU_MU);
235 const int NumOfTau = DP.apd(
MC::TAU);
242 if (!aChild)
continue;
243 const int childPDG = aChild->pdgId();
245 if (possibleNuclearFragment &&
252 if ((
MC::isPhoton(ancestorPDG) && numberOfChildren == 2 && NumOfEl == 1 && NumOfPos == 1) || (
MC::isPhoton(ancestorPDG) && numberOfChildren == 1 && (NumOfEl == 1 || NumOfPos == 1)))
return PhotonConv;
257 if (numOfParents == 1 && std::abs(ancestorPDG) ==
MC::PIPLUS && numberOfChildren > 2 && NumOfNucFr != 0)
return ElMagProc;
266 if (ancestorPDG ==
MC::ELECTRON && numberOfChildren == 2 && NumOfEl == 2 && NumOfPos == 0)
return ElMagProc;
269 if (ancestorPDG ==
MC::POSITRON && numberOfChildren == 2 && NumOfEl == 0 && NumOfPos == 2)
return ElMagProc;
276 if (numberOfChildren == 2 && (NumOfEl == 1 || NumOfPos == 1) && !
MC::isElectron(ancestorPDG) && samePart)
return ElMagProc;
278 if ((ancestorPDG ==
MC::PI0 && numberOfChildren == 3 && NumOfPhot == 1 && NumOfEl == 1 && NumOfPos == 1) ||
279 (ancestorPDG ==
MC::PI0 && numberOfChildren == 4 && NumOfPhot == 0 && NumOfEl == 2 && NumOfPos == 2))
283 if (
MC::isSMQuark(ancestorPDG) && numOfParents == 1 && numberOfChildren == 3 && NumOfquark == 1 && NumOfElNeut == 1)
return QuarkWeakDec;
296 }
while (
MC::isW(ptrPart) && prodVert);
315 bool isZboson =
false;
316 bool isWboson =
false;
317 bool skipnext =
false;
319 for (
unsigned int ipOut = 0; ipOut + 1 < partProdVtx->
nOutgoingParticles(); ++ipOut) {
321 if (!aChild)
continue;
323 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partProdVtx->
nOutgoingParticles(); ipOut1++) {
325 if (theNextChild)
break;
327 if (!theNextChild)
continue;
335 if (thePartToCheck == aChild || thePartToCheck == theNextChild) {
342 if (thePartToCheck == aChild || thePartToCheck == theNextChild) {
349 if (isWboson)
return WBoson;
350 if (isZboson)
return ZBoson;
352 if (numOfParents == 2) {
354 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && NumOfEl == 1 && NumOfPos == 1)
return ZBoson;
357 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && (NumOfEl == 1 || NumOfPos == 1) && NumOfElNeut == 1)
return WBoson;
362 if ((numberOfChildren - NumOfquark - NumOfgluon) == 4 &&
363 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
367 if ((numberOfChildren - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
368 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
372 if ((numberOfChildren - NumOfquark - NumOfgluon) == 8 &&
373 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 8) &&
380 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && NumOfEl == 1 && NumOfPos == 1) {
384 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && (NumOfEl == 1 || NumOfPos == 1) && NumOfElNeut == 1) {
391 if (partProdVtx == ancestorProdVtx) {
392 int NumOfEleLoop = 0;
393 int NumOfLepLoop = 0;
394 int NumOfEleNeuLoop = 0;
397 for (
const auto *
const pin: partProdVtx->
particles_in()) {
401 if (std::abs(pout->pdgId()) ==
MC::NU_E) NumOfEleNeuLoop++;
406 if (NumOfEleLoop == 2 && NumOfEleNeuLoop == 0)
return ZBoson;
407 if (NumOfEleLoop == 1 && NumOfEleNeuLoop == 1)
return WBoson;
408 if ((NumOfEleLoop == 4 && NumOfEleNeuLoop == 0) || (NumOfEleLoop == 3 && NumOfEleNeuLoop == 1) ||
409 (NumOfEleLoop == 2 && NumOfEleNeuLoop == 2))
return DiBoson;
410 if (NumOfLepLoop == 4)
return DiBoson;
474 if (ancestor == ancestorParent) {
break; }
476 ancestorParent = ancestor;
481 if (ancestorParent) {
482 pPDG = ancestorParent->
pdgId();
485 ancestor = ancestorParent;
494 ancestor = ancestorParent;
498 const int ancestorPDG = ancestor->
pdgId();
505 auto DP = DecayProducts(partProdVtx);
509 const int NumOfElNeut = DP.apd(
MC::NU_E);
510 const int NumOfMuNeut = DP.apd(
MC::NU_MU);
513 const int NumOfgluon = DP.apd(
MC::GLUON);
514 const int NumOfMuPl = DP.pd(-
MC::MUON);
515 const int NumOfMuMin = DP.pd(
MC::MUON);
516 const int NumOfTau = DP.apd(
MC::TAU);
520 if (std::abs(ancestorPDG) ==
MC::PIPLUS && numberOfChildren == 2 && NumOfMuNeut == 1)
return PionDecay;
521 if (std::abs(ancestorPDG) ==
MC::KPLUS && numberOfChildren == 2 && NumOfMuNeut == 1)
return KaonDecay;
530 if (
MC::isSMQuark(ancestorPDG) && numOfParents == 1 && numberOfChildren == 3 && NumOfquark == 1 && NumOfMuNeut == 1)
return QuarkWeakDec;
538 }
while (
MC::isW(itrP) && prodVert);
549 if (
MC::isPhoton(ancestorPDG) && numberOfChildren == 2 && NumOfMuMin == 1 && NumOfMuPl == 1)
return PhotonConv;
554 bool isZboson =
false;
555 bool isWboson =
false;
556 bool skipnext =
false;
557 for (
unsigned int ipOut = 0; ipOut + 1 < partProdVtx->
nOutgoingParticles(); ipOut++) {
563 if (!aChild)
continue;
565 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partProdVtx->
nOutgoingParticles(); ipOut1++) {
567 if (theNextChild)
break;
569 if (!theNextChild)
continue;
572 if (thePriPart == aChild || thePriPart == theNextChild) {
579 if (thePriPart == aChild || thePriPart == theNextChild) {
586 if (isWboson)
return WBoson;
587 if (isZboson)
return ZBoson;
589 if (numOfParents == 2 ) {
591 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && NumOfMuPl == 1 && NumOfMuMin == 1)
return ZBoson;
595 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && (NumOfMuPl == 1 || NumOfMuMin == 1) && NumOfMuNeut == 1)
return WBoson;
600 if ((numberOfChildren - NumOfquark - NumOfgluon) == 4 &&
601 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
605 if ((numberOfChildren - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
606 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
610 if ((numberOfChildren - NumOfquark - NumOfgluon) == 8 &&
611 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 8) &&
618 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && NumOfMuPl == 1 && NumOfMuMin == 1) {
622 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && (NumOfMuPl == 1 || NumOfMuMin == 1) && NumOfMuNeut == 1) {
630 if (partProdVtx == ancestorProdVtx) {
632 int NumOfMuNeuLoop = 0;
633 int NumOfLepLoop = 0;
640 if (std::abs(pout->pdg_id()) ==
MC::NU_MU) NumOfMuNeuLoop++;
646 if (NumOfMuLoop == 2 && NumOfMuNeuLoop == 0)
return ZBoson;
647 if (NumOfMuLoop == 1 && NumOfMuNeuLoop == 1)
return WBoson;
648 if ((NumOfMuLoop == 4 && NumOfMuNeuLoop == 0) || (NumOfMuLoop == 3 && NumOfMuNeuLoop == 1) ||
649 (NumOfMuLoop == 2 && NumOfMuNeuLoop == 2))
return DiBoson;
650 if (NumOfLepLoop == 4)
return DiBoson;
705 ancestor = ancestorParent;
709 const int ancestorPDG = ancestor->
pdgId();
716 auto DP = DecayProducts(partProdVtx);
717 const int numberOfChildren = DP.size();
721 const int NumOfElNeut = DP.apd(
MC::NU_E);
722 const int NumOfMuNeut = DP.apd(
MC::NU_MU);
725 const int NumOfgluon = DP.apd(
MC::GLUON);
726 const int NumOfMuPl = DP.pd(-
MC::MUON);
727 const int NumOfMuMin = DP.pd(
MC::MUON);
728 const int NumOfTau = DP.apd(
MC::TAU);
739 }
while (
MC::isW(itrP) && prodVert);
751 bool isZboson =
false;
752 bool isWboson =
false;
753 bool skipnext =
false;
754 for (
unsigned int ipOut = 0; ipOut + 1 < partProdVtx->
nOutgoingParticles(); ipOut++) {
760 if (!aChild)
continue;
762 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partProdVtx->
nOutgoingParticles(); ipOut1++) {
764 if (theNextChild)
break;
771 if (thePriPart == aChild || thePriPart == theNextChild) {
778 if (thePriPart == aChild || thePriPart == theNextChild) {
785 if (isWboson)
return WBoson;
786 if (isZboson)
return ZBoson;
788 if (numOfParents == 2 ) {
795 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && NumOfTau == 1 && NumOfTauNeut == 1)
return WBoson;
798 if ((numberOfChildren - NumOfquark - NumOfgluon) == 4 &&
799 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
803 if ((numberOfChildren - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
804 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
808 if ((numberOfChildren - NumOfquark - NumOfgluon) == 8 &&
809 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 8) &&
816 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && NumOfTau == 2) {
820 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && NumOfTau == 1 && NumOfTauNeut == 1) {
827 if (partProdVtx == ancestorProdVtx) {
828 int NumOfTauLoop = 0;
829 int NumOfTauNeuLoop = 0;
830 int NumOfLepLoop = 0;
831 for (
const auto *
const pout: partProdVtx->
particles_out()) {
833 for (
const auto *
const pin: partProdVtx->
particles_in()) {
837 if (std::abs(pout->pdgId()) ==
MC::NU_TAU) NumOfTauNeuLoop++;
842 if (NumOfTauLoop == 2 && NumOfTauNeuLoop == 0)
return ZBoson;
843 if (NumOfTauLoop == 1 && NumOfTauNeuLoop == 1)
return WBoson;
844 if ((NumOfTauLoop == 4 && NumOfTauNeuLoop == 0) || (NumOfTauLoop == 3 && NumOfTauNeuLoop == 1) || (NumOfTauLoop == 2 && NumOfTauNeuLoop == 2))
return DiBoson;
845 if (NumOfLepLoop == 4)
return DiBoson;
890 int ancestorPDG = ancestor->
pdgId();
900 auto DP = DecayProducts(partProdVtx);
903 const int NumOfMu = DP.apd(
MC::MUON);
904 const int NumOfTau = DP.apd(
MC::TAU);
906 const int NumOfLep = NumOfEl + NumOfPos + NumOfMu + NumOfTau;
917 childPDG = pout->pdg_id();
918 if (possibleNuclearFragment &&
930 if (childPDG == ancestorPDG) {
936 bool foundISR =
false;
937 bool foundFSR =
false;
939 if (numOfParents == 1 && numberOfChildren == 2 &&
MC::isElectron(ancestorPDG) && NumOfPht == 2)
return ElMagProc;
953 PartPDG = std::abs(pin->pdgId());
954 prodVert = pin->prodVtx();
962 }
while (prodVert && std::abs(ancestorPDG) == PartPDG);
972 if ((numOfParents == 1 && (
MC::isPhoton(ancestorPDG) ||
MC::isElectron(ancestorPDG)) && numberOfChildren > 2 && NumOfNucFr != 0) ||
973 (numOfParents == 1 && std::abs(ancestorPDG) ==
MC::PIPLUS && numberOfChildren > 10 && NumOfNucFr != 0) ||
989 if (ancestorPDG != pout->pdgId())
continue;
1004 if (numOfParents == 2 && ((
MC::isElectron(ancestorPDG) && NumOfEl == 1 && NumOfPos == 1) || (
MC::isMuon(ancestorPDG) && NumOfMu == 2) || (
MC::isTau(ancestorPDG) && NumOfTau == 2))) {
1008 if (numOfParents == 2 && NumOfLep == 1 && NumOfNeut == 1 && (
MC::isElectron(ancestorPDG) || std::abs(ancestorPDG) ==
MC::NU_E))
return FSRPhot;
1011 if (
MC::isElectron(ancestorPDG) && numOfParents == 1 && numberOfChildren == 2 && (NumOfEl == 1 || NumOfPos == 1) && NumOfPht == 1 &&
1016 if (
MC::isZ(ancestorPDG) && ((NumOfEl + NumOfPos == 2 || NumOfEl + NumOfPos == 4) || (NumOfMu == 2 || NumOfMu == 4) || (NumOfTau == 2 || NumOfTau == 4)) && NumOfPht > 0)
return FSRPhot;
1020 if (numOfParents == 2 && NumOfLQ == 1)
return FSRPhot;
1027 if (NumOfLep == 1 && NumOfNeut == 1 && numberOfChildren == NumOfLep + NumOfNeut + NumOfPht)
return FSRPhot;
1035 }
while (
MC::isW(itrP) && prodVert);
1050 bool isZboson =
false;
1051 bool isWboson =
false;
1052 bool skipnext =
false;
1053 for (
unsigned int ipOut = 0; ipOut + 1 < partProdVtx->
nOutgoingParticles(); ipOut++) {
1059 if (!aChild)
continue;
1061 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partProdVtx->
nOutgoingParticles(); ipOut1++) {
1063 if (theNextChild)
break;
1065 if (!theNextChild)
continue;
1068 if (thePriPart == aChild || thePriPart == theNextChild) {
1075 if (thePriPart == aChild || thePriPart == theNextChild) {
1082 if (isWboson)
return WBoson;
1083 if (isZboson)
return ZBoson;
1087 if (numOfParents == 4 && (numberOfChildren - NumOfPht) == 4 && (NumOfLep + NumOfNeut == 4)) {
1094 if (partProdVtx == ancestorProdVtx) {
1095 for (
const auto *
const pout: partProdVtx->
particles_out()) {
1096 if (!pout)
continue;
1097 for (
const auto *
const pin: partProdVtx->
particles_in()) {
1130 const int nuFlav = std::abs(thePart->
pdgId());
1160 ancestorParent = ancestor;
1164 if (ancestorParent) {
1165 pPDG = ancestorParent->
pdgId();
1168 if (ancestor == ancestorParent) {
break; }
1172 ancestor = ancestorParent;
1181 ancestor = ancestorParent;
1187 const int ancestorPDG = ancestor->
pdgId();
1188 partProdVtx = ancestor->
decayVtx();
1194 auto DP = DecayProducts(partProdVtx);
1197 const int NumOfgluon = DP.apd(
MC::GLUON);
1199 const int NumOfElNeut = DP.apd(
MC::NU_E);
1200 const int NumOfMuNeut = DP.apd(
MC::NU_MU);
1203 const int NumOfMu = DP.apd(
MC::MUON);
1204 const int NumOfTau = DP.apd(
MC::TAU);
1208 if (!aChild)
continue;
1217 if (
MC::isQuark(ancestorPDG) && numOfParents == 1 && numberOfChildren == 3 && NumOfquark == 1 && (NumOfEl == 1 || NumOfMu == 1 || NumOfTau == 1))
return QuarkWeakDec;
1226 }
while (
MC::isW(ptrPart) && prodVert);
1247 bool isZboson =
false;
1248 bool isWboson =
false;
1249 bool skipnext =
false;
1251 for (
unsigned int ipOut = 0; ipOut + 1 < partProdVtx->
nOutgoingParticles(); ++ipOut) {
1253 if (!aChild)
continue;
1255 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partProdVtx->
nOutgoingParticles(); ipOut1++) {
1257 if (theNextChild)
break;
1259 if (!theNextChild)
continue;
1266 const int apdgID1 = std::abs(aChild->
pdgId());
1267 const int apdgID2 = std::abs(theNextChild->
pdgId());
1270 if (thePartToCheck == aChild || thePartToCheck == theNextChild) {
1283 if (thePartToCheck == aChild || thePartToCheck == theNextChild) {
1290 if (isWboson)
return WBoson;
1291 if (isZboson)
return ZBoson;
1294 if (numOfParents == 2) {
1296 if ( (numberOfChildren - NumOfquark - NumOfgluon) == 2 && (NumOfElNeut == 2 || NumOfMuNeut == 2 || NumOfTauNeut == 2))
return ZBoson;
1299 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && ((NumOfEl == 1 && NumOfElNeut == 1) || (NumOfMu == 1 && NumOfMuNeut == 1) || (NumOfTau == 1 && NumOfTauNeut == 1)))
return WBoson;
1304 if ( (numberOfChildren - NumOfquark - NumOfgluon) == 4 && (NumOfEl + NumOfMu + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
1308 if ((numberOfChildren - NumOfquark - NumOfgluon - NumOfPhot) == 6 && (NumOfEl + NumOfMu + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
1312 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && (NumOfElNeut == 2 || NumOfMuNeut == 2 || NumOfTauNeut == 2)) {
1319 if (partProdVtx == ancestorProdVtx) {
1320 int NumOfLepLoop = 0;
1321 int NumOfNeuLoop = 0;
1322 for (
const auto *
const pout: partProdVtx->
particles_out()) {
1323 if (!pout)
continue;
1324 for (
const auto *
const pin: partProdVtx->
particles_in()) {
1327 const int apdgid = std::abs(pout->pdgId());
1330 else { NumOfLepLoop++; }
1335 if (NumOfNeuLoop == 2 && NumOfLepLoop == 0)
return ZBoson;
1336 if (NumOfNeuLoop == 1 && NumOfLepLoop == 1)
return WBoson;
1337 if (NumOfNeuLoop + NumOfLepLoop == 4)
return DiBoson;
ATLAS-specific HepMC functions.
int status() const
Status code.
int pdgId() const
PDG ID code.
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
int pdg_id() const
PDG ID code.
bool hasProdVtx() const
Check for a production vertex on this particle.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
std::vector< const TruthParticle * > particles_out() const
Get the outgoing particles.
size_t nOutgoingParticles() const
Get the number of outgoing particles.
size_t nIncomingParticles() const
Get the number of incoming particles.
std::vector< const TruthParticle * > particles_in() const
Get the incoming particles.
bool is_same_generator_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same generated particle.
bool is_same_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same particle.
bool is_simulation_particle(const T &p)
Method to establish if a particle was created during the simulation (based on the status value).
ParticleOutCome defOutComeOfElectron(T thePart)
Determine the outcome of a simulated electron from its end vertex (NonInteract, ElectrMagInter,...
ParticleOutCome defOutComeOfPhoton(T thePart)
Determine the outcome of a simulated photon from its end vertex (UnConverted, Converted,...
static ParticleOrigin defOrigOfNeutrino(const xAOD::TruthParticleContainer &xTruthParticleContainer, const xAOD::TruthParticle *thePart, bool &isPrompt, ParticleOutCome &outCome)
ParticleOutCome
Outcome of a (simulated) truth particle: what happened to it after being produced,...
@ NonInteract
Particle without an end vertex (survived the detector) – also used for neutrinos.
ParticleType defTypeOfPhoton(ParticleOrigin PhotOrig)
Classify a photon (Unknown/Iso/NonIso/Bkg) from its origin.
ParticleOrigin convHadronTypeToOrig(ParticleType pType, int motherPDG)
Convert a hadron ParticleType to a ParticleOrigin (JPsi if a c-cbar meson has a J/psi mother).
ParticleOutCome defOutComeOfTau(T thePart)
Determine the outcome of a simulated tau from its decay products (NonInteract, NuclInteraction,...
ParticleType defTypeOfTau(ParticleOrigin TauOrig)
Classify a tau (Unknown/Iso/NonIso/Bkg) from its origin.
static ParticleOrigin defOrigOfTau(const xAOD::TruthParticleContainer &xTruthParticleContainer, const xAOD::TruthParticle *thePart, int ancestorPDGin, ParticleOutCome &outCome)
ParticleType defTypeOfMuon(ParticleOrigin MuOrig, bool isPrompt)
Classify a muon (Unknown/Iso/NonIso/Bkg) from its origin; prompt muons are always Iso.
ParticleOrigin
Origin of a truth particle, as assigned by MCTruthClassifier::particleTruthClassifier (the second mem...
@ ElMagProc
Electromagnetic or nuclear material process: bremsstrahlung/pair production in the detector,...
@ UndrPhot
"Underlying" photon: radiated from a quark or gluon in the parton shower/underlying event
@ WBosonLRSM
Decay of the W_R boson of the left-right symmetric model (Pythia-specific PDG 9900024).
@ ZBoson
Z boson (or Z/gamma*) decay (including Sherpa Z records and Z+gamma).
@ ISRPhot
Initial-state radiation photon (quark/gluon mother whose copy is a Herwig cluster).
@ PromptPhot
Prompt (direct) photon of the hard process, e.g. Pythia8 gamma+jet.
@ BremPhot
Bremsstrahlung photon: the mother continues as a copy of itself plus this photon.
@ DiBoson
Two-boson (WW, WZ, ZZ) production recorded without explicit bosons: four leptons/neutrinos in the har...
@ Higgs
Higgs boson decay (SM Higgs, PDG 25).
@ HiggsMSSM
Decay of an extra (MSSM/2HDM) Higgs boson: H (35), A (36) or H+ (37).
@ LQ
Leptoquark: the ancestor is a leptoquark, or the decay vertex contains one.
@ PhotonConv
Photon conversion (gamma -> e+ e-, or gamma -> mu+ mu- for muons).
@ NuREle
Decay of a right-handed electron neutrino (Pythia-specific PDG 9900012), or of a W_R decaying to it.
@ TauLep
Decay (or radiation) of a tau lepton that is not itself prompt.
@ NuRMu
Decay of a right-handed muon neutrino (Pythia-specific PDG 9900014).
@ KaonDecay
Muon from K -> mu nu in flight.
@ FSRPhot
Final-state radiation photon, e.g. from the leptons of W/Z/H decays or from Photos.
@ WBoson
W boson decay (including Sherpa W records and W+gamma).
@ Mu
Decay (or radiation) of a muon.
@ OtherBSM
Decay of a non-SUSY BSM particle (added later, hence the out-of-order value).
@ NuRTau
Decay of a right-handed tau neutrino (Pythia-specific PDG 9900016).
@ NonDefined
Origin could not be determined (no production vertex, no ancestor, or particle not classified).
@ PiZero
Photon from a pi0 decay.
@ NucReact
Photon from a nuclear reaction in the material.
@ SingleElec
Single-electron particle gun: production vertex with no mother and one outgoing particle.
@ top
Decay of a top quark (including through W).
@ DalitzDec
Dalitz decay of a pi0 (pi0 -> gamma e+ e-, or pi0 -> e+ e- e+ e-).
@ QuarkWeakDec
Weak decay of a quark: q -> q' l nu with a single other quark in the final state.
@ SingleTau
Single-tau particle gun.
@ HeavyBoson
Decay of a heavy gauge boson Z', Z'', W'+ (PDG 32, 33, 34), or a KK graviton (5100039) in the photon ...
@ SingleMuon
Single-muon particle gun.
@ SinglePhot
Single-photon particle gun.
@ PionDecay
Muon from pi -> mu nu in flight.
@ MultiBoson
Three or more bosons (VVV, 4-top with leptonic W decays): six or eight leptons/neutrinos in the hard-...
ParticleType defTypeOfHadron(int pdg)
Classify a hadron by PDG ID into a ParticleType (Unknown if none applies).
static ParticleOrigin defOrigOfMuon(const xAOD::TruthParticleContainer &xTruthParticleContainer, const xAOD::TruthParticle *thePart, bool &isPrompt, ParticleOutCome &outCome)
std::pair< ParticleType, ParticleOrigin > classifyTruthParticle(const xAOD::TruthParticleContainer &truthParticleContainer, const xAOD::TruthParticle *const thePart, ParticleOutCome &outCome)
Classify thePart (not nullptr), using truthParticleContainer to look up its ancestors.
static ParticleOrigin defOrigOfPhoton(const xAOD::TruthParticleContainer &xTruthParticleContainer, const xAOD::TruthParticle *thePart, bool &isPrompt, ParticleOutCome &outCome)
int isPrompt(const unsigned int classify, bool allow_prompt_tau_decays=true)
Tell whether a particle is prompt, from the word returned by defOrigOfParticle().
ParticleOutCome defOutComeOfMuon(T thePart)
Determine the outcome of a simulated muon from its end vertex (NonInteract, DecaytoElectron,...
ParticleType defTypeOfElectron(ParticleOrigin EleOrig, bool isPrompt)
Classify an electron (Unknown/Iso/NonIso/Bkg) from its origin; prompt electrons are always Iso.
ParticleType
Type of a truth particle, as assigned by MCTruthClassifier::particleTruthClassifier (the first member...
@ BBbarMesonPart
Hidden-bottom meson (e.g. Upsilon, chi_b).
@ Unknown
Not classified: not a lepton, photon, neutrino or hadron (e.g. a quark, a gluon, a boson),...
@ Neutrino
Neutrino (an origin is determined for it, see ParticleOrigin).
@ NonPrimary
Not a primary particle: a copy produced by the simulation (e.g. Geant4) with no production vertex,...
@ IsoPhoton
Isolated (prompt) photon: from W/Z/H/BSM decay, a hard-process prompt photon, or a single-photon gun.
@ IsoTau
Isolated (prompt) tau.
@ UnknownMuon
Muon with undefined origin.
@ NuclFrag
Nuclear fragment: a nucleus other than a proton, produced in a material interaction.
@ CCbarMesonPart
Hidden-charm meson (e.g. J/psi, chi_c).
@ OtherBSMParticle
Stable non-SUSY BSM particle (added later, hence the out-of-order value).
@ IsoElectron
Isolated (prompt) electron, e.g. from W/Z/H/top/BSM decay, or a single-electron particle gun.
@ IsoMuon
Isolated (prompt) muon.
@ GenParticle
Generator-level intermediate particle (decayed, or otherwise not a final-state candidate) that is not...
@ UnknownPhoton
Photon with undefined origin.
@ SUSYParticle
Stable SUSY particle (e.g. the LSP).
@ UnknownElectron
Electron with undefined origin (no production vertex, or origin could not be traced).
@ Hadron
Any hadron (neither the beam nor a nuclear fragment); the origin is not studied further.
@ UnknownTau
Tau with undefined origin.
static ParticleOrigin defOrigOfElectron(const xAOD::TruthParticleContainer &xTruthParticleContainer, const xAOD::TruthParticle *thePart, bool &isPrompt, ParticleOutCome &outCome)
bool isConditionA(const T &p)
Match selected Pythia status codes for hardest-subprocess and later-stage particles: 21: incoming par...
T findMatching(C TruthContainer, T p)
Function to find in the container the particle that p descends from in the simulation (see HepMC::is_...
bool isNeutrinoRH(const T &p)
PDG rule 12: Occasionally program authors add their own states.
static const int DQUARK
PDG Rule 1: Particles are given positive numbers, antiparticles negative numbers.
bool TruthLoopDetectionMethod1(const V &childOrigVtx, const T &parent)
Method 1: true if the parent is among the children produced at the child's production vertex,...
bool isHardScatteringVertex(T pVert)
Function to classify the vertex as hard scattering vertex.
bool isSMLepton(const T &p)
APID: the fourth generation leptons are not standard model leptons.
bool isPhoton(const T &p)
static const int RH_NU_TAU
bool isSMNeutrino(const T &p)
static const int WBOSON_LRSM
bool isNeutrino(const T &p)
APID: the fourth generation neutrinos are neutrinos.
bool isElectron(const T &p)
static const int ELECTRON
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
bool isSMQuark(const T &p)
bool TruthLoopDetectionMethod2(const T1 &child, const T2 &parent)
Method 2: true if the parent's production vertex is the child's decay vertex and the child's producti...
static const int POSITRON
bool isMSSMHiggs(const T &p)
APID: Additional Higgs bosons for MSSM (Used in MCTruthClassifier).
bool isDecayed(const T &p)
Identify if the particle decayed.
bool isQuark(const T &p)
PDG rule 2: Quarks and leptons are numbered consecutively starting from 1 and 11 respectively; to do ...
T findMother(T thePart)
Function to get a mother of particle. MCTruthClassifier legacy.
bool isHiggs(const T &p)
APID: HIGGS boson is only one particle.
static const int LEPTOQUARK
bool isBeam(const T &p)
Identify if the particle is beam particle.
bool isHadron(const T &p)
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
static const int RH_NU_MU
bool isHeavyBoson(const T &p)
APID: Additional "Heavy"/"prime" versions of W and Z bosons (Used in MCTruthClassifier).
bool isLeptoQuark(const T &p)
PDG rule 11c: “One-of-a-kind” exotic particles are assigned numbers in the range 41–80.
static const int RH_NU_E
PDG Rule 12: Occasionally program authors add their own states.
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.
TruthVertex_v1 TruthVertex
Typedef to implementation.
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.