]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AOD/AliAODPid.h
Changes for #87282 Request for committing to trunk + port to v5-01 (TRD PID with...
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODPid.h
1 #ifndef AliAODPid_H
2 #define AliAODPid_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //-------------------------------------------------------------------------
9 //     AOD Pid object for additional pid information
10 //     Author: Annalisa Mastroserio, CERN
11 //-------------------------------------------------------------------------
12
13 #include <TObject.h>
14
15 class AliAODPid : public TObject {
16
17  public:
18   AliAODPid();
19   virtual ~AliAODPid();
20   AliAODPid(const AliAODPid& pid); 
21   AliAODPid& operator=(const AliAODPid& pid);
22   
23   enum{kSPECIES=5, kTRDnPlanes=6};
24
25  //setters
26   void      SetITSsignal(Double_t its)                         {fITSsignal=its;}
27   void      SetITSdEdxSamples(const Double_t s[4]);
28   void      SetTPCsignal(Double_t tpc)                         {fTPCsignal=tpc;}
29   void      SetTPCsignalN(UShort_t tpcN)                       {fTPCsignalN=tpcN;}
30   void      SetTPCmomentum(Double_t tpcMom)                    {fTPCmomentum=tpcMom;}
31   inline void  SetTRDsignal(Int_t nslices, const Double_t * const trdslices);  
32   void      SetTRDmomentum(Int_t nplane, Float_t trdMom)       {fTRDmomentum[nplane]=trdMom;}
33   inline void  SetTRDncls(UChar_t ncls, Int_t layer = -1);
34   void      SetTRDntrackletsPID(UChar_t ntls) {fTRDntls = ntls;}
35   void      SetTOFsignal(Double_t tof)                         {fTOFesdsignal=tof;}
36   void      SetTOFpidResolution(Double_t tofPIDres[5]);
37   void      SetIntegratedTimes(Double_t timeint[5]);
38   void      SetHMPIDsignal(Double_t hmpid)                     {fHMPIDsignal=hmpid;}
39   void      SetHMPIDprobs(Double_t hmpPid[5]);
40   void      SetEMCALPosition(Double_t emcalpos[3]);
41   void      SetEMCALMomentum(Double_t emcalmom[3]);
42
43   Double_t  GetITSsignal()       const {return  fITSsignal;}
44   void      GetITSdEdxSamples(Double_t *s) const;
45   Double_t  GetITSdEdxSample(Int_t i) const {
46     if(i>=0 && i<4) return fITSdEdxSamples[i];
47     else return 0.;
48   }
49   Double_t  GetTPCsignal()       const {return  fTPCsignal;}
50   UShort_t  GetTPCsignalN()      const {return  fTPCsignalN;}
51   Double_t  GetTPCmomentum()     const {return  fTPCmomentum;}
52   Int_t     GetTRDnSlices()      const {return  fTRDnSlices;}
53   Double_t* GetTRDsignal()       const {return  fTRDslices;}
54   const Float_t*  GetTRDmomentum() const {return  fTRDmomentum;}
55   UChar_t   GetTRDncls(UChar_t layer) const { if(layer > 5) return 0; return fTRDncls[layer];}
56   inline UChar_t GetTRDncls() const;
57   UChar_t   GetTRDntrackletsPID() const {return fTRDntls;}
58   Double_t  GetTOFsignal()       const {return  fTOFesdsignal;}
59   Double_t  GetHMPIDsignal()     const {return  fHMPIDsignal;}
60   void      GetHMPIDprobs(Double_t *p) const;
61
62   void      GetIntegratedTimes(Double_t timeint[5])  const; 
63   void      GetEMCALPosition  (Double_t emcalpos[3]) const;
64   void      GetEMCALMomentum  (Double_t emcalmom[3]) const;
65   void      GetTOFpidResolution (Double_t tofRes[5]) const;
66
67  private :
68   Double32_t  fITSsignal;        //[0.,0.,10] detector raw signal
69   Double32_t  fITSdEdxSamples[4];//[0.,0.,10] ITS dE/dx samples
70   Double32_t  fTPCsignal;        //[0.,0.,10] detector raw signal
71   UShort_t    fTPCsignalN;       // number of points used for TPC dE/dx
72   Double_t    fTPCmomentum;      // momentum at the inner wall of TPC;
73   Int_t       fTRDnSlices;       // N slices used for PID in the TRD
74   UChar_t     fTRDntls;          // number of tracklets used for PID calculation
75   UChar_t     fTRDncls[6];       // number of clusters used for dE/dx calculation
76   Double32_t* fTRDslices;        //[fTRDnSlices]
77   Float_t     fTRDmomentum[6];   // momentum at the TRD layers
78   Double32_t  fTOFesdsignal;     // TOF signal - t0 (T0 interaction time)
79   Double32_t  fTOFpidResolution[5]; // TOF pid resolution for each mass hypotesys 
80   Double32_t  fIntTime[5];       // track time hypothesis
81   Double32_t  fHMPIDsignal;      // detector raw signal
82   Double32_t  fHMPIDprobs[5];    // detector pid probabilities
83   Double32_t  fEMCALPosition[3]; // global position of track
84                                  // extrapolated to EMCAL surface
85   Double32_t  fEMCALMomentum[3]; // momentum of track
86                                  // extrapolated to EMCAL surface
87
88   ClassDef(AliAODPid, 8);
89 };
90
91 //_____________________________________________________________
92 void AliAODPid::SetTRDsignal(Int_t nslices, const Double_t * const trdslices) {
93   //
94   // Set TRD dE/dx slices and the number of dE/dx slices per track
95   //
96   if(fTRDslices && fTRDnSlices != nslices) {
97     delete [] fTRDslices; fTRDslices = NULL;
98   };
99   if(!fTRDslices) fTRDslices = new Double32_t[nslices];
100   fTRDnSlices = nslices; 
101   for(Int_t is = 0; is < fTRDnSlices; is++) fTRDslices[is] = trdslices[is];
102 }
103
104 //_____________________________________________________________
105 void AliAODPid::SetTRDncls(UChar_t ncls, Int_t layer) { 
106   //
107   // Set the number of clusters / tracklet
108   // If no layer is specified the full number of clusters will be put in layer 0
109   //
110   if(layer > 5) return; 
111   if(layer < 0) fTRDncls[0] = ncls;
112   else fTRDncls[layer] = ncls;
113 }
114
115 //_____________________________________________________________
116 UChar_t AliAODPid::GetTRDncls() const{
117   //
118   // Get number of clusters per track
119   // Calculated as sum of the number of clusters per tracklet
120   //
121   UChar_t ncls = 0;
122   for(Int_t ily = 0; ily < 6; ily++) ncls += fTRDncls[ily];
123   return ncls;
124 }
125 #endif