]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ANALYSIS/AliAODParticle.h
First version of writing aod files. Reader for aod files. AliAOD::fParticles chnged...
[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);
78d7c6d3 35 AliAODParticle(const AliVAODParticle& in);
afa8b37b 36
37 AliAODParticle(Int_t pdg, Int_t idx, Double_t px, Double_t py, Double_t pz, Double_t etot,
38 Double_t vx, Double_t vy, Double_t vz, Double_t time);
39
40 AliAODParticle(Int_t pdg, Float_t prob, Int_t idx, Double_t px, Double_t py, Double_t pz, Double_t etot,
41 Double_t vx, Double_t vy, Double_t vz, Double_t time);
42
43 AliAODParticle(const TParticle& p, Int_t idx);
44
45 virtual ~AliAODParticle();
46
47 AliAODParticle& operator=(const AliAODParticle& in);
dd2b6810 48 AliAODParticle& operator=(const AliVAODParticle& in);
afa8b37b 49
dd2b6810 50 void Clear(Option_t* /*option*/ ="");//Must be implemented in order to store this object in Clones Array
295c08ac 51
afa8b37b 52 TLorentzVector FourMomentum() const {TLorentzVector v(fPx,fPy,fPz,fE);return v;}
53 TVector3 ProductionVertex() const {TVector3 v(fVx,fVy,fVz);return v;}
54
55 void SetPIDprobability(Int_t pdg, Float_t prob = 1.0);
56 Float_t GetPIDprobability(Int_t pdg) const;
57 Double_t GetProbability(Int_t pdg) const {return GetPIDprobability(pdg);}
78d7c6d3 58
afa8b37b 59 Int_t GetMostProbable() const { return (fPids)?fPids[0]:0;}
60
61 Int_t GetPdgCode () const { return (fPids)?fPids[fPdgIdx]:0;}
62
dd2b6810 63 Double_t GetPidProb () const { return (fPidProb)?fPidProb[fPdgIdx]:0;}
afa8b37b 64
65 Int_t GetUID () const { return fIdxInEvent;}
66 Int_t GetNumberOfPids () const { return fNPids;}
67 Int_t GetNthPid (Int_t idx) const;
68 Float_t GetNthPidProb (Int_t idx) const;
69
70 void SetPdgCode(Int_t pdg, Float_t prob = 1.0);
71 Double_t GetCalcMass () const { return fCalcMass; }
72 Double_t Mass () const { return (GetPDG())?GetPDG()->Mass():-1.;}
73
74
75 TParticlePDG* GetPDG () const {return TDatabasePDG::Instance()->GetParticle(GetPdgCode());}
76 Double_t Charge () const { return (GetPDG())?GetPDG()->Charge():1.e8;}
77
78 Int_t Beauty () { return GetPDG()->Beauty(); }
79 Int_t Charm () { return GetPDG()->Charm(); }
80 Int_t Strangeness () { return GetPDG()->Strangeness();}
81 void ProductionVertex(TLorentzVector &v) const { v.SetXYZT(fVx,fVy,fVz,fVt);}
82
83
84 Double_t Vx () const { return fVx;}
85 Double_t Vy () const { return fVy;}
86 Double_t Vz () const { return fVz;}
87 Double_t T () const { return fVt;}
88
89 Double_t Px () const { return fPx; } //X coordinate of the momentum
90 Double_t Py () const { return fPy; } //Y coordinate of the momentum
91 Double_t Pz () const { return fPz; } //Z coordinate of the momentum
92 Double_t P () const //momentum
93 { return TMath::Sqrt(fPx*fPx+fPy*fPy+fPz*fPz); }
94
95 void Momentum(TLorentzVector &v) const { v.SetPxPyPzE(fPx,fPy,fPz,fE);}
96
97 Double_t Pt () const //transverse momentum
98 { return TMath::Sqrt(fPx*fPx+fPy*fPy); }
b9eb3bc7 99 Double_t E() const { return fE; }
afa8b37b 100
101 //Pseudo Rapidity
102 Double_t Eta () const { if (P() != fPz) return 0.5*TMath::Log((P()+fPz)/(P()-fPz));
103 else return 1.e30;}
104
105 //Rapidity
106 Double_t Y () const { if (fE != fPz) return 0.5*TMath::Log((fE+fPz)/(fE-fPz));
107 else return 1.e30;}
108
109 Double_t Phi () const { return TMath::Pi()+TMath::ATan2(-fPy,-fPx); }
110
111 Double_t Theta () const { return (fPz==0)?TMath::PiOver2():TMath::ACos(fPz/P()); }
112
113 // setters
114
115 void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
116 {fPx=px; fPy=py; fPz=pz; fE=e;}
117 void SetMomentum(const TLorentzVector& p)
118 {SetMomentum(p.Px(),p.Py(),p.Pz(),p.Energy());}
119
120 void SetProductionVertex(Double_t vx, Double_t vy, Double_t vz, Double_t t)
121 {fVx=vx; fVy=vy; fVz=vz; fVt=t;}
122 void SetProductionVertex(const TLorentzVector& v)
123 {SetProductionVertex(v.X(),v.Y(),v.Z(),v.T());}
124 void SetCalcMass(Double_t mass) {fCalcMass = mass;}
125
78d7c6d3 126 void SetUID(Int_t id){fIdxInEvent = id;}
afa8b37b 127
78d7c6d3 128 const Char_t* GetName() const;
129 void Print() const;
afa8b37b 130
78d7c6d3 131 void SetTPCTrackPoints(AliTrackPoints* tpts){fTPCTrackPoints = tpts;}
132 AliTrackPoints* GetTPCTrackPoints() const {return fTPCTrackPoints;}
133 void SetITSTrackPoints(AliTrackPoints* tpts){fITSTrackPoints = tpts;}
134 AliTrackPoints* GetITSTrackPoints() const {return fITSTrackPoints;}
135 void SetClusterMap(AliClusterMap* cm){fClusterMap = cm;}
136 AliClusterMap* GetClusterMap() const {return fClusterMap;}
afa8b37b 137
138
139protected:
140 Int_t GetPidSlot(Int_t pdg) const;//returns position of the given PID in fPids (and fPidProb) array.
a5556ea5 141
142private:
afa8b37b 143 Char_t fPdgIdx; // index of PDG code of the particle in fPids
144 Int_t fIdxInEvent; // index of a particle: the same particle can appear in the event
145 // many times with different pid's. Idx allows to check that they are the same particles
146 Int_t fNPids; // number of non-zero proboble Pids
147 Int_t *fPids; // [fNPids] Array with PIDs
148 Float_t *fPidProb; // [fNPids] PIDs probabilities
149 Double_t fCalcMass; // Calculated mass
150
151
152 Double_t fPx; // x component of momentum
153 Double_t fPy; // y component of momentum
154 Double_t fPz; // z component of momentum
155 Double_t fE; // Energy
156
157 Double_t fVx; // x of production vertex
158 Double_t fVy; // y of production vertex
159 Double_t fVz; // z of production vertex
160 Double_t fVt; // t of production vertex
a5556ea5 161
78d7c6d3 162 AliTrackPoints* fTPCTrackPoints; // track positions along trajectory - used by anti-merging cut
163 AliTrackPoints* fITSTrackPoints; // track positions along trajectory - used by anti-merging cut
afa8b37b 164 AliClusterMap* fClusterMap; // bit map of cluters occupation; 1 if has cluter on given layer/padrow/...
165
166 ClassDef(AliAODParticle,3) // TParticle vertex particle information
a5556ea5 167};
168
169#endif