24std::pair<ParticleType, ParticleOrigin>
27 const EventContext& ctx = info ? info->eventContext : Gaudi::Hive::currentContext();
29 if (!truthParticleLinkVecReadHandle.
isValid()) {
30 ATH_MSG_WARNING(
" Invalid ReadHandle for xAODTruthParticleLinkVector with key: " << truthParticleLinkVecReadHandle.
key());
41std::pair<ParticleType, ParticleOrigin>
51 return std::make_pair(partType, partOrig);
53 info.genPart = thePart;
57 if (!truthParticleContainerReadHandle.
isValid()) {
58 ATH_MSG_WARNING(
" Invalid ReadHandle for xAOD::TruthParticleContainer with key: " << truthParticleContainerReadHandle.
key());
59 return std::make_pair(partType, partOrig);
62 ATH_MSG_DEBUG(
"xAODTruthParticleContainer with key " << truthParticleContainerReadHandle.
key() <<
" has valid ReadHandle ");
102 const int parentPDG = parent?parent->pdg_id():0;
103 info.setMotherProperties(parent);
120 if (!partProdVtx &&
MC::isTau(thePart)) {
122 partOrig =
defOrigOfTau(*truthParticleContainerReadHandle, thePart, parentPDG, info);
134 return std::make_pair(
Neutrino, partOrig);
140 if (isPartHadr)
return std::make_pair(
Hadron, partOrig);
173 partOrig =
defOrigOfTau(*truthParticleContainerReadHandle, thePart, parentPDG, info);
186 return std::make_pair(partType, partOrig);
193 const int parentPDG = parent->pdgId();
195 if (!aChild)
continue;
224 parent_prdVtx = parent->hasProdVtx() ? parent->prodVtx() :
nullptr;
225 parent_endVtx = parent->decayVtx();
229 return (child_endVtx == parent_prdVtx && child_prdVtx == parent_endVtx);
237 const xAOD::TruthVertex* parentOrigVtx = parent->hasProdVtx() ? parent->prodVtx() :
nullptr;
268 info.setMotherProperties(ancestor);
284 if (ancestor == ancestorParent) {
break; }
286 ancestorParent = ancestor;
291 if (ancestorParent) {
292 pPDG = ancestorParent->
pdgId();
294 ancestor = ancestorParent;
303 ancestor = ancestorParent;
307 info.setMotherProperties(ancestor);
308 const int ancestorPDG = ancestor->
pdgId();
315 auto DP = DecayProducts(partProdVtx);
320 const int NumOfgluon = DP.apd(
MC::GLUON);
321 const int NumOfElNeut = DP.apd(
MC::NU_E);
323 const int NumOfMuPl = DP.pd(-
MC::MUON);
324 const int NumOfMuMin = DP.pd(
MC::MUON);
325 const int NumOfMuNeut = DP.apd(
MC::NU_MU);
326 const int NumOfTau = DP.apd(
MC::TAU);
333 if (!aChild)
continue;
334 const int childPDG = aChild->pdgId();
336 if (possibleNuclearFragment &&
345 for (
const auto& photonParent: ancestorProdVtx->
particles_in()) {
346 if (!photonParent)
continue;
347 info.photonMother = photonParent;
351 if ((
MC::isPhoton(ancestorPDG) && numberOfChildren == 2 && NumOfEl == 1 && NumOfPos == 1) || (
MC::isPhoton(ancestorPDG) && numberOfChildren == 1 && (NumOfEl == 1 || NumOfPos == 1)))
return PhotonConv;
356 if (numOfParents == 1 && std::abs(ancestorPDG) ==
MC::PIPLUS && numberOfChildren > 2 && NumOfNucFr != 0)
return ElMagProc;
365 if (ancestorPDG ==
MC::ELECTRON && numberOfChildren == 2 && NumOfEl == 2 && NumOfPos == 0)
return ElMagProc;
368 if (ancestorPDG ==
MC::POSITRON && numberOfChildren == 2 && NumOfEl == 0 && NumOfPos == 2)
return ElMagProc;
375 if (numberOfChildren == 2 && (NumOfEl == 1 || NumOfPos == 1) && !
MC::isElectron(ancestorPDG) && samePart)
return ElMagProc;
377 if ((ancestorPDG ==
MC::PI0 && numberOfChildren == 3 && NumOfPhot == 1 && NumOfEl == 1 && NumOfPos == 1) ||
378 (ancestorPDG ==
MC::PI0 && numberOfChildren == 4 && NumOfPhot == 0 && NumOfEl == 2 && NumOfPos == 2))
382 if (
MC::isSMQuark(ancestorPDG) && numOfParents == 1 && numberOfChildren == 3 && NumOfquark == 1 && NumOfElNeut == 1)
return QuarkWeakDec;
395 }
while (
MC::isW(ptrPart) && prodVert);
414 bool isZboson =
false;
415 bool isWboson =
false;
416 bool skipnext =
false;
418 for (
unsigned int ipOut = 0; ipOut + 1 < partProdVtx->
nOutgoingParticles(); ++ipOut) {
420 if (!aChild)
continue;
422 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partProdVtx->
nOutgoingParticles(); ipOut1++) {
424 if (theNextChild)
break;
426 if (!theNextChild)
continue;
434 if (thePartToCheck == aChild || thePartToCheck == theNextChild) {
441 if (thePartToCheck == aChild || thePartToCheck == theNextChild) {
448 if (isWboson)
return WBoson;
449 if (isZboson)
return ZBoson;
451 if (numOfParents == 2) {
453 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && NumOfEl == 1 && NumOfPos == 1)
return ZBoson;
456 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && (NumOfEl == 1 || NumOfPos == 1) && NumOfElNeut == 1)
return WBoson;
461 if ((numberOfChildren - NumOfquark - NumOfgluon) == 4 &&
462 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
466 if ((numberOfChildren - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
467 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
471 if ((numberOfChildren - NumOfquark - NumOfgluon) == 8 &&
472 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 8) &&
479 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && NumOfEl == 1 && NumOfPos == 1) {
483 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && (NumOfEl == 1 || NumOfPos == 1) && NumOfElNeut == 1) {
490 if (partProdVtx == ancestorProdVtx) {
491 int NumOfEleLoop = 0;
492 int NumOfLepLoop = 0;
493 int NumOfEleNeuLoop = 0;
496 for (
const auto *
const pin: partProdVtx->
particles_in()) {
500 if (std::abs(pout->pdgId()) ==
MC::NU_E) NumOfEleNeuLoop++;
505 if (NumOfEleLoop == 2 && NumOfEleNeuLoop == 0)
return ZBoson;
506 if (NumOfEleLoop == 1 && NumOfEleNeuLoop == 1)
return WBoson;
507 if ((NumOfEleLoop == 4 && NumOfEleNeuLoop == 0) || (NumOfEleLoop == 3 && NumOfEleNeuLoop == 1) ||
508 (NumOfEleLoop == 2 && NumOfEleNeuLoop == 2))
return DiBoson;
509 if (NumOfLepLoop == 4)
return DiBoson;
562 info.setMotherProperties(ancestor);
575 if (ancestor == ancestorParent) {
break; }
577 ancestorParent = ancestor;
582 if (ancestorParent) {
583 pPDG = ancestorParent->
pdgId();
586 ancestor = ancestorParent;
595 ancestor = ancestorParent;
599 info.setMotherProperties(ancestor);
600 const int ancestorPDG = ancestor->
pdgId();
607 auto DP = DecayProducts(partProdVtx);
611 const int NumOfElNeut = DP.apd(
MC::NU_E);
612 const int NumOfMuNeut = DP.apd(
MC::NU_MU);
615 const int NumOfgluon = DP.apd(
MC::GLUON);
616 const int NumOfMuPl = DP.pd(-
MC::MUON);
617 const int NumOfMuMin = DP.pd(
MC::MUON);
618 const int NumOfTau = DP.apd(
MC::TAU);
622 if (std::abs(ancestorPDG) ==
MC::PIPLUS && numberOfChildren == 2 && NumOfMuNeut == 1)
return PionDecay;
623 if (std::abs(ancestorPDG) ==
MC::KPLUS && numberOfChildren == 2 && NumOfMuNeut == 1)
return KaonDecay;
632 if (
MC::isSMQuark(ancestorPDG) && numOfParents == 1 && numberOfChildren == 3 && NumOfquark == 1 && NumOfMuNeut == 1)
return QuarkWeakDec;
640 }
while (
MC::isW(itrP) && prodVert);
651 if (
MC::isPhoton(ancestorPDG) && numberOfChildren == 2 && NumOfMuMin == 1 && NumOfMuPl == 1)
return PhotonConv;
656 bool isZboson =
false;
657 bool isWboson =
false;
658 bool skipnext =
false;
659 for (
unsigned int ipOut = 0; ipOut + 1 < partProdVtx->
nOutgoingParticles(); ipOut++) {
665 if (!aChild)
continue;
667 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partProdVtx->
nOutgoingParticles(); ipOut1++) {
669 if (theNextChild)
break;
671 if (!theNextChild)
continue;
674 if (thePriPart == aChild || thePriPart == theNextChild) {
681 if (thePriPart == aChild || thePriPart == theNextChild) {
688 if (isWboson)
return WBoson;
689 if (isZboson)
return ZBoson;
691 if (numOfParents == 2 ) {
693 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && NumOfMuPl == 1 && NumOfMuMin == 1)
return ZBoson;
697 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && (NumOfMuPl == 1 || NumOfMuMin == 1) && NumOfMuNeut == 1)
return WBoson;
702 if ((numberOfChildren - NumOfquark - NumOfgluon) == 4 &&
703 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
707 if ((numberOfChildren - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
708 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
712 if ((numberOfChildren - NumOfquark - NumOfgluon) == 8 &&
713 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 8) &&
720 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && NumOfMuPl == 1 && NumOfMuMin == 1) {
724 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && (NumOfMuPl == 1 || NumOfMuMin == 1) && NumOfMuNeut == 1) {
732 if (partProdVtx == ancestorProdVtx) {
734 int NumOfMuNeuLoop = 0;
735 int NumOfLepLoop = 0;
742 if (std::abs(pout->pdg_id()) ==
MC::NU_MU) NumOfMuNeuLoop++;
748 if (NumOfMuLoop == 2 && NumOfMuNeuLoop == 0)
return ZBoson;
749 if (NumOfMuLoop == 1 && NumOfMuNeuLoop == 1)
return WBoson;
750 if ((NumOfMuLoop == 4 && NumOfMuNeuLoop == 0) || (NumOfMuLoop == 3 && NumOfMuNeuLoop == 1) ||
751 (NumOfMuLoop == 2 && NumOfMuNeuLoop == 2))
return DiBoson;
752 if (NumOfLepLoop == 4)
return DiBoson;
799 info.setMotherProperties(ancestor);
809 ancestor = ancestorParent;
813 const int ancestorPDG = ancestor->
pdgId();
814 info.setMotherProperties(ancestor);
821 auto DP = DecayProducts(partProdVtx);
822 const int numberOfChildren = DP.size();
826 const int NumOfElNeut = DP.apd(
MC::NU_E);
827 const int NumOfMuNeut = DP.apd(
MC::NU_MU);
830 const int NumOfgluon = DP.apd(
MC::GLUON);
831 const int NumOfMuPl = DP.pd(-
MC::MUON);
832 const int NumOfMuMin = DP.pd(
MC::MUON);
833 const int NumOfTau = DP.apd(
MC::TAU);
844 }
while (
MC::isW(itrP) && prodVert);
856 bool isZboson =
false;
857 bool isWboson =
false;
858 bool skipnext =
false;
859 for (
unsigned int ipOut = 0; ipOut + 1 < partProdVtx->
nOutgoingParticles(); ipOut++) {
865 if (!aChild)
continue;
867 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partProdVtx->
nOutgoingParticles(); ipOut1++) {
869 if (theNextChild)
break;
876 if (thePriPart == aChild || thePriPart == theNextChild) {
883 if (thePriPart == aChild || thePriPart == theNextChild) {
890 if (isWboson)
return WBoson;
891 if (isZboson)
return ZBoson;
893 if (numOfParents == 2 ) {
900 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && NumOfTau == 1 && NumOfTauNeut == 1)
return WBoson;
903 if ((numberOfChildren - NumOfquark - NumOfgluon) == 4 &&
904 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
908 if ((numberOfChildren - NumOfquark - NumOfgluon - NumOfPhot) == 6 &&
909 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
913 if ((numberOfChildren - NumOfquark - NumOfgluon) == 8 &&
914 (NumOfEl + NumOfPos + NumOfMuPl + NumOfMuMin + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 8) &&
921 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && NumOfTau == 2) {
925 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && NumOfTau == 1 && NumOfTauNeut == 1) {
932 if (partProdVtx == ancestorProdVtx) {
933 int NumOfTauLoop = 0;
934 int NumOfTauNeuLoop = 0;
935 int NumOfLepLoop = 0;
936 for (
const auto *
const pout: partProdVtx->
particles_out()) {
938 for (
const auto *
const pin: partProdVtx->
particles_in()) {
942 if (std::abs(pout->pdgId()) ==
MC::NU_TAU) NumOfTauNeuLoop++;
947 if (NumOfTauLoop == 2 && NumOfTauNeuLoop == 0)
return ZBoson;
948 if (NumOfTauLoop == 1 && NumOfTauNeuLoop == 1)
return WBoson;
949 if ((NumOfTauLoop == 4 && NumOfTauNeuLoop == 0) || (NumOfTauLoop == 3 && NumOfTauNeuLoop == 1) || (NumOfTauLoop == 2 && NumOfTauNeuLoop == 2))
return DiBoson;
950 if (NumOfLepLoop == 4)
return DiBoson;
977 info.resetMotherProperties();
978 info.photonMother =
nullptr;
996 info.setMotherProperties(ancestor);
999 int ancestorPDG = ancestor->
pdgId();
1003 partProdVtx = ancestor->
decayVtx();
1009 auto DP = DecayProducts(partProdVtx);
1012 const int NumOfMu = DP.apd(
MC::MUON);
1013 const int NumOfTau = DP.apd(
MC::TAU);
1015 const int NumOfLep = NumOfEl + NumOfPos + NumOfMu + NumOfTau;
1020 int NumOfPartons(0);
1025 if (!pout)
continue;
1026 childPDG = pout->pdg_id();
1027 if (possibleNuclearFragment &&
1039 if (childPDG == ancestorPDG) {
1045 bool foundISR =
false;
1046 bool foundFSR =
false;
1048 if (numOfParents == 1 && numberOfChildren == 2 &&
MC::isElectron(ancestorPDG) && NumOfPht == 2)
return ElMagProc;
1062 PartPDG = std::abs(pin->pdgId());
1063 prodVert = pin->prodVtx();
1071 }
while (prodVert && std::abs(ancestorPDG) == PartPDG);
1081 if ((numOfParents == 1 && (
MC::isPhoton(ancestorPDG) ||
MC::isElectron(ancestorPDG)) && numberOfChildren > 2 && NumOfNucFr != 0) ||
1082 (numOfParents == 1 && std::abs(ancestorPDG) ==
MC::PIPLUS && numberOfChildren > 10 && NumOfNucFr != 0) ||
1087 if (
MC::isMuon(ancestorPDG) && NumOfMu == 0)
return Mu;
1097 if (!pout)
continue;
1098 if (ancestorPDG != pout->pdgId())
continue;
1100 if (!Vrtx)
continue;
1113 if (numOfParents == 2 && ((
MC::isElectron(ancestorPDG) && NumOfEl == 1 && NumOfPos == 1) || (
MC::isMuon(ancestorPDG) && NumOfMu == 2) || (
MC::isTau(ancestorPDG) && NumOfTau == 2))) {
1117 if (numOfParents == 2 && NumOfLep == 1 && NumOfNeut == 1 && (
MC::isElectron(ancestorPDG) || std::abs(ancestorPDG) ==
MC::NU_E))
return FSRPhot;
1120 if (
MC::isElectron(ancestorPDG) && numOfParents == 1 && numberOfChildren == 2 && (NumOfEl == 1 || NumOfPos == 1) && NumOfPht == 1 &&
1125 if (
MC::isZ(ancestorPDG) && ((NumOfEl + NumOfPos == 2 || NumOfEl + NumOfPos == 4) || (NumOfMu == 2 || NumOfMu == 4) || (NumOfTau == 2 || NumOfTau == 4)) && NumOfPht > 0)
return FSRPhot;
1129 if (numOfParents == 2 && NumOfLQ == 1)
return FSRPhot;
1136 if (NumOfLep == 1 && NumOfNeut == 1 && numberOfChildren == NumOfLep + NumOfNeut + NumOfPht)
return FSRPhot;
1144 }
while (
MC::isW(itrP) && prodVert);
1159 bool isZboson =
false;
1160 bool isWboson =
false;
1161 bool skipnext =
false;
1162 for (
unsigned int ipOut = 0; ipOut + 1 < partProdVtx->
nOutgoingParticles(); ipOut++) {
1168 if (!aChild)
continue;
1170 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partProdVtx->
nOutgoingParticles(); ipOut1++) {
1172 if (theNextChild)
break;
1174 if (!theNextChild)
continue;
1177 if (thePriPart == aChild || thePriPart == theNextChild) {
1184 if (thePriPart == aChild || thePriPart == theNextChild) {
1191 if (isWboson)
return WBoson;
1192 if (isZboson)
return ZBoson;
1196 if (numOfParents == 4 && (numberOfChildren - NumOfPht) == 4 && (NumOfLep + NumOfNeut == 4)) {
1203 if (partProdVtx == ancestorProdVtx) {
1204 for (
const auto *
const pout: partProdVtx->
particles_out()) {
1205 if (!pout)
continue;
1206 for (
const auto *
const pin: partProdVtx->
particles_in()) {
1239 const int nuFlav = std::abs(thePart->
pdgId());
1254 info.setMotherProperties(ancestor);
1271 ancestorParent = ancestor;
1275 if (ancestorParent) {
1276 pPDG = ancestorParent->
pdgId();
1279 if (ancestor == ancestorParent) {
break; }
1283 ancestor = ancestorParent;
1284 info.setMotherProperties(ancestor);
1293 ancestor = ancestorParent;
1294 info.setMotherProperties(ancestor);
1300 info.setMotherProperties(ancestor);
1301 const int ancestorPDG = ancestor->
pdgId();
1302 partProdVtx = ancestor->
decayVtx();
1308 auto DP = DecayProducts(partProdVtx);
1311 const int NumOfgluon = DP.apd(
MC::GLUON);
1313 const int NumOfElNeut = DP.apd(
MC::NU_E);
1314 const int NumOfMuNeut = DP.apd(
MC::NU_MU);
1317 const int NumOfMu = DP.apd(
MC::MUON);
1318 const int NumOfTau = DP.apd(
MC::TAU);
1322 if (!aChild)
continue;
1331 if (
MC::isQuark(ancestorPDG) && numOfParents == 1 && numberOfChildren == 3 && NumOfquark == 1 && (NumOfEl == 1 || NumOfMu == 1 || NumOfTau == 1))
return QuarkWeakDec;
1340 }
while (
MC::isW(ptrPart) && prodVert);
1361 bool isZboson =
false;
1362 bool isWboson =
false;
1363 bool skipnext =
false;
1365 for (
unsigned int ipOut = 0; ipOut + 1 < partProdVtx->
nOutgoingParticles(); ++ipOut) {
1367 if (!aChild)
continue;
1369 for (
unsigned int ipOut1 = ipOut + 1; ipOut1 < partProdVtx->
nOutgoingParticles(); ipOut1++) {
1371 if (theNextChild)
break;
1373 if (!theNextChild)
continue;
1380 const int apdgID1 = std::abs(aChild->
pdgId());
1381 const int apdgID2 = std::abs(theNextChild->
pdgId());
1384 if (thePartToCheck == aChild || thePartToCheck == theNextChild) {
1397 if (thePartToCheck == aChild || thePartToCheck == theNextChild) {
1404 if (isWboson)
return WBoson;
1405 if (isZboson)
return ZBoson;
1408 if (numOfParents == 2) {
1410 if ( (numberOfChildren - NumOfquark - NumOfgluon) == 2 && (NumOfElNeut == 2 || NumOfMuNeut == 2 || NumOfTauNeut == 2))
return ZBoson;
1413 if ((numberOfChildren - NumOfquark - NumOfgluon) == 2 && ((NumOfEl == 1 && NumOfElNeut == 1) || (NumOfMu == 1 && NumOfMuNeut == 1) || (NumOfTau == 1 && NumOfTauNeut == 1)))
return WBoson;
1418 if ( (numberOfChildren - NumOfquark - NumOfgluon) == 4 && (NumOfEl + NumOfMu + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 4) &&
1422 if ((numberOfChildren - NumOfquark - NumOfgluon - NumOfPhot) == 6 && (NumOfEl + NumOfMu + NumOfTau + NumOfElNeut + NumOfMuNeut + NumOfTauNeut == 6) &&
1426 if ((numberOfChildren - NumOfquark - NumOfgluon) >= 3 && NumOfPhot >= 1 && (NumOfElNeut == 2 || NumOfMuNeut == 2 || NumOfTauNeut == 2)) {
1433 if (partProdVtx == ancestorProdVtx) {
1434 int NumOfLepLoop = 0;
1435 int NumOfNeuLoop = 0;
1436 for (
const auto *
const pout: partProdVtx->
particles_out()) {
1437 if (!pout)
continue;
1438 for (
const auto *
const pin: partProdVtx->
particles_in()) {
1441 const int apdgid = std::abs(pout->pdgId());
1444 else { NumOfLepLoop++; }
1449 if (NumOfNeuLoop == 2 && NumOfLepLoop == 0)
return ZBoson;
1450 if (NumOfNeuLoop == 1 && NumOfLepLoop == 1)
return WBoson;
1451 if (NumOfNeuLoop + NumOfLepLoop == 4)
return DiBoson;
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
ElementLink implementation for ROOT usage.
bool isValid() const
Check if the element can be found.
a link optimized in size for a GenParticle in a McEventCollection
bool TruthLoopDetectionMethod3(const xAOD::TruthVertex *childOrigVtx, const xAOD::TruthParticle *parent) const
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleHepMCTruthClassifier(const HepMcParticleLink &theLink, MCTruthPartClassifier::Info *info=nullptr) const override final
MCTruthPartClassifier::ParticleOrigin defOrigOfElectron(const xAOD::TruthParticleContainer &xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
SG::ReadHandleKey< xAODTruthParticleLinkVector > m_truthLinkVecReadHandleKey
bool TruthLoopDetectionMethod1(const xAOD::TruthVertex *childOrigVtx, const xAOD::TruthParticle *parent) const
MCTruthPartClassifier::ParticleOrigin defOrigOfNeutrino(const xAOD::TruthParticleContainer &xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
MCTruthPartClassifier::ParticleOrigin defOrigOfMuon(const xAOD::TruthParticleContainer &xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
MCTruthPartClassifier::ParticleOrigin defOrigOfPhoton(const xAOD::TruthParticleContainer &xTruthParticleContainer, const xAOD::TruthParticle *, bool &isPrompt, MCTruthPartClassifier::Info &info) const
virtual std::pair< MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin > particleTruthClassifier(const xAOD::TruthParticle *, MCTruthPartClassifier::Info *info=nullptr) const override final
bool TruthLoopDetectionMethod2(const xAOD::TruthParticle *child, const xAOD::TruthParticle *parent) const
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerKey
MCTruthPartClassifier::ParticleOrigin defOrigOfTau(const xAOD::TruthParticleContainer &xTruthParticleContainer, const xAOD::TruthParticle *, int motherPDG, MCTruthPartClassifier::Info &info) const
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
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 (or barcode) was created during the simulation (TODO update to be s...
bool is_same_vertex(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same vertex.
ParticleOutCome defOutComeOfElectron(T thePart)
ParticleOutCome defOutComeOfPhoton(T thePart)
ParticleType defTypeOfPhoton(ParticleOrigin PhotOrig)
ParticleOrigin convHadronTypeToOrig(ParticleType pType, int motherPDG)
ParticleOutCome defOutComeOfTau(T thePart)
ParticleType defTypeOfTau(ParticleOrigin TauOrig)
ParticleType defTypeOfMuon(ParticleOrigin MuOrig, bool isPrompt)
ParticleType defTypeOfHadron(int pdg)
int isPrompt(const unsigned int classify, bool allow_prompt_tau_decays=true)
ParticleOutCome defOutComeOfMuon(T thePart)
ParticleType defTypeOfElectron(ParticleOrigin EleOrig, bool isPrompt)
bool isConditionA(const T &p)
To be understood.
T findMatching(C TruthContainer, T p)
Function to find a particle in container.
bool isNeutrinoRH(const T &p)
PDG Rule 12: APID: Helper function for right-handed neutrino states These are generator defined PDG I...
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)
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: Generator defined PDG ID values for right handed neutrinos and corresponding W+ boson fr...
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.