]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/Correlations/DPhi/DiHadronPID/AliTrackDiHadronPID.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / Correlations / DPhi / DiHadronPID / AliTrackDiHadronPID.h
1 #ifndef ALITRACKDIHADRONPID_H
2 #define ALITRACKDIHADRONPID_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * 
4 * See cxx source for full Copyright notice */ 
5 /* $Id$ */
6
7 #include <iostream>
8 using namespace std;
9
10 #include "AliAODTrack.h"
11 #include "AliAODEvent.h"
12 #include "AliAODMCParticle.h"
13 #include "AliPIDResponse.h"
14
15 class AliTrackDiHadronPID : public TObject {
16
17 public:
18         AliTrackDiHadronPID();
19         AliTrackDiHadronPID(AliAODTrack* track, AliAODTrack* globaltrack = 0x0, AliAODMCParticle* mcparticle = 0x0, AliPIDResponse* pidresponse = 0x0);
20         virtual ~AliTrackDiHadronPID() {}
21
22 private:
23         AliTrackDiHadronPID(const AliTrackDiHadronPID&);
24         AliTrackDiHadronPID& operator=(const AliTrackDiHadronPID&);
25
26 // Internal copy functions.
27 private:
28         Bool_t CopyBasicTrackInfo();
29         Bool_t CopyFlags();
30         Bool_t CopyDCAInfo();
31         Bool_t CopyITSInfo();
32         Bool_t CopyTPCInfo();
33         Bool_t CopyTOFInfo();
34         Bool_t CopyMCInfo();
35
36 // Check functions.
37 public:
38         Bool_t IsBasicTrackInfoAvailable() const {return fBasicInfoAvailable;}
39         Bool_t IsFlagInfoAvailable() const {return fFlagsAvailable;}
40         Bool_t IsDCAInfoAvailable() const {return fDCAInfoAvailable;}
41         Bool_t IsITSInfoAvailable() const {return fITSInfoAvailable;}
42         Bool_t IsTPCInfoAvailable() const {return fTPCInfoAvailable;}
43         Bool_t IsTOFInfoAvailable() const {return fTOFInfoAvailable;}
44         Bool_t IsMCInfoAvailable() const {return fMCInfoAvailable;}                     
45
46 public:
47 // Getting Track Parameters. Functionality is the same as AOD track,
48 // unless stated otherwise.
49         Bool_t UnknownSpecies(Int_t species) const;
50         Double_t Pt() const {return fPt;}
51         Double_t Eta() const {return fEta;}
52         Double_t Phi() const {return fPhi;}
53         Double_t Y(Int_t species) {
54                 if (UnknownSpecies(species)) return fY[species];
55                 else return -999.;
56         }
57
58         ULong_t GetFlags() const {return fFlags;}
59         ULong_t GetStatus() const {return GetFlags();}
60         UInt_t GetFilterMap() const {return fFilterMap;}
61         Bool_t TestFilterMask(UInt_t filterMask) const {return (Bool_t)((filterMask & fFilterMap) == filterMask);}
62
63         Int_t GetID() const {return fID;}
64         Int_t GetLabel() const {return fLabel;}
65         void GetTOFLabel(Int_t* label) const {label[0] = fTOFLabel[0]; label[1] = fTOFLabel[1]; label[2] = fTOFLabel[2];}
66         Short_t Charge() const {return fCharge;}
67         Int_t GetNclsTPC() const {return fNclsTPC;}
68
69         Double_t GetZAtDCA() const {return fDCAz;}
70         Double_t GetXYAtDCA() const {return fDCAxy;}
71
72         // TOF related Getters.
73         Double_t GetTOFsignal() const {return fTOFsignal;}
74         Double_t GetTOFsignalMinusExpected(Int_t species) const {
75                 if (UnknownSpecies(species)) {return -10e10;}
76                 return fTOFsignalMinusExpected[species];
77         }
78         Double_t GetTOFsignalExpected(Int_t species) const {
79                 if (UnknownSpecies(species)) {return -10e10;}
80                 return (fTOFsignal - fTOFsignalMinusExpected[species]);
81         }
82         Double_t GetTOFsigmaExpected(Int_t species) {
83                 if (UnknownSpecies(species)) {return -10e10;}
84                 if (GetNumberOfSigmasTOF(species) < 10e-10) {return -10e30;}
85                 return (GetTOFsignalMinusExpected(species)/GetNumberOfSigmasTOF(species));
86         }
87         Double_t GetNumberOfSigmasTOF(Int_t species) const {
88                 if (UnknownSpecies(species)) {return -10e10;}
89                 return fTOFNsigma[species];
90         }
91         Int_t GetTOFMatchingStatus() const {return fTOFMatchingStatus;}
92         Bool_t IsTOFMismatch() const {
93                 if (fTOFMatchingStatus==1) {return kTRUE;}
94                 else {return kFALSE;}
95         }
96
97         Double_t GetTPCsignal() const {return fTPCsignal;}
98         Double_t GetTPCsignalMinusExpected(Int_t species) const {return fTPCsignalMinusExpected[species];}
99         Double_t GetTPCmomentum() const {return fTPCmomentum;}
100         Double_t GetNumberOfSigmasTPC(Int_t species) const {
101                 if (UnknownSpecies(species)) {return -10e10;}
102                 return fTPCNsigma[species];
103         }
104
105         Char_t GetITSClusterMap() const {return fITSClusterMap;}
106         Bool_t HasPointOnITSLayer(Int_t layer) const {
107                 if ((layer > -1) && (layer < 6)) return fITSHits[layer];
108                 else {
109                         cout<<"ITS has only 6 layers."<<endl;
110                         return kFALSE;
111                 }
112         }
113
114         Double_t MCPt() const {return fMCPt;}
115         Double_t MCEta() const {return fMCEta;}
116         Double_t MCPhi() const {return fMCPhi;}
117         Double_t MCY() const {return fMCY;}
118         Int_t GetMCSpecies() const {
119                 Int_t abspdg = TMath::Abs(GetPdgCode());
120                 if (abspdg == 211) return 0;
121                 else if (abspdg == 321) return 1;
122                 else if (abspdg == 2212) return 2;
123                 else return -999;
124         }
125         
126         Int_t GetPdgCode() const {return fPdgCode;}
127         Bool_t IsPhysicalPrimary() const {return fIsPhysicalPrimary;}
128         Bool_t IsSecondaryFromWeakDecay() const {return fIsSecondaryFromWeakDecay;}
129         Bool_t IsSecondaryFromMaterial() const {return fIsSecondaryFromMaterial;}
130
131         void ForgetAboutPointers() {
132                 // AOD tracks are usually deleted, while the 
133                 // AliTrackDiHadronPID is not. This method ensures that
134                 // the pointers to the track/event objects etc. don't
135                 // point to deleted objects.
136                 fAODTrack = 0x0;
137                 fAODGlobalTrack = 0x0;
138                 fAODEvent = 0x0;
139                 fAODMCParticle = 0x0;
140                 fPIDResponse = 0x0;
141         }
142
143         void SetDebugLevel(Int_t debuglevel) {fDebug = debuglevel;}
144         Int_t GetDebugLevel() const {return fDebug;}
145
146 private:
147 // Pointers to original Tracks etc (cannot be returned, will not be streamed/saved).
148         AliAODTrack*            fAODTrack;                      //! Original AOD Track.
149         AliAODTrack*            fAODGlobalTrack;        //! Corresponding Global AOD Track.
150         AliAODEvent*            fAODEvent;                      //!     Original AOD Event.
151         AliAODMCParticle*       fAODMCParticle;         //! Original MC Particle.
152         AliPIDResponse*         fPIDResponse;           //!     Original PID Response.
153
154 // Flags if a certain type of information is available for this track.
155         Bool_t                          fBasicInfoAvailable;// Basic Track Info.
156         Bool_t                          fFlagsAvailable;
157         Bool_t                          fDCAInfoAvailable;      // DCA Info.
158         Bool_t                          fITSInfoAvailable;      // ITS Info.
159         Bool_t                          fTPCInfoAvailable;      // TPC Info.
160         Bool_t                          fTOFInfoAvailable;      // TOF Info.
161         Bool_t                          fMCInfoAvailable;       // MC Info.
162
163 // Basic Track Info.
164         Double_t                        fPt;                            // Reconstructed Pt.
165         Double_t                        fEta;                           // Reconstructed Eta.
166         Double_t                        fY[3];                          // Reconstructed Rapidity for pi,K,p.
167         Double_t                        fPhi;                           // Reconstructed Phi.
168
169         ULong_t                         fFlags;                         // Reconstruction Flags.
170         UInt_t                          fFilterMap;                     // FilterMap.
171
172         Short_t                         fID;                            // Track ID.
173         Int_t                           fLabel;                         // Track Label.
174         Int_t                           fTOFLabel[3];           // Track TOF label.
175
176         Short_t                         fCharge;                        // Charge (is a Char_t in AliAODTrack)
177         Int_t                           fNclsTPC;                       // Number of clusters in TPC.
178         
179 // DCA Info.
180         Double_t                        fDCAz;                          // z at DCA.
181         Double_t                        fDCAxy;                         // xy at DCA.
182
183 // PID Info.
184         Double_t                        fTOFsignal;                     
185         Double_t                        fTOFsignalMinusExpected[3];
186         Double_t                        fTOFNsigma[3];
187         Int_t                           fTOFMatchingStatus;             // 0 -> match, 1 -> mismatch, 2 -> no TOF hit.
188         Double_t                        fTPCsignal;                     
189         Double_t                        fTPCsignalMinusExpected[3];
190         Double_t                        fTPCNsigma[3];
191         Double_t                        fTPCmomentum;           
192         UChar_t                         fITSClusterMap;
193         Bool_t                          fITSHits[6];
194
195 // MC Info.
196         Double_t                        fMCPt;
197         Double_t                        fMCEta;
198         Double_t                        fMCPhi;
199         Double_t                        fMCY;
200         Int_t                           fPdgCode;
201         Bool_t                          fIsPhysicalPrimary;
202         Bool_t                          fIsSecondaryFromWeakDecay;
203         Bool_t                          fIsSecondaryFromMaterial;
204
205 // Static variables.
206 public:
207         static Double_t         fSigmaTOFStd;
208         static Double_t         fSigmaTPCStd;
209
210 // Debug.
211 private:
212         Int_t                           fDebug;                         // Debug flag.
213
214         ClassDef(AliTrackDiHadronPID,1);
215
216 };
217
218 #endif