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.

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)

◆ 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.

47
49 template <class T> inline bool isFinalState(const T& p) { return HepMC::status(p)%HepMC::SIM_STATUS_THRESHOLD == 1 && !p->end_vertex();}
50
52 template <class T> inline bool isPhysical(const T& p) { return isStable<T>(p) || isDecayed<T>(p); }
53
55 template <class T> inline bool isGenStable(const T& p) { return isStable<T>(p) && !HepMC::is_simulation_particle<T>(p);}
56
58 template <class T> inline bool isSimStable(const T& p) { return isStable<T>(p) && !p->end_vertex() && HepMC::is_simulation_particle<T>(p);}
59
61 template <class T> inline bool isSimInteracting(const T& p) { return isGenStable<T>(p) && isInteracting<T>(p);}
62
66 template <class T> inline bool isStableOrSimDecayed(const T& p) {
67 const auto vertex = p->end_vertex();
68 return ( isStable<T>(p) || (isDecayed<T>(p) && (!vertex || HepMC::is_simulation_vertex(vertex))));
69 }
70
72 template <class T> inline bool isZeroEnergyPhoton(const T& p) { return isPhoton<T>(p) && p->e() == 0;}
73
75 template <class T> inline bool isSpecialNonInteracting(const T& p) {
76 const int apid = std::abs(p->pdg_id());
77 if (apid == NU_E || apid == NU_MU || apid == NU_TAU) return true; //< neutrinos
78 if (apid == 1000022 || apid == 1000024 || apid == 5100022) return true; // SUSY & KK photon and Z partners
79 if (apid == GRAVITON || apid == 1000039 || apid == 5000039) return true; //< gravitons: standard, SUSY and KK
80 if (apid == 9000001 || apid == 9000002 || apid == 9000003 || apid == 9000004 || apid == 9000005 || apid == 9000006) return true; //< exotic particles from monotop model
81 return false;
82 }
83
85
86 template <class T> T findMother(T thePart) {
87 auto partOriVert = thePart->production_vertex();
88 if (!partOriVert) return nullptr;
89
90 long partPDG = thePart->pdg_id();
bool is_simulation_vertex(const T &v)
Method to establish if the vertex was created during simulation (TODO migrate to be based on status).
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.
T findMother(T thePart)
Function to get a mother of particle. MCTruthClassifier legacy.
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.
unsigned long long T

◆ from_string()

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

Definition at line 92 of file HepMCHelpers.h.

98 {
99 if (itr != 0) partOriVert = MothOriVert;
100 for ( const auto& p : partOriVert->particles_in() ) {
101 theMoth = p;
102 if (!theMoth) continue;
103 MotherPDG = theMoth->pdg_id();
104 MothOriVert = theMoth->production_vertex();
105 if (MotherPDG == partPDG) break;
106 }
107 itr++;
108 if (itr > 100) {
109 break;
110 }
111 } while (MothOriVert != nullptr && MotherPDG == partPDG && !HepMC::is_simulation_particle(thePart) &&
112 MothOriVert != partOriVert);
113 return theMoth;
114 }
115
117
118 template <class C, class T> T findMatching(C TruthContainer, T p) {
119 T ptrPart = nullptr;
120 if (!p) return ptrPart;
struct color C
T findMatching(C TruthContainer, T p)
Function to find a particle in container.

◆ resize()

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

Definition at line 148 of file HepMCHelpers.h.

153 {
154 auto endVtx = thePart->end_vertex();
155 if (!endVtx) return;
156 for (const auto& theDaughter: endVtx->particles_out()) {

◆ to_string()

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

Definition at line 122 of file HepMCHelpers.h.

122 : *TruthContainer) {
123 if (HepMC::is_sim_descendant(p,truthParticle)) {
124 ptrPart = truthParticle;
125 break;
126 }
127 }
128 }
129 else {
130 for (T truthParticle : TruthContainer) {
131 if (HepMC::is_sim_descendant(p,truthParticle)) {
132 ptrPart = truthParticle;
133 break;
134 }
135 }
136 }
137 return ptrPart;
138 }
140
141 template <class T> void findParticleAncestors(T thePart, std::set<T>& allancestors) {
142 auto prodVtx = thePart->production_vertex();
143 if (!prodVtx) return;
144 for (const auto& theMother: prodVtx->particles_in()) {
145 if (!theMother) continue;
146 allancestors.insert(theMother);
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,...
void findParticleAncestors(T thePart, std::set< T > &allancestors)
Function to find all ancestors of the particle.

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.

169{

◆ 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: