]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/ESD/AliESDpid.h
Modifications needed to use PID framework based mass during tracking and
[u/mrichter/AliRoot.git] / STEER / ESD / AliESDpid.h
index 50c8043bd0056f408948f197d5741f4721fbe8f6..6e1d5279e76919e53ff1efd85abbaa5e78196b0b 100644 (file)
@@ -13,6 +13,7 @@
 //-------------------------------------------------------
 #include <Rtypes.h>
 #include "AliESDtrack.h" // Needed for inline functions
+#include "AliMCEventHandler.h"
 
 //#include "HMPID/AliHMPID.h"
 //#include "TRD/AliTRDpidESD.h"
@@ -25,10 +26,14 @@ class AliVParticle;
 
 class AliESDpid : public AliPIDResponse  {
 public:
-  AliESDpid(Bool_t forMC=kFALSE): AliPIDResponse(forMC), fRangeTOFMismatch(5.) {;}
+  AliESDpid(Bool_t forMC=kFALSE): AliPIDResponse(forMC), fRangeTOFMismatch(5.), fEventHandler(NULL) {;}
+AliESDpid(const AliESDpid&a): AliPIDResponse(a), fRangeTOFMismatch(a.fRangeTOFMismatch), fEventHandler(NULL){;};
+AliESDpid& operator=(const AliESDpid& a){if (this==&a) return *this; AliPIDResponse::operator=(a); fRangeTOFMismatch=a.fRangeTOFMismatch; fEventHandler=NULL; return *this;};
   virtual ~AliESDpid() {}
   
   Int_t MakePID(AliESDEvent *event, Bool_t TPCOnly = kFALSE, Float_t timeZeroTOF=9999) const;
+  void  MakePIDForTracking(AliESDEvent *event) const;
+
   void MakeTPCPID(AliESDtrack *track) const;
   void MakeITSPID(AliESDtrack *track) const;
   void MakeTOFPID(AliESDtrack *track, Float_t /*timeZeroTOF*/) const;
@@ -36,31 +41,32 @@ public:
   //  void MakeHMPIDPID(AliESDtrack *track);
   void MakeTRDPID(AliESDtrack *track) const;
   void CombinePID(AliESDtrack *track) const;
-  
-  virtual Float_t NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type, const Float_t timeZeroTOF) const;
-  virtual Float_t NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type) const {return NumberOfSigmasTOF(vtrack,type,0); }
+
+  void SetMassForTracking(AliESDtrack *track) const;
+
+//   Float_t NumberOfSigmasTOF(const AliVParticle *track, AliPID::EParticleType type) const {return AliPIDResponse::NumberOfSigmasTOF(track,type);}
+//   Float_t GetNumberOfSigmasTOF(const AliVParticle *track, AliPID::EParticleType type, const Float_t timeZeroTOF) const;
   
   void SetNMaxSigmaTOFTPCMismatch(Float_t range) {fRangeTOFMismatch=range;}
   Float_t GetNMaxSigmaTOFTPCMismatch() const {return fRangeTOFMismatch;}
 
   Float_t GetTPCsignalTunedOnData(const AliVTrack *t) const;
+  Float_t GetTOFsignalTunedOnData(const AliVTrack *t) const;
+
+  void SetEventHandler(AliVEventHandler *event){fEventHandler=event;};
+protected:
+  virtual Float_t GetSignalDeltaTOFold(const AliVParticle *track, AliPID::EParticleType type, Bool_t ratio=kFALSE) const;
+  virtual Float_t GetNumberOfSigmasTOFold(const AliVParticle *track, AliPID::EParticleType type) const;
 
 private:
-  Float_t           fRangeTOFMismatch; // nSigma max for TOF matching with TPC
 
-  ClassDef(AliESDpid,6)  // PID calculation class
+  Float_t           fRangeTOFMismatch; // nSigma max for TOF matching with TPC
+  AliVEventHandler *fEventHandler; //! MC event handler
+  
+  ClassDef(AliESDpid,7)  // PID calculation class
 };
 
 
-inline Float_t AliESDpid::NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type, const Float_t /*timeZeroTOF*/) const {
-  AliESDtrack *track=(AliESDtrack*)vtrack;
-  //  Double_t times[AliPID::kSPECIES];
-  // track->GetIntegratedTimes(times);
-  Double_t expTime = fTOFResponse.GetExpectedSignal((AliVTrack*)vtrack,type);
-  //  return (track->GetTOFsignal() - fTOFResponse.GetStartTime(track->GetP()) - times[type])/fTOFResponse.GetExpectedSigma(track->GetP(),times[type],AliPID::ParticleMass(type));
-  return (track->GetTOFsignal() - fTOFResponse.GetStartTime(track->GetP()) - expTime)/fTOFResponse.GetExpectedSigma(track->GetP(),expTime,AliPID::ParticleMassZ(type));
-}
-
 #endif