C++InterfacetoTauola
include/Tauola/TauolaHEPEVTParticle.h
1 #ifndef _TauolaHEPEVTParticle_h_included_
2 #define _TauolaHEPEVTParticle_h_included_
3 
4 /**
5  * @class TauolaHEPEVTParticle
6  *
7  * @brief Single particle of HEPEVT event record
8  *
9  * This class implements the virtual methods of
10  * TauolaParticle. In this way it provides an
11  * interface between the generic TauolaParticle class
12  * and information stored in HEPEVT event record.
13  *
14  * @author Tomasz Przedzinski
15  * @date 24 November 2011
16  */
17 
18 #include <iostream>
19 #include <vector>
20 
21 #include "f_Decay.h"
22 #include "TauolaParticle.h"
23 #include "TauolaHEPEVTEvent.h"
24 
25 namespace Tauolapp
26 {
27 
28 class TauolaHEPEVTEvent;
29 
31 
32  public:
33  /** Default destructor */
35 
36  /** Default constructor */
37  TauolaHEPEVTParticle(int pdgid, int status, double px, double py, double pz, double e, double m, int ms, int me, int ds, int de);
38 
39  /** Remove the decay branch from the event record and reset the particle status code to stable.
40  WARNING: not implemented for HEPEVT. */
41  void undecay();
42 
43  /** Set the mothers of this particle via a vector of TauolaParticle*/
44  void setMothers(std::vector<TauolaParticle*> mothers);
45 
46  /** Set the daughters of this particle via a vector of TauolaParticle*/
47  void setDaughters(std::vector<TauolaParticle*> daughters);
48 
49  /** Returns the mothers of this particle via a vector of TauolaParticle */
50  std::vector<TauolaParticle*> getMothers();
51 
52  /** Returns the daughters of this particle via a vector of TauolaParticle */
53  std::vector<TauolaParticle*> getDaughters();
54 
55  /** Check that the 4 momentum in conserved in the decay of this particle */
57 
58  /** Creates a new particle of type TauolaHEPEVTParticle, with the given
59  properties. The new particle bares no relations to this
60  particle, but `this particle' provides only a way of creating an instance of
61  this derived class. eg. createNewParticle() is used inside
62  filhep_() so that a TauolaHEPEVTParticle can be created without
63  the method having explicit knowledge of the TauolaHEPEVTParticle
64  class */
65  TauolaHEPEVTParticle * createNewParticle(int pdg_id, int status, double mass,
66  double px, double py,
67  double pz, double e);
68 
69  /** Check if particle 'p' is daughter of this particle */
71 
72  /** Check if particle 'p' is mother of this particle */
74 
75  /** Print information on this particle into standard output */
76  void print();
77 
78  /** Set the PDG ID code of this particle */
79  void setPdgID(int pdg_id);
80 
81  /** Set the status of this particle */
82  void setStatus(int statu);
83 
84  /** Set the mass of this particle */
85  void setMass(double mass);
86 
87  /** Get the PDG ID code of this particle */
88  int getPdgID();
89 
90  /** Get the status of this particle */
91  int getStatus();
92 
93  /** Get the mass stored (i.e. not calculated from four vector) at generation step */
94  double getMass();
95 
96  /** Returns the px component of the four vector*/
97  double getPx();
98 
99  /** Returns the py component of the four vector */
100  double getPy();
101 
102  /** Returns the pz component of the four vector */
103  double getPz();
104 
105  /** Returns the energy component of the four vector */
106  double getE();
107 
108  /** Set the px component of the four vector */
109  void setPx( double px );
110 
111  /** Set the px component of the four vector */
112  void setPy( double py );
113 
114  /** Set the pz component of the four vector */
115  void setPz( double pz );
116 
117  /** Set the energy component of the four vector */
118  void setE( double e );
119 
120  /** Get the barcode (position in list) of this particle */
121  int getBarcode();
122 
123  /** Set barcode (position in list) of this particle */
124  void setBarcode(int barcode);
125 
126  /** Set event of this particle */
127  void setEvent(TauolaHEPEVTEvent *event);
128 
129  /** Get index of first mother */
130  int getFirstMotherIndex();
131 
132  /** Get index of second mother */
133  int getSecondMotherIndex();
134 
135  /** Get index of first daughter */
136  int getDaughterRangeStart();
137 
138  /** Get index of last daughter */
139  int getDaughterRangeEnd();
140 
141 private:
142 
143  /** Event from which this particle is taken */
145 
146  /** Position in the event record */
148 
149  /** Indexes of mothers (-1 if do not have mothers) */
150  int m_first_mother, m_second_mother;
151 
152  /** Range of indexes of daughters (-1 if do not have daughters) */
153  int m_daughter_start, m_daughter_end;
154 
155  /** PDG ID */
156  int m_pdgid;
157 
158  /** Status (stable, decayed) */
159  int m_status;
160 
161  /** Momentum */
162  double m_px, m_py, m_pz, m_e;
163 
164  /** Mass saved at generation step */
166 
167  /** List of created particles - if they are not in the event, they
168  will be deleted when no longer needed */
169  vector<TauolaHEPEVTParticle*> cache;
170 };
171 
172 } // namespace Tauolapp
173 #endif
174 
TauolaHEPEVTParticle(int pdgid, int status, double px, double py, double pz, double e, double m, int ms, int me, int ds, int de)
std::vector< TauolaParticle * > getMothers()
bool isMotherOf(TauolaHEPEVTParticle *p)
bool isDaughterOf(TauolaHEPEVTParticle *p)
std::vector< TauolaParticle * > getDaughters()
void setMothers(std::vector< TauolaParticle * > mothers)
void setDaughters(std::vector< TauolaParticle * > daughters)
void setEvent(TauolaHEPEVTEvent *event)
TauolaHEPEVTParticle * createNewParticle(int pdg_id, int status, double mass, double px, double py, double pz, double e)