ATLAS Offline Software
Loading...
Searching...
No Matches
HepMC::BarcodeBased Namespace Reference

Functions

template<class T>
bool is_truth_suppressed_pileup (const T &p)
 Method to establish if a particle (or barcode) corresponds to truth-suppressed pile-up.
template<class T>
bool no_truth_link (const T &p)
 Method to establish if a if the object is linked to something which was never saved to the HepMC Truth - for example particle was too low energy to be recorded.
template<class T>
bool ignoreTruthLink (const T &p, bool vetoPileUp)
 Helper function for SDO creation in PileUpTools.
template<class T>
bool is_simulation_particle (const T &p)
 Method to establish if a particle (or barcode) was created during the simulation (only to be used in legacy TP converters)
template<class T>
bool is_sim_secondary (const T &p)
 Method to establish if a particle (or barcode) is a new seondary created during the simulation (only to be used in legacy TP converters)
template<class T>
int generations (const T &p)
 Method to return how many interactions a particle has undergone during simulation (only to be used in legacy TP converters).
template<class T>
bool is_simulation_vertex (const T &v)
 Method to establish if the vertex was created during simulation (only to be used in legacy TP converters)
template<class T1, class T2>
bool is_same_generator_particle (const T1 &p1, const T2 &p2)
 Method to establish if two particles in the GenEvent actually represent the same generated particle.
template<class T1, class T2>
bool is_same_object (const T1 &p1, const T2 &p2)
 Method to establish if two particles/vertices in the GenEvent actually represent the same generated particle.
template<class T1, class T2>
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, i.e. particle p1 was produced simulations particle p2.

Function Documentation

◆ generations()

template<class T>
int HepMC::BarcodeBased::generations ( const T & p)
inline

Method to return how many interactions a particle has undergone during simulation (only to be used in legacy TP converters).

Definition at line 212 of file MagicNumbers.h.

int barcode(const T *p)
Definition Barcode.h:16
constexpr int SIM_REGENERATION_INCREMENT
Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an intera...

◆ ignoreTruthLink()

template<class T>
bool HepMC::BarcodeBased::ignoreTruthLink ( const T & p,
bool vetoPileUp )
inline

Helper function for SDO creation in PileUpTools.

Definition at line 203 of file MagicNumbers.h.

203{ const int b = barcode(p); return no_truth_link(b) || (vetoPileUp && is_truth_suppressed_pileup(b)); }
bool is_truth_suppressed_pileup(const T &p)
Method to establish if a particle (or barcode) corresponds to truth-suppressed pile-up.
bool no_truth_link(const T &p)
Method to establish if a if the object is linked to something which was never saved to the HepMC Trut...

◆ is_same_generator_particle()

template<class T1, class T2>
bool HepMC::BarcodeBased::is_same_generator_particle ( const T1 & p1,
const T2 & p2 )
inline

Method to establish if two particles in the GenEvent actually represent the same generated particle.

Definition at line 218 of file MagicNumbers.h.

218{ int b1 = barcode(p1); int b2 = barcode(p2); return b1% SIM_REGENERATION_INCREMENT == b2 % SIM_REGENERATION_INCREMENT; }

◆ is_same_object()

template<class T1, class T2>
bool HepMC::BarcodeBased::is_same_object ( const T1 & p1,
const T2 & p2 )
inline

Method to establish if two particles/vertices in the GenEvent actually represent the same generated particle.

Definition at line 221 of file MagicNumbers.h.

221{ int b1 = uniqueID(p1); int b2 = uniqueID(p2); return b1 == b2; } // NB Still need to adapt CaloCalibrationHits
int uniqueID(const T &p)

◆ is_sim_descendant()

template<class T1, class T2>
bool HepMC::BarcodeBased::is_sim_descendant ( const T1 & p1,
const T2 & p2 )
inline

Method to check if the first particle is a descendant of the second in the simulation, i.e. particle p1 was produced simulations particle p2.

Definition at line 224 of file MagicNumbers.h.

224{ int b1 = barcode(p1); int b2 = barcode(p2); return b1 % SIM_REGENERATION_INCREMENT == b2;}

◆ is_sim_secondary()

template<class T>
bool HepMC::BarcodeBased::is_sim_secondary ( const T & p)
inline

Method to establish if a particle (or barcode) is a new seondary created during the simulation (only to be used in legacy TP converters)

Definition at line 209 of file MagicNumbers.h.

constexpr int SIM_BARCODE_THRESHOLD
Constant defining the barcode threshold for simulated particles, eg. can be used to separate generato...

◆ is_simulation_particle()

template<class T>
bool HepMC::BarcodeBased::is_simulation_particle ( const T & p)
inline

Method to establish if a particle (or barcode) was created during the simulation (only to be used in legacy TP converters)

Definition at line 206 of file MagicNumbers.h.

206{ return (barcode(p)>SIM_BARCODE_THRESHOLD);}

◆ is_simulation_vertex()

template<class T>
bool HepMC::BarcodeBased::is_simulation_vertex ( const T & v)
inline

Method to establish if the vertex was created during simulation (only to be used in legacy TP converters)

Definition at line 215 of file MagicNumbers.h.

215{ return (barcode(v)<-SIM_BARCODE_THRESHOLD);}

◆ is_truth_suppressed_pileup()

template<class T>
bool HepMC::BarcodeBased::is_truth_suppressed_pileup ( const T & p)
inline

Method to establish if a particle (or barcode) corresponds to truth-suppressed pile-up.

Definition at line 197 of file MagicNumbers.h.

197{ return (barcode(p) == SUPPRESSED_PILEUP_BARCODE);}
constexpr int SUPPRESSED_PILEUP_BARCODE(std::numeric_limits< int32_t >::max())
This barcode is used by objects matched to particles from pile-up interactions in standard MC Product...

◆ no_truth_link()

template<class T>
bool HepMC::BarcodeBased::no_truth_link ( const T & p)
inline

Method to establish if a if the object is linked to something which was never saved to the HepMC Truth - for example particle was too low energy to be recorded.

Definition at line 200 of file MagicNumbers.h.

200{ return (barcode(p) == UNDEFINED_ID);}
constexpr int UNDEFINED_ID