ATLAS Offline Software
Loading...
Searching...
No Matches
MCTruthPartClassifier::ParticleDef Struct Reference

#include <TruthClassifiers.h>

Collaboration diagram for MCTruthPartClassifier::ParticleDef:

Public Attributes

std::vector< std::string > sParticleType
 the vector of particle types
std::vector< std::string > sParticleOrigin
 the vector of particle origin
std::vector< std::string > sParticleOutCome
 the vector of particle out come

Detailed Description

Definition at line 123 of file TruthClassifiers.h.

Member Data Documentation

◆ sParticleOrigin

std::vector< std::string > ParticleDef::sParticleOrigin

the vector of particle origin

Definition at line 168 of file TruthClassifiers.h.

180 {
181 std::bitset<MCTC_bits::totalBits> res(classify);
182 if (res.test(MCTC_bits::uncat)) return -1;
183 bool fromPromptTau = res.test(MCTC_bits::Tau) && !res.test(MCTC_bits::HadTau);
184 if (fromPromptTau) return int(allow_prompt_tau_decays);
185 return !res.test(MCTC_bits::hadron);
186 }
187
188template <class T>
190 ParticleOutCome PartOutCome = UnknownOutCome;
191 auto EndVert = MC::findSimulatedEndVertex(thePart);
192 if (EndVert == nullptr) return NonInteract;
193
194 int ElecOutNumOfNucFr(0);
195 int ElecOutNumOfElec(0);
196 int NumOfHadr(0);
197 auto outgoing = EndVert->particles_out();
198 int NumOfElecDaug = outgoing.size();
199 for (const auto& p: outgoing) {
200 if (!p) continue;
201 int EndDaugType = p->pdg_id();
202 if (MC::isElectron(EndDaugType)) ElecOutNumOfElec++;
203 if (MC::isHadron(p) && !MC::isBeam(p)) NumOfHadr++;
204 if (EndDaugType > 1000000000 || EndDaugType == 0 || abs(EndDaugType) == 2212 || abs(EndDaugType) == 2112) ElecOutNumOfNucFr++;
205 }
206
207 if (ElecOutNumOfNucFr != 0 || NumOfHadr != 0) PartOutCome = NuclInteraction;
208 if (ElecOutNumOfElec == 1 && NumOfElecDaug == 1) PartOutCome = ElectrMagInter;
209
210 return PartOutCome;
211}
212template <class T>
214 ParticleOutCome PartOutCome = UnknownOutCome;
215 auto EndVert = MC::findSimulatedEndVertex(thePart);
216 if (EndVert == nullptr) return NonInteract;
std::pair< std::vector< unsigned int >, bool > res
ParticleOutCome defOutComeOfElectron(T thePart)
ParticleOutCome defOutComeOfMuon(T thePart)
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.

◆ sParticleOutCome

std::vector< std::string > ParticleDef::sParticleOutCome
Initial value:
{
"NonDefinedOutCome",
"UnknownOutCome",
"UnConverted",
"Converted",
"NonInteract",
"NuclInteraction",
"ElectrMagInter",
"DecaytoElectron",
"DecaytoMuon",
"OneProng",
"ThreeProng",
"FiveProng"}

the vector of particle out come

Definition at line 219 of file TruthClassifiers.h.

224 : outgoing) {
225 if (!p) continue;
226 int EndDaugType = p->pdg_id();
227 if (MC::isElectron(EndDaugType)) NumOfElec++;
228 if (abs(EndDaugType) == 12) NumOfEleNeutr++;
229 if (abs(EndDaugType) == 14) NumOfMuonNeutr++;
230 if (MC::isHadron(p) && !MC::isBeam(p)) NumOfHadr++;
231 if (EndDaugType > 1000000000 || EndDaugType == 0 || abs(EndDaugType) == 2212 || abs(EndDaugType) == 2112) MuOutNumOfNucFr++;

◆ sParticleType

std::vector< std::string > ParticleDef::sParticleType

the vector of particle types

Definition at line 125 of file TruthClassifiers.h.

131 {
132 ParticleOrigin partOrig = NonDefined;
133 for (const auto& it: allJetMothers) {
134 int pdg = abs(it->pdg_id());
135 if (MC::isTop(pdg)) partOrig = top;
136 if (MC::isZ(pdg)) partOrig = ZBoson;
137 if (MC::isW(pdg) && !(partOrig == top)) partOrig = WBoson;
138 if ((MC::isQuark(pdg) || MC::isGluon(pdg)) && partOrig != top && partOrig != ZBoson && partOrig != WBoson) partOrig = QCD;
139 if (MC::isHiggs(pdg)) return Higgs;
140 if (pdg == 35 || pdg == 36 || pdg == 37) return HiggsMSSM;
141 if (pdg == 32 || pdg == 33 || pdg == 34) return HeavyBoson;
142 if (pdg == 42) return LQ;
143 if (MC::isSUSY(pdg)) return SUSY;
144 if (MC::isBSM(pdg)) return OtherBSM;
145 }
146 return partOrig;
147}
148 enum MCTC_bits : unsigned int { HadTau=0, Tau, hadron, frombsm, uncat, isbsm, isgeant, stable, totalBits };
149
150template <class T>
151std::tuple<unsigned int, T> defOrigOfParticle(T thePart) {
152
153 T parent_hadron_ptr = nullptr;
154
155 bool uncat = 0, fromHad = 0, fromTau = 0;
156 bool isPhysical = MC::isPhysical(thePart);
157 bool isGeant = HepMC::is_simulation_particle(thePart);
158 bool isBSM = MC::isBSM(thePart);
159 bool fromBSM = isBSM; // just to initialise
160
161 auto prodVtx = thePart->production_vertex();
162 if (isPhysical && prodVtx && !isGeant) {
163 fromHad = MC::isFromHadron(thePart, parent_hadron_ptr, fromTau, fromBSM);
164 }
165 else uncat = 1;
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.
Definition AtlasPID.h:846
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...
std::tuple< unsigned int, T > defOrigOfParticle(T thePart)
bool isZ(const T &p)
bool isW(const T &p)
bool isTop(const T &p)
bool isFromHadron(T p, T hadron, bool &fromTau, bool &fromBSM)
Function to classify the particle.
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 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.
unsigned long long T

The documentation for this struct was generated from the following files: