1 #ifndef ALIHBTPARTICLE_H
2 #define ALIHBTPARTICLE_H
3 //___________________________________________________________
4 /////////////////////////////////////////////////////////////
6 // class AliHBTParticle
8 // Ali HBT Particle: simplified class TParticle
9 // Simplified in order to minimize the size of 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)
15 // Piotr.Skowronski@cern.ch
17 /////////////////////////////////////////////////////////////
20 #include <TLorentzVector.h>
22 #include <TDatabasePDG.h>
26 class AliHBTTrackPoints;
27 class AliHBTClusterMap;
29 class AliHBTParticle : public TObject
32 // ****** constructors and destructor
34 AliHBTParticle(const AliHBTParticle& in);
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);
39 AliHBTParticle(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);
42 AliHBTParticle(const TParticle& p,Int_t idx);
44 virtual ~AliHBTParticle();
46 AliHBTParticle& operator=(const AliHBTParticle& in);
48 void SetPIDprobability(Int_t pdg, Float_t prob = 1.0);
49 Float_t GetPIDprobability(Int_t pdg) const;
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;}
55 Int_t GetUID () const { return fIdxInEvent;}
56 Int_t GetNumberOfPids () const { return fNPids;}
57 Int_t GetNthPid (Int_t idx) const;
58 Float_t GetNthPidProb (Int_t idx) const;
60 void SetPdgCode(Int_t pdg, Float_t prob = 1.0);
61 Double_t GetCalcMass () const { return fCalcMass; }
62 Double_t GetMass () { return (GetPDG())?GetPDG()->Mass():-1.;}
64 TParticlePDG* GetPDG (){return TDatabasePDG::Instance()->GetParticle(GetPdgCode());}
66 Int_t Beauty () { return GetPDG()->Beauty(); }
67 Int_t Charm () { return GetPDG()->Charm(); }
68 Int_t Strangeness () { return GetPDG()->Strangeness();}
69 void ProductionVertex(TLorentzVector &v) const { v.SetXYZT(fVx,fVy,fVz,fVt);}
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;}
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); }
83 void Momentum(TLorentzVector &v) const { v.SetPxPyPzE(fPx,fPy,fPz,fE);}
85 Double_t Pt () const //transverse momentum
86 { return TMath::Sqrt(fPx*fPx+fPy*fPy); }
87 Double_t Energy() const { return fE; }
90 Double_t Eta () const { if (P() != fPz) return 0.5*TMath::Log((P()+fPz)/(P()-fPz));
94 Double_t Y () const { if (fE != fPz) return 0.5*TMath::Log((fE+fPz)/(fE-fPz));
97 Double_t Phi () const { return TMath::Pi()+TMath::ATan2(-fPy,-fPx); }
99 Double_t Theta () const { return (fPz==0)?TMath::PiOver2():TMath::ACos(fPz/P()); }
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());}
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());}
112 void SetCalcMass(Double_t mass) {fCalcMass = mass;}
114 void SetUID(Int_t id){fIdxInEvent = id;}
116 const Char_t* GetName() const;
119 void SetTrackPoints(AliHBTTrackPoints* tpts){fTrackPoints = tpts;}
120 AliHBTTrackPoints* GetTrackPoints() const {return fTrackPoints;}
121 void SetClusterMap(AliHBTClusterMap* cm){fClusterMap = cm;}
122 AliHBTClusterMap* GetClusterMap() const {return fClusterMap;}
124 static void SetDebug(Int_t dbg=1){fgDebug=dbg;}
125 static Int_t GetDebug(){return fgDebug;}
128 Int_t GetPidSlot(Int_t pdg) const;//returns position of the given PID in fPids (and fPidProb) array.
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
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
137 Double_t fCalcMass; // Calculated mass
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
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
149 AliHBTTrackPoints* fTrackPoints; // track positions along trajectory - used by anti-merging cut
150 AliHBTClusterMap* fClusterMap; // bit map of cluters occupation; 1 if has cluter on given layer/padrow/...
152 static Int_t fgDebug; //debug printout level
153 ClassDef(AliHBTParticle,3) // TParticle vertex particle information