]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/RESONANCES/AliRsnCutDaughterD0.cxx
Starting a collection of QA/Comparison macros
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCutDaughterD0.cxx
index 150386fb1d203dce2218272bb685cc278609fa2f..81aad95a86ff0c8095e5e405c9cdaf9010771431 100644 (file)
@@ -23,13 +23,13 @@ AliRsnCut(name, AliRsnTarget::kDaughter),
   fPionTPCPIDCut(3.0),
   fKaonTPCPIDCut(3.0),
   fPionTOFPIDCut(3.0),
-  fKaonTOFPIDCut(3.0)
+  fKaonTOFPIDCut(3.0),
+  fPtDepPIDCut(kFALSE) 
 {
   //
   // Constructor
   // Initialize track quality cuts to 2010 defaults
   //
-
   fCutQuality.SetPtRange(0.15, 1E+20);
   fCutQuality.SetEtaRange(-0.8, 0.8);
   fCutQuality.SetDCARPtFormula("0.0105+0.0350/pt^1.1");
@@ -86,24 +86,57 @@ Bool_t AliRsnCutDaughterD0::IsSelected(TObject *obj)
   Bool_t   isTOF  = MatchTOF(track);   
   AliDebugClass(2, "...passed");
    
-  // Double_t pTPC   = track->GetTPCmomentum();
-  // Double_t p      = track->P();
+  Double_t pTPC   = track->GetTPCmomentum();
+  Double_t p      = track->P();
   Double_t nsTPC  = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID));
   Double_t nsTOF  = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20;
   Double_t maxTPC = 1E20;
   Double_t maxTOF = 1E20;
   AliDebugClass(2, "Checking PID...");
 
-  // applies the cut differently depending on the PID and the momentum
-  if (isTOF) {
-    if (fPID == AliPID::kPion) {maxTPC = fPionTPCPIDCut; maxTOF = fPionTOFPIDCut;}
-    if (fPID == AliPID::kKaon) {maxTPC = fKaonTPCPIDCut; maxTOF = fKaonTOFPIDCut;}
-    return (nsTPC <= maxTPC && nsTOF <= maxTOF);
+  if(!fPtDepPIDCut){
+    // applies the cut differently depending on the PID and the momentum
+    if (isTOF) {
+      if (fPID == AliPID::kPion) {maxTPC = fPionTPCPIDCut; maxTOF = fPionTOFPIDCut;}
+      if (fPID == AliPID::kKaon) {maxTPC = fKaonTPCPIDCut; maxTOF = fKaonTOFPIDCut;}
+      return (nsTPC <= maxTPC && nsTOF <= maxTOF);
+    } else {
+      if (fPID == AliPID::kPion) maxTPC = fPionTPCPIDCut;
+      if (fPID == AliPID::kKaon) maxTPC = fKaonTPCPIDCut;
+      return (nsTPC <= maxTPC); 
+    }
   } else {
-    if (fPID == AliPID::kPion) maxTPC = fPionTPCPIDCut;
-    if (fPID == AliPID::kKaon) maxTPC = fKaonTPCPIDCut;
-    return (nsTPC <= maxTPC); 
-  }     
+    // applies the cut differently depending on the PID and the momentum
+    if (isTOF) {
+      // TPC: 5sigma cut for all
+      if (nsTPC > 5.0) return kFALSE;
+      // TOF: 3sigma below 1.5 GeV, 2sigma above
+      if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0;
+      return (nsTOF <= maxTOF);
+    } else {
+      // TPC:
+      // all   below   350         MeV: 5sigma
+      // all   between 350 and 500 MeV: 3sigma
+      // pions above   500         MeV: 2sigma
+      // kaons between 500 and 700 MeV: 2sigma
+      // kaons above   700         MeV: rejected
+      if (pTPC <= 0.35)
+       maxTPC = 5.0;
+      else if (pTPC > 0.35 && pTPC <= 0.5)
+       maxTPC = 3.0;
+      else {
+       if (fPID == AliPID::kPion)
+         maxTPC = 2.0;
+       else if (fPID == AliPID::kKaon) {
+         if (pTPC <= 0.7)
+           maxTPC = 2.0;
+         else
+           return kFALSE;
+       }
+      }
+      return (nsTPC <= maxTPC);
+    } 
+  }    
   
   AliDebugClass(2, "...passed"); 
   // if we reach this point, all checks were successful