ATLAS Offline Software
Loading...
Searching...
No Matches
MCTruthPartClassifier Namespace Reference

Classes

struct  ParticleDef

Enumerations

enum  ParticleType : unsigned int {
  Unknown = 0 , UnknownElectron = 1 , IsoElectron = 2 , NonIsoElectron = 3 ,
  BkgElectron = 4 , UnknownMuon = 5 , IsoMuon = 6 , NonIsoMuon = 7 ,
  BkgMuon = 8 , UnknownTau = 9 , IsoTau = 10 , NonIsoTau = 11 ,
  BkgTau = 12 , UnknownPhoton = 13 , IsoPhoton = 14 , NonIsoPhoton = 15 ,
  BkgPhoton = 16 , Hadron = 17 , Neutrino = 18 , NuclFrag = 19 ,
  NonPrimary = 20 , GenParticle = 21 , SUSYParticle = 22 , OtherBSMParticle = 39 ,
  BBbarMesonPart = 23 , BottomMesonPart = 24 , CCbarMesonPart = 25 , CharmedMesonPart = 26 ,
  BottomBaryonPart = 27 , CharmedBaryonPart = 28 , StrangeBaryonPart = 29 , LightBaryonPart = 30 ,
  StrangeMesonPart = 31 , LightMesonPart = 32 , BJet = 33 , CJet = 34 ,
  LJet = 35 , GJet = 36 , TauJet = 37 , UnknownJet = 38
}
enum  ParticleOrigin : unsigned int {
  NonDefined = 0 , SingleElec = 1 , SingleMuon = 2 , SinglePhot = 3 ,
  SingleTau = 4 , PhotonConv = 5 , DalitzDec = 6 , ElMagProc = 7 ,
  Mu = 8 , TauLep = 9 , top = 10 , QuarkWeakDec = 11 ,
  WBoson = 12 , ZBoson = 13 , Higgs = 14 , HiggsMSSM = 15 ,
  HeavyBoson = 16 , WBosonLRSM = 17 , NuREle = 18 , NuRMu = 19 ,
  NuRTau = 20 , LQ = 21 , SUSY = 22 , OtherBSM = 46 ,
  LightMeson = 23 , StrangeMeson = 24 , CharmedMeson = 25 , BottomMeson = 26 ,
  CCbarMeson = 27 , JPsi = 28 , BBbarMeson = 29 , LightBaryon = 30 ,
  StrangeBaryon = 31 , CharmedBaryon = 32 , BottomBaryon = 33 , PionDecay = 34 ,
  KaonDecay = 35 , BremPhot = 36 , PromptPhot = 37 , UndrPhot = 38 ,
  ISRPhot = 39 , FSRPhot = 40 , NucReact = 41 , PiZero = 42 ,
  DiBoson = 43 , ZorHeavyBoson = 44 , MultiBoson = 47 , QCD = 45
}
enum  ParticleOutCome : unsigned int {
  NonDefinedOutCome = 0 , UnknownOutCome = 1 , UnConverted = 2 , Converted = 3 ,
  NonInteract = 4 , NuclInteraction = 5 , ElectrMagInter = 6 , DecaytoElectron = 7 ,
  DecaytoMuon = 8 , OneProng = 9 , ThreeProng = 10 , FiveProng = 11
}
enum  MCTC_bits : unsigned int {
  HadTau =0 , Tau , hadron , frombsm ,
  uncat , isbsm , isgeant , stable ,
  totalBits
}
 Bit positions of the particle classification word built by defOrigOfParticle(). More...

Functions

ParticleOrigin convHadronTypeToOrig (ParticleType pType, int motherPDG)
 Convert a hadron ParticleType to a ParticleOrigin (JPsi if a c-cbar meson has a J/psi mother).
ParticleOrigin defHadronType (int pdg)
 Classify a hadron by PDG ID into a ParticleOrigin (NonDefined if none applies).
ParticleType defTypeOfHadron (int pdg)
 Classify a hadron by PDG ID into a ParticleType (Unknown if none applies).
ParticleType defTypeOfElectron (ParticleOrigin EleOrig, bool isPrompt)
 Classify an electron (Unknown/Iso/NonIso/Bkg) from its origin; prompt electrons are always Iso.
ParticleType defTypeOfMuon (ParticleOrigin MuOrig, bool isPrompt)
 Classify a muon (Unknown/Iso/NonIso/Bkg) from its origin; prompt muons are always Iso.
ParticleType defTypeOfTau (ParticleOrigin TauOrig)
 Classify a tau (Unknown/Iso/NonIso/Bkg) from its origin.
ParticleType defTypeOfPhoton (ParticleOrigin PhotOrig)
 Classify a photon (Unknown/Iso/NonIso/Bkg) from its origin.
template<class T>
ParticleOrigin defJetOrig (const T &allJetMothers)
 Determine a jet's origin from its mother particles (BSM/Higgs first, then top > Z > W > QCD).
template<class T>
std::tuple< unsigned int, T > defOrigOfParticle (T thePart)
 Classify a particle into a bit-word (see MCTC_bits).
int isPrompt (const unsigned int classify, bool allow_prompt_tau_decays=true)
 Tell whether a particle is prompt, from the word returned by defOrigOfParticle().
template<class T>
ParticleOutCome defOutComeOfElectron (T thePart)
 Determine the outcome of a simulated electron from its end vertex (NonInteract, ElectrMagInter, NuclInteraction or UnknownOutCome).
template<class T>
ParticleOutCome defOutComeOfMuon (T thePart)
 Determine the outcome of a simulated muon from its end vertex (NonInteract, DecaytoElectron, NuclInteraction or UnknownOutCome).
template<class T>
ParticleOutCome defOutComeOfTau (T thePart)
 Determine the outcome of a simulated tau from its decay products (NonInteract, NuclInteraction, DecaytoElectron/Muon, One/Three/FiveProng or UnknownOutCome).
template<class T>
ParticleOutCome defOutComeOfPhoton (T thePart)
 Determine the outcome of a simulated photon from its end vertex (UnConverted, Converted, NuclInteraction or UnknownOutCome).

Enumeration Type Documentation

◆ MCTC_bits

enum MCTruthPartClassifier::MCTC_bits : unsigned int

Bit positions of the particle classification word built by defOrigOfParticle().

Enumerator
HadTau 
Tau 
hadron 
frombsm 
uncat 
isbsm 
isgeant 
stable 
totalBits 

Definition at line 156 of file TruthClassifiers.h.

◆ ParticleOrigin

Enumerator
NonDefined 
SingleElec 
SingleMuon 
SinglePhot 
SingleTau 
PhotonConv 
DalitzDec 
ElMagProc 
Mu 
TauLep 
top 
QuarkWeakDec 
WBoson 
ZBoson 
Higgs 
HiggsMSSM 
HeavyBoson 
WBosonLRSM 
NuREle 
NuRMu 
NuRTau 
LQ 
SUSY 
OtherBSM 
LightMeson 
StrangeMeson 
CharmedMeson 
BottomMeson 
CCbarMeson 
JPsi 
BBbarMeson 
LightBaryon 
StrangeBaryon 
CharmedBaryon 
BottomBaryon 
PionDecay 
KaonDecay 
BremPhot 
PromptPhot 
UndrPhot 
ISRPhot 
FSRPhot 
NucReact 
PiZero 
DiBoson 
ZorHeavyBoson 
MultiBoson 
QCD 

Definition at line 53 of file TruthClasses.h.

53 : unsigned int {
54 NonDefined = 0,
55
56 SingleElec = 1,
57 SingleMuon = 2,
58 SinglePhot = 3,
59 SingleTau = 4,
60
61 PhotonConv = 5,
62 DalitzDec = 6,
63 ElMagProc = 7,
64 Mu = 8,
65 TauLep = 9,
66 top = 10,
67 QuarkWeakDec = 11,
68 WBoson = 12,
69 ZBoson = 13,
70 Higgs = 14,
71 HiggsMSSM = 15,
72 HeavyBoson = 16,
73 WBosonLRSM = 17,
74 NuREle = 18,
75 NuRMu = 19,
76 NuRTau = 20,
77 LQ = 21,
78
79 SUSY = 22,
80 OtherBSM = 46,
81 LightMeson = 23,
82 StrangeMeson = 24,
83 CharmedMeson = 25,
84 BottomMeson = 26,
85 CCbarMeson = 27,
86 JPsi = 28,
87 BBbarMeson = 29,
88 LightBaryon = 30,
89 StrangeBaryon = 31,
90 CharmedBaryon = 32,
91 BottomBaryon = 33,
92 PionDecay = 34,
93 KaonDecay = 35,
94 BremPhot = 36,
95 PromptPhot = 37,
96 UndrPhot = 38,
97 ISRPhot = 39,
98 FSRPhot = 40,
99 NucReact = 41,
100 PiZero = 42,
101 DiBoson = 43,
102 ZorHeavyBoson = 44,
103 MultiBoson = 47,
104 QCD = 45
105 };

◆ ParticleOutCome

Enumerator
NonDefinedOutCome 
UnknownOutCome 
UnConverted 
Converted 
NonInteract 
NuclInteraction 
ElectrMagInter 
DecaytoElectron 
DecaytoMuon 
OneProng 
ThreeProng 
FiveProng 

Definition at line 107 of file TruthClasses.h.

◆ ParticleType

Enumerator
Unknown 
UnknownElectron 
IsoElectron 
NonIsoElectron 
BkgElectron 
UnknownMuon 
IsoMuon 
NonIsoMuon 
BkgMuon 
UnknownTau 
IsoTau 
NonIsoTau 
BkgTau 
UnknownPhoton 
IsoPhoton 
NonIsoPhoton 
BkgPhoton 
Hadron 
Neutrino 
NuclFrag 
NonPrimary 
GenParticle 
SUSYParticle 
OtherBSMParticle 
BBbarMesonPart 
BottomMesonPart 
CCbarMesonPart 
CharmedMesonPart 
BottomBaryonPart 
CharmedBaryonPart 
StrangeBaryonPart 
LightBaryonPart 
StrangeMesonPart 
LightMesonPart 
BJet 
CJet 
LJet 
GJet 
TauJet 
UnknownJet 

Definition at line 10 of file TruthClasses.h.

10 : unsigned int {
11 Unknown = 0,
13 IsoElectron = 2,
15 BkgElectron = 4,
16 UnknownMuon = 5,
17 IsoMuon = 6,
18 NonIsoMuon = 7,
19 BkgMuon = 8,
20 UnknownTau = 9,
21 IsoTau = 10,
22 NonIsoTau = 11,
23 BkgTau = 12,
24 UnknownPhoton = 13,
25 IsoPhoton = 14,
26 NonIsoPhoton = 15,
27 BkgPhoton = 16,
28 Hadron = 17,
29 Neutrino = 18,
30 NuclFrag = 19,
31 NonPrimary = 20,
32 GenParticle = 21,
33 SUSYParticle = 22,
35 BBbarMesonPart = 23,
36 BottomMesonPart = 24,
37 CCbarMesonPart = 25,
42 LightBaryonPart = 30,
44 LightMesonPart = 32,
45 BJet = 33,
46 CJet = 34,
47 LJet = 35,
48 GJet = 36,
49 TauJet = 37,
50 UnknownJet = 38
51 };

Function Documentation

◆ convHadronTypeToOrig()

ParticleOrigin MCTruthPartClassifier::convHadronTypeToOrig ( ParticleType pType,
int motherPDG )
inline

Convert a hadron ParticleType to a ParticleOrigin (JPsi if a c-cbar meson has a J/psi mother).

Definition at line 15 of file TruthClassifiers.h.

16{
17 if (pType == CCbarMesonPart && abs(motherPDG) == MC::JPSI) return JPsi;
18 if (pType == BBbarMesonPart) return BBbarMeson;
19 if (pType == BottomMesonPart) return BottomMeson;
20 if (pType == BottomBaryonPart) return BottomBaryon;
21 if (pType == CCbarMesonPart) return CCbarMeson;
22 if (pType == CharmedMesonPart) return CharmedMeson;
23 if (pType == CharmedBaryonPart) return CharmedBaryon;
24 if (pType == StrangeBaryonPart) return StrangeBaryon;
25 if (pType == StrangeMesonPart) return StrangeMeson;
26 if (pType == LightBaryonPart) return LightBaryon;
27 if (pType == LightMesonPart) return LightMeson;
28 return NonDefined;
29}
static const int JPSI

◆ defHadronType()

ParticleOrigin MCTruthPartClassifier::defHadronType ( int pdg)
inline

Classify a hadron by PDG ID into a ParticleOrigin (NonDefined if none applies).

Definition at line 32 of file TruthClassifiers.h.

32 {
33 if (abs(pdg) == MC::JPSI) return JPsi;
34 if (MC::isBBbarMeson(pdg)) return BBbarMeson;
35 if (MC::isCCbarMeson(pdg)) return CCbarMeson;
36 if (MC::isBottomMeson(pdg)) return BottomMeson;
37 if (MC::isCharmMeson(pdg)) return CharmedMeson;
38 if (MC::isBottomBaryon(pdg)) return BottomBaryon;
39 if (MC::isCharmBaryon(pdg)) return CharmedBaryon;
40 if (MC::isStrangeBaryon(pdg)) return StrangeBaryon;
41 if (MC::isLightBaryon(pdg)) return LightBaryon;
42 if (MC::isStrangeMeson(pdg)) return StrangeMeson;
43 if (MC::isLightMeson(pdg)) return LightMeson;
44 return NonDefined;
45}
bool isStrangeBaryon(const T &p)
bool isLightBaryon(const T &p)
bool isLightMeson(const T &p)
bool isStrangeMeson(const T &p)
bool isBottomMeson(const T &p)
bool isCharmBaryon(const T &p)
bool isCCbarMeson(const T &p)
bool isBottomBaryon(const T &p)
bool isCharmMeson(const T &p)
bool isBBbarMeson(const T &p)

◆ defJetOrig()

template<class T>
ParticleOrigin MCTruthPartClassifier::defJetOrig ( const T & allJetMothers)

Determine a jet's origin from its mother particles (BSM/Higgs first, then top > Z > W > QCD).

Definition at line 138 of file TruthClassifiers.h.

138 {
139 ParticleOrigin partOrig = NonDefined;
140 for (const auto& it: allJetMothers) {
141 int pdg = abs(it->pdg_id());
142 if (MC::isTop(pdg)) partOrig = top;
143 if (MC::isZ(pdg)) partOrig = ZBoson;
144 if (MC::isW(pdg) && !(partOrig == top)) partOrig = WBoson;
145 if ((MC::isQuark(pdg) || MC::isGluon(pdg)) && partOrig != top && partOrig != ZBoson && partOrig != WBoson) partOrig = QCD;
146 if (MC::isHiggs(pdg)) return Higgs;
147 if (pdg == 35 || pdg == 36 || pdg == 37) return HiggsMSSM;
148 if (pdg == 32 || pdg == 33 || pdg == 34) return HeavyBoson;
149 if (pdg == 42) return LQ;
150 if (MC::isSUSY(pdg)) return SUSY;
151 if (MC::isBSM(pdg)) return OtherBSM;
152 }
153 return partOrig;
154}
bool isZ(const T &p)
bool isW(const T &p)
bool isTop(const T &p)
bool isSUSY(const T &p)
bool isQuark(const T &p)
PDG rule 2: Quarks and leptons are numbered consecutively starting from 1 and 11 respectively; to do ...
bool isHiggs(const T &p)
APID: HIGGS boson is only one particle.
bool isGluon(const T &p)
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.

◆ defOrigOfParticle()

template<class T>
std::tuple< unsigned int, T > MCTruthPartClassifier::defOrigOfParticle ( T thePart)

Classify a particle into a bit-word (see MCTC_bits).

Returns
the word and the parent hadron (nullptr if none)

Definition at line 160 of file TruthClassifiers.h.

160 {
161
162 T parent_hadron_ptr = nullptr;
163
164 bool uncat = 0, fromHad = 0, fromTau = 0;
165 bool isPhysical = MC::isPhysical(thePart);
166 bool isGeant = HepMC::is_simulation_particle(thePart);
167 bool isBSM = MC::isBSM(thePart);
168 bool fromBSM = isBSM; // just to initialise
169
170 auto prodVtx = thePart->production_vertex();
171 if (isPhysical && prodVtx && !isGeant) {
172 fromHad = MC::isFromHadron(thePart, parent_hadron_ptr, fromTau, fromBSM);
173 }
174 else uncat = 1;
175
176 std::bitset<MCTC_bits::totalBits> classifier;
177 classifier[MCTC_bits::stable] = isPhysical;
178 classifier[MCTC_bits::isgeant] = isGeant;
179 classifier[MCTC_bits::isbsm] = isBSM;
180 classifier[MCTC_bits::uncat] = uncat;
181 classifier[MCTC_bits::frombsm] = fromBSM;
182 classifier[MCTC_bits::hadron] = fromHad;
183 classifier[MCTC_bits::Tau] = fromTau;
184 classifier[MCTC_bits::HadTau] = fromHad && fromTau;
185 unsigned int outputvalue = static_cast<unsigned int>(classifier.to_ulong());
186
187 return std::make_tuple(outputvalue,parent_hadron_ptr);
188}
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.
Definition AtlasPID.h:848
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 isFromHadron(T p, U &hadron, bool &fromTau, bool &fromBSM)
Function to classify the particle.
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.

◆ defOutComeOfElectron()

template<class T>
ParticleOutCome MCTruthPartClassifier::defOutComeOfElectron ( T thePart)

Determine the outcome of a simulated electron from its end vertex (NonInteract, ElectrMagInter, NuclInteraction or UnknownOutCome).

Definition at line 203 of file TruthClassifiers.h.

203 {
204 ParticleOutCome PartOutCome = UnknownOutCome;
205 auto EndVert = MC::findSimulatedEndVertex(thePart);
206 if (EndVert == nullptr) return NonInteract;
207
208 int ElecOutNumOfNucFr(0);
209 int ElecOutNumOfElec(0);
210 int NumOfHadr(0);
211 auto outgoing = EndVert->particles_out();
212 int NumOfElecDaug = outgoing.size();
213 for (const auto& p: outgoing) {
214 if (!p) continue;
215 int EndDaugType = p->pdg_id();
216 if (MC::isElectron(EndDaugType)) ElecOutNumOfElec++;
217 if (MC::isHadron(p) && !MC::isBeam(p)) NumOfHadr++;
218 if (EndDaugType > 1000000000 || EndDaugType == 0 || abs(EndDaugType) == 2212 || abs(EndDaugType) == 2112) ElecOutNumOfNucFr++;
219 }
220
221 if (ElecOutNumOfNucFr != 0 || NumOfHadr != 0) PartOutCome = NuclInteraction;
222 if (ElecOutNumOfElec == 1 && NumOfElecDaug == 1) PartOutCome = ElectrMagInter;
223
224 return PartOutCome;
225}
bool isElectron(const T &p)
bool isBeam(const T &p)
Identify if the particle is beam particle.
bool isHadron(const T &p)
auto findSimulatedEndVertex(T thePart) -> decltype(thePart->end_vertex())
Function to find the end vertex of a particle.

◆ defOutComeOfMuon()

template<class T>
ParticleOutCome MCTruthPartClassifier::defOutComeOfMuon ( T thePart)

Determine the outcome of a simulated muon from its end vertex (NonInteract, DecaytoElectron, NuclInteraction or UnknownOutCome).

Definition at line 229 of file TruthClassifiers.h.

229 {
230 ParticleOutCome PartOutCome = UnknownOutCome;
231 auto EndVert = MC::findSimulatedEndVertex(thePart);
232 if (EndVert == nullptr) return NonInteract;
233 int MuOutNumOfNucFr(0);
234 int NumOfHadr(0);
235 int NumOfEleNeutr(0);
236 int NumOfMuonNeutr(0);
237 int NumOfElec(0);
238 auto outgoing = EndVert->particles_out();
239 int NumOfMuDaug = outgoing.size();
240 for (const auto& p: outgoing) {
241 if (!p) continue;
242 int EndDaugType = p->pdg_id();
243 if (MC::isElectron(EndDaugType)) NumOfElec++;
244 if (abs(EndDaugType) == 12) NumOfEleNeutr++;
245 if (abs(EndDaugType) == 14) NumOfMuonNeutr++;
246 if (MC::isHadron(p) && !MC::isBeam(p)) NumOfHadr++;
247 if (EndDaugType > 1000000000 || EndDaugType == 0 || abs(EndDaugType) == 2212 || abs(EndDaugType) == 2112) MuOutNumOfNucFr++;
248 }
249
250 if (MuOutNumOfNucFr != 0 || NumOfHadr != 0) PartOutCome = NuclInteraction;
251 if (NumOfMuDaug == 3 && NumOfElec == 1 && NumOfEleNeutr == 1 && NumOfMuonNeutr == 1) PartOutCome = DecaytoElectron;
252
253 return PartOutCome;
254}

◆ defOutComeOfPhoton()

template<class T>
ParticleOutCome MCTruthPartClassifier::defOutComeOfPhoton ( T thePart)

Determine the outcome of a simulated photon from its end vertex (UnConverted, Converted, NuclInteraction or UnknownOutCome).

Definition at line 287 of file TruthClassifiers.h.

287 {
288 ParticleOutCome PartOutCome = UnknownOutCome;
289 auto EndVert = MC::findSimulatedEndVertex(thePart);
290 if (EndVert == nullptr) return UnConverted;
291
292 int PhtOutNumOfNucFr(0);
293 int PhtOutNumOfEl(0);
294 int PhtOutNumOfPos(0);
295 int PhtOutNumOfHadr(0);
296
297 auto outgoing = EndVert->particles_out();
298 int NumOfPhtDaug = outgoing.size();
299 for (const auto& p: outgoing) {
300 if (!p) continue;
301 int EndDaugType = p->pdg_id();
302 if (EndDaugType > 1000000000 || EndDaugType == 0 || abs(EndDaugType) == 2212 || abs(EndDaugType) == 2112) PhtOutNumOfNucFr++;
303 if (EndDaugType == 11) PhtOutNumOfEl++;
304 if (EndDaugType == -11) PhtOutNumOfPos++;
305 if (MC::isHadron(p) && !MC::isBeam(p)) PhtOutNumOfHadr++;
306 }
307
308 if (PhtOutNumOfEl == 1 && PhtOutNumOfPos == 1 && NumOfPhtDaug == 2) PartOutCome = Converted;
309 if ((NumOfPhtDaug > 1 && PhtOutNumOfNucFr != 0) || PhtOutNumOfHadr > 0) PartOutCome = NuclInteraction;
310
311 return PartOutCome;
312}

◆ defOutComeOfTau()

template<class T>
ParticleOutCome MCTruthPartClassifier::defOutComeOfTau ( T thePart)

Determine the outcome of a simulated tau from its decay products (NonInteract, NuclInteraction, DecaytoElectron/Muon, One/Three/FiveProng or UnknownOutCome).

Definition at line 257 of file TruthClassifiers.h.

257 {
258 ParticleOutCome PartOutCome = UnknownOutCome;
259 auto EndVert = MC::findSimulatedEndVertex(thePart);
260 if (EndVert == nullptr) return NonInteract;
261 int NumOfTauDaug = EndVert->nOutgoingParticles();
262 auto tauFinalStatePart = MC::findFinalStateParticles(EndVert);
263 auto PD = DecayProducts(tauFinalStatePart);
264 int NumOfElec = PD.apd(11);
265 int NumOfMuon = PD.apd(13);
266 int NumOfElecNeut = PD.apd(12);
267 int NumOfMuonNeut = PD.apd(14);
268 int NumOfPhot = PD.apd(22);
269 int NumOfPi = PD.apd(211);
270 int NumOfKaon = PD.apd(321);
271 int NumOfNucFr = PD.apd(0) + PD.apd(1000000000, std::numeric_limits<int>::max());
272
273 if (NumOfNucFr != 0) PartOutCome = NuclInteraction;
274 if ((NumOfTauDaug == 3 && NumOfElec == 1 && NumOfElecNeut == 1) || (NumOfTauDaug == (3 + NumOfPhot) && NumOfElecNeut == 1)) PartOutCome = DecaytoElectron;
275 if ((NumOfTauDaug == 3 && NumOfMuon == 1 && NumOfMuonNeut == 1) || (NumOfTauDaug == (3 + NumOfPhot) && NumOfMuonNeut == 1)) PartOutCome = DecaytoMuon;
276
277 if (NumOfPi == 1 || NumOfKaon == 1) PartOutCome = OneProng;
278 if (NumOfPi + NumOfKaon == 3) PartOutCome = ThreeProng;
279 if (NumOfPi + NumOfKaon == 5) PartOutCome = FiveProng;
280
281
282 return PartOutCome;
283}
auto findFinalStateParticles(V theVert) -> decltype(theVert->particles_out())
Function to find the stable particle descendants of the given vertex.

◆ defTypeOfElectron()

ParticleType MCTruthPartClassifier::defTypeOfElectron ( ParticleOrigin EleOrig,
bool isPrompt )
inline

Classify an electron (Unknown/Iso/NonIso/Bkg) from its origin; prompt electrons are always Iso.

Definition at line 64 of file TruthClassifiers.h.

64 {
65
66 if (EleOrig == NonDefined)
67 return UnknownElectron;
68
69 if (EleOrig == WBoson || EleOrig == ZBoson || EleOrig == top || EleOrig == SingleElec || EleOrig == Higgs ||
70 EleOrig == HiggsMSSM || EleOrig == HeavyBoson || EleOrig == WBosonLRSM || EleOrig == NuREle || EleOrig == NuRMu ||
71 EleOrig == NuRTau || EleOrig == LQ || EleOrig == SUSY || EleOrig == DiBoson || EleOrig == ZorHeavyBoson ||
72 EleOrig == OtherBSM || EleOrig == MultiBoson || isPrompt) {
73 return IsoElectron;
74 }
75 if (EleOrig == JPsi || EleOrig == BottomMeson || EleOrig == CharmedMeson || EleOrig == BottomBaryon ||
76 EleOrig == CharmedBaryon || EleOrig == TauLep || EleOrig == Mu || EleOrig == QuarkWeakDec) {
77 return NonIsoElectron;
78 }
79 return BkgElectron;
80}
int isPrompt(const unsigned int classify, bool allow_prompt_tau_decays=true)
Tell whether a particle is prompt, from the word returned by defOrigOfParticle().

◆ defTypeOfHadron()

ParticleType MCTruthPartClassifier::defTypeOfHadron ( int pdg)
inline

Classify a hadron by PDG ID into a ParticleType (Unknown if none applies).

Definition at line 48 of file TruthClassifiers.h.

48 {
49 if (MC::isBBbarMeson(pdg)) return BBbarMesonPart;
50 if (MC::isCCbarMeson(pdg)) return CCbarMesonPart;
51 if (MC::isBottomMeson(pdg)) return BottomMesonPart;
52 if (MC::isCharmMeson(pdg)) return CharmedMesonPart;
53 if (MC::isBottomBaryon(pdg)) return BottomBaryonPart;
54 if (MC::isCharmBaryon(pdg)) return CharmedBaryonPart;
56 if (MC::isLightBaryon(pdg)) return LightBaryonPart;
57 if (MC::isStrangeMeson(pdg)) return StrangeMesonPart;
58 if (MC::isLightMeson(pdg)) return LightMesonPart;
59 return Unknown;
60}

◆ defTypeOfMuon()

ParticleType MCTruthPartClassifier::defTypeOfMuon ( ParticleOrigin MuOrig,
bool isPrompt )
inline

Classify a muon (Unknown/Iso/NonIso/Bkg) from its origin; prompt muons are always Iso.

Definition at line 84 of file TruthClassifiers.h.

84 {
85
86 if (MuOrig == NonDefined) return UnknownMuon;
87
88 if (MuOrig == WBoson || MuOrig == ZBoson || MuOrig == top || MuOrig == SingleMuon || MuOrig == Higgs ||
89 MuOrig == HiggsMSSM || MuOrig == HeavyBoson || MuOrig == WBosonLRSM || MuOrig == NuREle || MuOrig == NuRMu ||
90 MuOrig == NuRTau || MuOrig == LQ || MuOrig == SUSY || MuOrig == DiBoson || MuOrig == ZorHeavyBoson ||
91 MuOrig == OtherBSM || MuOrig == MultiBoson || isPrompt) {
92 return IsoMuon;
93 }
94 if (MuOrig == JPsi || MuOrig == BottomMeson || MuOrig == CharmedMeson || MuOrig == BottomBaryon ||
95 MuOrig == CharmedBaryon || MuOrig == TauLep || MuOrig == QuarkWeakDec) {
96 return NonIsoMuon;
97 }
98 // if (MuOrig == Pion || MuOrig == Kaon ) return DecayMuon;
99 return BkgMuon;
100}

◆ defTypeOfPhoton()

ParticleType MCTruthPartClassifier::defTypeOfPhoton ( ParticleOrigin PhotOrig)
inline

Classify a photon (Unknown/Iso/NonIso/Bkg) from its origin.

Definition at line 121 of file TruthClassifiers.h.

122{
123 if (PhotOrig == NonDefined) return UnknownPhoton;
124
125 if (PhotOrig == WBoson || PhotOrig == ZBoson || PhotOrig == SinglePhot || PhotOrig == Higgs ||
126 PhotOrig == HiggsMSSM || PhotOrig == HeavyBoson || PhotOrig == PromptPhot || PhotOrig == SUSY ||
127 PhotOrig == OtherBSM)
128 return IsoPhoton;
129
130 if (PhotOrig == ISRPhot || PhotOrig == FSRPhot || PhotOrig == TauLep || PhotOrig == Mu || PhotOrig == NuREle ||
131 PhotOrig == NuRMu || PhotOrig == NuRTau)
132 return NonIsoPhoton;
133
134 return BkgPhoton;
135}

◆ defTypeOfTau()

ParticleType MCTruthPartClassifier::defTypeOfTau ( ParticleOrigin TauOrig)
inline

Classify a tau (Unknown/Iso/NonIso/Bkg) from its origin.

Definition at line 103 of file TruthClassifiers.h.

103 {
104 if (TauOrig == NonDefined) return UnknownTau;
105
106 if (TauOrig == WBoson || TauOrig == ZBoson || TauOrig == top || TauOrig == SingleMuon || TauOrig == Higgs ||
107 TauOrig == HiggsMSSM || TauOrig == HeavyBoson || TauOrig == WBosonLRSM || TauOrig == NuREle || TauOrig == NuRMu ||
108 TauOrig == NuRTau || TauOrig == SUSY || TauOrig == DiBoson || TauOrig == ZorHeavyBoson || TauOrig == OtherBSM ||
109 TauOrig == MultiBoson)
110 return IsoTau;
111
112 if (TauOrig == JPsi || TauOrig == BottomMeson || TauOrig == CharmedMeson || TauOrig == BottomBaryon ||
113 TauOrig == CharmedBaryon || TauOrig == QuarkWeakDec)
114 return NonIsoTau;
115
116 return BkgTau;
117}

◆ isPrompt()

int MCTruthPartClassifier::isPrompt ( const unsigned int classify,
bool allow_prompt_tau_decays = true )
inline

Tell whether a particle is prompt, from the word returned by defOrigOfParticle().

Parameters
allow_prompt_tau_decayscount products of prompt tau decays as prompt
Returns
1 prompt, 0 non-prompt, -1 uncategorised

Definition at line 193 of file TruthClassifiers.h.

193 {
194 std::bitset<MCTC_bits::totalBits> res(classify);
195 if (res.test(MCTC_bits::uncat)) return -1;
196 bool fromPromptTau = res.test(MCTC_bits::Tau) && !res.test(MCTC_bits::HadTau);
197 if (fromPromptTau) return int(allow_prompt_tau_decays);
198 return !res.test(MCTC_bits::hadron);
199 }
std::pair< std::vector< unsigned int >, bool > res