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