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, 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, 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 (TODO update to be status based) 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_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 (int oldStatus, int barcode)
 Functions for converting between the old and new barcode/status schemes. More...
 
int old_particle_status_from_new (int newStatus)
 
int new_vertex_status_from_old (int oldStatus, int barcode)
 
int old_vertex_status_from_new (int newStatus)
 
int maxGeneratedParticleBarcode (const HepMC::GenEvent *genEvent)
 
int maxGeneratedVertexBarcode (const HepMC::GenEvent *genEvent)
 

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 SPECIALSTATUS = 902
 Constant that the meaning of which is currently lost, to be recovered... More...
 
constexpr int EVTGENUNDECAYEDSTATUS = 899
 
constexpr int PYTHIA8LHESTATUS = 1003
 
constexpr int HERWIG7INTERMEDIATESTATUS = 11
 
constexpr int PYTHIA8NOENDVERTEXSTATUS = 201
 
constexpr int FORWARDTRANSPORTMODELSTATUS = 212
 
constexpr int INVALID_PARTICLE_BARCODE = -1
 
constexpr int SINGLE_PARTICLE = 10001
 
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 74 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 506 of file GenEvent.h.

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

◆ barcode_to_vertex()

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

Definition at line 505 of file GenEvent.h.

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

◆ begin() [1/3]

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

Definition at line 500 of file GenEvent.h.

500 { 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 498 of file GenEvent.h.

498 { return e.particles_begin(); }

◆ copyemptyGenEvent()

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

Definition at line 531 of file GenEvent.h.

531  {
532  HepMC::GenEvent* outEvt = new HepMC::GenEvent( inEvt->signal_process_id(), inEvt->event_number() );
533  outEvt->set_mpi ( inEvt->mpi() );
534  outEvt->set_event_scale ( inEvt->event_scale() );
535  outEvt->set_alphaQCD ( inEvt->alphaQCD() );
536  outEvt->set_alphaQED ( inEvt->alphaQED() );
537  outEvt->weights() = inEvt->weights();
538  outEvt->set_random_states( inEvt->random_states() );
539  if ( nullptr != inEvt->heavy_ion() ) {
540  outEvt->set_heavy_ion ( *inEvt->heavy_ion() );
541  }
542  if ( nullptr != inEvt->pdf_info() ) {
543  outEvt->set_pdf_info ( *inEvt->pdf_info() );
544  }
545  return outEvt;
546 }

◆ end() [1/3]

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

Definition at line 501 of file GenEvent.h.

501 { 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 499 of file GenEvent.h.

499 { return e.particles_end(); }

◆ fillBarcodesAttribute()

void HepMC::fillBarcodesAttribute ( GenEvent *  )
inline

Definition at line 504 of file GenEvent.h.

504 { }

◆ 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 302 of file MagicNumbers.h.

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

◆ get_ll_event_number()

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

Definition at line 495 of file GenEvent.h.

495  {
496  return e->event_number();
497 }

◆ get_particle_history()

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

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

Definition at line 156 of file MagicNumbers.h.

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

◆ ignoreTruthLink()

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

Helper function for SDO creation in PileUpTools.

Definition at line 296 of file MagicNumbers.h.

296 { return BarcodeBased::ignoreTruthLink(p, vetoPileUp); }

◆ 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 309 of file MagicNumbers.h.

◆ 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 313 of file MagicNumbers.h.

313 { return BarcodeBased::is_sim_descendant(p1, p2);}

◆ 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 299 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 305 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 290 of file MagicNumbers.h.

◆ maxGeneratedParticleBarcode()

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

Definition at line 361 of file MagicNumbers.h.

361  {
362  int maxBarcode=0;
363 #ifdef HEPMC3
364  auto allbarcodes = genEvent->attribute<HepMC::GenEventBarcodes>("barcodes");
365  for (const auto& bp: allbarcodes->barcode_to_particle_map()) {
366  if (!HepMC::BarcodeBased::is_simulation_particle(bp.first)) { maxBarcode=std::max(maxBarcode,bp.first); }
367  }
368 #else
369  for (auto currentGenParticle: *genEvent) {
370  const int barcode=HepMC::barcode(currentGenParticle);
371  if (barcode > maxBarcode && !HepMC::BarcodeBased::is_simulation_particle(barcode)) { maxBarcode=barcode; }
372  }
373 #endif
374  return maxBarcode;
375 }

◆ maxGeneratedVertexBarcode()

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

Definition at line 377 of file MagicNumbers.h.

377  {
378  int maxBarcode=0;
379 #ifdef HEPMC3
380  auto allbarcodes = genEvent->attribute<HepMC::GenEventBarcodes>("barcodes");
381  for (const auto& bp: allbarcodes->barcode_to_vertex_map()) {
382  if (!HepMC::BarcodeBased::is_simulation_vertex(bp.first)) { maxBarcode=std::min(maxBarcode,bp.first); }
383  }
384 #else
385  HepMC::GenEvent::vertex_const_iterator currentGenVertexIter;
386  for (currentGenVertexIter= genEvent->vertices_begin();
387  currentGenVertexIter!= genEvent->vertices_end();
388  ++currentGenVertexIter) {
389  const int barcode((*currentGenVertexIter)->barcode());
390  if (barcode < maxBarcode && !HepMC::BarcodeBased::is_simulation_vertex(barcode)) { maxBarcode=barcode; }
391  }
392 #endif
393  return maxBarcode;
394 }

◆ mpi() [1/2]

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

Definition at line 507 of file GenEvent.h.

507  {
508  return e.mpi();
509 }

◆ mpi() [2/2]

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

Definition at line 510 of file GenEvent.h.

510  {
511  return e->mpi();
512 }

◆ new_particle_status_from_old()

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

Functions for converting between the old and new barcode/status schemes.

Definition at line 345 of file MagicNumbers.h.

345  {
346  int generations_barcode_based = (barcode/SIM_REGENERATION_INCREMENT);
347  bool is_sim_secondary_barcode_based = (barcode%SIM_REGENERATION_INCREMENT > SIM_BARCODE_THRESHOLD);
348  return oldStatus + SIM_STATUS_INCREMENT*generations_barcode_based + (is_sim_secondary_barcode_based? SIM_STATUS_THRESHOLD : 0); }

◆ new_vertex_status_from_old()

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

Definition at line 351 of file MagicNumbers.h.

351  {
352  bool is_simulation_vertex_barcode_based = (barcode<-SIM_BARCODE_THRESHOLD);
353  return (is_simulation_vertex_barcode_based? SIM_STATUS_THRESHOLD : 0) + oldStatus;
354  }

◆ newGenEvent()

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

Definition at line 502 of file GenEvent.h.

502 { 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 (TODO update to be status based)

Definition at line 293 of file MagicNumbers.h.

293 { return BarcodeBased::no_truth_link(p);} // TODO potentially this could become id()==0?

◆ old_particle_status_from_new()

int HepMC::old_particle_status_from_new ( int  newStatus)
inline

Definition at line 349 of file MagicNumbers.h.

349 { 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 316 of file MagicNumbers.h.

316  {
317  auto particle_status = [] (int barcode, int status) {
321  return status;
322  };
323  auto vertex_status = [] (int barcode, int status) {
325  return status;
326  };
327 #ifdef HEPMC3
328  for (auto p: evt->particles()) {
329  p->set_status (particle_status (HepMC::barcode(p), p->status()));
330  }
331  for (auto v: evt->vertices()) {
332  v->set_status (vertex_status (HepMC::barcode(v), v->status()));
333  }
334 #else
335  for (auto p = evt->particles_begin(); p != evt->particles_end(); ++p) {
336  (*p)->set_status (particle_status ((*p)->barcode(), (*p)->status()));
337  }
338  for (auto v = evt->vertices_begin(); v != evt->vertices_end(); ++v) {
339  (*v)->set_id (vertex_status ((*v)->barcode(), (*v)->id()));
340  }
341 #endif
342  }

◆ old_vertex_status_from_new()

int HepMC::old_vertex_status_from_new ( int  newStatus)
inline

Definition at line 355 of file MagicNumbers.h.

355  {
356  bool is_simulation_vertex_status_based = (newStatus>SIM_STATUS_THRESHOLD);
357  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 490 of file GenEvent.h.

490  {
491  if (num > std::numeric_limits<int>::max()) return false;
492  e->set_event_number((int)num);
493  return true;
494 }

◆ set_mpi()

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

Definition at line 522 of file GenEvent.h.

522  {
523  e->set_mpi(i);
524 }

◆ 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 525 of file GenEvent.h.

525  {
526  e->set_random_states(a);
527 }

◆ set_signal_process_id()

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

Definition at line 519 of file GenEvent.h.

519  {
520  e->set_signal_process_id(i);
521 }

◆ set_signal_process_vertex()

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

Definition at line 528 of file GenEvent.h.

528  {
529  e->set_signal_process_vertex(v);
530 }

◆ signal_process_id() [1/2]

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

Definition at line 513 of file GenEvent.h.

513  {
514  return e.signal_process_id();
515 }

◆ signal_process_id() [2/2]

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

Definition at line 516 of file GenEvent.h.

516  {
517  return e->signal_process_id();
518 }

◆ signal_process_vertex()

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

Definition at line 503 of file GenEvent.h.

503 { return e->signal_process_vertex(); }

◆ simulation_history()

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

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

Definition at line 185 of file MagicNumbers.h.

185 { 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 151 of file MagicNumbers.h.

151 { return v1->id();}

◆ status() [2/3]

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

Definition at line 152 of file MagicNumbers.h.

152 { return v1->id();}

◆ status() [3/3]

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

Definition at line 130 of file MagicNumbers.h.

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

◆ suggest_barcode() [1/2]

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

Definition at line 548 of file GenEvent.h.

548 {return p.suggest_barcode(i);}

◆ suggest_barcode() [2/2]

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

Definition at line 549 of file GenEvent.h.

549 {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 551 of file GenEvent.h.

551 {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 113 of file MagicNumbers.h.

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

◆ valid_beam_particles()

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

Definition at line 559 of file GenEvent.h.

559 {return e->valid_beam_particles();}

Variable Documentation

◆ EVTGENUNDECAYEDSTATUS

constexpr int HepMC::EVTGENUNDECAYEDSTATUS = 899
constexpr

Definition at line 42 of file MagicNumbers.h.

◆ FORWARDTRANSPORTMODELSTATUS

constexpr int HepMC::FORWARDTRANSPORTMODELSTATUS = 212
constexpr

Definition at line 46 of file MagicNumbers.h.

◆ HERWIG7INTERMEDIATESTATUS

constexpr int HepMC::HERWIG7INTERMEDIATESTATUS = 11
constexpr

Definition at line 44 of file MagicNumbers.h.

◆ INVALID_PARTICLE_BARCODE

constexpr int HepMC::INVALID_PARTICLE_BARCODE = -1
constexpr

Definition at line 51 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 67 of file MagicNumbers.h.

◆ PYTHIA8LHESTATUS

constexpr int HepMC::PYTHIA8LHESTATUS = 1003
constexpr

Definition at line 43 of file MagicNumbers.h.

◆ PYTHIA8NOENDVERTEXSTATUS

constexpr int HepMC::PYTHIA8NOENDVERTEXSTATUS = 201
constexpr

Definition at line 45 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 29 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 32 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 35 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 38 of file MagicNumbers.h.

◆ SINGLE_PARTICLE

constexpr int HepMC::SINGLE_PARTICLE = 10001
constexpr

Definition at line 53 of file MagicNumbers.h.

◆ SPECIALSTATUS

constexpr int HepMC::SPECIALSTATUS = 902
constexpr

Constant that the meaning of which is currently lost, to be recovered...

Definition at line 41 of file MagicNumbers.h.

◆ UNDEFINED_ID

constexpr int HepMC::UNDEFINED_ID = 0
constexpr

Definition at line 55 of file MagicNumbers.h.

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:29
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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:35
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:198
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
HepMC::get_particle_history
void get_particle_history(const T &p, std::deque< int > &out, int direction=0)
Function to calculate all the descendants(direction=1)/ancestors(direction=-1) of the particle.
Definition: MagicNumbers.h:156
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:296
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:309
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
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:299
lumiFormat.i
int i
Definition: lumiFormat.py:92
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:113
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:305
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:32
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:207
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:41
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:38
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
HepMC::status
int status(const GenVertexPtr &v1)
Definition: MagicNumbers.h:152
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.PyAthena.v
v
Definition: PyAthena.py:157
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
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:74
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:313
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:302
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:290
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:293
GenParticle
@ GenParticle
Definition: TruthClasses.h:30