LCOV - code coverage report
Current view: top level - STEER/STEERBase - AliTOFPIDResponse.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 15 24 62.5 %
Date: 2016-06-14 17:26:59 Functions: 17 32 53.1 %

          Line data    Source code
       1             : #ifndef ALITOFPIDRESPONSE_H
       2             : #define ALITOFPIDRESPONSE_H
       3             : 
       4             : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       5             :  * See cxx source for full Copyright notice                               */
       6             : 
       7             : //-------------------------------------------------------
       8             : //                    TOF PID class
       9             : //   Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
      10             : //-------------------------------------------------------
      11             : 
      12             : #include <TObject.h>
      13             : #include <TF1.h>
      14             : #include "AliPID.h"
      15             : #include "AliVParticle.h"
      16             : #include "AliVTrack.h"
      17             : 
      18             : class AliTOFPIDParams;
      19             : class TH1F;
      20             : class TH1D;
      21             : 
      22           0 : class AliTOFPIDResponse : public TObject {
      23             : public:
      24             : 
      25             :   AliTOFPIDResponse();
      26             :   AliTOFPIDResponse(Double_t *param);
      27          40 :   ~AliTOFPIDResponse(){}
      28             : 
      29          16 :   void     SetTimeResolution(Float_t res) { fSigma = res; }
      30           0 :   void     SetTimeZero(Double_t t0) { fTime0=t0; }
      31           0 :   Double_t GetTimeZero() const { return fTime0; }
      32          16 :   Float_t  GetTimeResolution() const { return fSigma; }
      33             : 
      34           0 :   void     SetMaxMismatchProbability(Double_t p) {fPmax=p;}
      35           0 :   Double_t GetMaxMismatchProbability() const {return fPmax;}
      36             : 
      37             :   Double_t GetExpectedSigma(Float_t mom, Float_t tof, Float_t massZ) const;
      38             :   Double_t GetExpectedSigma(Float_t mom, Float_t tof, AliPID::EParticleType type) const;
      39             :   Double_t GetExpectedSignal(const AliVTrack *track, AliPID::EParticleType type) const;
      40             : 
      41             :   Double_t GetMismatchProbability(Double_t time,Double_t eta) const;
      42             : 
      43             :   static Double_t GetTailRandomValue(Float_t pt=1.0,Float_t eta=0.0,Float_t time=0.0,Float_t addmism=0.0); // generate a random value to add a tail to TOF time (for MC analyses), addmism = additional mismatch in percentile
      44             :   static Double_t GetMismatchRandomValue(Float_t eta); // generate a random value for mismatched tracks (for MC analyses)
      45             : 
      46         192 :   void     SetT0event(Float_t *t0event){for(Int_t i=0;i < fNmomBins;i++) fT0event[i] = t0event[i];};
      47         192 :   void     SetT0resolution(Float_t *t0resolution){for(Int_t i=0;i < fNmomBins;i++) fT0resolution[i] = t0resolution[i];};
      48         528 :   void     ResetT0info(){ for(Int_t i=0;i < fNmomBins;i++){ fT0event[i] = 0.0; fT0resolution[i] = 0.0; fMaskT0[i] = 0;} };
      49             :   void     SetMomBoundary();
      50             :   Int_t    GetMomBin(Float_t p) const;
      51         640 :   Int_t    GetNmomBins(){return fNmomBins;};
      52         320 :   Float_t  GetMinMom(Int_t ibin) const {if(ibin >=0 && ibin < fNmomBins) return fPCutMin[ibin]; else return 0.0;}; // overrun static array - coverity
      53         320 :   Float_t  GetMaxMom(Int_t ibin) const {if(ibin >=0 && ibin < fNmomBins) return fPCutMin[ibin+1]; else return 0.0;}; // overrun static array - coverity
      54         320 :   void     SetT0bin(Int_t ibin,Float_t t0bin){if(ibin >=0 && ibin < fNmomBins) fT0event[ibin] = t0bin;}; // overrun static array - coverity
      55         320 :   void     SetT0binRes(Int_t ibin,Float_t t0binRes){if(ibin >=0 && ibin < fNmomBins) fT0resolution[ibin] = t0binRes;}; // overrun static array - coverity
      56         320 :   void     SetT0binMask(Int_t ibin,Int_t t0binMask){if(ibin >=0 && ibin < fNmomBins) fMaskT0[ibin] = t0binMask;}; // overrun static array - coverity
      57        1316 :   Float_t  GetT0bin(Int_t ibin) const {if(ibin >=0 && ibin < fNmomBins) return fT0event[ibin]; else return 0.0;}; // overrun static array - coverity
      58         360 :   Float_t  GetT0binRes(Int_t ibin) const {if(ibin >=0 && ibin < fNmomBins) return fT0resolution[ibin]; else return 0.0;}; // overrun static array - coverity
      59           0 :   Int_t    GetT0binMask(Int_t ibin) const {if(ibin >=0 && ibin < fNmomBins) return fMaskT0[ibin]; else return 0;}; // overrun static array - coverity
      60             : 
      61             :   // Get Start Time for a track
      62             :   Float_t  GetStartTime(Float_t mom) const;
      63             :   Float_t  GetStartTimeRes(Float_t mom) const;
      64             :   Int_t    GetStartTimeMask(Float_t mom) const;
      65             : 
      66             :   // Tracking resolution for expected times
      67           0 :   void SetTrackParameter(Int_t ip,Float_t value){if(ip>=0 && ip < 4) fPar[ip] = value;};
      68           0 :   Float_t GetTrackParameter(Int_t ip){if(ip>=0 && ip < 4) return fPar[ip]; else return -1.0;};
      69             :   Int_t GetTOFchannel(AliVParticle *trk) const;
      70             : 
      71           0 :   Float_t GetTOFtail() {if(fTOFtailResponse) return fTOFtailResponse->GetParameter(3);else return -1;};
      72             :   void    SetTOFtail(Float_t tail);
      73             :   void    SetTOFtailAllPara(Float_t mean,Float_t tail);
      74             : 
      75             :  private:
      76             :   Int_t LoadTOFtailHisto();
      77             : 
      78             :   Double_t fSigma;        // intrinsic TOF resolution
      79             : 
      80             :   // obsolete
      81             :   Double_t fPmax;         // "maximal" probability of mismathing (at ~0.5 GeV/c)
      82             :   Double_t fTime0;        // time zero
      83             :   //--------------
      84             : 
      85             :   // About event time (t0) info
      86             :   static const Int_t fNmomBins = 10; // number of momentum bin 
      87             :   Float_t fT0event[fNmomBins];    // t0 (best, T0, T0-TOF, ...) of the event as a function of p 
      88             :   Float_t fT0resolution[fNmomBins]; // t0 (best, T0, T0-TOF, ...) resolution as a function of p 
      89             :   Float_t fPCutMin[fNmomBins+1]; // min values for p bins
      90             :   Int_t fMaskT0[fNmomBins]; // mask withthe T0 used (0x1=T0-TOF,0x2=T0A,0x3=TOC) for p bins
      91             :   Float_t fPar[4]; // parameter for expected times resolution
      92             : 
      93             :   static TF1 *fTOFtailResponse; // function to generate a TOF tail
      94             :   static TH1F *fHmismTOF; // TOF mismatch distribution
      95             :   static TH1D *fHchannelTOFdistr;// TOF channel distance distribution
      96             :   static TH1D *fHTOFtailResponse;// histogram to generate a TOF tail
      97             : 
      98         192 :   ClassDef(AliTOFPIDResponse,6)   // TOF PID class
      99             : };
     100             : 
     101             : #endif

Generated by: LCOV version 1.11