]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/RESONANCES/AliRsnCutV0.cxx
Extended pT-axis range (Neelima)
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCutV0.cxx
index 5da0a43f52b954adc670d70798b2f6b123af2653..557315e9fccfa56fc7b0b179630442eb230d520a 100644 (file)
@@ -30,7 +30,6 @@
 ClassImp(AliRsnCutV0)
 
 //_________________________________________________________________________________________________
-//AliRsnCutV0::AliRsnCutV0(const char *name, Int_t hypothesis) :
 AliRsnCutV0::AliRsnCutV0(const char *name, Int_t hypothesis, AliPID::EParticleType pid, AliPID::EParticleType pid2) :
    AliRsnCut(name, AliRsnTarget::kDaughter),
    fHypothesis(0),
@@ -39,12 +38,12 @@ AliRsnCutV0::AliRsnCutV0(const char *name, Int_t hypothesis, AliPID::EParticleTy
    fMaxDCAVertex(0.3),
    fMinCosPointAngle(0.95),
    fMaxDaughtersDCA(0.5),
+   fMinTPCcluster(70),
    fMaxRapidity(0.8),
    fPID(pid),
    fPID2(pid2),
-   fPIDCut1(0),
-   fPIDCut2(0),
-   fPIDCut3(0),
+   fPIDCutProton(0),
+   fPIDCutPion(0),
    fESDtrackCuts(0x0),
    fCutQuality(Form("%sDaughtersQuality", name)),
    fAODTestFilterBit(5)
@@ -66,12 +65,12 @@ AliRsnCutV0::AliRsnCutV0(const AliRsnCutV0 &copy) :
    fMaxDCAVertex(copy.fMaxDCAVertex),
    fMinCosPointAngle(copy.fMinCosPointAngle),
    fMaxDaughtersDCA(copy.fMaxDaughtersDCA),
-   fMaxRapidity(copy.fMaxRapidity),  
+   fMinTPCcluster(copy.fMinTPCcluster),
+   fMaxRapidity(copy.fMaxRapidity),
    fPID(copy.fPID),
    fPID2(copy.fPID2),
-   fPIDCut1(copy.fPIDCut1),
-   fPIDCut2(copy.fPIDCut2),
-   fPIDCut3(copy.fPIDCut3),
+   fPIDCutProton(copy.fPIDCutProton),
+   fPIDCutPion(copy.fPIDCutPion),
    fESDtrackCuts(copy.fESDtrackCuts),
    fCutQuality(copy.fCutQuality),
    fAODTestFilterBit(copy.fAODTestFilterBit)
@@ -83,13 +82,10 @@ AliRsnCutV0::AliRsnCutV0(const AliRsnCutV0 &copy) :
 //
    fCutQuality.SetPtRange(0.15, 1E+20);
    fCutQuality.SetEtaRange(-0.8, 0.8);
-   fCutQuality.SetDCARmax(0.05);
-   //fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01");
-   fCutQuality.SetDCAZmax(2.0);
    fCutQuality.SetSPDminNClusters(1);
    fCutQuality.SetITSminNClusters(0);
    fCutQuality.SetITSmaxChi2(1E+20);
-   fCutQuality.SetTPCminNClusters(70);
+   fCutQuality.SetTPCminNClusters(fMinTPCcluster);
    fCutQuality.SetTPCmaxChi2(4.0);
    fCutQuality.SetRejectKinkDaughters();
    fCutQuality.SetAODTestFilterBit(5);
@@ -97,30 +93,33 @@ AliRsnCutV0::AliRsnCutV0(const AliRsnCutV0 &copy) :
 }
 
 //_________________________________________________________________________________________________
-AliRsnCutV0AliRsnCutV0::operator=(const AliRsnCutV0 &copy)
+AliRsnCutV0 &AliRsnCutV0::operator=(const AliRsnCutV0 &copy)
 {
 //
 // Assignment operator.
 // Just copy all data member values.
 //
+   if (this == &copy)
+     return *this;
    fHypothesis = copy.fHypothesis;
    fMass = copy.fMass;
    fTolerance = copy.fTolerance;
    fMaxDCAVertex = copy.fMaxDCAVertex;
    fMinCosPointAngle = copy.fMinCosPointAngle;
    fMaxDaughtersDCA = copy.fMaxDaughtersDCA;
+   fMinTPCcluster = copy.fMinTPCcluster;
    fMaxRapidity = copy.fMaxRapidity;
+   fCutQuality = copy.fCutQuality;
    fPID = copy.fPID;
    fPID2 = copy.fPID2;
-   fPIDCut1 = copy.fPIDCut1;
-   fPIDCut2 = copy.fPIDCut2;
-   fPIDCut3 = copy.fPIDCut3;
+   fPIDCutProton = copy.fPIDCutProton;
+   fPIDCutPion = copy.fPIDCutPion;
    fESDtrackCuts = copy.fESDtrackCuts;
    fCutQuality = copy.fCutQuality;
    fAODTestFilterBit = copy.fAODTestFilterBit;
 
    return (*this);
- }
+}
 
 //_________________________________________________________________________________________________
 Bool_t AliRsnCutV0::IsSelected(TObject *object)
@@ -134,12 +133,12 @@ Bool_t AliRsnCutV0::IsSelected(TObject *object)
 
    // coherence check
    if (!TargetOK(object)) return kFALSE;
-   
+
    // check cast
    AliESDv0 *v0esd = fDaughter->Ref2ESDv0();
    AliAODv0 *v0aod = fDaughter->Ref2AODv0();
    //cout << fDaughter->GetRef()->ClassName() << ' ' << v0esd << ' ' << v0aod << endl;
-   
+
    // operate depending on cast:IsSelected: Object is not a V0 (RESONANCES/AliRsnCutV0.cxx:149)
 
    if (v0esd) {
@@ -166,20 +165,20 @@ Bool_t AliRsnCutV0::CheckESD(AliESDv0 *v0)
       AliDebugClass(1, "Rejecting V0 in 'on fly' status");
       return kFALSE; // if kTRUE, then this V0 is recontructed
    }
-   
+
    // retrieve pointer to owner event
    AliESDEvent *lESDEvent = fEvent->GetRefESD();
    Double_t xPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetX();
    Double_t yPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetY();
    Double_t zPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetZ();
    AliDebugClass(2, Form("Primary vertex: %f %f %f", xPrimaryVertex, yPrimaryVertex, zPrimaryVertex));
-   
+
    // retrieve the V0 daughters
    UInt_t lIdxPos      = (UInt_t) TMath::Abs(v0->GetPindex());
    UInt_t lIdxNeg      = (UInt_t) TMath::Abs(v0->GetNindex());
    AliESDtrack *pTrack = lESDEvent->GetTrack(lIdxPos);
    AliESDtrack *nTrack = lESDEvent->GetTrack(lIdxNeg);
-   
+
    // check quality cuts
    if (fESDtrackCuts) {
       AliDebugClass(2, "Checking quality cuts");
@@ -192,21 +191,21 @@ Bool_t AliRsnCutV0::CheckESD(AliESDv0 *v0)
          return kFALSE;
       }
    }
-   
+
    // filter like-sign V0
-  if ( TMath::Abs( ((pTrack->GetSign()) - (nTrack->GetSign())) ) < 0.1) {
-     AliDebugClass(2, "Failed like-sign V0 check");
-     return kFALSE;
-  }
+   if ( TMath::Abs( ((pTrack->GetSign()) - (nTrack->GetSign())) ) < 0.1) {
+      AliDebugClass(2, "Failed like-sign V0 check");
+      return kFALSE;
+   }
+
 
-   
    // check compatibility with expected species hypothesis
    v0->ChangeMassHypothesis(fHypothesis);
    if ((TMath::Abs(v0->GetEffMass() - fMass)) > fTolerance) {
       AliDebugClass(2, "V0 is not in the expected inv mass range");
       return kFALSE;
    }
-   
+
    // topological checks
    if (TMath::Abs(v0->GetD(xPrimaryVertex, yPrimaryVertex, zPrimaryVertex)) > fMaxDCAVertex) {
       AliDebugClass(2, "Failed check on DCA to primary vertes");
@@ -221,101 +220,86 @@ Bool_t AliRsnCutV0::CheckESD(AliESDv0 *v0)
       return kFALSE;
    }
    if (TMath::Abs(v0->Y(fHypothesis)) > fMaxRapidity) {
-   AliDebugClass(2, "Failed check on V0 rapidity");
-   return kFALSE;
+      AliDebugClass(2, "Failed check on V0 rapidity");
+      return kFALSE;
    }
-   
-   
+
+
    // check PID on proton or antiproton from V0
-  
-       // check initialization of PID object
-       AliPIDResponse *pid = fEvent->GetPIDResponse();
-       if (!pid) {
-       AliFatal("NULL PID response");
-             return kFALSE;
-       }
-   
-       // check if TOF is matched
-          // and computes all values used in the PID cut
-          //Bool_t   isTOFpos  = MatchTOF(ptrack);
-          //Bool_t   isTOFneg  = MatchTOF(ntrack);
-          Double_t pospTPC   = pTrack->GetTPCmomentum();
-          Double_t negpTPC   = nTrack->GetTPCmomentum();
-          //Double_t posp      = pTrack->P();
-          //Double_t negp      = nTrack->P();
-          Double_t posnsTPC   = TMath::Abs(pid->NumberOfSigmasTPC(pTrack, fPID));
-          Double_t posnsTPC2  = TMath::Abs(pid->NumberOfSigmasTPC(pTrack, fPID2));
-          //Double_t posnsTOF  = TMath::Abs(pid->NumberOfSigmasTOF(ptrack, fPID));
-          Double_t negnsTPC   = TMath::Abs(pid->NumberOfSigmasTPC(nTrack, fPID));
-          Double_t negnsTPC2  = TMath::Abs(pid->NumberOfSigmasTPC(nTrack, fPID2));
-          //Double_t negnsTOF  = TMath::Abs(pid->NumberOfSigmasTOF(ntrack, fPID));
-          Double_t maxTPC = 1E20;
-          Double_t maxTPC2 = 1E20;
-          //Double_t maxTOF = 1E20;
-   
-       // applies the cut differently depending on the PID and the momentum
-       
-       if(fHypothesis==kLambda0){
-          //if (isTOFpos) {
-             // TPC: 5sigma cut for all
-             //if (posnsTPC > 5.0) return kFALSE;
-             // TOF: 3sigma
-            // maxTOF = 3.0;
-               //return (posnsTOF <= maxTOF);
-             //} else {
-             // TPC: 
-             // below 600 MeV: 4sigma
-             // above 600 MeV: 3sigma
-             
-             if (pospTPC <= 0.6 && fPID==AliPID::kProton) 
-              maxTPC = fPIDCut1;
-             else if (pospTPC > 0.6 && fPID==AliPID::kProton)
-              maxTPC = fPIDCut2;
-             else
-             return kFALSE; 
-             
-             maxTPC2 = fPIDCut3;           
-             
-             if (! ((posnsTPC <= maxTPC) && (negnsTPC2 <= maxTPC2)) ) {
-             AliDebugClass(2, "Failed check on V0 PID");
-              return kFALSE;
-            } 
-           }
-          
-          //}
-           
-        if(fHypothesis==kLambda0Bar){
-          //if (isTOFneg) {
-             // TPC: 5sigma cut for all
-             //if (negnsTPC > 5.0) return kFALSE;
-             // TOF: 3sigma 
-            // maxTOF = 3.0;
-               //return (negnsTOF <= maxTOF);
-             //} else {
-             // TPC: 
-             // below 600 MeV: 4sigma
-             // above 600 MeV: 3sigma
-             
-             if (negpTPC <= 0.6 && fPID==AliPID::kProton) 
-              maxTPC = fPIDCut1;
-             else if (negpTPC > 0.6 && fPID==AliPID::kProton)
-              maxTPC = fPIDCut2;
-             else
-             return kFALSE; 
-             
-             maxTPC2 = fPIDCut3;            
-
-              if(! ((negnsTPC <= maxTPC) && (posnsTPC2 <= maxTPC2)) ){
-             AliDebugClass(2, "Failed check on V0 PID");
-              return kFALSE;
-             }
-          }
-         //}
-       
-   
+
+   // check initialization of PID object
+   AliPIDResponse *pid = fEvent->GetPIDResponse();
+   if (!pid) {
+      AliFatal("NULL PID response");
+      return kFALSE;
+   }
+
+   // check if TOF is matched
+   // and computes all values used in the PID cut
+   //Bool_t   isTOFpos  = MatchTOF(ptrack);
+   //Bool_t   isTOFneg  = MatchTOF(ntrack);
+   //Double_t pospTPC   = pTrack->GetTPCmomentum();
+   //Double_t negpTPC   = nTrack->GetTPCmomentum();
+   //Double_t posp      = pTrack->P();
+   //Double_t negp      = nTrack->P();
+   Double_t posnsTPC   = TMath::Abs(pid->NumberOfSigmasTPC(pTrack, fPID));
+   Double_t posnsTPC2  = TMath::Abs(pid->NumberOfSigmasTPC(pTrack, fPID2));
+   //Double_t posnsTOF  = TMath::Abs(pid->NumberOfSigmasTOF(ptrack, fPID));
+   Double_t negnsTPC   = TMath::Abs(pid->NumberOfSigmasTPC(nTrack, fPID));
+   Double_t negnsTPC2  = TMath::Abs(pid->NumberOfSigmasTPC(nTrack, fPID2));
+   //Double_t negnsTOF  = TMath::Abs(pid->NumberOfSigmasTOF(ntrack, fPID));
+   Double_t maxTPC = 1E20;
+   Double_t maxTPC2 = 1E20;
+   //Double_t maxTOF = 1E20;
+
+   // applies the cut differently depending on the PID and the momentum
+
+   if(fHypothesis==kLambda0) {
+      //if (isTOFpos) {
+      // TPC: 5sigma cut for all
+      //if (posnsTPC > 5.0) return kFALSE;
+      // TOF: 3sigma
+      // maxTOF = 3.0;
+      //return (posnsTOF <= maxTOF);
+      //} else {
+      // TPC:
+
+      maxTPC = fPIDCutProton;
+      maxTPC2 = fPIDCutPion;
+
+      if (! ((posnsTPC <= maxTPC) && (negnsTPC2 <= maxTPC2)) ) {
+         AliDebugClass(2, "Failed check on V0 PID");
+         return kFALSE;
+      }
+   }
+
+   //}
+
+   if(fHypothesis==kLambda0Bar) {
+      //if (isTOFneg) {
+      // TPC: 5sigma cut for all
+      //if (negnsTPC > 5.0) return kFALSE;
+      // TOF: 3sigma
+      // maxTOF = 3.0;
+      //return (negnsTOF <= maxTOF);
+      //} else {
+      // TPC:
+
+     
+         maxTPC = fPIDCutProton;
+         maxTPC2 = fPIDCutPion;
+
+      if(! ((negnsTPC <= maxTPC) && (posnsTPC2 <= maxTPC2)) ) {
+         AliDebugClass(2, "Failed check on V0 PID");
+         return kFALSE;
+      }
+   }
+   //}
+
+
    // if we reach this point, all checks were successful
-   AliDebugClass(2, "Good V0 (hallelujah)");
-   return kTRUE;   
+   AliDebugClass(2, "Good V0");
+   return kTRUE;
 }
 
 //_________________________________________________________________________________________________
@@ -333,8 +317,6 @@ Bool_t AliRsnCutV0::CheckAOD(AliAODv0 *v0)
       return kFALSE; // if kTRUE, then this V0 is recontructed
    }
 
-   
    // retrieve pointer to owner event
    AliAODEvent *lAODEvent = fEvent->GetRefAOD();
    Double_t xPrimaryVertex = lAODEvent->GetPrimaryVertex()->GetX();
@@ -346,181 +328,131 @@ Bool_t AliRsnCutV0::CheckAOD(AliAODv0 *v0)
    AliAODTrack *pTrack = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(0));
    AliAODTrack *nTrack = (AliAODTrack *) (v0->GetSecondaryVtx()->GetDaughter(1));
 
-
    // check quality cuts
    UInt_t  filtermapP = 9999;
    UInt_t  filtermapN = 9999;
    filtermapP = pTrack->GetFilterMap();
    filtermapN = nTrack->GetFilterMap();
-   
-   
+
+   //-----
+   // next lines commented out by EF - 17/01/2014 
+   // NOTE that the filter bit test on V0 daughters removes a huge amount of V0 candidates, including good ones.
+   //      Likely wrong -> requires a DCA max!
+   //      Removing the test, there's a little gain in efficiency in the
+   //      final search for Sigma* candidates
+   // NOTE that further constrains (e.g. DCA of daughters greater than xxx), 
+   //      necessary to remove background, are already in V0s. (see also below)
+   /*
    if ( !pTrack->TestFilterBit(fAODTestFilterBit)   ) {
-     AliDebugClass(2, Form("Positive daughter failed quality cuts filtermapP=%d",filtermapP));
-     return kFALSE;
+      AliDebugClass(2, Form("Positive daughter failed quality cuts filtermapP=%d",filtermapP));
+      return kFALSE;
    }
    if ( !nTrack->TestFilterBit(fAODTestFilterBit)   ) {
-     AliDebugClass(2, Form("Negative daughter failed quality cuts filtermapN=%d",filtermapN));
-     return kFALSE;
+      AliDebugClass(2, Form("Negative daughter failed quality cuts filtermapN=%d",filtermapN));
+      return kFALSE;
    }
-   
-   
-
-   AliDebugClass(1, Form("fESDtrackCuts=%p",fESDtrackCuts));
-   if (fESDtrackCuts) { // use fESDtrackCuts to retrieve cuts values
-
-    
-     AliDebugClass(2, "Checking quality cuts");
-
-
-     
-     const Bool_t  CutAcceptKinkDaughters  = fESDtrackCuts->GetAcceptKinkDaughters(); // 0 = kFalse
-     const Float_t CutMaxChi2PerClusterTPC = fESDtrackCuts->GetMaxChi2PerClusterTPC();
-     const Int_t   CutMinNClusterTPC       = fESDtrackCuts->GetMinNClusterTPC();
-     const Bool_t  CutRequireTPCRefit      = fESDtrackCuts->GetRequireTPCRefit();
-     //AliDebugClass(2, Form("accept kink=%d maxchi2=%f minnclSTPC=%d requireTPCrefit=%d", CutAcceptKinkDaughters,
-     //                   CutMaxChi2PerClusterTPC, CutMinNClusterTPC, CutRequireTPCRefit));
-     //AliDebugClass(2, Form("pTrack->TPCNcls=%d", pTrack->GetTPCNcls() ));
-     //AliDebugClass(2, Form("nTrack->TPCNcls=%d", nTrack->GetTPCNcls() ));
-     
-     
-      if(pTrack->GetTPCNcls() < CutMinNClusterTPC) {AliDebugClass(2, "Positive daughter not MinNclsTPC"); return kFALSE;}
-      if(nTrack->GetTPCNcls() < CutMinNClusterTPC) {AliDebugClass(2, "Negative daughter not MinNclsTPC"); return kFALSE;}
-
+   */
+
+   //----
+   // next lines are not necessary. Just left there (commented-out) to remind that the requirement on the DCA of V0 daughters
+   //      is already in the V0, so requiring dca>0.050 (with 0.050 cm the default value from the Lambda analysis)
+   //      does not remove V0s candidates
+   /*
+   Double_t dca = v0->DcaPosToPrimVertex() ;
+     AliDebugClass(2, Form("DCA of Lambda positive daughter %f",dca));
+   if(dca<0.050) {
+     AliDebugClass(2, Form("DCA of Lambda positive daughter (%f) less than 0.05",dca));
+      return kFALSE;
+   }
+   dca = v0->DcaNegToPrimVertex();
+   if(dca<0.050) {
+     AliDebugClass(2, Form("DCA of Lambda negative daughter (%f) less than 0.05",dca));
+      return kFALSE;
    }
+   */
 
+   // EF - 17/01/2014 - next check apparently not effective!? Already in V0s?
    // filter like-sign V0
-  if ( TMath::Abs( ((pTrack->Charge()) - (nTrack->Charge())) ) < 0.1) {
-     AliDebugClass(2, "Failed like-sign V0 check");
-     return kFALSE;
-  }
+   if ( TMath::Abs( ((pTrack->Charge()) - (nTrack->Charge())) ) < 0.1) {
+      AliDebugClass(2, "Failed like-sign V0 check");
+      return kFALSE;
+   }
 
    // check compatibility with expected species hypothesis
-  Double_t mass = 0.0;
-  if(fHypothesis==kLambda0) {
-    mass = v0->MassLambda();
-  }
-  else if (fHypothesis==kLambda0Bar) {
-    mass = v0->MassAntiLambda();   
-  }
-  if ((TMath::Abs(mass - fMass)) > fTolerance) {
-    AliDebugClass(2, Form("V0 is not in the expected inv mass range  Mass: %d %f %f", fHypothesis, fMass, mass));
-    return kFALSE;
-  }
+   Double_t mass = 0.0;
+   if(fHypothesis==kLambda0) {
+      mass = v0->MassLambda();
+   }
+   else if (fHypothesis==kLambda0Bar) {
+      mass = v0->MassAntiLambda();
+   }
+   if ((TMath::Abs(mass - fMass)) > fTolerance) {
+      AliDebugClass(2, Form("V0 is not in the expected inv mass range  Mass: %d %f %f", fHypothesis, fMass, mass));
+      return kFALSE;
+   }
    AliDebugClass(2, Form("Mass: %d %f %f", fHypothesis, fMass, mass));
-  
-
-  // topological checks
-  if (TMath::Abs(v0->DcaV0ToPrimVertex()) > fMaxDCAVertex) {
-    AliDebugClass(2, Form("Failed check on DCA to primary vertes dca=%f maxdca=%f",TMath::Abs(v0->DcaV0ToPrimVertex()),fMaxDCAVertex));
-    return kFALSE;
-  }
-  if (TMath::Abs( TMath::Cos(v0->OpenAngleV0()) ) < fMinCosPointAngle) {
+
+
+   // topological checks
+   if (TMath::Abs(v0->DcaV0ToPrimVertex()) > fMaxDCAVertex) {
+      AliDebugClass(2, Form("Failed check on DCA to primary vertes dca=%f maxdca=%f",TMath::Abs(v0->DcaV0ToPrimVertex()),fMaxDCAVertex));
+      return kFALSE;
+   }
+
+   // next cut is effective (should it be in AODV0?)
+   if (TMath::Abs( TMath::Cos(v0->OpenAngleV0()) ) < fMinCosPointAngle) {
       AliDebugClass(2, "Failed check on cosine of pointing angle");
       return kFALSE;
    }
+   // next cut is effective (should it be in AODV0?)
    if (TMath::Abs(v0->DcaV0Daughters()) > fMaxDaughtersDCA) {
       AliDebugClass(2, "Failed check on DCA between daughters");
       return kFALSE;
    }
    if (TMath::Abs(v0->RapLambda()) > fMaxRapidity) {
-   AliDebugClass(2, "Failed check on V0 rapidity");
-   return kFALSE;
+      AliDebugClass(2, "Failed check on V0 rapidity");
+      return kFALSE;
    }
 
-
-
-   
-
+   //-----------------------------------------------------------
    // check initialization of PID object
    AliPIDResponse *pid = fEvent->GetPIDResponse();
    if (!pid) {
-     AliFatal("NULL PID response");
-     return kFALSE;
+      AliFatal("NULL PID response");
+      return kFALSE;
    }
 
-   // check if TOF is matched
-   // and computes all values used in the PID cut
-   //Bool_t   isTOFpos  = MatchTOF(ptrack);
-   //Bool_t   isTOFneg  = MatchTOF(ntrack);
-   Double_t pospTPC   = pTrack->GetTPCmomentum();
-   Double_t negpTPC   = nTrack->GetTPCmomentum();
-   //Double_t posp      = pTrack->P();
-   //Double_t negp      = nTrack->P();
    Double_t posnsTPC   = TMath::Abs(pid->NumberOfSigmasTPC(pTrack, fPID));
    Double_t posnsTPC2  = TMath::Abs(pid->NumberOfSigmasTPC(pTrack, fPID2));
-   //Double_t posnsTOF  = TMath::Abs(pid->NumberOfSigmasTOF(ptrack, fPID));
    Double_t negnsTPC   = TMath::Abs(pid->NumberOfSigmasTPC(nTrack, fPID));
    Double_t negnsTPC2  = TMath::Abs(pid->NumberOfSigmasTPC(nTrack, fPID2));
-   //Double_t negnsTOF  = TMath::Abs(pid->NumberOfSigmasTOF(ntrack, fPID));
    Double_t maxTPC = 1E20;
    Double_t maxTPC2 = 1E20;
-   //Double_t maxTOF = 1E20;
-   
+
    // applies the cut differently depending on the PID and the momentum
-   
-   if(fHypothesis==kLambda0){
-
-
-     //if (isTOFpos) {
-     // TPC: 5sigma cut for all
-     //if (posnsTPC > 5.0) return kFALSE;
-     // TOF: 3sigma
-     // maxTOF = 3.0;
-     //return (posnsTOF <= maxTOF);
-     //} else {
-     // TPC: 
-     // below 600 MeV: 4sigma
-     // above 600 MeV: 3sigma
-     
-     if (pospTPC <= 0.6 && fPID==AliPID::kProton) 
-       maxTPC = fPIDCut1; // EF safer value to run on MC
-     else if (pospTPC > 0.6 && fPID==AliPID::kProton)
-       maxTPC = fPIDCut2; // EF safer value to run on MC
-     else
-       return kFALSE; 
-                
-     maxTPC2 = fPIDCut3; // EF safer value to run on MC
-     
+   if(fHypothesis==kLambda0) {
+     maxTPC = fPIDCutProton; 
+     maxTPC2 = fPIDCutPion;      
      if (! ((posnsTPC <= maxTPC) && (negnsTPC2 <= maxTPC2)) ) {
        AliDebugClass(2, "Failed check on V0 PID");
        return kFALSE;
-     } 
+     }
    }
-      
-   if(fHypothesis==kLambda0Bar){
-
-     //if (isTOFneg) {
-     // TPC: 5sigma cut for all
-     //if (negnsTPC > 5.0) return kFALSE;
-     // TOF: 3sigma 
-     // maxTOF = 3.0;
-     //return (negnsTOF <= maxTOF);
-     //} else {
-     // TPC: 
-     // below 600 MeV: 4sigma
-     // above 600 MeV: 3sigma
-     
-     if (negpTPC <= 0.6 && fPID==AliPID::kProton) 
-       maxTPC = fPIDCut1; // EF safer value to run on MC
-     else if (negpTPC > 0.6 && fPID==AliPID::kProton)
-       maxTPC = fPIDCut2; // EF safer value to run on MC
-     else
-       return kFALSE; 
-           
-     maxTPC2 = fPIDCut3; // EF safer value to run on MC
-     
-     if(! ((negnsTPC <= maxTPC) && (posnsTPC2 <= maxTPC2)) ){
+   
+   if(fHypothesis==kLambda0Bar) {
+     maxTPC = fPIDCutProton;
+     maxTPC2 = fPIDCutPion;
+     if(! ((negnsTPC <= maxTPC) && (posnsTPC2 <= maxTPC2)) ) {
        AliDebugClass(2, "Failed check on V0 PID");
        return kFALSE;
      }
    }
    
-   
-
+   //---------------------------------------------------------------
    // if we reach this point, all checks were successful
-   AliDebugClass(1, "Good AOD V0 (hallelujah)");
+   AliDebugClass(1, "Good AOD V0");
    AliDebugClass(1, Form("Mass: %d %f %f %d %d", fHypothesis, fMass, mass, filtermapP, filtermapN));
-   return kTRUE;   
+   return kTRUE;
 
 }