#90105
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Jan 2012 11:49:39 +0000 (11:49 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Jan 2012 11:49:39 +0000 (11:49 +0000)
F. Noferini

STEER/STEERBase/AliPIDResponse.cxx
STEER/STEERBase/AliPIDResponse.h

index 96dba44..20aa086 100644 (file)
@@ -70,6 +70,7 @@ fTRDPIDParams(0x0),
 fTRDPIDReference(0x0),
 fTOFTimeZeroType(kBest_T0),
 fTOFres(100.),
+fTOFtail(1.1),
 fEMCALPIDParams(0x0),
 fCurrentEvent(0x0),
 fCurrCentrality(0.0)
@@ -122,6 +123,7 @@ fTRDPIDParams(0x0),
 fTRDPIDReference(0x0),
 fTOFTimeZeroType(AliPIDResponse::kBest_T0),
 fTOFres(100.),
+fTOFtail(1.1),
 fEMCALPIDParams(0x0),
 fCurrentEvent(0x0),
 fCurrCentrality(0.0)
@@ -167,6 +169,7 @@ AliPIDResponse& AliPIDResponse::operator=(const AliPIDResponse &other)
     memset(fTRDslicesForPID,0,sizeof(UInt_t)*2);
     fTOFTimeZeroType=AliPIDResponse::kBest_T0;
     fTOFres=100.;
+    fTOFtail=1.1;
     fCurrentEvent=other.fCurrentEvent;
   }
   return *this;
@@ -358,6 +361,8 @@ AliPIDResponse::EDetPidStatus AliPIDResponse::ComputeTOFProbability  (const AliV
   // Compute PID response for the
   //
 
+  Double_t meanCorrFactor = 0.11/fTOFtail; // Correction factor on the mean because of the tail (should be ~ 0.1 with tail = 1.1)
+
   // set flat distribution (no decision)
   for (Int_t j=0; j<nSpecies; j++) p[j]=1./nSpecies;
   
@@ -375,13 +380,27 @@ AliPIDResponse::EDetPidStatus AliPIDResponse::ComputeTOFProbability  (const AliV
   Bool_t mismatch = kTRUE/*, heavy = kTRUE*/;
   for (Int_t j=0; j<AliPID::kSPECIES; j++) {
     AliPID::EParticleType type=AliPID::EParticleType(j);
-    Double_t nsigmas=NumberOfSigmasTOF(track,type);
-    
+    Double_t nsigmas=NumberOfSigmasTOF(track,type) + meanCorrFactor;
+
     Double_t sig = sigma[j];
+    if (TMath::Abs(nsigmas) > (fRange+2)) {
+      if(nsigmas < fTOFtail)
+       p[j] = TMath::Exp(-0.5*(fRange+2)*(fRange+2))/sig;
+      else
+       p[j] = TMath::Exp(-(fRange+2 - fTOFtail*0.5)*fTOFtail)/sig;
+    } else{
+      if(nsigmas < fTOFtail)
+       p[j] = TMath::Exp(-0.5*nsigmas*nsigmas)/sig;
+      else
+       p[j] = TMath::Exp(-(nsigmas - fTOFtail*0.5)*fTOFtail)/sig;
+    }
+
+    /* OLD Gaussian shape
     if (TMath::Abs(nsigmas) > (fRange+2)) {
       p[j] = TMath::Exp(-0.5*(fRange+2)*(fRange+2))/sig;
     } else
       p[j] = TMath::Exp(-0.5*nsigmas*nsigmas)/sig;
+    */
 
     if (TMath::Abs(nsigmas)<5.){
       Double_t nsigmasTPC=NumberOfSigmasTPC(track,type);
index e1a8306..78e7053 100644 (file)
@@ -93,6 +93,9 @@ public:
   // event info
   Float_t GetCurrentCentrality() const {return fCurrCentrality;};
 
+  // TOF setting
+  void SetTOFtail(Float_t tail=1.1){if(tail > 0) fTOFtail=tail; else printf("TOF tail should be greater than 0 (nothing done)\n");};
+
   AliPIDResponse(const AliPIDResponse &other);
   AliPIDResponse& operator=(const AliPIDResponse &other);
 
@@ -131,6 +134,7 @@ private:
 
   Int_t   fTOFTimeZeroType;            //! default start time type for tof (ESD)
   Float_t fTOFres;                     //! TOF resolution
+  Float_t fTOFtail;                    //! TOF tail effect used in TOF probability
 
   TObjArray *fEMCALPIDParams;             //! EMCAL PID Params
 
@@ -165,7 +169,7 @@ private:
   //
   void SetRecoInfo();
   
-  ClassDef(AliPIDResponse,4);  //PID response handling
+  ClassDef(AliPIDResponse,5);  //PID response handling
 };
 
 inline Float_t AliPIDResponse::NumberOfSigmasTPC(const AliVParticle *vtrack, AliPID::EParticleType type) const {