|
ATLAS Offline Software
|
|
void | initCommonMuonHistoryInfo (const xAOD::IParticle *muon, bool doPartonHistory) |
|
void | initRecoMuonHistoryInfo (const xAOD::Muon *muon, bool doPartonHistory) |
|
void | initTruthMuonHistoryInfo (const xAOD::TruthParticle *truthmu, bool doPartonHistory) |
|
void | copyRecoMuonHistoryInfo (const xAOD::Muon *m_origin, const xAOD::Muon *m_target) |
|
void | copyTruthMuonHistoryInfo (const xAOD::TruthParticle *tm_origin, const xAOD::TruthParticle *tm_target) |
|
void | copyCommonMuonHistoryInfo (const xAOD::IParticle *m_origin, const xAOD::IParticle *m_target) |
|
const xAOD::TruthParticle * | getTruthMuonAssociatedToRecoMuon (const xAOD::Muon *muon) |
|
void | getRecoMuonHistory (const xAOD::Muon *muon, bool doPartonHistory, SampleXsection::showering shAlgo, bool verbose) |
|
void | getTruthMuonHistory (const xAOD::TruthParticle *truthmu, bool doPartonHistory, SampleXsection::showering shAlgo, bool verbose) |
|
void | getTruthMuonPartonHistory (const xAOD::TruthParticle *truthmu, top::LepParticleOriginFlag lepParticleOriginFlag, const xAOD::TruthParticle *truthmu_Bmother, const xAOD::TruthParticle *truthmu_Cmother, const xAOD::TruthParticle *truthmu_firstNonLeptonMother, SampleXsection::showering shAlgo, bool verbose) |
|
top::LepParticleOriginFlag | getTruthMuonFromCharmHistory (const xAOD::TruthParticle *&truthmu_Bmother, const xAOD::TruthParticle *truthmu_Cmother, bool verbose) |
|
top::LepParticleOriginFlag | getTruthMuonFromTauHistory (const xAOD::TruthParticle *tau, const xAOD::TruthParticle *&truthmu_Bmother, const xAOD::TruthParticle *&truthmu_Cmother, const xAOD::TruthParticle *&truthmu_firstNonLeptonMother, bool verbose) |
|
const xAOD::TruthParticle * | getFirstHFHadronOfSameFlavour (const xAOD::TruthParticle *truthParticle, bool verbose) |
|
const xAOD::TruthParticle * | getInitialStateParticle (const xAOD::TruthParticle *truthParticle, bool verbose) |
|
void | printDecayChain (const xAOD::TruthParticle *part, std::ostream &os=std::cout, const std::string &prefix="") |
| Prints the decay chain leading up to a certain particle to a std::ostream. More...
|
|
bool | isFrom (const xAOD::TruthParticle *truthParticle, const std::vector< int > &parentPDGIds, bool bOnlyDirect=false) |
| Function to determine whether the input particle was produced in the physical decay of a particle of given PDG ID. More...
|
|
bool | isFromWZDecay (const xAOD::TruthParticle *truthParticle, bool bOnlyDirect=false) |
| Function to determine whether a given truth particle is a result of a decay chain that started in the decay of a W or Z boson. More...
|
|
bool | isLeptonFromTau (const xAOD::TruthParticle *truthParticle) |
| Function the check if a particle is a lepton which was produced in the decay of a tau lepton. More...
|
|
bool | isNotFromHadron (const xAOD::TruthParticle *truthParticle, bool bOnlyDirect=false, bool bTauIsHadron=false) |
| Check whether a given truth particle is not produced in the decay of physical hadrons or their descendents. More...
|
|
bool | isBHadron (int pdgId) |
| Check if a certain pdg ID corresponds to a B hadron. More...
|
|
bool | isLepton (const xAOD::TruthParticle *truthParticle) |
| Check whether a given truth particle is a lepton. More...
|
|
◆ copyCommonMuonHistoryInfo()
Definition at line 84 of file TruthTools.cxx.
88 ATH_MSG_ERROR(
" top::truth::copyCommonMuonHistoryInfo called with an origin muon which has no truth info!");
89 throw std::runtime_error(
"Muon has no truth info in copyCommonMuonHistoryInfo");
◆ copyRecoMuonHistoryInfo()
◆ copyTruthMuonHistoryInfo()
Definition at line 77 of file TruthTools.cxx.
80 tm_target->
auxdecor<
bool>(
"hasTruthMuonHistoryInfo")= tm_origin->
auxdecor<
bool>(
"hasTruthMuonHistoryInfo");
81 tm_target->
auxdecor<
bool>(
"hasTruthMuonPartonHistoryInfo")= tm_origin->
auxdecor<
bool>(
"hasTruthMuonPartonHistoryInfo");
◆ getFirstHFHadronOfSameFlavour()
Definition at line 692 of file TruthTools.cxx.
694 if(!truthParticle)
return 0;
700 if(
verbose)
ATH_MSG_INFO(
"getFirstHFHadronOfSameFlavour:: this can be called only on HF hadrons...");
707 if((niterations++)>100)
709 if(
verbose)
ATH_MSG_INFO(
"getFirstHFHadronOfSameFlavour:: too many iterations on particle "<<(truthParticle->
pdgId()));
716 if(
verbose)
ATH_MSG_INFO(
"getFirstHFHadronOfSameFlavour:: initial state particle not found");
722 bool hasSameFlavourParent=
false;
730 hasSameFlavourParent=
true;
736 if(!hasSameFlavourParent)
◆ getInitialStateParticle()
Definition at line 752 of file TruthTools.cxx.
754 if(!truthParticle)
return 0;
761 if((niterations++)>100)
767 bool hasParentWithSamePdgId=
false;
773 hasParentWithSamePdgId=
true;
777 if(!hasParentWithSamePdgId)
break;
◆ getRecoMuonHistory()
Definition at line 128 of file TruthTools.cxx.
131 if(
verbose)
ATH_MSG_INFO(
"getRecoMuonHistory:: ---------------entering in function-----------------");
139 if (origmu.isAvailable(*
muon)) origin = origmu(*
muon);
141 ATH_MSG_INFO(
"getRecoMuonHistory::called on muon with pt="<<
muon->pt()<<
" origin="<<origin);
146 static int nWarnings=0;
149 ATH_MSG_WARNING(
"top::truth::getRecoMuonHistory : partonHistory can be checked only for pythia8 and herwigpp showering algorithms, SoftMuonAdditionalTruthInfoCheckPartonOrigin will be ignored for this sample");
152 doPartonHistory=
false;
155 if(!
muon->isAvailable<
bool>(
"hasRecoMuonHistoryInfo"))
159 else if(
muon->auxdecor<
bool>(
"hasRecoMuonHistoryInfo"))
164 muon->auxdecor<
bool>(
"hasRecoMuonHistoryInfo")=
true;
179 ATH_MSG_INFO(
"getRecoMuonHistory::---truth decay chain---");
◆ getTruthMuonAssociatedToRecoMuon()
◆ getTruthMuonFromCharmHistory()
Definition at line 587 of file TruthTools.cxx.
594 bool hasBHadronParent=
false;
599 if(
parent->isBottomHadron())
601 hasBHadronParent=
true;
◆ getTruthMuonFromTauHistory()
Definition at line 613 of file TruthTools.cxx.
623 throw std::runtime_error(
"getTruthMuonFromTauHistory called with a non-tau particle ID");
636 if(!tauMother->
isLepton()) truthmu_firstNonLeptonMother=tauMother;
654 if(tauMother->
isBSM())
660 truthmu_Bmother=tauMother;
665 truthmu_Cmother=tauMother;
668 bool hasBHadronParent=
false;
674 if(
parent->isBottomHadron())
676 hasBHadronParent=
true;
◆ getTruthMuonHistory()
Definition at line 200 of file TruthTools.cxx.
217 if(!truthmu->
isAvailable<
bool>(
"hasTruthMuonHistoryInfo"))
221 else if(truthmu->
auxdecor<
bool>(
"hasTruthMuonHistoryInfo"))
223 if(
verbose)
ATH_MSG_INFO(
"getTruthMuonHistory:: -> we already ran on this truth muon, exiting");
226 truthmu->
auxdecor<
bool>(
"hasTruthMuonHistoryInfo")=
true;
235 if(initial_mu) truthmu_mother= initial_mu->
parent(0);
237 if(truthmu_mother && !
MC::isMuon(truthmu_mother))
240 if(!truthmu_mother->
isLepton()) truthmu_firstNonLeptonMother=truthmu_mother;
245 else if(truthmu_mother->
isW())
249 else if(truthmu_mother->
isZ())
257 else if(truthmu_mother->
isHiggs())
261 else if(truthmu_mother->
isBSM())
265 else if(truthmu_mother->
isTau())
272 truthmu_Bmother=truthmu_mother;
276 truthmu_Cmother=truthmu_mother;
283 ATH_MSG_INFO(
"getTruthMuonHistory::LepParticleOriginFlag="<<
static_cast<int>(lepParticleOriginFlag));
284 if(truthmu)
ATH_MSG_INFO(
"getTruthMuonHistory::-->truth muon "<<truthmu);
285 else ATH_MSG_INFO(
"getTruthMuonHistory::-->truth muon not found");
286 if(truthmu_mother)
ATH_MSG_INFO(
"getTruthMuonHistory::-->truth muon mother "<<truthmu_mother);
287 else ATH_MSG_INFO(
"getTruthMuonHistory::-->truth muon mother not found");
288 if(truthmu_firstNonLeptonMother)
ATH_MSG_INFO(
"getTruthMuonHistory::-->truthmu_firstNonLeptonMother "<<truthmu_firstNonLeptonMother);
289 else ATH_MSG_INFO(
"getTruthMuonHistory::-->truthmu_firstNonLeptonMother not found");
290 if(truthmu_Bmother)
ATH_MSG_INFO(
"getTruthMuonHistory::-->truth muon Bmother "<<truthmu_Bmother);
291 else ATH_MSG_INFO(
"getTruthMuonHistory::-->truth muon Bmother not found");
292 if(truthmu_Cmother)
ATH_MSG_INFO(
"getTruthMuonHistory::-->truth muon Cmother "<<truthmu_Cmother);
293 else ATH_MSG_INFO(
"getTruthMuonHistory::-->truth muon Cmother not found");
◆ getTruthMuonPartonHistory()
Definition at line 311 of file TruthTools.cxx.
317 ATH_MSG_INFO(
"getTruthMuonPartonHistory:: -> called on empty truth muon");
321 if(!truthmu->
isAvailable<
bool>(
"hasTruthMuonPartonHistoryInfo"))
325 else if(truthmu->
auxdecor<
bool>(
"hasTruthMuonPartonHistoryInfo"))
327 if(
verbose)
ATH_MSG_INFO(
"getTruthMuonHistory:: -> we already ran on this truth muon, exiting");
330 truthmu->
auxdecor<
bool>(
"hasTruthMuonPartonHistoryInfo")=
true;
336 if(
verbose)
ATH_MSG_INFO(
"getTruthMuonPartonHistory:: -> no muon mother available, returning");
342 if(
verbose)
ATH_MSG_INFO(
"getTruthMuonPartonHistory:: -> muon from light hadron, will not fill info");
351 if(
p->isTop())
return 0;
352 if(
p->isHiggs())
return 10;
353 if(
p->isBSM())
return 15;
354 if(
p->isW() ||
p->isZ())
return 20;
355 if(
p->isPhoton())
return 25;
359 if(truthmu_mother->isTop())
366 else if(truthmu_mother->isHiggs())
371 else if(truthmu_mother->isBSM())
376 else if(truthmu_mother->isW() || truthmu_mother->isZ() || truthmu_mother->isPhoton() )
387 unsigned int bosonOrigin_priority=999;
389 if(initialStateBoson)
396 unsigned int parent_priority=get_priority(
parent);
397 if(parent_priority<bosonOrigin_priority)
399 bosonOrigin_priority=parent_priority;
404 if(bosonOrigin && bosonOrigin->
isTop())
412 else if(bosonOrigin && bosonOrigin->
isHiggs())
418 else if(bosonOrigin && bosonOrigin->
isBSM())
426 if(
verbose)
ATH_MSG_INFO(
"getTruthMuonPartonHistory:: -> muon from boson not from top or higgs");
430 else if(truthmu_Bmother || truthmu_Cmother)
434 bool isBHadronMother=truthmu_Bmother;
435 const xAOD::TruthParticle* hadronMother= isBHadronMother ? truthmu_Bmother : truthmu_Cmother;
440 ATH_MSG_INFO(
"getTruthMuonPartonHistory:: isBHadronmother="<<isBHadronMother<<
" Bmom="<<truthmu_Bmother<<
" Cmom="<<truthmu_Cmother<<
" hadMom="<<hadronMother<<
" firstHadMom="<<firstHadronMother);
441 ATH_MSG_INFO(
"getTruthMuonPartonHistory:: -> muon from hadron pdgId="<<(hadronMother ? hadronMother->
pdgId() : 0)<<
", first hadron in chain pdgId="<<(firstHadronMother ? firstHadronMother->
pdgId() : 0));
443 if(firstHadronMother)
482 unsigned int parton_ancestor_priority=999;
484 if(initial_hf_parton_parent)
486 for(
unsigned int ip=0;
ip<initial_hf_parton_parent->nParents();
ip++)
490 if(!parton_ancestor) parton_ancestor=
parent;
494 if(
priority < parton_ancestor_priority)
504 if(parton_ancestor && parton_ancestor->
isTop())
512 else if(parton_ancestor && parton_ancestor->
isHiggs())
517 else if(parton_ancestor && parton_ancestor->
isBSM())
522 else if(parton_ancestor && (parton_ancestor->
isW() || parton_ancestor->
isZ() || parton_ancestor->
isPhoton()))
531 unsigned int bosonOrigin_priority=999;
533 if(first_bosonMotherOfHfQuark)
535 for(
unsigned int ip=0;
ip<first_bosonMotherOfHfQuark->
nParents();
ip++)
547 if(bosonOrigin && bosonOrigin->
isTop())
549 if(
verbose)
ATH_MSG_INFO(
"getTruthMuonPartonHistory:: -> muon from HF from boson from top");
555 else if(bosonOrigin && bosonOrigin->
isHiggs())
557 if(
verbose)
ATH_MSG_INFO(
"getTruthMuonPartonHistory:: -> muon from HF from boson from higgs");
561 else if(bosonOrigin && bosonOrigin->
isBSM())
563 if(
verbose)
ATH_MSG_INFO(
"getTruthMuonPartonHistory:: -> muon from HF from boson from BSM");
580 if(
verbose)
ATH_MSG_INFO(
"getTruthMuonHistory::------> LepPartonOriginFlag="<<
static_cast<int>(lepPartonOriginFlag));
◆ initCommonMuonHistoryInfo()
◆ initRecoMuonHistoryInfo()
void top::truth::initRecoMuonHistoryInfo |
( |
const xAOD::Muon * |
muon, |
|
|
bool |
doPartonHistory |
|
) |
| |
Definition at line 56 of file TruthTools.cxx.
58 muon->auxdecor<
bool>(
"hasRecoMuonHistoryInfo")=
false;
◆ initTruthMuonHistoryInfo()
Definition at line 62 of file TruthTools.cxx.
64 truthmu->
auxdecor<
bool>(
"hasTruthMuonHistoryInfo")=
false;
65 if(doPartonHistory) truthmu->
auxdecor<
bool>(
"hasTruthMuonPartonHistoryInfo")=
false;
◆ isBHadron()
bool top::truth::isBHadron |
( |
int |
pdgId | ) |
|
|
inline |
Check if a certain pdg ID corresponds to a B hadron.
This follows the official PDG Monte-Carlo numbering scheme (c.f. http://pdg.lbl.gov/2007/reviews/montecarlorpp.pdf) which defines the PDG ID to be a 7 digit number in the form +- n_r n_L n_q1 n_q2 n_q3 n_J where n_q1 = 0, n_q2 >= n_q3 (for mesons) n_q1 >= n_q2 >= n_q3 (for baryons) n_q1 >= n_q2, n_q3 = 0 (for diquarks) the n_qi denote the flavour of the quark composing the hadron, i.e. n_q = 1 -> d n_q = 2 -> u n_q = 3 -> s n_q = 4 -> 4 n_q = 5 -> b The digit \(n_J\) encodes the total angular momentum \(J\) of a compound system. \(n_L\) is used to distinguish compound objects which have the same total angular momentum but different spin ( \(S\)) and orbital ( \(L\)) angular momentum numbers. Finally, \(n_r\) is used to label mesons which are radially exited.
- Parameters
-
- Returns
- True if pdg ID corresponds to B hadron, false otherwise.
Definition at line 105 of file TruthTools.h.
108 (
pdgId / 100) % 10 == 5 ||
109 (
pdgId / 1000) % 10 == 5);
◆ isFrom()
Function to determine whether the input particle was produced in the physical decay of a particle of given PDG ID.
The algorithm uses the MC Truth Record. The algorithm works by ascending through the decay chain following the production vertex reference (obtained by the prodVtx() member function of the xAOD::TruthParticle). From the input particle, the algorithm ascends through the chain until the PDG ID of the particle found as first incoming particle is not equal to the PDG ID of the input particle. The last production vertex found during this ascent should then correspond to the physical production vertex of the input particle.
- Parameters
-
truthParticle | The input particle. |
parentPDGIds | A list of PDG IDs which are valid parents |
bOnlyDirect | A flag denoting whether "chained matching" is allowed. In chained matching mode, intermittend particles are allowed, i.e. for the chain A -> B -> C isFrom( C, A ) is true (for A != B != C). If only direct decays are considered, this is only the case if A == B or B == C. Defaults to false. |
- Returns
- Return true if the input particle was produced in the decay of a particle which has a PDG ID that is listed in parentPDGIds. Return false otherwise. Also return false if the input particle has an invalid production vertex reference.
Definition at line 841 of file TruthTools.cxx.
860 for (std::size_t motherIndex = 0;
861 motherIndex < numIncoming;
864 int motherPdgId = truthParticle->
pdgId();
870 while (truthParticle->
pdgId() == motherPdgId) {
873 motherPdgId = mother->
pdgId();
878 if (truthParticle->
pdgId() != motherPdgId) {
887 if (prevProdVtx == mother->
prodVtx()) {
892 prevProdVtx = prodVtx;
909 if (
std::find(parentPDGIds.begin(), parentPDGIds.end(), motherPdgId) != parentPDGIds.end()) {
915 if (!bOnlyDirect &&
isFrom(mother, parentPDGIds, bOnlyDirect)) {
◆ isFromWZDecay()
Function to determine whether a given truth particle is a result of a decay chain that started in the decay of a W or Z boson.
The algorithm works by ascending through the decay chain following the production vertex reference (obtained by the prodVtx() member function of the xAOD::TruthParticle). From the input particle, the algorithm ascends through the chain until the PDG ID of the particle found as first incoming particle is not equal to the PDG ID of the input particle. The last production vertex found during this ascent should then correspond to the physical production vertex of the input particle.
If the PDG ID of the mother particle (i.e. the incoming particle to the truth decay vertex) corresponds to a W / Z boson the algorithm terminates directly, returning true. Otherwise a vertex-based check is employed (which was designed to operate on SHERPA samples, c.f. the JetSimTools-00-02-09 package [svn: /Reconstruction/Jet/JetSimTools]).
- Parameters
-
truthParticle | The input particle. |
bOnlyDirect | A flag denoting whether "chained matching" is allowed. In chained matching mode, intermittend particles are allowed, i.e. for the chain A -> B -> C isFrom( C, A ) is true (for A != B != C). If only direct decays are considered, this is only the case if A == B or B == C. Defaults to false. |
- Returns
- Return true if the input particle was created in a physical decay of a W or Z boson. Otherwise return false. Will also return false if the prduction vertex of the input particle is invalid or has zero incoming particles.
Definition at line 924 of file TruthTools.cxx.
943 for (std::size_t motherIndex = 0;
944 motherIndex < numIncoming;
947 int motherAbsPdgId = truthParticle->
absPdgId();
953 while (truthParticle->
absPdgId() == motherAbsPdgId) {
956 motherAbsPdgId = mother->
absPdgId();
961 if (truthParticle->
absPdgId() != motherAbsPdgId) {
970 if (prevProdVtx == mother->
prodVtx()) {
975 prevProdVtx = prodVtx;
994 if (motherAbsPdgId == 23 || motherAbsPdgId == 24) {
◆ isLepton()
Check whether a given truth particle is a lepton.
- Parameters
-
truthParticle | The input truth particle to be tested. |
- Returns
- Return true if input is a lepton, false otherwise.
Definition at line 197 of file TruthTools.h.
◆ isLeptonFromTau()
Function the check if a particle is a lepton which was produced in the decay of a tau lepton.
- Parameters
-
truthParticle | The input truth particle which will be checked. |
- Returns
- True if the input particle is a lepton and it has a parent which was a tau. False otherwise. Will also return false if the production vertex of the input particle is invalid.
Definition at line 1044 of file TruthTools.cxx.
1050 return isFrom(truthParticle, {15, -15},
true);
◆ isNotFromHadron()
bool top::truth::isNotFromHadron |
( |
const xAOD::TruthParticle * |
truthParticle, |
|
|
bool |
bOnlyDirect = false , |
|
|
bool |
bTauIsHadron = false |
|
) |
| |
Check whether a given truth particle is not produced in the decay of physical hadrons or their descendents.
This must be done in a recursive manner, i.e. the decay chain must be traversed upwards until the initial state is found.
- Parameters
-
truthParticle | The truth particle to be tested. |
bOnlyDirect | A flag denoting whether "chained matching" is allowed. In chained matching mode, intermittend particles are allowed, i.e. for the chain A -> B -> C isFrom( C, A ) is true (for A != B != C). If only direct decays are considered, this is only the case if A == B or B == C. Defaults to false. |
bTauIsHadron | If true, any intermediate tauons are treated as hadrons. |
- Returns
- True if truthParticle does not descend from a physical hadron, false otherwise.
Definition at line 1053 of file TruthTools.cxx.
1077 for (std::size_t motherIndex = 0;
1078 motherIndex < numIncoming;
1080 int motherPdgId = truthParticle->
pdgId();
1087 while (truthParticle->
pdgId() == motherPdgId) {
1090 motherPdgId = mother->
pdgId();
1100 if (prevProdVtx == mother->
prodVtx()) {
1105 prevProdVtx = prodVtx;
1125 (bTauIsHadron &&
MC::isTau(motherPdgId)))) {
1131 if (!bOnlyDirect && !
isNotFromHadron(mother, bOnlyDirect, bTauIsHadron)) {
◆ printDecayChain()
Prints the decay chain leading up to a certain particle to a std::ostream.
- Parameters
-
part | Pointer to xAOD::TruthParticle whose decay origin shall be printed. |
os | The std::ostream into which the decay chain shall be printed. Defaults to std::cout. |
prefix | A string which will be prefixed to the output. |
Definition at line 783 of file TruthTools.cxx.
787 if (!truthPart || !truthPart->prodVtx()) {
788 os <<
prefix <<
"[" << (truthPart ? truthPart->pdgId() :0x0) <<
" <- NULL]" <<
'\n';
792 os <<
prefix <<
"[" << truthPart->pdgId();
796 if((niterations++)>30)
798 os<<
" STOP! too many iterations ";
801 if(truthPart->nParents()<1)
break;
808 for(
unsigned int ip=0;
ip<truthPart->nParents();
ip++)
811 os<<
" "<<(truthPart->parent(
ip) ? truthPart->parent(
ip)->pdgId() : 0);
812 if(!truthPart->parent(
ip))
continue;
814 if(!firstWithSamePdgId && truthPart->parent(
ip)->pdgId()==truthPart->pdgId())
816 firstWithSamePdgId = truthPart->
parent(
ip);
818 if(!firstNonParton && !truthPart->parent(
ip)->isParton())
820 firstNonParton = truthPart->
parent(
ip);
822 if(truthPart->isBottomHadron() &&
MC::isBottom(truthPart->parent(
ip)))
824 firstCorrectFlavorQuark = truthPart->
parent(
ip);
826 if(truthPart->isCharmHadron() &&
MC::isCharm(truthPart->parent(
ip)))
828 firstCorrectFlavorQuark = truthPart->
parent(
ip);
832 if(firstWithSamePdgId) truthPart=firstWithSamePdgId;
833 else if(firstNonParton) truthPart=firstNonParton;
834 else if(firstCorrectFlavorQuark) truthPart=firstCorrectFlavorQuark;
835 else truthPart=truthPart->
parent(0);
@ FromAntiTopViaLeptonicBoson
tipically means that the muon is coming from tbar->W->...->muon in some way (or any tbar->W/Z/gamma*...
bool isNotFromHadron(const xAOD::TruthParticle *truthParticle, bool bOnlyDirect, bool bTauIsHadron)
Check whether a given truth particle is not produced in the decay of physical hadrons or their descen...
const TruthParticle_v1 * parent(size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
@ Unknown
BSMparticle->tau->muon.
@ FromAntiTopViaQuarkToHF
tipically means that the muon is coming from tbar->bbar->...->muon in some way (or any tbar->qbar->....
int absPdgId() const
Absolute PDG ID code (often useful)
const xAOD::TruthParticle * getFirstHFHadronOfSameFlavour(const xAOD::TruthParticle *truthParticle, bool verbose)
@ FromAntiTopViaHadronicBosonToHF
tipically means that the muon is coming from tbar->W->...->muon in some way (or any tbar->W/Z/gamma*...
bool isFrom(const xAOD::TruthParticle *truthParticle, const std::vector< int > &parentPDGIds, bool bOnlyDirect)
Function to determine whether the input particle was produced in the physical decay of a particle of ...
@ FromBtoTau
from B-hadron to tau to mu decay
@ FromLeptonicW
from W with leptonic decay (note: this will not work for Sherpa)
std::string find(const std::string &s)
return a remapped string
void copyCommonMuonHistoryInfo(const xAOD::IParticle *m_origin, const xAOD::IParticle *m_target)
@ FromHiggs
H->HF->muon, not sure if this can happen in some generators.
LepParticleOriginFlag
this enum defines a flag used to understand the particle origin of a lepton (tipically a soft muon),...
const xAOD::TruthParticle * getTruthMuonAssociatedToRecoMuon(const xAOD::Muon *muon)
bool isCharmHadron() const
Determine if the PID is that of a c-hadron.
Helper class to provide type-safe access to aux data.
@ FromLeptonicZToTau
from Z->tau->lep (note: this will not work for Sherpa)
@ MissingTruthInfo
e.g. this can mean the muon is coming from light hadrons and there is no truth history,...
@ FromHiggsViaHadronicBosonToHF
H->VV->muon.
@ FromTopViaLeptonicBoson
tipically means that the muon is coming from t->W->...->muon in some way (or any t->W/Z/gamma*/H->....
bool isW() const
Check if this particle is a W boson.
top::LepParticleOriginFlag getTruthMuonFromCharmHistory(const xAOD::TruthParticle *&truthmu_Bmother, const xAOD::TruthParticle *truthmu_Cmother, bool verbose)
@ FromLightHadron
often these muons are Unknown, but in some cases we have the truth record and we can verify they are ...
const TPLinks_t & outgoingParticleLinks() const
Get all the outgoing particles.
bool isBSM() const
Check if this is a BSM particle.
Decorator< T, ALLOC >::reference_type auxdecor(const std::string &name) const
Fetch an aux decoration, as a non-const reference.
bool isBottomHadron(const T &p)
@ FromTopViaHadronicBosonToHF
tipically means that the muon is coming from t->W->...->muon in some way (or any t->W/Z/gamma*/H->....
bool isSMLepton(const T &p)
bool isZ() const
Check if this particle is a Z boson.
top::LepParticleOriginFlag getTruthMuonFromTauHistory(const xAOD::TruthParticle *tau, const xAOD::TruthParticle *&truthmu_Bmother, const xAOD::TruthParticle *&truthmu_Cmother, const xAOD::TruthParticle *&truthmu_firstNonLeptonMother, bool verbose)
@ FromTau
from Tau leptonic (not coming from W or HF-hadron, so not sure this can really happen)
bool isLepton() const
Whether the particle is a lepton.
@ FromHiggsViaLeptonicBosonToHF
@ FromTopViaQuarkToHF
tipically means that the muon is coming from t->b->...->muon in some way (or any t->q->....
size_t nParents() const
Number of parents of this particle.
void initTruthMuonHistoryInfo(const xAOD::TruthParticle *truthmu, bool doPartonHistory)
bool isBottom(const T &p)
Class describing a truth particle in the MC record.
void initRecoMuonHistoryInfo(const xAOD::Muon *muon, bool doPartonHistory)
@ FromLeptonicBoson
general case of W/Z/gamma*/H->muon or W/Z/gamma*/H->tau->muon
@ MissingTruthInfo
no associated truth muon tipically this happens for muon from light-hadrons
bool hasProdVtx() const
Check for a production vertex on this particle.
@ Unknown
BSMparticle->HF->muon.
@ FromCtoTau
from C-hadron (with no B-hadron parent) to tau to mu decay
void getTruthMuonHistory(const xAOD::TruthParticle *truthmu, bool doPartonHistory, SampleXsection::showering shAlgo, bool verbose)
@ FromBtoC
from B-hadron to C-hadron to muon decay
@ FromBtoCtoTau
from B-hadron to C-hadron to tau to muon decay
bool isTau() const
Whether the particle is a tau (or antitau)
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
const xAOD::TruthParticle * getInitialStateParticle(const xAOD::TruthParticle *truthParticle, bool verbose)
bool isBottomHadron() const
Determine if the PID is that of a b-hadron.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
bool isLightHadron() const
Determine if the PID is that of a light flavour (not b or c) hadron.
Class describing a truth vertex in the MC record.
@ FromBSMToHF
BSMparticle->V->HF->muon.
void initCommonMuonHistoryInfo(const xAOD::IParticle *muon, bool doPartonHistory)
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
bool isHadron(const T &p)
@ FromHiggsToHF
H->VV->HF->muon.
bool isAvailable(const std::string &name, const std::string &clsname="") const
Check if a user property is available for reading or not.
@ FromLeptonicWToTau
from W->tau->lep (note: this will not work for Sherpa)
bool isPhoton() const
Whether the particle is a photon.
@ FromPhotonToTau
gamma*->muonmuon
bool isHiggs() const
Check if this particle is a Higgs boson.
@ FromBSMViaHadronicBosonToHF
BSMparticle->V->muon.
#define ATH_MSG_WARNING(x)
size_t nIncomingParticles() const
Get the number of incoming particles.
bool isDecayed(const T &p)
@ FromLeptonicZ
gamma*->tautau and tau->muon
bool isMuon() const
Whether the particle is a muon (or antimuon)
@ FromBSMToTau
BSMparticle->muon.
bool isCharmHadron(const T &p)
@ FromHFHadronOfUnkownOrigin
HF hadron->muon or HF hadron->tau->muon, we're not sure where the HF hadron is coming from (maybe a g...
void getTruthMuonPartonHistory(const xAOD::TruthParticle *truthmu, top::LepParticleOriginFlag lepParticleOriginFlag, const xAOD::TruthParticle *truthmu_Bmother, const xAOD::TruthParticle *truthmu_Cmother, const xAOD::TruthParticle *truthmu_firstNonLeptonMother, SampleXsection::showering shAlgo, bool verbose)
bool isFromWZDecay(const xAOD::TruthParticle *truthParticle, bool bOnlyDirect)
Function to determine whether a given truth particle is a result of a decay chain that started in the...
Class describing a TrackParticle.
@ FromHadronicBosonToHF
general case of W/Z/gamma*/H->HF hadrons->muon
@ FromC
from direct C-hadron (with no B-hadron parent) decay
@ FromBSMViaLeptonicBosonToHF
BSMparticle->muon.
int pdgId() const
PDG ID code.
void printDecayChain(const xAOD::TruthParticle *truthPart, std::ostream &os, const std::string &prefix)
Prints the decay chain leading up to a certain particle to a std::ostream.
LepPartonOriginFlag
this enum defines a flag used to understand the partonic origin of a lepton (tipically a soft muon),...
@ FromHiggsToTau
Higgs->muon.
bool isTop() const
Check if this particle is a top quark.