]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ANALYSIS/AliAODParticle.h
Allowing coding conventions to be checked
[u/mrichter/AliRoot.git] / ANALYSIS / AliAODParticle.h
CommitLineData
a5556ea5 1#ifndef ALIAODPARTICLE_H
2#define ALIAODPARTICLE_H
afa8b37b 3//___________________________________________________________
a5556ea5 4/////////////////////////////////////////////////////////////
5//
afa8b37b 6// class AliAODParticle
7//
8// Ali HBT Particle: simplified class TParticle
9// Simplified in order to minimize the size of the object
10// - we want to keep a lot of such a objects in memory
11// Additionaly adjusted for HBT Analysies purposes
12// + pointer to Track Points
13// + pointer to Cluster Map(s)
14//
15// Piotr.Skowronski@cern.ch
a5556ea5 16//
17/////////////////////////////////////////////////////////////
18
afa8b37b 19#include "AliVAODParticle.h"
20//#include <TLorentzVector.h>
21//#include <TMath.h>
22#include <TDatabasePDG.h>
a5556ea5 23
a5556ea5 24
afa8b37b 25class TParticle;
a5556ea5 26class AliTrackPoints;
27class AliClusterMap;
28
afa8b37b 29class AliAODParticle: public AliVAODParticle
30{
a5556ea5 31public:
afa8b37b 32 // ****** constructors and destructor
33 AliAODParticle();
34 AliAODParticle(const AliAODParticle& in);
35
36 AliAODParticle(Int_t pdg, Int_t idx, Double_t px, Double_t py, Double_t pz, Double_t etot,
37 Double_t vx, Double_t vy, Double_t vz, Double_t time);
38
39 AliAODParticle(Int_t pdg, Float_t prob, Int_t idx, Double_t px, Double_t py, Double_t pz, Double_t etot,
40 Double_t vx, Double_t vy, Double_t vz, Double_t time);
41
42 AliAODParticle(const TParticle& p, Int_t idx);
43
44 virtual ~AliAODParticle();
45
46 AliAODParticle& operator=(const AliAODParticle& in);
47
48 TLorentzVector FourMomentum() const {TLorentzVector v(fPx,fPy,fPz,fE);return v;}
49 TVector3 ProductionVertex() const {TVector3 v(fVx,fVy,fVz);return v;}
50
51 void SetPIDprobability(Int_t pdg, Float_t prob = 1.0);
52 Float_t GetPIDprobability(Int_t pdg) const;
53 Double_t GetProbability(Int_t pdg) const {return GetPIDprobability(pdg);}
54 Int_t GetMostProbable() const { return (fPids)?fPids[0]:0;}
55
56 Int_t GetPdgCode () const { return (fPids)?fPids[fPdgIdx]:0;}
57
58 Float_t GetPidProb () const { return (fPidProb)?fPidProb[fPdgIdx]:0;}
59
60 Int_t GetUID () const { return fIdxInEvent;}
61 Int_t GetNumberOfPids () const { return fNPids;}
62 Int_t GetNthPid (Int_t idx) const;
63 Float_t GetNthPidProb (Int_t idx) const;
64
65 void SetPdgCode(Int_t pdg, Float_t prob = 1.0);
66 Double_t GetCalcMass () const { return fCalcMass; }
67 Double_t Mass () const { return (GetPDG())?GetPDG()->Mass():-1.;}
68
69
70 TParticlePDG* GetPDG () const {return TDatabasePDG::Instance()->GetParticle(GetPdgCode());}
71 Double_t Charge () const { return (GetPDG())?GetPDG()->Charge():1.e8;}
72
73 Int_t Beauty () { return GetPDG()->Beauty(); }
74 Int_t Charm () { return GetPDG()->Charm(); }
75 Int_t Strangeness () { return GetPDG()->Strangeness();}
76 void ProductionVertex(TLorentzVector &v) const { v.SetXYZT(fVx,fVy,fVz,fVt);}
77
78
79 Double_t Vx () const { return fVx;}
80 Double_t Vy () const { return fVy;}
81 Double_t Vz () const { return fVz;}
82 Double_t T () const { return fVt;}
83
84 Double_t Px () const { return fPx; } //X coordinate of the momentum
85 Double_t Py () const { return fPy; } //Y coordinate of the momentum
86 Double_t Pz () const { return fPz; } //Z coordinate of the momentum
87 Double_t P () const //momentum
88 { return TMath::Sqrt(fPx*fPx+fPy*fPy+fPz*fPz); }
89
90 void Momentum(TLorentzVector &v) const { v.SetPxPyPzE(fPx,fPy,fPz,fE);}
91
92 Double_t Pt () const //transverse momentum
93 { return TMath::Sqrt(fPx*fPx+fPy*fPy); }
94 Double_t Energy() const { return fE; }
95
96 //Pseudo Rapidity
97 Double_t Eta () const { if (P() != fPz) return 0.5*TMath::Log((P()+fPz)/(P()-fPz));
98 else return 1.e30;}
99
100 //Rapidity
101 Double_t Y () const { if (fE != fPz) return 0.5*TMath::Log((fE+fPz)/(fE-fPz));
102 else return 1.e30;}
103
104 Double_t Phi () const { return TMath::Pi()+TMath::ATan2(-fPy,-fPx); }
105
106 Double_t Theta () const { return (fPz==0)?TMath::PiOver2():TMath::ACos(fPz/P()); }
107
108 // setters
109
110 void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
111 {fPx=px; fPy=py; fPz=pz; fE=e;}
112 void SetMomentum(const TLorentzVector& p)
113 {SetMomentum(p.Px(),p.Py(),p.Pz(),p.Energy());}
114
115 void SetProductionVertex(Double_t vx, Double_t vy, Double_t vz, Double_t t)
116 {fVx=vx; fVy=vy; fVz=vz; fVt=t;}
117 void SetProductionVertex(const TLorentzVector& v)
118 {SetProductionVertex(v.X(),v.Y(),v.Z(),v.T());}
119 void SetCalcMass(Double_t mass) {fCalcMass = mass;}
120
121 void SetUID(Int_t id){fIdxInEvent = id;}
122
123 const Char_t* GetName() const;
124 void Print() const;
125
126 void SetTrackPoints(AliTrackPoints* tpts){fTrackPoints = tpts;}
127 AliTrackPoints* GetTrackPoints() const {return fTrackPoints;}
128 void SetClusterMap(AliClusterMap* cm){fClusterMap = cm;}
129 AliClusterMap* GetClusterMap() const {return fClusterMap;}
130
131
132protected:
133 Int_t GetPidSlot(Int_t pdg) const;//returns position of the given PID in fPids (and fPidProb) array.
a5556ea5 134
135private:
afa8b37b 136 Char_t fPdgIdx; // index of PDG code of the particle in fPids
137 Int_t fIdxInEvent; // index of a particle: the same particle can appear in the event
138 // many times with different pid's. Idx allows to check that they are the same particles
139 Int_t fNPids; // number of non-zero proboble Pids
140 Int_t *fPids; // [fNPids] Array with PIDs
141 Float_t *fPidProb; // [fNPids] PIDs probabilities
142 Double_t fCalcMass; // Calculated mass
143
144
145 Double_t fPx; // x component of momentum
146 Double_t fPy; // y component of momentum
147 Double_t fPz; // z component of momentum
148 Double_t fE; // Energy
149
150 Double_t fVx; // x of production vertex
151 Double_t fVy; // y of production vertex
152 Double_t fVz; // z of production vertex
153 Double_t fVt; // t of production vertex
a5556ea5 154
afa8b37b 155 AliTrackPoints* fTrackPoints; // track positions along trajectory - used by anti-merging cut
156 AliClusterMap* fClusterMap; // bit map of cluters occupation; 1 if has cluter on given layer/padrow/...
157
158 ClassDef(AliAODParticle,3) // TParticle vertex particle information
a5556ea5 159};
160
161#endif