1 #ifndef ALIPIDRESPONSE_H
2 #define ALIPIDRESPONSE_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 //---------------------------------------------------------------//
7 // Base class for handling the pid response //
8 // functions of all detectors //
9 // and give access to the nsigmas //
11 // Origin: Jens Wiechula, Uni Tuebingen, jens.wiechula@cern.ch //
12 //---------------------------------------------------------------//
14 #include "AliITSPIDResponse.h"
15 #include "AliTPCPIDResponse.h"
16 #include "AliTRDPIDResponse.h"
17 #include "AliTOFPIDResponse.h"
19 #include "AliVParticle.h"
20 #include "AliVTrack.h"
27 class AliPIDResponse : public TNamed {
29 AliPIDResponse(Bool_t isMC=kFALSE);
30 virtual ~AliPIDResponse();
32 enum EStartTimeType_t {kFILL_T0,kTOF_T0, kT0_T0, kBest_T0};
34 AliITSPIDResponse &GetITSResponse() {return fITSResponse;}
35 AliTPCPIDResponse &GetTPCResponse() {return fTPCResponse;}
36 AliTOFPIDResponse &GetTOFResponse() {return fTOFResponse;}
37 AliTRDPIDResponse &GetTRDResponse() {return fTRDResponse;}
39 virtual Float_t NumberOfSigmasITS(const AliVParticle *track, AliPID::EParticleType type) const;
40 virtual Float_t NumberOfSigmasTPC(const AliVParticle *track, AliPID::EParticleType type) const;
41 virtual Float_t NumberOfSigmasTOF(const AliVParticle *track, AliPID::EParticleType type) const = 0;
43 virtual void SetTOFResponse(AliVEvent */*event*/,EStartTimeType_t /*option*/) {;}
45 void SetOADBPath(const char* path) {fOADBPath=path;}
46 void InitialiseEvent(AliVEvent *event, Int_t pass);
48 AliPIDResponse(const AliPIDResponse &other);
49 AliPIDResponse& operator=(const AliPIDResponse &other);
52 AliITSPIDResponse fITSResponse; //PID response function of the ITS
53 AliTPCPIDResponse fTPCResponse; //PID response function of the TPC
54 AliTRDPIDResponse fTRDResponse; //PID response function of the TRD
55 AliTOFPIDResponse fTOFResponse; //PID response function of the TOF
58 Bool_t fIsMC; // If we run on MC data
60 TString fOADBPath; // OADB path to use
62 TString fBeamType; //! beam type (PP) or (PBPB)
63 TString fLHCperiod; //! LHC period
64 TString fMCperiodTPC; //! corresponding MC period to use for the TPC splines
65 Int_t fRecoPass; //! reconstruction pass
66 Int_t fRun; //! current run number
67 Int_t fOldRun; //! current run number
69 TObjArray *fArrPidResponseMaster; //! TPC pid splines
70 TF1 *fResolutionCorrection; //! TPC resolution correction
72 Int_t fTOFTimeZeroType; //! default start time type for tof (ESD)
73 Float_t fTOFres; //! TOF resolution
78 //setup parametrisations
82 void SetITSParametrisation();
85 void SetTPCPidResponseMaster();
86 void SetTPCParametrisation();
87 Double_t GetTPCMultiplicityBin(const AliVEvent * const event);
94 ClassDef(AliPIDResponse,2); //PID response handling
97 inline Float_t AliPIDResponse::NumberOfSigmasTPC(const AliVParticle *vtrack, AliPID::EParticleType type) const {
98 AliVTrack *track=(AliVTrack*)vtrack;
99 Double_t mom = track->GetTPCmomentum();
100 Double_t sig = track->GetTPCsignal();
101 UInt_t sigN = track->GetTPCsignalN();
103 Double_t nSigma = -999.;
104 if (sigN>0) nSigma=fTPCResponse.GetNumberOfSigmas(mom,sig,sigN,type);
109 inline Float_t AliPIDResponse::NumberOfSigmasITS(const AliVParticle *vtrack, AliPID::EParticleType type) const {
110 AliVTrack *track=(AliVTrack*)vtrack;
111 Float_t dEdx=track->GetITSsignal();
112 if (dEdx<=0) return -999.;
114 UChar_t clumap=track->GetITSClusterMap();
115 Int_t nPointsForPid=0;
116 for(Int_t i=2; i<6; i++){
117 if(clumap&(1<<i)) ++nPointsForPid;
119 Float_t mom=track->P();
121 if(track->GetTPCNcls()>0) isSA=kFALSE;
122 return fITSResponse.GetNumberOfSigmas(mom,dEdx,type,nPointsForPid,isSA);