CbmRoot
PParticle.h
Go to the documentation of this file.
1 // Author: Marios A. Kagarlis
2 // Written: 15.11.98
3 // Revised: 20.07.99
4 // Revised: 30.08.00 R. Holzmann
5 // Revised: 07.09.00 J. Ritman (added parent-,siblings-,daughter- index
6 // and decayTime)
7 // Revised: 15.12.00 R. Holzmann (creation time added)
8 // Revised: 22.03.05 R. Holzmann (get/setParent() added)
9 // Revised: 23.07.07 IF (new framework)
10 
11 // PParticle Class Header
12 
13 #ifndef _PPARTICLE_H_
14 #define _PPARTICLE_H_
15 
16 #define MAX_DAUGHTERS 7
17 
18 #include "PValues.h"
19 #include "TLorentzVector.h"
20 #include "TMath.h"
21 
22 class PParticle : public TLorentzVector {
23 
24 public:
25  PParticle(Int_t id = 0, Double_t T = 0., Double_t w = 1.);
26  // id, lab kinetic energy (GeV), weight
27 
28  /*
29  PParticle(const char *, Double_t T=0., Double_t w=1.);
30  // name, lab kinetic energy (GeV), weight
31 
32  PParticle(Int_t, Double_t, Double_t, Double_t, Double_t m=0., Double_t w=1.);
33  // id, Px, Py, Pz (GeV/c), mass (GeV/c**2) overrides default, weight
34 
35  PParticle(const char *, Double_t, Double_t, Double_t,Double_t m=0., Double_t w=1.);
36  // name, Px, Py, Pz (GeV/c), mass (GeV/c**2) overrides default, weight
37 
38  PParticle(Int_t, const TVector3 &, Double_t m=0., Double_t w=1.);
39  // id, 3-momentum vector (GeV/c), mass (GeV/c**2) overrides default, weight
40 
41  PParticle(Int_t, Double_t *, Double_t w=1.);
42  // id, pointer to 4-dim array (Px, Py, Pz, E) (GeV/c, GeV), weight
43 
44  PParticle(Int_t, float *, Double_t w=1.);
45  // id, pointer to 4-dim array (Px, Py, Pz, E) (GeV/c, GeV), weight
46 
47  PParticle(const PParticle &);
48  // copy constructor
49 
50  PParticle(const PParticle *);
51  // copy constructor
52 */
53 
54  virtual ~PParticle() {
55  if (qParticle1) delete qParticle1;
56  if (qParticle2) delete qParticle2;
57  if (values) delete values;
58  }
59 
60  Int_t ID() const { return pid; }
61 
62  TLorentzVector Vect4() const { return TLorentzVector(Vect(), E()); }
63 
64  void SetVertex(Double_t x, Double_t y, Double_t z, Double_t t) {
65  fV.SetXYZ(x, y, z);
66  fT = t;
67  }
68 
69  inline Int_t GetParentIndex() const { return parentIndex; }
70  inline Int_t GetDaughterIndex() const { return daughterIndex; }
71 
72  inline TVector3& GetVertex() { return fV; }
73  inline TVector3& getVertex() { return fV; }
74 
75  inline void SetParentId(Int_t pId) { parentId = pId; }
76  inline void SetSourceId(Int_t sId) { sourceId = sId; }
77  inline void SetDaughterIndex(Int_t dInd) { daughterIndex = dInd; }
78  inline void SetSiblingIndex(Int_t sInd) { siblingIndex = sInd; }
79  inline void SetParentIndex(Int_t pInd) { parentIndex = pInd; }
80  inline void SetSibling(PParticle* p) { sParticle = p; }
81 
82  inline void ResetDaughters(void) {
83  for (int i = 0; i < (MAX_DAUGHTERS + 1); i++)
84  daughters[i] = nullptr;
85  };
86 
87 protected:
88  void defaults(void);
89 
90  Int_t pid; // particle code (partially conforms with Geant 3)
91  Int_t sourceId; // Source ID
92  Int_t parentId; // parent ID
93  Int_t parentIndex; // parent index in particle array
94  Int_t decayModeIndex; // decay Mode index (for decayAll option)
95  Int_t destroyDecayModeIndex; // save only for data file
96  Int_t daughterIndex; // daughter index
97  Int_t siblingIndex; // sibling index
98  Int_t spectator;
99 
100  Double_t decayTime; // proper time until decay (in mm/c)
101  Double_t wt; // weight
102  Double_t genwt;
103  Double_t invgenwt;
104  Double_t mult;
105 
106  TVector3 fV; // creation vertex (in mm)
107  Double_t fT; // creation time (in mm/c)
108  Bool_t active;
109  Int_t index;
115  TString debug;
116 
118  Int_t status;
119 
121 
122  ClassDef(PParticle, 4) // Pluto Particle Class
123 };
124 #endif // _PPARTICLE_H_
PParticle::~PParticle
virtual ~PParticle()
Definition: PParticle.h:54
PParticle::wt
Double_t wt
Definition: PParticle.h:101
PParticle::defaults
void defaults(void)
Definition: PParticle.cxx:21
PParticle::GetVertex
TVector3 & GetVertex()
Definition: PParticle.h:72
PParticle::decayModeIndex
Int_t decayModeIndex
Definition: PParticle.h:94
PParticle::decayTime
Double_t decayTime
flag that forces particle to be treated as spectator
Definition: PParticle.h:100
PParticle::PParticle
PParticle(Int_t id=0, Double_t T=0., Double_t w=1.)
Definition: PParticle.cxx:48
PParticle::spectator
Int_t spectator
Definition: PParticle.h:98
PValues
Definition: PValues.h:21
PParticle
Definition: PParticle.h:22
PParticle::pid
Int_t pid
Definition: PParticle.h:90
PParticle::fT
Double_t fT
Definition: PParticle.h:107
PParticle::daughterIndex
Int_t daughterIndex
Definition: PParticle.h:96
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
PParticle::Vect4
TLorentzVector Vect4() const
Definition: PParticle.h:62
PParticle::qParticle2
PParticle * qParticle2
Definition: PParticle.h:112
PParticle::status
Int_t status
pointer to value container
Definition: PParticle.h:118
PParticle::SetParentIndex
void SetParentIndex(Int_t pInd)
Definition: PParticle.h:79
PParticle::SetSourceId
void SetSourceId(Int_t sId)
Definition: PParticle.h:76
PParticle::parentId
Int_t parentId
Definition: PParticle.h:92
PParticle::getVertex
TVector3 & getVertex()
Definition: PParticle.h:73
PParticle::genwt
Double_t genwt
Definition: PParticle.h:102
PParticle::ResetDaughters
void ResetDaughters(void)
Definition: PParticle.h:82
PParticle::SetSibling
void SetSibling(PParticle *p)
Definition: PParticle.h:80
PParticle::active
Bool_t active
Definition: PParticle.h:108
PParticle::mult
Double_t mult
inverted generator weight
Definition: PParticle.h:104
PParticle::SetDaughterIndex
void SetDaughterIndex(Int_t dInd)
Definition: PParticle.h:77
PParticle::SetParentId
void SetParentId(Int_t pId)
Definition: PParticle.h:75
PParticle::daughters
PParticle * daughters[MAX_DAUGHTERS+1]
pointer to particle object
Definition: PParticle.h:114
PParticle::GetParentIndex
Int_t GetParentIndex() const
Definition: PParticle.h:69
MAX_DAUGHTERS
#define MAX_DAUGHTERS
Definition: PParticle.h:16
PParticle::ID
Int_t ID() const
Definition: PParticle.h:60
PParticle::sourceId
Int_t sourceId
Definition: PParticle.h:91
PParticle::GetDaughterIndex
Int_t GetDaughterIndex() const
Definition: PParticle.h:70
PParticle::parentIndex
Int_t parentIndex
Definition: PParticle.h:93
PValues.h
PParticle::SetSiblingIndex
void SetSiblingIndex(Int_t sInd)
Definition: PParticle.h:78
PParticle::make_new_qParticle
Bool_t make_new_qParticle
status of parent particle in PChannel::Decay
Definition: PParticle.h:120
PParticle::values
PValues * values
debug string
Definition: PParticle.h:117
PParticle::index
Int_t index
internal activity flag
Definition: PParticle.h:109
PParticle::SetVertex
void SetVertex(Double_t x, Double_t y, Double_t z, Double_t t)
Definition: PParticle.h:64
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
PParticle::sParticle
PParticle * sParticle
Definition: PParticle.h:113
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
PParticle::fV
TVector3 fV
multiplicity
Definition: PParticle.h:106
PParticle::invgenwt
Double_t invgenwt
generator weight
Definition: PParticle.h:103
PParticle::destroyDecayModeIndex
Int_t destroyDecayModeIndex
Definition: PParticle.h:95
PParticle::qParticle1
PParticle * qParticle1
pointer to particle object
Definition: PParticle.h:111
PParticle::debug
TString debug
pointer to daughter array
Definition: PParticle.h:115
PParticle::siblingIndex
Int_t siblingIndex
Definition: PParticle.h:97
PParticle::pParticle
PParticle * pParticle
index in particle array
Definition: PParticle.h:110