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