]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/AliHFEreducedTrack.h
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEreducedTrack.h
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 *                                                                        *
4 * Author: The ALICE Off-line Project.                                    *
5 * Contributors are mentioned in the code where appropriate.              *
6 *                                                                        *
7 * Permission to use, copy, modify and distribute this software and its   *
8 * documentation strictly for non-commercial purposes is hereby granted   *
9 * without fee, provided that the above copyright notice appears in all   *
10 * copies and that both the copyright notice and this permission notice   *
11 * appear in the supporting documentation. The authors make no claims     *
12 * about the suitability of this software for any purpose. It is          *
13 * provided "as is" without express or implied warranty.                  *
14 **************************************************************************/
15 //
16 // Debug tree to look at the distribution of the variable we are cutting on
17 //
18 //
19 #ifndef ALIHFEREDUCEDTRACK_H
20 #define ALIHFEREDUCEDTRACK_H
21
22 #include <TObject.h>
23 #include <TMath.h>
24 #include <TBits.h>
25
26 class AliHFEreducedTrack : public TObject{
27  public:
28   typedef enum{
29     kV0electron = 0,
30     kV0proton = 1,
31     kV0pion = 2,
32     kV0undef = 3
33   } EV0PID_t;
34   AliHFEreducedTrack();
35   AliHFEreducedTrack(const AliHFEreducedTrack &ref);
36   AliHFEreducedTrack &operator=(const AliHFEreducedTrack &ref);
37   ~AliHFEreducedTrack() {}
38   
39   // -------------- Getters ------------------------
40   Double_t Pt() const { return TMath::Abs(fSignedPt); }
41   Double_t P() const { return fP; }
42   Double_t TPCmomentum() const { return fTPCmomentum; }
43   Double_t Eta() const { return fEta; }
44   Double_t Phi() const { return fPhi; }
45   Int_t Charge() const {
46     if(fSignedPt >= 0.) return 1.;
47     return -1;
48   }
49   
50   Double_t MCPt() const { return TMath::Abs(fMCSignedPt); }
51   Double_t MCP() const { return fMCP; }
52   Double_t MCEta() const { return fMCEta; }
53   Double_t MCPhi() const { return fMCPhi; }
54   Int_t MCCharge() const {
55     if(fMCSignedPt >= 0.) return 1.;
56     return -1;
57   }
58   Int_t MCPDG() const { return fMCPDG; }
59   Int_t MCMotherPdg() const { return fMCMotherPdg; }
60   Bool_t MCSignal() const { return fMCSignal; }
61   Int_t MCSource() const { return fMCSource; }
62   Int_t MCElectronSource() const { return static_cast<Int_t>(fMCEleSource); }
63   Double_t MCProdVtxX() const { return fMCProdVtx[0]; }
64   Double_t MCProdVtxY() const { return fMCProdVtx[1]; }
65   Double_t MCProdVtxZ() const { return fMCProdVtx[2]; }
66   Double_t MCMotherProdVtxX() const { return fMCMotherProdVtx[0]; }
67   Double_t MCMotherProdVtxY() const { return fMCMotherProdVtx[1]; }
68   Double_t MCMotherProdVtxZ() const { return fMCMotherProdVtx[2]; }
69   Double_t MCProdRadius() const { return TMath::Sqrt(fMCProdVtx[0]*fMCProdVtx[0]+fMCProdVtx[1]*fMCProdVtx[1]); }
70   
71   Double_t DCAr() const { return fDCA[0]; }
72   Double_t DCAz() const { return fDCA[1]; }
73   Double_t HFEImpactParameter() const { return fHFEImpactParam[0]; }
74   Double_t HFEImpactParameterResolution() const { return fHFEImpactParam[1]; }
75   
76   Bool_t TestFilterBit(Int_t ibit) const { return fFilterBit.TestBitNumber(ibit); }
77   Int_t GetTrackID() const { return fTrackID; }
78   Bool_t HasITSrefit() const { return fTrackStatus.TestBitNumber(kITSrefit); }
79   Bool_t HasTPCrefit() const { return fTrackStatus.TestBitNumber(kTPCrefit); }
80   Bool_t HasTOFpid() const { return fTrackStatus.TestBitNumber(kTOFpid); }
81   Bool_t IsTOFmismatch() const { return fTrackStatus.TestBitNumber(kTOFmismatch); }
82   Bool_t HasEMCALpid() const { return fTrackStatus.TestBitNumber(kEMCALpid); }
83   Bool_t IsDoubleCounted() const { return fTrackStatus.TestBitNumber(kDoubleCounted); }
84   Bool_t IsKinkMother() const { return fTrackStatus.TestBitNumber(kKinkMother); }
85   Bool_t IsKinkDaughter() const { return fTrackStatus.TestBitNumber(kKinkDaughter); }
86   
87   Int_t GetITSnclusters() const { return static_cast<Int_t>(fNclustersITS); }
88   Int_t GetTPCnclusters() const { return static_cast<Int_t>(fNclustersTPC); }
89   Int_t GetTRDnclusters() const { return static_cast<Int_t>(fNclustersTRD); }
90   Bool_t HasITScluster(int nly) const { 
91     if(nly > 5) return kFALSE;
92     return fITSclusterMap.TestBitNumber(nly);
93   }
94   Bool_t GetITSlayerStatus(int nly) const { 
95     if(nly > 5) return kFALSE;
96     return fITSstatusMap.TestBitNumber(nly);
97   }
98   Double_t GetChi2PerTPCcluster() const { return fChi2PerTPCcluster; }
99   Int_t GetTPCnclusterPID() const { return static_cast<Int_t>(fNclustersTPCPID); }
100   Int_t GetTPCnclustersAll() const { return static_cast<Int_t>(fNclustersTPCAll); }
101   Int_t GetTPCcrossedRows() const { return static_cast<Int_t>(fTPCcrossedRows); }
102   Int_t GetTPCsharedClusters() const { return static_cast<Int_t>(fTPCsharedClusters); }
103   Float_t GetTPCclusterRatio() const { return fTPCclusterRatio; }
104   Float_t GetTPCclusterRatioAll() const { return fTPCclusterRatioAll; }
105   Int_t GetTRDntrackletsPID() const { return static_cast<UChar_t>(fTRDtrackletsPID); }
106   Int_t GetTRDnslices() const { return static_cast<Int_t>(fTRDnslices); }
107   Bool_t GetTRDstatus(Int_t layer) const { 
108     if(layer > 5) return kFALSE;
109     return fTRDlayer.TestBitNumber(layer); 
110   }
111   Float_t GetTRDchi2() const { return fTRDchi2; }
112   
113   Double_t GetTPCdEdx() const { return fTPCdEdx; }
114   Double_t GetTPCdEdxCorrected() const { return fTPCdEdxCorrected; }
115   Double_t GetTPCsigmaEl() const { return fTPCsigmaEl; }
116   Double_t GetTPCsigmaElCorrected() const { return fTPCsigmaElCorrected; }
117   Double_t GetTOFsigmaEl() const { return fTOFsigmaEl; }
118   Double_t GetTOFsigmaDeuteron() const { return fTOFsigmaDeuteron; }
119   Float_t GetTOFmismatchProb() const { return fTOFmismatchProb; }
120   Double_t GetITSsigmaEl() const { return fITSsigmaEl; }
121   Double_t GetEMCALEoverP() const { return fEoverP; }
122   Double_t GetEMCALSigmaEl() const { return fEMCALsigmaEl; }
123   void GetEMCALShowerShape(Double_t showershape[4]) const{
124     for(Int_t is = 0; is < 4; is++) showershape[is] = fShowerShape[is]; 
125   }
126   
127   Bool_t IsV0electron() const { return fV0PID == kV0electron; }
128   Bool_t IsV0pion() const { return fV0PID == kV0pion; }
129   Bool_t IsV0proton() const { return fV0PID == kV0proton; }
130   
131   Float_t GetV0prodR() const { return fV0ProdR; }
132   Double_t GetDCAerr() const { return fDCAerr; }
133   
134   // -------------- Setters ------------------------
135   void SetSignedPt(Double_t abspt, Bool_t positivecharge) { 
136     Double_t charge = positivecharge ? 1. : -1;
137     fSignedPt = abspt * charge;
138   }
139   void SetP(Double_t p) { fP = p; }
140   void SetTPCmomentum(Double_t p) { fTPCmomentum = p; }
141   void SetEta(Double_t eta) { fEta = eta; }
142   void SetPhi(Double_t phi) { fPhi = phi; }
143   
144   void SetFilterBit(Int_t ibit) { fFilterBit.SetBitNumber(ibit); }
145   void SetTrackID(Int_t trackID) { fTrackID = trackID; }
146   void SetITSrefit() { fTrackStatus.SetBitNumber(kITSrefit); }
147   void SetTPCrefit() { fTrackStatus.SetBitNumber(kTPCrefit); }
148   void SetTOFpid() { fTrackStatus.SetBitNumber(kTOFpid); }
149   void SetTOFmismatch() { fTrackStatus.SetBitNumber(kTOFmismatch); }
150   void SetEMCALpid() { fTrackStatus.SetBitNumber(kEMCALpid); }
151   void SetDoubleCounted() { fTrackStatus.SetBitNumber(kDoubleCounted); }
152   void SetIsKinkMother() { fTrackStatus.SetBitNumber(kKinkMother); }
153   void SetIsKinkDaughter() { fTrackStatus.SetBitNumber(kKinkDaughter); }
154   
155   
156   void SetMCSignedPt(Double_t abspt, Bool_t positivecharge){
157     Double_t charge = positivecharge ? 1. : -1;
158     fMCSignedPt = abspt * charge;
159   }
160   void SetMCP(Double_t mcp) { fMCP = mcp; }
161   void SetMCEta(Double_t mceta) { fMCEta = mceta; }
162   void SetMCPhi(Double_t mcphi) { fMCPhi = mcphi; }
163   void SetMCPDG(Int_t mcpdg) {fMCPDG = mcpdg; }
164   void SetMCMotherPdg(Int_t pdg) { fMCMotherPdg = pdg; }
165   void SetMCSignal() { fMCSignal = kTRUE; }
166   void SetMCSource(Int_t mcsource) { fMCSource = mcsource; }
167   void SetMCElectronSource(Int_t source) { fMCEleSource = static_cast<UChar_t>(source); }
168   void SetMCProdVtx(Double_t vx, Double_t vy, Double_t vz){
169     fMCProdVtx[0] = vx;
170     fMCProdVtx[1] = vy;
171     fMCProdVtx[2] = vz;
172   }
173   void SetMCMotherProdVtx(Double_t vx, Double_t vy, Double_t vz){
174     fMCMotherProdVtx[0] = vx;
175     fMCMotherProdVtx[1] = vy;
176     fMCMotherProdVtx[2] = vz;
177   }
178   
179   void SetDCA(Float_t dcaR, Float_t dcaZ){
180     fDCA[0] = dcaR;
181     fDCA[1] = dcaZ;
182   }
183   void SetHFEImpactParam(Double_t impactParam, Double_t impactParamResolution){
184     fHFEImpactParam[0] = impactParam;
185     fHFEImpactParam[1] = impactParamResolution;
186   }
187   
188   void SetITSnclusters(int ncls) { fNclustersITS = ncls; }
189   void SetTPCnclusters(int ncls) { fNclustersTPC = ncls; }
190   void SetTRDnclusters(int ncls) { fNclustersTRD = ncls; }
191   void SetITScluster(UInt_t ly){
192     if(ly > 5) return;
193     fITSclusterMap.SetBitNumber(ly); 
194   }
195   void SetITSstatus(UInt_t ly){
196     if(ly > 5) return;
197     fITSstatusMap.SetBitNumber(ly); 
198   }
199   void SetChi2PerTPCcluster(Double_t value) { fChi2PerTPCcluster = value; }
200   void SetTPCnclustersPID(Int_t ncls) { fNclustersTPCPID = static_cast<UChar_t>(ncls); }
201   void SetTPCnclustersAll(Int_t ncls) { fNclustersTPCAll = static_cast<UChar_t>(ncls); }
202   void SetTPCcrossedRows(int nrows) { fTPCcrossedRows = static_cast<UChar_t>(nrows); }
203   void SetTPCsharedClusters(Int_t ncls) { fTPCsharedClusters = static_cast<UChar_t>(ncls); }
204   void SetTPCclusterRatio(Float_t ratio) { fTPCclusterRatio = ratio; }
205   void SetTPCclusterRatioAll(Float_t ratio) { fTPCclusterRatioAll = ratio; }
206   void SetTRDntrackletsPID(Int_t ntracklets) { fTRDtrackletsPID = static_cast<UChar_t>(ntracklets); }
207   void SetTRDnslices(Int_t nslices) { fTRDnslices = static_cast<UChar_t>(nslices); }
208   void SetTRDstatus(Int_t layer) { 
209     if(layer > 5) return;
210     fTRDlayer.SetBitNumber(static_cast<UInt_t>(layer)); 
211   }
212   void SetTRDchi2(Float_t chi2) { fTRDchi2 = chi2; }
213   
214   void SetTPCdEdx(Double_t dEdx) { fTPCdEdx = dEdx; }
215   void SetTPCdEdxCorrected(Double_t dEdx) { fTPCdEdxCorrected = dEdx; }
216   void SetTPCsigmaEl(Double_t sigma) { fTPCsigmaEl = sigma; }
217   void SetTPCsigmaElCorrected(Double_t sigma) { fTPCsigmaElCorrected = sigma; }
218   void SetTOFsigmaEl(Double_t sigma) { fTOFsigmaEl = sigma; }
219   void SetTOFsigmaDeuteron(Double_t sigma) { fTOFsigmaDeuteron = sigma; }
220   void SetTOFmismatchProbability(Float_t mismatchProb) { fTOFmismatchProb = mismatchProb; }
221   void SetITSsigmaEl(Double_t sigma) { fITSsigmaEl = sigma; }
222   void SetEMCALEoverP(Double_t eop) { fEoverP = eop; }
223   void SetEMCALSigmaEl(Double_t sigma) { fEMCALsigmaEl = sigma; }
224   void SetEMCALShowerShape(Double_t showershape[4]){
225     for(Int_t is = 0; is < 4; is++) fShowerShape[is] = showershape[is]; 
226   }
227   void SetV0PID(AliHFEreducedTrack::EV0PID_t v0pid) { fV0PID = v0pid; }
228   void SetV0prodR(Double_t v0prodR) { fV0ProdR = v0prodR; }
229   void SetDCAerr(Double_t InDCAerr) { fDCAerr = InDCAerr;}
230   
231  private:
232   typedef enum{
233     kITSrefit = 0,
234     kTPCrefit = 1,
235     kTOFpid   = 2,
236     kTOFmismatch = 3,
237     kEMCALpid =4,
238     kDoubleCounted = 5,
239     kKinkMother = 6,
240     kKinkDaughter = 7
241   } TrackStatus_t;
242   Double_t fSignedPt;                     // signed pt
243   Double_t fP;                            // p
244   Double_t fEta;                          // eta
245   Double_t fPhi;                          // phi
246   Double_t fTPCmomentum;                  // TPC p
247   TBits    fFilterBit;                    // filterbit
248   Int_t    fTrackID;                      // trackID
249   Double_t fMCSignedPt;                   // MCSignedPt
250   Double_t fMCP;                          // MCP
251   Double_t fMCEta;                        // MCEta
252   Double_t fMCPhi;                        // MCPhi
253   Int_t    fMCPDG;                        // MCPDG
254   Int_t    fMCMotherPdg;                  // MCMP
255   Bool_t   fMCSignal;                     // MCSignal
256   Int_t    fMCSource;                     // MCSource
257   UChar_t  fMCEleSource;                  // MC Electron Source (AliHFEmcQA)
258   Double_t fMCProdVtx[3];                 // MC prod Vtx
259   Double_t fMCMotherProdVtx[3];           // MC prod Vtx of the mother
260   TBits    fTrackStatus;                  // Track Status
261   UChar_t  fNclustersITS;                 // ITS nb cls
262   UChar_t  fNclustersTPC;                 // TPC nb cls
263   UChar_t  fNclustersTRD;                 // TRD nb cls
264   TBits    fITSclusterMap;                // ITS maps
265   TBits    fITSstatusMap;                 // ITS status map
266   UChar_t  fNclustersTPCPID;              // TPC PID nb cls
267   UChar_t  fNclustersTPCAll;              // TPC all nb cls
268   UChar_t  fTPCcrossedRows;               // TPC crossed rows
269   UChar_t  fTPCsharedClusters;            // TPC shared clusters
270   Float_t  fTPCclusterRatio;              // TPC cls ratio
271   Float_t  fTPCclusterRatioAll;           // TPC cls ratio all
272   Double_t fChi2PerTPCcluster;            // Chi2/TPC cluster
273   UChar_t  fTRDtrackletsPID;              // TRD tracklet PID
274   UChar_t  fTRDnslices;                   // TRD nslices
275   TBits    fTRDlayer;                     // TRD layer
276   Float_t  fTRDchi2;                      // TRD chi2
277   Double_t fTPCdEdx;                      // TPC dedx
278   Double_t fTPCdEdxCorrected;             // TPC dedx corrected
279   Double_t fTPCsigmaEl;                   // TPC sigma el
280   Double_t fTPCsigmaElCorrected;          // TPC sigma el corrected
281   Double_t fTOFsigmaEl;                   // TOF sigma el
282   Double_t fTOFsigmaDeuteron;             // TOF sigma deuteron
283   Float_t  fTOFmismatchProb;              // TOF mismatch prob
284   Double_t fITSsigmaEl;                   // ITS sigma el
285   Double_t fEoverP;                       // Eoverp
286   Double_t fEMCALsigmaEl;                 // EMCAl sigmal el
287   Double_t fShowerShape[4];               // showershape
288   Float_t fDCA[2];                        // dca
289   Double_t fHFEImpactParam[2];            // HFE impact paramter (value, resolution) for beauty analysis
290   EV0PID_t fV0PID;                        // V0pid
291   Double_t  fV0ProdR;                      // V0 doughter production vertex R in x-y plane 
292   Double_t fDCAerr;                       // New: Error on Track DCA
293   
294   ClassDef(AliHFEreducedTrack, 3)
295 };
296 #endif