LCOV - code coverage report
Current view: top level - STEER/AOD - AliAODPid.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 19 41 46.3 %
Date: 2016-06-14 17:26:59 Functions: 14 33 42.4 %

          Line data    Source code
       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             : #include "AliPID.h"
      15             : 
      16             : class AliTPCdEdxInfo;
      17             : 
      18             : class AliAODPid : public TObject {
      19             : 
      20             :  public:
      21             :   AliAODPid();
      22             :   virtual ~AliAODPid();
      23             :   AliAODPid(const AliAODPid& pid); 
      24             :   AliAODPid& operator=(const AliAODPid& pid);
      25             :   
      26             :   enum{kTRDnPlanes=6};
      27             : 
      28             :  //setters
      29         240 :   void      SetITSsignal(Double_t its)                         {fITSsignal=its;}
      30             :   void      SetITSdEdxSamples(const Double_t s[4]);
      31         240 :   void      SetTPCsignal(Double_t tpc)                         {fTPCsignal=tpc;}
      32         240 :   void      SetTPCsignalN(UShort_t tpcN)                       {fTPCsignalN=(UChar_t)((tpcN<160)?tpcN:160);}
      33         240 :   void      SetTPCmomentum(Double_t tpcMom)                    {fTPCmomentum=tpcMom;}
      34         240 :   void      SetTPCTgl(Double_t tpcTgl)                         {fTPCTgl=tpcTgl;}
      35             :   void      SetTPCdEdxInfo(AliTPCdEdxInfo * dEdxInfo);
      36             :   void      SetTRDslices(Int_t nslices, const Double_t * const trdslices);  
      37         240 :   void      SetTRDsignal(Double_t sig)                         {fTRDsignal = sig;}
      38        1440 :   void      SetTRDmomentum(Int_t nplane, Float_t trdMom)       {fTRDmomentum[nplane]=trdMom;}
      39             :   void      SetTRDncls(UChar_t ncls, Int_t layer = -1);
      40         240 :   void      SetTRDntrackletsPID(UChar_t ntls) {fTRDntls = ntls;}
      41         240 :   void      SetTRDChi2(Double_t chi2)          {fTRDChi2 = chi2;}
      42         240 :   void      SetTOFsignal(Double_t tof)                         {fTOFesdsignal=tof;}
      43             :   void      SetTOFpidResolution(Double_t tofPIDres[5]);
      44             :   void      SetIntegratedTimes(Double_t timeint[5]);
      45             : 
      46           0 :   Double_t  GetITSsignal()       const {return  fITSsignal;}
      47             :   void      GetITSdEdxSamples(Double_t *s) const;
      48             :   Double_t  GetITSdEdxSample(Int_t i) const {
      49           0 :     if(i>=0 && i<4) return fITSdEdxSamples[i];
      50           0 :     else return 0.;
      51           0 :   }
      52           0 :   Double_t  GetTPCsignal()       const {return  fTPCsignal;}
      53           0 :   UShort_t  GetTPCsignalN()      const {return  (UShort_t)fTPCsignalN;}
      54           0 :   AliTPCdEdxInfo * GetTPCdEdxInfo()const{return fTPCdEdxInfo;}
      55             : 
      56           0 :   Double_t  GetTPCmomentum()     const {return  fTPCmomentum;}
      57           0 :   Double_t  GetTPCTgl()          const {return  fTPCTgl;}
      58           0 :   Int_t     GetTRDnSlices()      const {return  fTRDnSlices/6;}
      59           0 :   Double_t  GetTRDsignal()       const {return  fTRDsignal;}
      60           0 :   Double_t* GetTRDslices()       const {return  fTRDslices;}
      61           0 :   Double_t  GetTRDChi2()         const {return fTRDChi2;}
      62           0 :   const Double_t*  GetTRDmomentum() const {return  fTRDmomentum;}
      63           0 :   UChar_t   GetTRDncls(UChar_t layer) const { if(layer > 5) return 0; return fTRDncls[layer];}
      64             :   UChar_t   GetTRDncls() const;
      65           0 :   UChar_t   GetTRDntrackletsPID() const {return fTRDntls;}
      66           0 :   Double_t  GetTOFsignal()       const {return  fTOFesdsignal;}
      67             : 
      68             :   void      GetIntegratedTimes(Double_t *timeint, Int_t nspec=AliPID::kSPECIES)  const; 
      69             :   void      GetTOFpidResolution (Double_t tofRes[5]) const;
      70             : 
      71             :  private :
      72             :   Double32_t  fITSsignal;        //[0.,0.,10] detector raw signal
      73             :   Double32_t  fITSdEdxSamples[4];//[0.,0.,10] ITS dE/dx samples
      74             : 
      75             :   Double32_t  fTPCsignal;        //[0.,0.,10] detector raw signal
      76             :   UChar_t     fTPCsignalN;       // number of points used for TPC dE/dx
      77             :   Double32_t  fTPCmomentum;      //[0.,0.,20] momentum at the inner wall of TPC;
      78             :   Double32_t  fTPCTgl;           //[0.,0.,10] track momentum dip angle at the inner wall of TPC;
      79             :   
      80             :   Int_t       fTRDnSlices;       // N slices used for PID in the TRD (as number of slices per tracklet * number of layers)
      81             :   UChar_t     fTRDntls;          // number of tracklets used for PID calculation
      82             :   UChar_t     fTRDncls[6];       // number of clusters used for dE/dx calculation
      83             :   Double32_t* fTRDslices;        //[fTRDnSlices][0.,0.,10]
      84             :   Double32_t  fTRDsignal;        //[0.,0.,10]  TRD signal
      85             :   Double32_t  fTRDmomentum[6];   //[0.,0.,10]  momentum at the TRD layers
      86             :   Double32_t  fTRDChi2;          //[0.,0.,10]  TRD chi2
      87             : 
      88             :   Double32_t  fTOFesdsignal;     //[0.,0.,20] TOF signal - t0 (T0 interaction time)
      89             :   Double32_t  fTOFpidResolution[5]; //[0.,0.,20] TOF pid resolution for each mass hypotesys 
      90             :   Double32_t  fIntTime[5];       //[0.,0.,20] track time hypothesis
      91             :  
      92             :   AliTPCdEdxInfo * fTPCdEdxInfo; // object containing dE/dx information for different pad regions
      93             : 
      94         654 :   ClassDef(AliAODPid, 15);
      95             : };
      96             : 
      97             : //_____________________________________________________________
      98             : inline void AliAODPid::SetTRDslices(Int_t nslices, const Double_t * const trdslices) {
      99             :   //
     100             :   // Set TRD dE/dx slices and the number of dE/dx slices per track
     101             :   //
     102         240 :   if(fTRDslices && fTRDnSlices != nslices) {
     103           0 :     delete [] fTRDslices; fTRDslices = NULL;
     104           0 :   };
     105         240 :   if(!fTRDslices) fTRDslices = new Double32_t[nslices];
     106         120 :   fTRDnSlices = nslices; 
     107        9648 :   for(Int_t is = 0; is < fTRDnSlices; is++) fTRDslices[is] = trdslices[is];
     108         120 : }
     109             : 
     110             : //_____________________________________________________________
     111             : inline void AliAODPid::SetTRDncls(UChar_t ncls, Int_t layer) { 
     112             :   //
     113             :   // Set the number of clusters / tracklet
     114             :   // If no layer is specified the full number of clusters will be put in layer 0
     115             :   //
     116         240 :   if(layer > 5) return; 
     117         240 :   if(layer < 0) fTRDncls[0] = ncls;
     118           0 :   else fTRDncls[layer] = ncls;
     119         120 : }
     120             : 
     121             : //_____________________________________________________________
     122             : inline UChar_t AliAODPid::GetTRDncls() const {
     123             :   //
     124             :   // Get number of clusters per track
     125             :   // Calculated as sum of the number of clusters per tracklet
     126             :   //
     127             :   UChar_t ncls = 0;
     128           0 :   for(Int_t ily = 0; ily < 6; ily++) ncls += fTRDncls[ily];
     129           0 :   return ncls;
     130             : }
     131             : #endif

Generated by: LCOV version 1.11