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"
26 class AliPIDResponse : public TNamed {
28 AliPIDResponse(Bool_t isMC=kFALSE) : fITSResponse(isMC), fTPCResponse(), fTRDResponse(), fTOFResponse() {;}
29 virtual ~AliPIDResponse() {;}
31 enum EStartTimeType_t {kFILL_T0,kTOF_T0, kT0_T0, kBest_T0};
33 AliITSPIDResponse &GetITSResponse() {return fITSResponse;}
34 AliTPCPIDResponse &GetTPCResponse() {return fTPCResponse;}
35 AliTOFPIDResponse &GetTOFResponse() {return fTOFResponse;}
36 AliTRDPIDResponse &GetTRDResponse() {return fTRDResponse;}
38 virtual Float_t NumberOfSigmasITS(const AliVParticle *track, AliPID::EParticleType type) const;
39 virtual Float_t NumberOfSigmasTPC(const AliVParticle *track, AliPID::EParticleType type) const;
40 virtual Float_t NumberOfSigmasTOF(const AliVParticle *track, AliPID::EParticleType type) const = 0;
42 void SetTOFResponse(AliVEvent */*event*/,EStartTimeType_t /*option*/) {;}
45 AliITSPIDResponse fITSResponse; //PID response function of the ITS
46 AliTPCPIDResponse fTPCResponse; //PID response function of the TPC
47 AliTRDPIDResponse fTRDResponse; //PID response function of the TRD
48 AliTOFPIDResponse fTOFResponse; //PID response function of the TOF
50 ClassDef(AliPIDResponse,1); //PID response handling
53 inline Float_t AliPIDResponse::NumberOfSigmasTPC(const AliVParticle *vtrack, AliPID::EParticleType type) const {
54 AliVTrack *track=(AliVTrack*)vtrack;
55 Double_t mom = track->GetTPCmomentum();
56 Double_t sig = track->GetTPCsignal();
57 UInt_t sigN = track->GetTPCsignalN();
59 Double_t nSigma = -999.;
60 if (sigN>0) nSigma=fTPCResponse.GetNumberOfSigmas(mom,sig,sigN,type);
65 inline Float_t AliPIDResponse::NumberOfSigmasITS(const AliVParticle *vtrack, AliPID::EParticleType type) const {
66 AliVTrack *track=(AliVTrack*)vtrack;
67 Float_t dEdx=track->GetITSsignal();
68 if (dEdx<=0) return -999.;
70 UChar_t clumap=track->GetITSClusterMap();
71 Int_t nPointsForPid=0;
72 for(Int_t i=2; i<6; i++){
73 if(clumap&(1<<i)) ++nPointsForPid;
75 Float_t mom=track->P();
77 if(track->GetTPCNcls()>0) isSA=kFALSE;
78 return fITSResponse.GetNumberOfSigmas(mom,dEdx,type,nPointsForPid,isSA);