ATLAS Offline Software
Namespaces | Classes | Typedefs | Functions | Variables
HepMC Namespace Reference

Namespaces

 BarcodeBased
 
 Print
 
 StatusBased
 

Classes

struct  DataPool
 
struct  is_smart_ptr
 
struct  is_smart_ptr< std::shared_ptr< T > >
 
struct  is_smart_ptr< std::unique_ptr< T > >
 
struct  is_smart_ptr< std::weak_ptr< T > >
 
struct  remove_smart_pointer
 
struct  remove_smart_pointer< std::shared_ptr< T > >
 
struct  remove_smart_pointer< std::unique_ptr< T > >
 
struct  remove_smart_pointer< std::weak_ptr< T > >
 

Typedefs

typedef GenParticleGenParticlePtr
 
typedef const GenParticleConstGenParticlePtr
 
typedef HepMC::GenVertex * GenVertexPtr
 
typedef const HepMC::GenVertex * ConstGenVertexPtr
 
typedef HepMC::PdfInfo * GenPdfInfoPtr
 
template<class T >
using remove_smart_pointer_t = typename remove_smart_pointer< T >::type
 

Functions

template<class T >
int barcode (const T *p)
 
int barcode (int p)
 
template<class T , std::enable_if_t<!std::is_pointer< T >::value &&!std::is_same< T, int >::value, bool > = true>
int barcode (const T &p)
 
template<class T >
int flow (const T &a, int i)
 
template<class T >
Flow flow (const T &a)
 
bool set_ll_event_number (HepMC::GenEvent *e, long long int num)
 
long long int get_ll_event_number (const HepMC::GenEvent *e)
 
GenEvent::particle_iterator begin (HepMC::GenEvent &e)
 
GenEvent::particle_iterator end (HepMC::GenEvent &e)
 
GenEvent::particle_const_iterator begin (const HepMC::GenEvent &e)
 
GenEvent::particle_const_iterator end (const HepMC::GenEvent &e)
 
GenEvent * newGenEvent (const int a, const int b)
 
GenVertex * signal_process_vertex (const GenEvent *e)
 
void fillBarcodesAttribute (GenEvent *)
 
GenVertex * barcode_to_vertex (const GenEvent *e, int id)
 
GenParticlebarcode_to_particle (const GenEvent *e, int id)
 
int mpi (const GenEvent &e)
 
int mpi (const GenEvent *e)
 
int signal_process_id (const GenEvent &e)
 
int signal_process_id (const GenEvent *e)
 
void set_signal_process_id (GenEvent *e, const int i)
 
void set_mpi (GenEvent *e, const int i)
 
template<class T >
void set_random_states (GenEvent *e, std::vector< T > a)
 
template<class T >
void set_signal_process_vertex (GenEvent *e, T v)
 
GenEvent * copyemptyGenEvent (const GenEvent *inEvt)
 
template<class T >
bool suggest_barcode (T &p, int i)
 
template<class T >
bool suggest_barcode (T *p, int i)
 
template<>
bool suggest_barcode< std::unique_ptr< HepMC::GenParticle > > (std::unique_ptr< HepMC::GenParticle > &p, int i)
 
bool valid_beam_particles (const GenEvent *e)
 
GenParticlePtr newGenParticlePtr (const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
 
int barcode_or_id (const ConstGenParticlePtr &p)
 
std::ostream & operator<< (std::ostream &os, const GenParticle *p)
 
GenVertex::particles_out_const_iterator begin (const HepMC::GenVertex &v)
 
GenVertex::particles_out_const_iterator end (const HepMC::GenVertex &v)
 
GenVertexPtr newGenVertexPtr (const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
 
int barcode_or_id (const ConstGenVertexPtr &p)
 
std::ostream & operator<< (std::ostream &os, const GenVertex *v)
 
template<class T >
void set_polarization (T &a, Polarization b)
 
template<class T >
Polarization polarization (const T &a)
 
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 Production. More...
 
template<typename T >
int uniqueID (const T &p)
 
template<typename T >
int status (const T &p)
 
template<>
int status (const ConstGenVertexPtr &v1)
 
template<>
int status (const GenVertexPtr &v1)
 
template<class T >
void get_particle_history (const T &p, std::deque< int > &out, const int direction=0)
 Function to calculate all the descendants(direction=1)/ancestors(direction=-1) of the particle. More...
 
template<class T >
std::deque< int > simulation_history (const T &p, const int direction)
 Function to calculate all the descendants(direction=1)/ancestors(direction=-1) of the particle. More...
 
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 (TODO update to be status based) More...
 
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. More...
 
template<class T >
bool ignoreTruthLink (const T &p, bool vetoPileUp)
 Helper function for SDO creation in PileUpTools. More...
 
template<class T >
bool is_simulation_particle (const T &p)
 Method to establish if a particle (or barcode) was created during the simulation (TODO update to be status based) More...
 
template<class T >
int generations (const T &p)
 Method to return how many interactions a particle has undergone during simulation (TODO migrate to be based on status). More...
 
template<class T >
bool is_simulation_vertex (const T &v)
 Method to establish if the vertex was created during simulation (TODO migrate to be based on status). More...
 
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. More...
 
template<class T1 , class T2 >
bool is_same_particle (const T1 &p1, const T2 &p2)
 Method to establish if two particles in the GenEvent actually represent the same particle. More...
 
template<class T1 , class T2 >
bool is_same_vertex (const T1 &p1, const T2 &p2)
 Method to establish if two particles in the GenEvent actually represent the same vertex. More...
 
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. More...
 
template<class T >
void old_to_new_simulation_scheme (T &evt)
 Function that converts the old scheme of labeling the simulation particles (barcodes) into the new scheme (statuses). More...
 
int new_particle_status_from_old (const int oldStatus, const int barcode)
 Get particle status in the new scheme from the barcode and status in the old scheme. More...
 
int old_particle_status_from_new (const int newStatus)
 Get particle status in the old scheme from the status in the new scheme. More...
 
int new_vertex_status_from_old (const int oldStatus, const int barcode)
 Get vertex status in the new scheme from the barcode and status in the old scheme. More...
 
int old_vertex_status_from_new (const int newStatus)
 Get vertex status in the old scheme from the status in the new scheme. More...
 
int maxGeneratedParticleBarcode (const HepMC::GenEvent *genEvent)
 Get the maximal value of barcode of particle present in the event. More...
 
int maxGeneratedVertexBarcode (const HepMC::GenEvent *genEvent)
 Get the maximal absolute value of barcode of vertex present in the event. Returns a negative number. More...
 

Variables

constexpr int SIM_BARCODE_THRESHOLD = 200000
 Constant defining the barcode threshold for simulated particles, eg. can be used to separate generator event record entries from simulated particles. More...
 
constexpr int SIM_REGENERATION_INCREMENT = 1000000
 Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an interaction. More...
 
constexpr int SIM_STATUS_INCREMENT = 100000
 Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an interaction. More...
 
constexpr int SIM_STATUS_THRESHOLD = 20000
 Constant definiting the status threshold for simulated particles, eg. can be used to separate generator event record entries from simulated particles. More...
 
constexpr int FORWARD_TRANSPORT_MODEL_PROCESS = 212
 Special Forward transport Geant process for vertices. More...
 
constexpr int INVALID_PARTICLE_BARCODE = -1
 
constexpr int UNDEFINED_ID = 0
 
constexpr int INVALID_PARTICLE_ID = -1
 
constexpr int INVALID_VERTEX_ID = 1
 
template<class T >
constexpr bool is_smart_ptr_v = is_smart_ptr<T>::value
 

Typedef Documentation

◆ ConstGenParticlePtr

Definition at line 38 of file GenParticle.h.

◆ ConstGenVertexPtr

typedef const HepMC::GenVertex * HepMC::ConstGenVertexPtr

Definition at line 60 of file GenVertex.h.

◆ GenParticlePtr

Definition at line 37 of file GenParticle.h.

◆ GenPdfInfoPtr

typedef HepMC::PdfInfo* HepMC::GenPdfInfoPtr

Definition at line 17 of file PdfInfo.h.

◆ GenVertexPtr

typedef HepMC::GenVertex * HepMC::GenVertexPtr

Definition at line 59 of file GenVertex.h.

◆ remove_smart_pointer_t

template<class T >
using HepMC::remove_smart_pointer_t = typedef typename remove_smart_pointer<T>::type

Definition at line 72 of file MagicNumbers.h.

Function Documentation

◆ barcode() [1/3]

template<class T , std::enable_if_t<!std::is_pointer< T >::value &&!std::is_same< T, int >::value, bool > = true>
int HepMC::barcode ( const T &  p)
inline

Definition at line 57 of file Barcode.h.

57 { return p.barcode();}

◆ barcode() [2/3]

template<class T >
int HepMC::barcode ( const T *  p)
inline

Definition at line 16 of file Barcode.h.

16 { return p->barcode(); }

◆ barcode() [3/3]

int HepMC::barcode ( int  p)
inline

Definition at line 17 of file Barcode.h.

17 { return p; }

◆ barcode_or_id() [1/2]

int HepMC::barcode_or_id ( const ConstGenParticlePtr p)
inline

Definition at line 42 of file GenParticle.h.

42 { return p->barcode();}

◆ barcode_or_id() [2/2]

int HepMC::barcode_or_id ( const ConstGenVertexPtr p)
inline

Definition at line 71 of file GenVertex.h.

71 { return p->barcode();}

◆ barcode_to_particle()

GenParticle* HepMC::barcode_to_particle ( const GenEvent *  e,
int  id 
)
inline

Definition at line 628 of file GenEvent.h.

628 {return e->barcode_to_particle(id);}

◆ barcode_to_vertex()

GenVertex* HepMC::barcode_to_vertex ( const GenEvent *  e,
int  id 
)
inline

Definition at line 627 of file GenEvent.h.

627 {return e->barcode_to_vertex(id);}

◆ begin() [1/3]

GenEvent::particle_const_iterator HepMC::begin ( const HepMC::GenEvent &  e)
inline

Definition at line 622 of file GenEvent.h.

622 { return e.particles_begin(); }

◆ begin() [2/3]

GenVertex::particles_out_const_iterator HepMC::begin ( const HepMC::GenVertex &  v)
inline

Definition at line 61 of file GenVertex.h.

61 { return v.particles_out_const_begin(); }

◆ begin() [3/3]

GenEvent::particle_iterator HepMC::begin ( HepMC::GenEvent &  e)
inline

Definition at line 620 of file GenEvent.h.

620 { return e.particles_begin(); }

◆ copyemptyGenEvent()

GenEvent* HepMC::copyemptyGenEvent ( const GenEvent *  inEvt)
inline

Definition at line 653 of file GenEvent.h.

653  {
654  HepMC::GenEvent* outEvt = new HepMC::GenEvent( inEvt->signal_process_id(), inEvt->event_number() );
655  outEvt->set_mpi ( inEvt->mpi() );
656  outEvt->set_event_scale ( inEvt->event_scale() );
657  outEvt->set_alphaQCD ( inEvt->alphaQCD() );
658  outEvt->set_alphaQED ( inEvt->alphaQED() );
659  outEvt->weights() = inEvt->weights();
660  outEvt->set_random_states( inEvt->random_states() );
661  if ( nullptr != inEvt->heavy_ion() ) {
662  outEvt->set_heavy_ion ( *inEvt->heavy_ion() );
663  }
664  if ( nullptr != inEvt->pdf_info() ) {
665  outEvt->set_pdf_info ( *inEvt->pdf_info() );
666  }
667  return outEvt;
668 }

◆ end() [1/3]

GenEvent::particle_const_iterator HepMC::end ( const HepMC::GenEvent &  e)
inline

Definition at line 623 of file GenEvent.h.

623 { return e.particles_end(); }

◆ end() [2/3]

GenVertex::particles_out_const_iterator HepMC::end ( const HepMC::GenVertex &  v)
inline

Definition at line 62 of file GenVertex.h.

62 { return v.particles_out_const_end(); }

◆ end() [3/3]

GenEvent::particle_iterator HepMC::end ( HepMC::GenEvent &  e)
inline

Definition at line 621 of file GenEvent.h.

621 { return e.particles_end(); }

◆ fillBarcodesAttribute()

void HepMC::fillBarcodesAttribute ( GenEvent *  )
inline

Definition at line 626 of file GenEvent.h.

626 { }

◆ flow() [1/2]

template<class T >
Flow HepMC::flow ( const T &  a)

Definition at line 52 of file Flow.h.

52 {return a->flow();}

◆ flow() [2/2]

template<class T >
int HepMC::flow ( const T &  a,
int  i 
)

Definition at line 51 of file Flow.h.

51 {return a->flow(i);}

◆ generations()

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

Method to return how many interactions a particle has undergone during simulation (TODO migrate to be based on status).

Definition at line 345 of file MagicNumbers.h.

345 { return BarcodeBased::generations(p);}

◆ get_ll_event_number()

long long int HepMC::get_ll_event_number ( const HepMC::GenEvent *  e)
inline

Definition at line 617 of file GenEvent.h.

617  {
618  return e->event_number();
619 }

◆ get_particle_history()

template<class T >
void HepMC::get_particle_history ( const T &  p,
std::deque< int > &  out,
const int  direction = 0 
)
inline

Function to calculate all the descendants(direction=1)/ancestors(direction=-1) of the particle.

Definition at line 151 of file MagicNumbers.h.

151  {
152  if (direction < 0) {
153  if (p->status()>SIM_STATUS_INCREMENT) {
154  auto pv = p->production_vertex();
155  if (pv) {
156  for (auto pa: pv->particles_in()) {
157  if (pa->pdg_id() != p->pdg_id()) continue;
158  out.push_front(uniqueID(p));
159  get_particle_history(pa, out, -1);
160  break;
161  }
162  }
163  }
164  }
165  if (direction > 0) {
166  if (p->status()>SIM_STATUS_INCREMENT) {
167  auto pv = p->end_vertex();
168  if (pv) {
169  for (auto pa: pv->particles_out()) {
170  if (pa->pdg_id() != p->pdg_id()) continue;
171  out.push_back(uniqueID(p));
172  get_particle_history(pa, out, 1);
173  break;
174  }
175  }
176  }
177  }
178  }

◆ ignoreTruthLink()

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

Helper function for SDO creation in PileUpTools.

Definition at line 332 of file MagicNumbers.h.

332  {
333  if constexpr (std::is_same_v<std::remove_const_t<remove_smart_pointer_t<std::remove_pointer_t<T>>>, HepMcParticleLink>) {
334  return StatusBased::ignoreTruthLink(p, vetoPileUp);
335  }
336  else {
337  return BarcodeBased::ignoreTruthLink(p, vetoPileUp);
338  }
339  }

◆ is_same_generator_particle()

template<class T1 , class T2 >
bool HepMC::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 351 of file MagicNumbers.h.

◆ is_same_particle()

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

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

Definition at line 354 of file MagicNumbers.h.

354 { return BarcodeBased::is_same_object(p1, p2); }

◆ is_same_vertex()

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

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

Definition at line 357 of file MagicNumbers.h.

357 { return BarcodeBased::is_same_object(p1, p2); }

◆ is_sim_descendant()

template<class T1 , class T2 >
bool HepMC::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 360 of file MagicNumbers.h.

◆ is_simulation_particle()

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

Method to establish if a particle (or barcode) was created during the simulation (TODO update to be status based)

Definition at line 342 of file MagicNumbers.h.

◆ is_simulation_vertex()

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

Method to establish if the vertex was created during simulation (TODO migrate to be based on status).

Definition at line 348 of file MagicNumbers.h.

◆ is_truth_suppressed_pileup()

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

Method to establish if a particle (or barcode) corresponds to truth-suppressed pile-up (TODO update to be status based)

Definition at line 319 of file MagicNumbers.h.

319  {
320  if constexpr (std::is_same_v<std::remove_const_t<remove_smart_pointer_t<std::remove_pointer_t<T>>>, HepMcParticleLink>) {
322  }
323  else {
325  }
326  }

◆ maxGeneratedParticleBarcode()

int HepMC::maxGeneratedParticleBarcode ( const HepMC::GenEvent *  genEvent)
inline

Get the maximal value of barcode of particle present in the event.

Definition at line 415 of file MagicNumbers.h.

415  {
416  int maxBarcode = 0;
417 #ifdef HEPMC3
418  auto allbarcodes = genEvent->attribute<HepMC::GenEventBarcodes>("barcodes");
419  for (const auto& bp: allbarcodes->barcode_to_particle_map()) {
420  if (!HepMC::BarcodeBased::is_simulation_particle(bp.first)) { maxBarcode=std::max(maxBarcode,bp.first); }
421  }
422 #else
423  for (auto currentGenParticle: *genEvent) {
424  const int barcode=HepMC::barcode(currentGenParticle);
425  if (barcode > maxBarcode && !HepMC::BarcodeBased::is_simulation_particle(barcode)) { maxBarcode=barcode; }
426  }
427 #endif
428  return maxBarcode;
429 }

◆ maxGeneratedVertexBarcode()

int HepMC::maxGeneratedVertexBarcode ( const HepMC::GenEvent *  genEvent)
inline

Get the maximal absolute value of barcode of vertex present in the event. Returns a negative number.

Definition at line 432 of file MagicNumbers.h.

432  {
433  int maxBarcode=0;
434 #ifdef HEPMC3
435  auto allbarcodes = genEvent->attribute<HepMC::GenEventBarcodes>("barcodes");
436  for (const auto& bp: allbarcodes->barcode_to_vertex_map()) {
437  if (!HepMC::BarcodeBased::is_simulation_vertex(bp.first)) { maxBarcode=std::min(maxBarcode,bp.first); }
438  }
439 #else
440  HepMC::GenEvent::vertex_const_iterator currentGenVertexIter;
441  for (currentGenVertexIter= genEvent->vertices_begin();
442  currentGenVertexIter!= genEvent->vertices_end();
443  ++currentGenVertexIter) {
444  const int barcode((*currentGenVertexIter)->barcode());
445  if (barcode < maxBarcode && !HepMC::BarcodeBased::is_simulation_vertex(barcode)) { maxBarcode=barcode; }
446  }
447 #endif
448  return maxBarcode;
449 }

◆ mpi() [1/2]

int HepMC::mpi ( const GenEvent &  e)
inline

Definition at line 629 of file GenEvent.h.

629  {
630  return e.mpi();
631 }

◆ mpi() [2/2]

int HepMC::mpi ( const GenEvent *  e)
inline

Definition at line 632 of file GenEvent.h.

632  {
633  return e->mpi();
634 }

◆ new_particle_status_from_old()

int HepMC::new_particle_status_from_old ( const int  oldStatus,
const int  barcode 
)
inline

Get particle status in the new scheme from the barcode and status in the old scheme.

Definition at line 392 of file MagicNumbers.h.

392  {
393  int generations_barcode_based = (barcode/SIM_REGENERATION_INCREMENT);
394  bool is_sim_secondary_barcode_based = (barcode%SIM_REGENERATION_INCREMENT > SIM_BARCODE_THRESHOLD);
395  return oldStatus + SIM_STATUS_INCREMENT*generations_barcode_based + (is_sim_secondary_barcode_based? SIM_STATUS_THRESHOLD : 0);
396  }

◆ new_vertex_status_from_old()

int HepMC::new_vertex_status_from_old ( const int  oldStatus,
const int  barcode 
)
inline

Get vertex status in the new scheme from the barcode and status in the old scheme.

Definition at line 402 of file MagicNumbers.h.

402  {
403  bool is_simulation_vertex_barcode_based = (barcode<-SIM_BARCODE_THRESHOLD);
404  return (is_simulation_vertex_barcode_based? SIM_STATUS_THRESHOLD : 0) + oldStatus;
405  }

◆ newGenEvent()

GenEvent* HepMC::newGenEvent ( const int  a,
const int  b 
)
inline

Definition at line 624 of file GenEvent.h.

624 { return new GenEvent(a,b); }

◆ newGenParticlePtr()

GenParticlePtr HepMC::newGenParticlePtr ( const HepMC::FourVector &  mom = HepMC::FourVector(0.0,0.0,0.0,0.0),
int  pid = 0,
int  status = 0 
)
inline

Definition at line 39 of file GenParticle.h.

39  {
40  return new HepMC::GenParticle(mom,pid,status);
41 }

◆ newGenVertexPtr()

GenVertexPtr HepMC::newGenVertexPtr ( const HepMC::FourVector &  pos = HepMC::FourVector(0.0,0.0,0.0,0.0),
const int  i = 0 
)
inline

Definition at line 64 of file GenVertex.h.

64  {
65  return new HepMC::GenVertex(pos,i);
66 }

◆ no_truth_link()

template<class T >
bool HepMC::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 329 of file MagicNumbers.h.

329 { return StatusBased::no_truth_link(p);}

◆ old_particle_status_from_new()

int HepMC::old_particle_status_from_new ( const int  newStatus)
inline

Get particle status in the old scheme from the status in the new scheme.

Definition at line 399 of file MagicNumbers.h.

399 { return newStatus%SIM_STATUS_THRESHOLD; }

◆ old_to_new_simulation_scheme()

template<class T >
void HepMC::old_to_new_simulation_scheme ( T &  evt)

Function that converts the old scheme of labeling the simulation particles (barcodes) into the new scheme (statuses).

Definition at line 363 of file MagicNumbers.h.

363  {
364  auto particle_status = [] (int barcode, int status) {
368  return status;
369  };
370  auto vertex_status = [] (int barcode, int status) {
372  return status;
373  };
374 #ifdef HEPMC3
375  for (auto p: evt->particles()) {
376  p->set_status (particle_status (HepMC::barcode(p), p->status()));
377  }
378  for (auto v: evt->vertices()) {
379  v->set_status (vertex_status (HepMC::barcode(v), v->status()));
380  }
381 #else
382  for (auto p = evt->particles_begin(); p != evt->particles_end(); ++p) {
383  (*p)->set_status (particle_status ((*p)->barcode(), (*p)->status()));
384  }
385  for (auto v = evt->vertices_begin(); v != evt->vertices_end(); ++v) {
386  (*v)->set_id (vertex_status ((*v)->barcode(), (*v)->id()));
387  }
388 #endif
389  }

◆ old_vertex_status_from_new()

int HepMC::old_vertex_status_from_new ( const int  newStatus)
inline

Get vertex status in the old scheme from the status in the new scheme.

Definition at line 408 of file MagicNumbers.h.

408  {
409  bool is_simulation_vertex_status_based = (newStatus>SIM_STATUS_THRESHOLD);
410  return ( is_simulation_vertex_status_based ? -SIM_STATUS_THRESHOLD : 0) + newStatus; }

◆ operator<<() [1/2]

std::ostream& HepMC::operator<< ( std::ostream &  os,
const GenParticle p 
)
inline

Definition at line 47 of file GenParticle.h.

47 { if (p) return os<<(*p); else return os;}

◆ operator<<() [2/2]

std::ostream& HepMC::operator<< ( std::ostream &  os,
const GenVertex *  v 
)
inline

Definition at line 72 of file GenVertex.h.

72 { if (v) return os<<(*v); else return os;}

◆ polarization()

template<class T >
Polarization HepMC::polarization ( const T &  a)
inline

Definition at line 47 of file Polarization.h.

47  {
48  return a->polarization();
49 }

◆ set_ll_event_number()

bool HepMC::set_ll_event_number ( HepMC::GenEvent *  e,
long long int  num 
)
inline

Definition at line 612 of file GenEvent.h.

612  {
613  if (num > std::numeric_limits<int>::max()) return false;
614  e->set_event_number((int)num);
615  return true;
616 }

◆ set_mpi()

void HepMC::set_mpi ( GenEvent *  e,
const int  i 
)
inline

Definition at line 644 of file GenEvent.h.

644  {
645  e->set_mpi(i);
646 }

◆ set_polarization()

template<class T >
void HepMC::set_polarization ( T &  a,
Polarization  b 
)
inline

Definition at line 44 of file Polarization.h.

44  {
45  a->set_polarization(b);
46 }

◆ set_random_states()

template<class T >
void HepMC::set_random_states ( GenEvent *  e,
std::vector< T >  a 
)

Definition at line 647 of file GenEvent.h.

647  {
648  e->set_random_states(a);
649 }

◆ set_signal_process_id()

void HepMC::set_signal_process_id ( GenEvent *  e,
const int  i 
)
inline

Definition at line 641 of file GenEvent.h.

641  {
642  e->set_signal_process_id(i);
643 }

◆ set_signal_process_vertex()

template<class T >
void HepMC::set_signal_process_vertex ( GenEvent *  e,
v 
)

Definition at line 650 of file GenEvent.h.

650  {
651  e->set_signal_process_vertex(v);
652 }

◆ signal_process_id() [1/2]

int HepMC::signal_process_id ( const GenEvent &  e)
inline

Definition at line 635 of file GenEvent.h.

635  {
636  return e.signal_process_id();
637 }

◆ signal_process_id() [2/2]

int HepMC::signal_process_id ( const GenEvent *  e)
inline

Definition at line 638 of file GenEvent.h.

638  {
639  return e->signal_process_id();
640 }

◆ signal_process_vertex()

GenVertex* HepMC::signal_process_vertex ( const GenEvent *  e)
inline

Definition at line 625 of file GenEvent.h.

625 { return e->signal_process_vertex(); }

◆ simulation_history()

template<class T >
std::deque<int> HepMC::simulation_history ( const T &  p,
const int  direction 
)
inline

Function to calculate all the descendants(direction=1)/ancestors(direction=-1) of the particle.

Definition at line 180 of file MagicNumbers.h.

180 { std::deque<int> res; res.push_back(uniqueID(p)); get_particle_history(p, res, direction); return res;}

◆ status() [1/3]

template<>
int HepMC::status ( const ConstGenVertexPtr v1)
inline

Definition at line 146 of file MagicNumbers.h.

146 { return v1->id();}

◆ status() [2/3]

template<>
int HepMC::status ( const GenVertexPtr v1)
inline

Definition at line 147 of file MagicNumbers.h.

147 { return v1->id();}

◆ status() [3/3]

template<typename T >
int HepMC::status ( const T &  p)
inline

Definition at line 125 of file MagicNumbers.h.

125  {
126  if constexpr (std::is_integral_v<T>) {
127  return p;
128  }
129  else if constexpr (std::is_integral_v<std::remove_pointer_t<T>>) {
130  return *p;
131  }
132  else if constexpr (std::is_same_v<T, xAOD::TruthVertex_v1>) {
133  return p.id();
134  }
135  else if constexpr (std::is_same_v<std::remove_const_t<remove_smart_pointer_t<std::remove_pointer_t<T>>>, xAOD::TruthVertex_v1>) {
136  return p->id();
137  }
138  else if constexpr (std::is_pointer_v<T> || is_smart_ptr_v<T>){ //T is ptr
139  return p->status();
140  }
141  else {
142  return p.status();
143  }
144  }

◆ suggest_barcode() [1/2]

template<class T >
bool HepMC::suggest_barcode ( T &  p,
int  i 
)

Definition at line 670 of file GenEvent.h.

670 {return p.suggest_barcode(i);}

◆ suggest_barcode() [2/2]

template<class T >
bool HepMC::suggest_barcode ( T *  p,
int  i 
)

Definition at line 671 of file GenEvent.h.

671 {return p->suggest_barcode(i);}

◆ suggest_barcode< std::unique_ptr< HepMC::GenParticle > >()

template<>
bool HepMC::suggest_barcode< std::unique_ptr< HepMC::GenParticle > > ( std::unique_ptr< HepMC::GenParticle > &  p,
int  i 
)
inline

Definition at line 673 of file GenEvent.h.

673 {return p->suggest_barcode(i);}

◆ SUPPRESSED_PILEUP_BARCODE()

constexpr int HepMC::SUPPRESSED_PILEUP_BARCODE ( std::numeric_limits< int32_t >  ::max())
constexpr

This barcode is used by objects matched to particles from pile-up interactions in standard MC Production.

◆ uniqueID()

template<typename T >
int HepMC::uniqueID ( const T &  p)
inline

Definition at line 109 of file MagicNumbers.h.

109  {
110  if constexpr (std::is_integral_v<T>) {
111  return p;
112  }
113  else if constexpr (std::is_integral_v<std::remove_pointer_t<T>>) {
114  return *p;
115  }
116  else if constexpr (std::is_pointer_v<T> || is_smart_ptr_v<T>){ //T is ptr
117  return p->barcode();
118  }
119  else {
120  return p.barcode();
121  }
122  }

◆ valid_beam_particles()

bool HepMC::valid_beam_particles ( const GenEvent *  e)
inline

Definition at line 681 of file GenEvent.h.

681 {return e->valid_beam_particles();}

Variable Documentation

◆ FORWARD_TRANSPORT_MODEL_PROCESS

constexpr int HepMC::FORWARD_TRANSPORT_MODEL_PROCESS = 212
constexpr

Special Forward transport Geant process for vertices.

Definition at line 48 of file MagicNumbers.h.

◆ INVALID_PARTICLE_BARCODE

constexpr int HepMC::INVALID_PARTICLE_BARCODE = -1
constexpr

Definition at line 53 of file MagicNumbers.h.

◆ INVALID_PARTICLE_ID

constexpr int HepMC::INVALID_PARTICLE_ID = -1
constexpr

Definition at line 56 of file MagicNumbers.h.

◆ INVALID_VERTEX_ID

constexpr int HepMC::INVALID_VERTEX_ID = 1
constexpr

Definition at line 57 of file MagicNumbers.h.

◆ is_smart_ptr_v

template<class T >
constexpr bool HepMC::is_smart_ptr_v = is_smart_ptr<T>::value
inlineconstexpr

Definition at line 66 of file MagicNumbers.h.

◆ SIM_BARCODE_THRESHOLD

constexpr int HepMC::SIM_BARCODE_THRESHOLD = 200000
constexpr

Constant defining the barcode threshold for simulated particles, eg. can be used to separate generator event record entries from simulated particles.

Definition at line 36 of file MagicNumbers.h.

◆ SIM_REGENERATION_INCREMENT

constexpr int HepMC::SIM_REGENERATION_INCREMENT = 1000000
constexpr

Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an interaction.

Definition at line 39 of file MagicNumbers.h.

◆ SIM_STATUS_INCREMENT

constexpr int HepMC::SIM_STATUS_INCREMENT = 100000
constexpr

Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an interaction.

Definition at line 42 of file MagicNumbers.h.

◆ SIM_STATUS_THRESHOLD

constexpr int HepMC::SIM_STATUS_THRESHOLD = 20000
constexpr

Constant definiting the status threshold for simulated particles, eg. can be used to separate generator event record entries from simulated particles.

Definition at line 45 of file MagicNumbers.h.

◆ UNDEFINED_ID

constexpr int HepMC::UNDEFINED_ID = 0
constexpr

Definition at line 55 of file MagicNumbers.h.

AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
HepMC::SIM_BARCODE_THRESHOLD
constexpr int SIM_BARCODE_THRESHOLD
Constant defining the barcode threshold for simulated particles, eg. can be used to separate generato...
Definition: MagicNumbers.h:36
max
#define max(a, b)
Definition: cfImp.cxx:41
HepMC::SIM_STATUS_INCREMENT
constexpr int SIM_STATUS_INCREMENT
Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an intera...
Definition: MagicNumbers.h:42
HepMC::BarcodeBased::is_simulation_particle
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 ...
Definition: MagicNumbers.h:193
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
HepMC::ignoreTruthLink
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
Definition: MagicNumbers.h:332
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
HepMC::is_same_generator_particle
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.
Definition: MagicNumbers.h:351
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
HepMC::StatusBased::is_same_object
bool is_same_object(const T1 &p1, const T2 &p2)
Method to establish if two particles/vertices in the GenEvent actually represent the same particle.
Definition: MagicNumbers.h:287
HepMC::is_simulation_particle
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...
Definition: MagicNumbers.h:342
lumiFormat.i
int i
Definition: lumiFormat.py:85
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:109
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
HepMC::is_simulation_vertex
bool is_simulation_vertex(const T &v)
Method to establish if the vertex was created during simulation (TODO migrate to be based on status).
Definition: MagicNumbers.h:348
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
min
#define min(a, b)
Definition: cfImp.cxx:40
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
HepMC::SIM_REGENERATION_INCREMENT
constexpr int SIM_REGENERATION_INCREMENT
Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an intera...
Definition: MagicNumbers.h:39
HepMC::BarcodeBased::is_simulation_vertex
bool is_simulation_vertex(const T &v)
Method to establish if the vertex was created during simulation (only to be used in legacy TP convert...
Definition: MagicNumbers.h:202
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:37
HepMC::SIM_STATUS_THRESHOLD
constexpr int SIM_STATUS_THRESHOLD
Constant definiting the status threshold for simulated particles, eg. can be used to separate generat...
Definition: MagicNumbers.h:45
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
HepMC::status
int status(const GenVertexPtr &v1)
Definition: MagicNumbers.h:147
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.PyAthena.v
v
Definition: PyAthena.py:154
HepMC::get_particle_history
void get_particle_history(const T &p, std::deque< int > &out, const int direction=0)
Function to calculate all the descendants(direction=1)/ancestors(direction=-1) of the particle.
Definition: MagicNumbers.h:151
a
TList * a
Definition: liststreamerinfos.cxx:10
python.changerun.pv
pv
Definition: changerun.py:81
HepMC::remove_smart_pointer_t
typename remove_smart_pointer< T >::type remove_smart_pointer_t
Definition: MagicNumbers.h:72
merge.status
status
Definition: merge.py:17
HepMC::is_sim_descendant
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,...
Definition: MagicNumbers.h:360
HepMC::generations
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...
Definition: MagicNumbers.h:345
HepMC::is_truth_suppressed_pileup
bool is_truth_suppressed_pileup(const T &p)
Method to establish if a particle (or barcode) corresponds to truth-suppressed pile-up (TODO update t...
Definition: MagicNumbers.h:319
HepMC::no_truth_link
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...
Definition: MagicNumbers.h:329
GenParticle
@ GenParticle
Definition: TruthClasses.h:30