]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HBTAN/AliHBTParticle.h
Modifications needed by the HBT analysis (P.Skowronski)
[u/mrichter/AliRoot.git] / HBTAN / AliHBTParticle.h
1 #ifndef ALIHBTPARTICLE_H
2 #define ALIHBTPARTICLE_H
3 //___________________________________________________________
4 /////////////////////////////////////////////////////////////
5 //
6 // class AliHBTParticle
7 //
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)
14 //
15 // Piotr.Skowronski@cern.ch
16 //
17 /////////////////////////////////////////////////////////////
18
19 #include <TObject.h>
20 #include <TLorentzVector.h>
21 #include <TMath.h>
22 #include <TDatabasePDG.h>
23
24
25 class TParticle;
26 class AliHBTTrackPoints;
27 class AliHBTClusterMap;
28
29 class AliHBTParticle : public TObject
30 {
31 public:
32                                 // ****** constructors and destructor
33   AliHBTParticle();
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);
38
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);
41
42   AliHBTParticle(const TParticle& p,Int_t idx);
43
44   virtual ~AliHBTParticle();
45   
46   AliHBTParticle& operator=(const AliHBTParticle& in); 
47   
48   void           SetPIDprobability(Int_t pdg, Float_t prob = 1.0);
49   Float_t        GetPIDprobability(Int_t pdg) const;
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;}
56   Int_t          GetNumberOfPids () const { return fNPids;}
57   Int_t          GetNthPid         (Int_t idx) const;
58   Float_t        GetNthPidProb     (Int_t idx) const;
59       
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.;}
63
64   TParticlePDG*  GetPDG          (){return TDatabasePDG::Instance()->GetParticle(GetPdgCode());}
65
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);}
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   
83   void Momentum(TLorentzVector &v) const { v.SetPxPyPzE(fPx,fPy,fPz,fE);}
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
97   Double_t         Phi   () const { return TMath::Pi()+TMath::ATan2(-fPy,-fPx); }
98
99   Double_t         Theta () const { return (fPz==0)?TMath::PiOver2():TMath::ACos(fPz/P()); }
100
101   // setters
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());}
112   void           SetCalcMass(Double_t mass) {fCalcMass = mass;}
113   
114   void           SetUID(Int_t id){fIdxInEvent = id;}
115   
116   const Char_t*  GetName() const; 
117   void           Print() const;
118   
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;}
123   
124   static void    SetDebug(Int_t dbg=1){fgDebug=dbg;}
125   static Int_t   GetDebug(){return fgDebug;}
126   
127 protected:
128   Int_t          GetPidSlot(Int_t pdg) const;//returns position of the given PID in fPids (and fPidProb) array.
129
130 private:
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
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
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/...
151     
152   static Int_t   fgDebug; //debug printout level
153   ClassDef(AliHBTParticle,3)  // TParticle vertex particle information
154 };
155
156 #endif