ATLAS Offline Software
Loading...
Searching...
No Matches
MC::HepMC::ShortEventAttribute Class Reference

#include <HepMCHelpers.h>

Inheritance diagram for MC::HepMC::ShortEventAttribute:
Collaboration diagram for MC::HepMC::ShortEventAttribute:

Public Member Functions

 ShortEventAttribute ()
 ShortEventAttribute (const HepMC3::GenEvent *e)
bool from_event (const HepMC3::GenEvent *e)
bool from_string (const std::string &att) override
bool to_string (std::string &fl) const override
void resize ()

Public Attributes

int NUP = 0
int IDPRUP = 0
double XWGTUP = 0
double SCALUP = 0
double AQEDUP = 0
double AQCDUP = 0
std::vector< long > IDUP {}
std::vector< int > ISTUP {}
std::vector< std::pair< int, int > > MOTHUP {}
std::vector< std::pair< int, int > > ICOLUP {}
std::vector< std::vector< double > > PUP {}
std::vector< double > VTIMUP {}
std::vector< double > SPINUP {}

Detailed Description

Definition at line 41 of file HepMCHelpers.h.

Constructor & Destructor Documentation

◆ ShortEventAttribute() [1/2]

MC::HepMC::ShortEventAttribute::ShortEventAttribute ( )
inline

Definition at line 43 of file HepMCHelpers.h.

◆ ShortEventAttribute() [2/2]

MC::HepMC::ShortEventAttribute::ShortEventAttribute ( const HepMC3::GenEvent * e)
inline

Definition at line 44 of file HepMCHelpers.h.

Member Function Documentation

◆ from_event()

bool MC::HepMC::ShortEventAttribute::from_event ( const HepMC3::GenEvent * e)
inline

Definition at line 46 of file HepMCHelpers.h.

49
51 template <class T> inline bool isStable(const T& p) { return HepMC::status(p)%HepMC::SIM_STATUS_THRESHOLD == 1;}
52
54 template <class T> inline bool isFinalState(const T& p) { return HepMC::status(p)%HepMC::SIM_STATUS_THRESHOLD == 1 && !p->end_vertex();}
55
57 template <class T> inline bool isPhysical(const T& p) { return isStable<T>(p) || isDecayed<T>(p); }
58
60 template <class T> inline bool isGenStable(const T& p) { return isStable<T>(p) && !HepMC::is_simulation_particle<T>(p);}
61
63 template <class T> inline bool isSimStable(const T& p) { return isStable<T>(p) && !p->end_vertex() && HepMC::is_simulation_particle<T>(p);}
64
66 template <class T> inline bool isSimInteracting(const T& p) { return isGenStable<T>(p) && isInteracting<T>(p);}
67
71 template <class T> inline bool isStableOrSimDecayed(const T& p) {
72 const auto vertex = p->end_vertex();
73 return ( isStable<T>(p) || (isDecayed<T>(p) && (!vertex || HepMC::is_simulation_vertex(vertex))));
74 }
75
77 template <class T> inline bool isZeroEnergyPhoton(const T& p) { return isPhoton<T>(p) && p->e() == 0;}
78
80 template <class T> inline bool isSpecialNonInteracting(const T& p) {
81 const int apid = std::abs(p->pdg_id());
82 if (apid == NU_E || apid == NU_MU || apid == NU_TAU) return true; //< neutrinos
83 if (apid == 1000022 || apid == 1000024 || apid == 5100022) return true; // SUSY & KK photon and Z partners
84 if (apid == GRAVITON || apid == 1000039 || apid == 5000039) return true; //< gravitons: standard, SUSY and KK
85 if (apid == 9000001 || apid == 9000002 || apid == 9000003 || apid == 9000004 || apid == 9000005 || apid == 9000006) return true; //< exotic particles from monotop model
86 return false;
87 }
88
90
bool is_simulation_vertex(const T &v)
Method to establish if the vertex was created during simulation (TODO migrate to be based on status).
constexpr int SIM_STATUS_THRESHOLD
Constant definiting the status threshold for simulated particles, eg. can be used to separate generat...
int status(const T &p)
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...
static const int GRAVITON
bool isZeroEnergyPhoton(const T &p)
Identify a photon with zero energy. Probably a workaround for a generator bug.
bool isStableOrSimDecayed(const T &p)
Identify if particle is satble or decayed in simulation.
bool isPhoton(const T &p)
bool isSpecialNonInteracting(const T &p)
Identify a special non-interacting particles.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
bool isSimInteracting(const T &p)
Identify if the particle could interact with the detector during the simulation, e....
bool isInteracting(const T &p)
Identify if the particle with given PDG ID would not interact with the detector, i....
static const int NU_MU
bool isDecayed(const T &p)
Identify if the particle decayed.
static const int NU_E
static const int NU_TAU
bool isFinalState(const T &p)
Identify if the particle is final state particle.
bool isGenStable(const T &p)
Determine if the particle is stable at the generator (not det-sim) level,.
bool isSimStable(const T &p)
Identify if the particle is considered stable at the post-detector-sim stage.
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.

◆ from_string()

bool MC::HepMC::ShortEventAttribute::from_string ( const std::string & att)
inlineoverride

Definition at line 92 of file HepMCHelpers.h.

103 {
104 if (itr != 0) partOriVert = MothOriVert;
105 for ( const auto& p : particles_in(partOriVert) ) {
106 theMoth = p;
107 if (!theMoth) continue;
108 MotherPDG = theMoth->pdg_id();
109 MothOriVert = theMoth->production_vertex();
110 if (MotherPDG == partPDG) break;
111 }
112 itr++;
113 if (itr > 100) {
114 break;
115 }
116 } while (MothOriVert != nullptr && MotherPDG == partPDG && !HepMC::is_simulation_particle(thePart) &&
117 MothOriVert != partOriVert);
118 return theMoth;
119 }
120
auto particles_in(const VTX *p)

◆ resize()

void MC::HepMC::ShortEventAttribute::resize ( )
inline

Definition at line 148 of file HepMCHelpers.h.

149 : prodVtx->particles_in()) {
150 if (!theMother) continue;
151 allancestors.insert(theMother);
152 findParticleAncestors(theMother, allancestors);
153 }
154 }
155
void findParticleAncestors(T thePart, std::set< T > &allancestors)
Function to find all ancestors of the particle.

◆ to_string()

bool MC::HepMC::ShortEventAttribute::to_string ( std::string & fl) const
inlineoverride

Definition at line 122 of file HepMCHelpers.h.

123 {
124 T ptrPart = nullptr;
125 if (!p) return ptrPart;
126 if constexpr (std::is_pointer_v<C> || HepMC::is_smart_ptr_v<C>){ //C is ptr
127 for (T truthParticle : *TruthContainer) {
128 if (HepMC::is_sim_descendant(p,truthParticle)) {
129 ptrPart = truthParticle;
130 break;
131 }
132 }
133 }
134 else {
135 for (T truthParticle : TruthContainer) {
136 if (HepMC::is_sim_descendant(p,truthParticle)) {
137 ptrPart = truthParticle;
138 break;
139 }
140 }
141 }
142 return ptrPart;
143 }
145
146 template <class T> void findParticleAncestors(T thePart, std::set<T>& allancestors) {
constexpr bool is_smart_ptr_v
bool is_sim_descendant(const T1 &p1, const T2 &p2)
Method to check if the first particle is a descendant of the second in the simulation,...
unsigned long long T

Member Data Documentation

◆ AQCDUP

double MC::HepMC::ShortEventAttribute::AQCDUP = 0

Definition at line 163 of file HepMCHelpers.h.

◆ AQEDUP

double MC::HepMC::ShortEventAttribute::AQEDUP = 0

Definition at line 162 of file HepMCHelpers.h.

◆ ICOLUP

std::vector< std::pair<int,int> > MC::HepMC::ShortEventAttribute::ICOLUP {}

Definition at line 167 of file HepMCHelpers.h.

◆ IDPRUP

int MC::HepMC::ShortEventAttribute::IDPRUP = 0

Definition at line 159 of file HepMCHelpers.h.

◆ IDUP

std::vector<long> MC::HepMC::ShortEventAttribute::IDUP {}

Definition at line 164 of file HepMCHelpers.h.

◆ ISTUP

std::vector<int> MC::HepMC::ShortEventAttribute::ISTUP {}

Definition at line 165 of file HepMCHelpers.h.

◆ MOTHUP

std::vector< std::pair<int,int> > MC::HepMC::ShortEventAttribute::MOTHUP {}

Definition at line 166 of file HepMCHelpers.h.

◆ NUP

int MC::HepMC::ShortEventAttribute::NUP = 0

Definition at line 158 of file HepMCHelpers.h.

◆ PUP

std::vector< std::vector<double> > MC::HepMC::ShortEventAttribute::PUP {}

Definition at line 168 of file HepMCHelpers.h.

◆ SCALUP

double MC::HepMC::ShortEventAttribute::SCALUP = 0

Definition at line 161 of file HepMCHelpers.h.

◆ SPINUP

std::vector<double> MC::HepMC::ShortEventAttribute::SPINUP {}

Definition at line 170 of file HepMCHelpers.h.

◆ VTIMUP

std::vector<double> MC::HepMC::ShortEventAttribute::VTIMUP {}

Definition at line 169 of file HepMCHelpers.h.

◆ XWGTUP

double MC::HepMC::ShortEventAttribute::XWGTUP = 0

Definition at line 160 of file HepMCHelpers.h.


The documentation for this class was generated from the following file: