HepMC3 event record library
HepMC3Event.h
1 /**
2  * @class HepMC3Event
3  * @brief HEPEvent Interface to HepMC classes
4  *
5  * This class provides a set of methods that allow access to event data
6  * stored in HepMC format. The HepMC data structures are used by
7  * HEP programs as storage for event records in C++
8  *
9  * This class extends the GenEvent class and implements the methods of
10  * HEPEvent used by MC-TESTER. Not all functions are needed by the MC-TESTER,
11  * so dummy defintion are introduced for these
12  *
13  */
14 
15 #ifndef _HepMC3Event_H
16 #define _HepMC3Event_H
17 
18 #warning "HepMC3 interface is available in the latest version of MC-TESTER, see https://gitlab.cern.ch/cvsmctst/mc-tester. This interface will be removed in the future HepMC3 versions."
19 
20 #ifdef _USE_ROOT_
21 #include <TObject.h>
22 #include <TBuffer.h>
23 #include <TClass.h>
24 #endif
25 
26 #include "HepMC3/GenEvent.h"
27 #include "HepMC3Particle.h"
28 #include "HEPEvent.H"
29 
30 
31 
32 class HepMC3Event: public HEPEvent
33 {
34 private:
35  /** List of particles in the event */
37 
38  /** Flag for how particles decaying into there own type are treated */
40 
41 public:
42  /** Constructor for HepMC3Event. Creates a new event using the
43  event info from GenEvent e. Also copies each particle
44  into a HepMC3Particle and stores them as a list. */
45  HepMC3Event(HepMC3::GenEvent &e, bool include_self_decay=true);
46  /** Destructor for HepMC3Event */
48 
49  /** return the number of particles in the event */
51 
52  /** returns the event number */
54 
55  /** Dummy function definition. Do not use */
56  void SetNumOfParticles(int n);
57 
58  /** Dummy function definition. Do not use */
59  void SetEventNumber(int ev);
60 
61  /** Returns the HEPParticle with id "idx". This is the id number as used
62  by MC-TESTER and not the id number from the original GenParticle.
63  Note: Indecies begin at 1.*/
64  HEPParticle* GetParticle(int idx);
65 
66  /** Returns the HepMC3Particle by its id. This is the ID
67  number from the original GenParticle and not the ID used by
68  MC-TESTER. */
70 
71  /** Dummy function definition. Do not use */
72  void SetParticle(int idx, HEPParticle *particle);
73 
74  /** Dummy function definition. Do not use */
75  void AddParticle(HEPParticle *particle);
76 
77  /** Dummy function definition. Do not use */
78  void Clear (int fromIdx);
79 
80  /** Dummy function definition. Do not use */
81  void InsertParticle(int at_idx, HEPParticle *p);
82 
83  /** Dummy function definition. Do not use */
84  void AddParticle(int id, int pdgid, int status,
85  int mother, int mother2,
86  int firstdaughter, int lastdaughter,
87  double E,double px, double py, double pz, double m,
88  double vx, double vy, double vz, double tau);
89 
90  std::vector<double> * Sum4Momentum();
91 
92  bool CountSelfDecays() { return count_self_decays; };
93 
94  /** Implementation of FindParticle needed for excluding "self decays" */
95  HEPParticleList* FindParticle(int pdg, HEPParticleList *list);
96 
97 private:
98  HepMC3::GenEvent *evt;
99  int m_particle_count;
100 #ifdef _USE_ROOT_
101  ClassDef(HepMC3Event,1)//Interface to HepMC event record
102 #endif
103 };
104 #endif
Definition of class GenEvent.
HEPEvent Interface to HepMC classes.
Definition: HepMC3Event.h:33
void SetEventNumber(int ev)
HepMC3Event(HepMC3::GenEvent &e, bool include_self_decay=true)
HepMC3Particle ** particles
Definition: HepMC3Event.h:36
int GetEventNumber()
HEPParticleList * FindParticle(int pdg, HEPParticleList *list)
void AddParticle(int id, int pdgid, int status, int mother, int mother2, int firstdaughter, int lastdaughter, double E, double px, double py, double pz, double m, double vx, double vy, double vz, double tau)
void SetNumOfParticles(int n)
void InsertParticle(int at_idx, HEPParticle *p)
void SetParticle(int idx, HEPParticle *particle)
HEPParticle * GetParticle(int idx)
HepMC3Particle * GetParticleWithId(int id)
void AddParticle(HEPParticle *particle)
void Clear(int fromIdx)
bool count_self_decays
Definition: HepMC3Event.h:39
int GetNumOfParticles()
HEPParticle interface to HepMC classes.
Stores event-related information.
Definition: GenEvent.h:41