Enable custom settings for track quality cut object + renamed default 2011 cut for...
authorFrancesca Bellini <fbellini@cern.ch>
Mon, 23 Dec 2013 15:17:15 +0000 (16:17 +0100)
committerFrancesca Bellini <fbellini@cern.ch>
Mon, 23 Dec 2013 15:21:04 +0000 (16:21 +0100)
PWGLF/RESONANCES/AliRsnCutSetDaughterParticle.cxx
PWGLF/RESONANCES/AliRsnCutSetDaughterParticle.h
PWGLF/RESONANCES/AliRsnCutTrackQuality.cxx
PWGLF/RESONANCES/AliRsnCutTrackQuality.h
PWGLF/RESONANCES/macros/mini/ConfigTOFanalysisKStar.C

index a2d9d82..1c10170 100644 (file)
@@ -25,7 +25,9 @@ AliRsnCutSetDaughterParticle::AliRsnCutSetDaughterParticle() :
    fCutQuality(0x0),
    fAODTrkCutFilterBit(0),
    fCheckOnlyFilterBit(kTRUE),
-   fUseCustomQualityCuts(kFALSE)  
+   fUseCustomQualityCuts(kFALSE),
+   fIsUse2011stdQualityCuts(kFALSE),  
+   fIsUse2011stdQualityCutsHighPt(kFALSE)  
 {
    //
    // Default constructor
@@ -43,7 +45,9 @@ AliRsnCutSetDaughterParticle::AliRsnCutSetDaughterParticle(const char *name, Ali
    fCutQuality(new AliRsnCutTrackQuality("CutQuality")),
    fAODTrkCutFilterBit(AODfilterBit),
    fCheckOnlyFilterBit(kTRUE),
-   fUseCustomQualityCuts(kFALSE)
+   fUseCustomQualityCuts(kFALSE),
+   fIsUse2011stdQualityCuts(kFALSE),  
+   fIsUse2011stdQualityCutsHighPt(kFALSE)  
 {
    //
    // Constructor
@@ -74,7 +78,9 @@ AliRsnCutSetDaughterParticle::AliRsnCutSetDaughterParticle(const char *name, Ali
   fCutQuality(rsnTrackQualityCut),
   fAODTrkCutFilterBit(0),
   fCheckOnlyFilterBit(kFALSE),
-  fUseCustomQualityCuts(kTRUE)
+  fUseCustomQualityCuts(kFALSE),
+  fIsUse2011stdQualityCuts(kFALSE),  
+  fIsUse2011stdQualityCutsHighPt(kFALSE)  
 {
   //
   // Constructor: uses externally-defined track-quality cut object
@@ -119,7 +125,9 @@ AliRsnCutSetDaughterParticle::AliRsnCutSetDaughterParticle(const AliRsnCutSetDau
   fCutQuality(copy.fCutQuality),
   fAODTrkCutFilterBit(copy.fAODTrkCutFilterBit),
   fCheckOnlyFilterBit(copy.fCheckOnlyFilterBit),
-  fUseCustomQualityCuts(copy.fUseCustomQualityCuts)
+  fUseCustomQualityCuts(copy.fUseCustomQualityCuts),
+  fIsUse2011stdQualityCuts(copy.fIsUse2011stdQualityCuts),  
+  fIsUse2011stdQualityCutsHighPt(copy.fIsUse2011stdQualityCutsHighPt)  
 {
   //
   // copy constructor
@@ -143,6 +151,8 @@ AliRsnCutSetDaughterParticle &AliRsnCutSetDaughterParticle::operator=(const AliR
    fAODTrkCutFilterBit=copy.fAODTrkCutFilterBit;
    fCheckOnlyFilterBit=copy.fCheckOnlyFilterBit;
    fUseCustomQualityCuts=copy.fUseCustomQualityCuts;
+   fIsUse2011stdQualityCuts=copy.fIsUse2011stdQualityCuts;
+   fIsUse2011stdQualityCutsHighPt=copy.fIsUse2011stdQualityCutsHighPt; 
    fCutQuality=copy.fCutQuality;
    return (*this);
 }
@@ -186,7 +196,11 @@ void AliRsnCutSetDaughterParticle::Init()
          break;
 
       case AliRsnCutSetDaughterParticle::kQualityStd2011:
-         //fCutQuality->SetAODTestFilterBit(10);     //1024
+         AddCut(fCutQuality);
+         SetCutScheme(fCutQuality->GetName());
+         break;
+
+    case AliRsnCutSetDaughterParticle::kQualityStd2011HighPt:
          AddCut(fCutQuality);
          SetCutScheme(fCutQuality->GetName());
          break;
@@ -408,7 +422,7 @@ void AliRsnCutSetDaughterParticle::Init()
      break;
         
            
-   case AliRsnCutSetDaughterParticle::kTPCpidTOFvetoKStarPPB2011:
+   case AliRsnCutSetDaughterParticle::kTPCTOFtightPidKStarPPB2011:
      if (fNsigmaTPC <= 0.0) {
        AliWarning(Form("Invalid number of sigmas required for %s. Setting nSigma = 5.0",iCutTPCNSigma->GetName()));
        SetNsigmaForFastTPCpid(5.0);
@@ -441,10 +455,159 @@ void AliRsnCutSetDaughterParticle::Init()
      SetCutScheme( Form("%s&%s&%s",fCutQuality->GetName(), iCutTPCNSigma->GetName(),iCutTOFMatch->GetName()) );
      break;
 
-   default :
+    case AliRsnCutSetDaughterParticle::kTPCpidTOFveto4s:
+      if (fNsigmaTPC <= 0.0) {
+       AliWarning(Form("Invalid number of sigmas required for %s. Setting nSigma = 5.0",iCutTPCNSigma->GetName()));
+       SetNsigmaForFastTPCpid(5.0);
+      }
+      iCutTPCNSigma->SinglePIDRange(fNsigmaTPC);
+      AddCut(fCutQuality);
+      iCutTOFNSigma->SinglePIDRange(4.0);
+
+      AddCut(iCutTPCNSigma);
+      AddCut(iCutTOFMatch);
+      AddCut(iCutTOFNSigma);
+      
+      // scheme:
+      // quality & [ (TPCsigma & !TOFmatch) | (TPCsigma & TOFsigma) ]
+      SetCutScheme( Form("%s&((%s&(!%s))|(%s&%s))",fCutQuality->GetName(), iCutTPCNSigma->GetName(), iCutTOFMatch->GetName(),iCutTOFNSigma->GetName(), iCutTPCNSigma->GetName()) ) ;
+       break;
+
+    case AliRsnCutSetDaughterParticle::kTPCpidTOFveto3s:
+      if (fNsigmaTPC <= 0.0) {
+       AliWarning(Form("Invalid number of sigmas required for %s. Setting nSigma = 5.0",iCutTPCNSigma->GetName()));
+       SetNsigmaForFastTPCpid(5.0);
+      }
+      iCutTPCNSigma->SinglePIDRange(fNsigmaTPC);
+      AddCut(fCutQuality);
+      iCutTOFNSigma->SinglePIDRange(3.0);
+
+      AddCut(iCutTPCNSigma);
+      AddCut(iCutTOFMatch);
+      AddCut(iCutTOFNSigma);
+      
+      // scheme:
+      // quality & [ (TPCsigma & !TOFmatch) | (TPCsigma & TOFsigma) ]
+      SetCutScheme( Form("%s&((%s&(!%s))|(%s&%s))",fCutQuality->GetName(), iCutTPCNSigma->GetName(), iCutTOFMatch->GetName(),iCutTOFNSigma->GetName(), iCutTPCNSigma->GetName()) ) ;
+       break;     
+
+    case AliRsnCutSetDaughterParticle::kCombinedPidBestPtDep:
+      /* Set TPC  PID (if no TOF)*/
+      // all   below  500 MeV: 3sigma
+      // all above 500 MeV: 2sigma
+      iCutTPCNSigma->AddPIDRange(3.0, 0.0, 0.5);
+      iCutTPCNSigma->AddPIDRange(2.0, 0.5, 1E20);
+      
+      AddCut(fCutQuality);
+      AddCut(iCutTOFMatch);
+      AddCut(iCutTPCNSigma);
+      
+      /* set TPC+TOF PID*/
+      // pions if TOF match: TPC 5 sigma & TOF 3 sigma
+      // kaons if TOF match: 
+      //            below 1.5GeV/c: TPC 5 sigma & TOF 3 sigma
+      //            above 1.5GeV/c: TPC 3 sigma & TOF 3 sigma
+
+      if (fPID==AliPID::kPion){
+       iCutTPCTOFNSigma->SinglePIDRange(5.0);
+      }
+      
+      if (fPID==AliPID::kKaon){
+       iCutTPCTOFNSigma->AddPIDRange(5.0, 0.0, 1.5);
+       iCutTPCTOFNSigma->AddPIDRange(3.0, 1.5, 1E20);
+      }
+      iCutTOFNSigma->AddPIDRange(3.0, 0.0, 1E20);
+      AddCut(iCutTPCTOFNSigma);
+      AddCut(iCutTOFNSigma);
+        
+     // scheme:
+     // quality & [ (TOF & TPCTOF) || (!TOFmatch & TPConly) ]
+     SetCutScheme( Form("%s&((%s&%s)|((!%s)&%s))",fCutQuality->GetName(), iCutTPCTOFNSigma->GetName(), iCutTOFNSigma->GetName(), iCutTOFMatch->GetName(), iCutTPCNSigma->GetName()) ) ;
+     break;
+      
+    case AliRsnCutSetDaughterParticle::kTPCPidPtDep:
+      /* Set TPC  PID (if no TOF)*/
+      // all   below  500 MeV: 3sigma
+      // all above 500 MeV: 2sigma
+      iCutTPCNSigma->AddPIDRange(3.0, 0.0, 0.5);
+      iCutTPCNSigma->AddPIDRange(2.0, 0.5, 1E20);
+      
+      AddCut(fCutQuality);
+      AddCut(iCutTPCNSigma);
+      // scheme:
+     // quality & TPConly
+     SetCutScheme( Form("%s&%s",fCutQuality->GetName(), iCutTPCNSigma->GetName()) ) ;
      break;
-   }
 
+    case AliRsnCutSetDaughterParticle::kTOFPidPtDep:
+      /* Set TOF  PID */
+      // all   below  1500 MeV: 3sigma
+      // all above 1500 MeV: 2sigma
+      //TPC 5 sigma always to remove mismatch
+      iCutTPCTOFNSigma->SinglePIDRange(5.0);
+      iCutTOFNSigma->AddPIDRange(3.0, 0.0, 1.5);
+      iCutTOFNSigma->AddPIDRange(2.0, 1.5, 1E20);
+      
+      AddCut(fCutQuality);
+      AddCut(iCutTPCTOFNSigma);
+      AddCut(iCutTOFNSigma);
+      // scheme:
+      // quality & TPConly
+      SetCutScheme( Form("%s&%s&%s", fCutQuality->GetName(), iCutTPCTOFNSigma->GetName(), iCutTOFNSigma->GetName()) ) ;
+      break;
+
+    case AliRsnCutSetDaughterParticle::kTPCRejPtDepTOFNsigma:
+      /* Set TOF  PID */
+      // TPC mismatch rejection:
+      //             below  1.500 GeV: 5sigma
+      //             above  1.500 GeV: 3sigma
+      // TOF nsigma PID in full pT
+      iCutTPCTOFNSigma->AddPIDRange(5.0, 0.0, 1.5);
+      iCutTPCTOFNSigma->AddPIDRange(3.0, 1.5, 1E20);
+      
+      if (fNsigmaTOF <= 0.0) {
+       AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTOFNSigma->GetName()));
+       SetNsigmaForFastTOFpid(10.0);
+      }
+      iCutTOFNSigma->SinglePIDRange(fNsigmaTOF);
+      
+      AddCut(fCutQuality);
+      AddCut(iCutTPCTOFNSigma);
+      AddCut(iCutTOFNSigma);
+      // scheme:
+      // quality & TPConly
+      SetCutScheme( Form("%s&%s&%s", fCutQuality->GetName(), iCutTPCTOFNSigma->GetName(), iCutTOFNSigma->GetName()) ) ;
+      break;
+      
+    case AliRsnCutSetDaughterParticle::kTPCNsigmaTOFVetoPtDep:
+      /* Set TPC  PID */
+      // TOF veto:
+      //             below  1.500 GeV: 5sigma
+      //             above  1.500 GeV: 3sigma
+      // TPC nsigma PID in full pT
+      if (fNsigmaTPC <= 0.0) {
+       AliWarning(Form("Invalid number of sigmas required for %s. Setting default nSigma = 10",iCutTPCNSigma->GetName()));
+       SetNsigmaForFastTPCpid(10.0);
+      }
+      iCutTPCNSigma->SinglePIDRange(fNsigmaTPC);
+      
+      iCutTOFNSigma->AddPIDRange(3.0, 0.0, 1.5);
+      iCutTOFNSigma->AddPIDRange(4.0, 1.5, 1E20);
+      
+      AddCut(fCutQuality);
+      AddCut(iCutTPCNSigma);
+      AddCut(iCutTOFMatch);
+      AddCut(iCutTOFNSigma);
+      
+      // scheme:
+      // quality & [ (TPCsigma & !TOFmatch) | (TPCsigma & TOFsigma) ]
+      SetCutScheme( Form("%s&((%s&(!%s))|(%s&%s))",fCutQuality->GetName(), iCutTPCNSigma->GetName(), iCutTOFMatch->GetName(),iCutTOFNSigma->GetName(), iCutTPCNSigma->GetName()) ) ;
+      break;
+      
+    default :
+      break;
+    }
+  
 }
 
 
@@ -462,30 +625,45 @@ void AliRsnCutSetDaughterParticle::InitStdQualityCuts()
   // initialize quality std (if not externally defined) and PID cuts
   // init cut sets by setting variable params
   // 
-  Bool_t isUse2011stdQualityCuts = ((fAppliedCutSetID==AliRsnCutSetDaughterParticle::kQualityStd2011) ||
-                                   (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTOFMatchPPB2011) || //pA analysis
-                                   (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCpidKstarPPB2011) ||
-                                   (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTOFpidKstarPPB2011) ||
-                                   (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCTOFpidKstarPPB2011) ||
-                                   (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCpidTOFvetoKStarPPB2011) ||
-                                   (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCpidMatchPPB2011));
-  if (isUse2011stdQualityCuts) {
-    fCutQuality->SetDefaults2011();//uses filter bit 10 as default
-    fCutQuality->SetAODTestFilterBit(fAODTrkCutFilterBit); //changes default filter bit 10 to the chosen filter bit
+  // Bool_t isUse2011stdQualityCutsHighPt = ((fAppliedCutSetID==AliRsnCutSetDaughterParticle::kQualityStd2011HighPt) ||
+  //                                     (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTOFMatchPPB2011) || //pA analysis
+  //                                     (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCpidKstarPPB2011) ||
+  //                                     (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTOFpidKstarPPB2011) ||
+  //                                     (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCTOFpidKstarPPB2011) ||
+  //                                     (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCpidTOFvetoKStarPPB2011) ||
+  //                                     (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kTPCpidMatchPPB2011));
+  
+  // Bool_t isUse2011stdQualityCuts = (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kQualityStd2011);
+
+  if (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kQualityStd2011) {
+    fIsUse2011stdQualityCuts = kTRUE;
+    fIsUse2011stdQualityCutsHighPt = kFALSE;
+  }
+  if (fAppliedCutSetID==AliRsnCutSetDaughterParticle::kQualityStd2011HighPt) {
+    fIsUse2011stdQualityCuts = kFALSE;
+    fIsUse2011stdQualityCutsHighPt = kTRUE;
+  }
+
+  if (fIsUse2011stdQualityCuts) {
+    fCutQuality->SetDefaults2011();//uses filter bit 5 as default
   } else {
-    fCutQuality->SetDefaults2010();
-    fCutQuality->SetDCARPtFormula("0.0182+0.0350/pt^1.01");
-    fCutQuality->SetDCAZmax(2.0);
-    fCutQuality->SetSPDminNClusters(1);
-    fCutQuality->SetITSminNClusters(0);
-    fCutQuality->SetITSmaxChi2(36);
-    fCutQuality->SetTPCminNClusters(70);
-    fCutQuality->SetTPCmaxChi2(4.0);
-    fCutQuality->SetRejectKinkDaughters();
-    fCutQuality->SetAODTestFilterBit(fAODTrkCutFilterBit);
-    //fCutQuality->SetITSmaxChi2(36);
-    //fCutQuality->SetMaxChi2TPCConstrainedGlobal(36);
+    if (fIsUse2011stdQualityCutsHighPt) {
+      fCutQuality->SetDefaultsHighPt2011();//uses filter bit 5 as default
+    } else {
+      fCutQuality->SetDefaults2010();
+      fCutQuality->SetDCARPtFormula("0.0182+0.0350/pt^1.01");
+      fCutQuality->SetDCAZmax(2.0);
+      fCutQuality->SetSPDminNClusters(1);
+      fCutQuality->SetITSminNClusters(0);
+      fCutQuality->SetITSmaxChi2(36);
+      fCutQuality->SetTPCminNClusters(70);
+      fCutQuality->SetTPCmaxChi2(4.0);
+      fCutQuality->SetRejectKinkDaughters();
+      //fCutQuality->SetITSmaxChi2(36);
+      //fCutQuality->SetMaxChi2TPCConstrainedGlobal(36);
+    }
   }
+  fCutQuality->SetAODTestFilterBit(fAODTrkCutFilterBit); //changes default filter bit to the chosen filter bit
   
   //apply pt and eta cuts
   fCutQuality->SetPtRange(fPtRange[0], fPtRange[1]);
index e457f70..148f2ed 100644 (file)
@@ -25,7 +25,8 @@ public:
   enum ERsnDaughterCutSet {
     kNoCuts,
     kQualityStd2010,//quality only
-    kQualityStd2011,    
+    kQualityStd2011,
+    kQualityStd2011HighPt,    
     kTOFMatch,  
     kFastTPCpidNsigma, //PbPb analysis
     kFastTOFpidNsigma,
@@ -43,8 +44,15 @@ public:
     kTPCpidKstarPPB2011,
     kTOFpidKstarPPB2011,
     kTPCTOFpidKstarPPB2011,
-    kTPCpidTOFvetoKStarPPB2011, //TPC pid with TOF veto
+    kTPCTOFtightPidKStarPPB2011, //TPC 2.0 (3.0) sigma pid & TOF at 3.0 (5.0) sigma 
     kTPCpidMatchPPB2011, //Match with nsigma = fNsigmaTPC
+    kTPCpidTOFveto4s, //TPC n sigma + 4.0 sigma TOF veto
+    kTPCpidTOFveto3s, //TPC n sigma + 3.0 sigma TOF veto
+    kCombinedPidBestPtDep, 
+    kTPCPidPtDep,
+    kTOFPidPtDep,
+    kTPCRejPtDepTOFNsigma,
+    kTPCNsigmaTOFVetoPtDep,
     kNDaughterCuts
   };
 
@@ -86,7 +94,8 @@ public:
    void           EnableCustomCuts(Bool_t useCustom=kFALSE) {fUseCustomQualityCuts=useCustom; return;}
    void           SetPtRange(Double_t a, Double_t b)        {fPtRange[0] = TMath::Min(a, b); fPtRange[1] = TMath::Max(a, b); return;}
    void           SetEtaRange(Double_t a, Double_t b)       {fEtaRange[0] = TMath::Min(a, b); fEtaRange[1] = TMath::Max(a, b); return;}
-
+   void           SetUse2011StdQualityCuts(Bool_t use2011=kFALSE) {fIsUse2011stdQualityCuts=use2011; return;}
+   void           SetUse2011StdQualityCutsHighPt(Bool_t use2011HighPt=kFALSE) {fIsUse2011stdQualityCutsHighPt=use2011HighPt; return;}
    //getters
    const char   *GetAppliedDaughterCutSetName() { return GetName();}
    Int_t         GetAppliedDaughterCutSetId() { return fAppliedCutSetID;}
@@ -105,8 +114,10 @@ public:
    Bool_t                fUseCustomQualityCuts; //flag to enable the usage of custom quality cuts
    Float_t               fPtRange[2]; //single track pt range (min, max)
    Float_t               fEtaRange[2]; //single track eta range (min, max)
-
-   ClassDef(AliRsnCutSetDaughterParticle, 4) // cut definitions for K*
+   Bool_t                fIsUse2011stdQualityCuts;//flag to enalble std quality cuts 2011 
+   Bool_t                fIsUse2011stdQualityCutsHighPt;//flag to enalble std quality cuts 2011 
+   ClassDef(AliRsnCutSetDaughterParticle, 5) // cut definitions for K*
 
 };
 
index c324d43..2b71792 100644 (file)
@@ -58,7 +58,6 @@ AliRsnCutTrackQuality::AliRsnCutTrackQuality(const char *name) :
 // Default constructor.
 // Initializes all cuts in such a way that all of them are disabled.
 //
-
    SetPtRange(0.0, 1E20);
    SetEtaRange(-1E20, 1E20);
 }
@@ -261,13 +260,18 @@ Bool_t AliRsnCutTrackQuality::CheckESD(AliESDtrack *track)
    cuts.SetRequireSigmaToVertex(kFALSE);
 
    // TPC related cuts for TPC+ITS tracks
-   cuts.SetMinNClustersTPC(fTPCminNClusters);
+   if (fIsUseCrossedRowsCut) {
+     cuts.SetMinNCrossedRowsTPC(fTPCminNCrossedRows);
+     cuts.SetMinRatioCrossedRowsOverFindableClustersTPC(fTPCminCrossedRowsOverFindableCls);
+   } else {
+     cuts.SetMinNClustersTPC(fTPCminNClusters);
+   }
    cuts.SetMaxChi2PerClusterTPC(fTPCmaxChi2);
    cuts.SetAcceptKinkDaughters(!fRejectKinkDaughters);
    cuts.SetMaxChi2TPCConstrainedGlobal(fCutMaxChi2TPCConstrainedVsGlobal);
-   cuts.SetMinNCrossedRowsTPC(fTPCminNCrossedRows);
-   cuts.SetMinRatioCrossedRowsOverFindableClustersTPC(fTPCminCrossedRowsOverFindableCls);
-   cuts.SetMinLengthActiveVolumeTPC(fCutMinLengthActiveVolumeTPC);
+
+   if (fIsUseLengthActiveVolumeTPCCut)
+     cuts.SetMinLengthActiveVolumeTPC(fCutMinLengthActiveVolumeTPC);
 
    // ITS related cuts for TPC+ITS tracks
    if (fSPDminNClusters > 0)
@@ -319,10 +323,11 @@ Bool_t AliRsnCutTrackQuality::CheckAOD(AliAODTrack *track)
 
 
    //step #1: check number of clusters 
-   if (track->GetTPCNcls() < fTPCminNClusters) {
+   if ((!fIsUseCrossedRowsCut) && (track->GetTPCNcls() < fTPCminNClusters)) {
       AliDebug(AliLog::kDebug + 2, "Too few TPC clusters. Rejected");
       return kFALSE;
    }
    if (track->GetITSNcls() < fITSminNClusters) {
       AliDebug(AliLog::kDebug + 2, "Too few ITS clusters. Rejected");
       return kFALSE;
@@ -339,23 +344,26 @@ Bool_t AliRsnCutTrackQuality::CheckAOD(AliAODTrack *track)
    }
 
    //step #2a: check number of crossed rows in TPC
-   Float_t nCrossedRowsTPC = track->GetTPCNCrossedRows();
-   if (nCrossedRowsTPC < fTPCminNCrossedRows) {
-     AliDebug(AliLog::kDebug + 2, "Too few TPC crossed rows. Rejected");
-     return kFALSE;
-   }
-   if (track->GetTPCNclsF()>0) {
-     Float_t ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC / track->GetTPCNclsF();
-     if (ratioCrossedRowsOverFindableClustersTPC < fTPCminCrossedRowsOverFindableCls){
-       AliDebug(AliLog::kDebug + 2, "Too few TPC crossed rows/findable clusters. Rejected");
+   if (fIsUseCrossedRowsCut) {
+     Float_t nCrossedRowsTPC = track->GetTPCNCrossedRows();
+     if (nCrossedRowsTPC < fTPCminNCrossedRows) {
+       AliDebug(AliLog::kDebug + 2, "Too few TPC crossed rows. Rejected");
+       return kFALSE;
+     }
+     if (track->GetTPCNclsF()>0) {
+       Float_t ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC / track->GetTPCNclsF();
+       if (ratioCrossedRowsOverFindableClustersTPC < fTPCminCrossedRowsOverFindableCls){
+        AliDebug(AliLog::kDebug + 2, "Too few TPC crossed rows/findable clusters. Rejected");
+        return kFALSE;
+       }
+     } else {
+       AliDebug(AliLog::kDebug + 2, "Negative value for TPC crossed rows/findable clusters. Rejected");
        return kFALSE;
      }
-   } else {
-     AliDebug(AliLog::kDebug + 2, "Negative value for TPC crossed rows/findable clusters. Rejected");
-     return kFALSE;
    }
    //step #2b: check on track length in active volume of TPC implemented only for ESD tracks
-     
+   //if (fIsUseLengthActiveVolumeTPCCut) { // not yet implemented in AODs}
    //step #3: reject kink daughters
    AliAODVertex *vertex = track->GetProdVertex();
    if (vertex && fRejectKinkDaughters) {
@@ -480,27 +488,41 @@ void AliRsnCutTrackQuality::SetDefaults2010()
 }
 
 //__________________________________________________________________________________________________
-void AliRsnCutTrackQuality::SetDefaults2011()
+void AliRsnCutTrackQuality::SetDefaultsHighPt2011(Bool_t useTPCCrossedRows)
 {
 //
 // Default settings for cuts used in 2011 (for high-pT)
 //
-   fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE,1);
+   fIsUseCrossedRowsCut=useTPCCrossedRows;
+   fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE, useTPCCrossedRows);
    fESDtrackCuts->SetMinNCrossedRowsTPC(120); //default is min 70 crossed rows -> use 120 to go to higher pt
-   fESDtrackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
-   fESDtrackCuts->SetMaxChi2PerClusterITS(36);
    fESDtrackCuts->SetMaxFractionSharedTPCClusters(0.4);//default is not set --> use to go to higher pt
-   fESDtrackCuts->SetMaxChi2TPCConstrainedGlobal(36);
-   AddStatusFlag(AliESDtrack::kTPCin   , kTRUE);
-   AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE);
-   AddStatusFlag(AliESDtrack::kITSrefit, kTRUE);
+   //fESDtrackCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);//already in 2011 std
+   //fESDtrackCuts->SetMaxChi2PerClusterITS(36);//already in 2011 std
+   //fESDtrackCuts->SetMaxChi2TPCConstrainedGlobal(36);//already in 2011 std
+   // AddStatusFlag(AliESDtrack::kTPCin   , kTRUE); //already in 2011 std
+   // AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE);//already in 2011 std
+   // AddStatusFlag(AliESDtrack::kITSrefit, kTRUE);//already in 2011 std
    SetPtRange(0.15, 1E+20);
    SetEtaRange(-0.8, 0.8);
    SetAODTestFilterBit(10);
+   return;
 }
 
 //__________________________________________________________________________________________________
+void AliRsnCutTrackQuality::SetDefaults2011(Bool_t useTPCCrossedRows)
+{
+//
+// Default std cuts 2011 with crossed rows (=70)
+//
+  fIsUseCrossedRowsCut=useTPCCrossedRows;
+  fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE,useTPCCrossedRows);
+  SetPtRange(0.15, 1E+20);
+  SetEtaRange(-0.8, 0.8);
+  SetAODTestFilterBit(5);
+  return;
+}
+//__________________________________________________________________________________________________
 const char *AliRsnCutTrackQuality::Binary(UInt_t number)
 {
 //
index 96739bb..cb27bd1 100644 (file)
@@ -48,16 +48,17 @@ public:
    void      SetTPCminNClusters(Int_t value)           {fTPCminNClusters = value;}
    void      SetTPCmaxChi2(Double_t value)             {fTPCmaxChi2 = value;}
    void      SetMaxChi2TPCConstrainedGlobal(Float_t max) {fCutMaxChi2TPCConstrainedVsGlobal = max; }
-   void      SetMinNCrossedRowsTPC(Double_t min)       {fTPCminNCrossedRows=min;}
-   void      SetMinNCrossedRowsOverFindableClsTPC(Double_t min) {fTPCminCrossedRowsOverFindableCls=min;}
-   void      SetMinLengthActiveVolumeTPC(Double_t min) {fCutMinLengthActiveVolumeTPC=min;}
+   void      SetMinNCrossedRowsTPC(Double_t min, Bool_t useTPCCrossedRows) {fTPCminNCrossedRows=min; fIsUseCrossedRowsCut=useTPCCrossedRows;}
+   void      SetMinNCrossedRowsOverFindableClsTPC(Double_t min, Bool_t useTPCCrossedRows) {fTPCminCrossedRowsOverFindableCls=min; fIsUseCrossedRowsCut=useTPCCrossedRows;}
+   void      SetMinLengthActiveVolumeTPC(Double_t min, Bool_t on = kFALSE) {fCutMinLengthActiveVolumeTPC=min; fIsUseLengthActiveVolumeTPCCut=on;}
    void      SetRejectKinkDaughters(Bool_t yn = kTRUE) {fRejectKinkDaughters = yn;}
 
    void      SetAODTestFilterBit(Int_t value)          {fAODTestFilterBit = value;}
    void      SetCheckOnlyFilterBit(Bool_t on=kTRUE)    {fCheckOnlyFilterBit=on;}
-
    void      SetDefaults2010();
-   void      SetDefaults2011();
+   void      SetDefaults2011(Bool_t useTPCCrossedRows = kTRUE);
+   void      SetDefaultsHighPt2011(Bool_t useTPCCrossedRows = kTRUE);
    void      SetESDtrackCuts(AliESDtrackCuts *esdTrackCuts) {fESDtrackCuts = esdTrackCuts;}
    AliESDtrackCuts  *GetESDtrackCuts() {return fESDtrackCuts;}
    Double_t   GetPtRange(Bool_t max) {return fPt[max];}
@@ -94,8 +95,10 @@ protected:
    Double_t   fTPCmaxChi2;             // maximum chi2 / number of clusters in TPC
    Float_t    fCutMaxChi2TPCConstrainedVsGlobal;  // max chi2 TPC track constrained with vtx vs. global track
    
+   Bool_t     fIsUseCrossedRowsCut;     //enable cut on minimum number of TPC crossed rows
    Float_t    fTPCminNCrossedRows;     // minimum number of TPC crossed rows
    Float_t    fTPCminCrossedRowsOverFindableCls;     // minimum number of crossed rows/findable clusters
+   Bool_t     fIsUseLengthActiveVolumeTPCCut;     //enable cut on minimum track lenght in TPC active volume
    Float_t    fCutMinLengthActiveVolumeTPC; // mininum length (in cm) over which the track is sampled in the active volume of the TPC (outside boundaries)
 
    Int_t      fAODTestFilterBit;       // test filter bit for AOD tracks
index 2bc60b8..3ac0e6b 100644 (file)
@@ -49,9 +49,12 @@ Bool_t ConfigTOFanalysisKStar
   } else {
     //use defult quality cuts (std 2010 or 2011)
     cutSetQ  = new AliRsnCutSetDaughterParticle(Form("cutQ_bit%i",aodFilterBit), AliRsnCutSetDaughterParticle::kQualityStd2011, AliPID::kPion, -1.0, aodFilterBit);
+    cutSetQ->SetUse2011StdQualityCuts(kTRUE);
     cutSetPi = new AliRsnCutSetDaughterParticle(Form("cutPi%i_%2.1fsigma",cutPiCandidate, nsigmaPi), cutPiCandidate, AliPID::kPion, nsigmaPi, aodFilterBit);
+    cutSetPi->SetUse2011StdQualityCuts(kTRUE);
     cutSetK  = new AliRsnCutSetDaughterParticle(Form("cutK%i_%2.1fsigma",cutPiCandidate, nsigmaKa), cutKaCandidate, AliPID::kKaon, nsigmaKa, aodFilterBit);
-  }
+    cutSetK->SetUse2011StdQualityCuts(kTRUE);
+   }
   
   Int_t iCutQ = task->AddTrackCuts(cutSetQ);
   Int_t iCutPi = task->AddTrackCuts(cutSetPi);