]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGHF/hfe/AliHFEpidTOF.cxx
Event Cut update + outlier centrality for flow
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEpidTOF.cxx
index e3dd4b92a6426de8f3970b05418175508208e7b6..dc8b67b3947b0fef4c1b1347825ceeac5e8ab4a8 100644 (file)
@@ -45,7 +45,8 @@ AliHFEpidTOF::AliHFEpidTOF():
   // Constructor
   //
   
-  memset(fSigmaBordersTOF, 0, sizeof(Float_t) * 2);
+  memset(fSigmaBordersTOFLower, 0, sizeof(Float_t) * 12);
+  memset(fSigmaBordersTOFUpper, 0, sizeof(Float_t) * 12);
 } 
 
 //___________________________________________________________________
@@ -56,6 +57,9 @@ AliHFEpidTOF::AliHFEpidTOF(const Char_t *name):
   //
   // Constructor
   //
+  memset(fSigmaBordersTOFLower, 0, sizeof(Float_t) * 12);
+  memset(fSigmaBordersTOFUpper, 0, sizeof(Float_t) * 12);
+
 }
 
 //___________________________________________________________________
@@ -95,7 +99,8 @@ void AliHFEpidTOF::Copy(TObject &ref) const {
   AliHFEpidTOF &target = dynamic_cast<AliHFEpidTOF &>(ref);
 
   target.fNsigmaTOF = fNsigmaTOF;
-  memcpy(target.fSigmaBordersTOF, fSigmaBordersTOF, sizeof(Float_t) * 2);
+  memcpy(target.fSigmaBordersTOFLower, fSigmaBordersTOFLower, sizeof(Float_t) * 12);
+  memcpy(target.fSigmaBordersTOFUpper, fSigmaBordersTOFUpper, sizeof(Float_t) * 12);
 
   AliHFEpidBase::Copy(ref);
 }
@@ -129,8 +134,10 @@ Int_t AliHFEpidTOF::IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager
   AliDebug(2, Form("Number of sigmas in TOF: %f", sigEle));
   Int_t pdg = 0;
   if(TestBit(kSigmaBand)){
-    // Lower and Upper cut separate
-    if(sigEle > fSigmaBordersTOF[0] && sigEle < fSigmaBordersTOF[1]) pdg = 11;
+    Int_t centrality = track->IsPbPb() ? track->GetCentrality() + 1 : 0;
+    AliDebug(2, Form("Centrality: %d\n", centrality));
+    if(centrality > 11) return kFALSE;
+    if(sigEle > fSigmaBordersTOFLower[centrality] && sigEle < fSigmaBordersTOFUpper[centrality]) pdg = 11;
   } else {
     // Fixed nsigma cut
     if(TMath::Abs(sigEle) < fNsigmaTOF) pdg = 11;
@@ -140,4 +147,34 @@ Int_t AliHFEpidTOF::IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager
  
   return pdg;
 }
+//___________________________________________________________________
+void AliHFEpidTOF::SetTOFnSigmaBand(Float_t lower, Float_t upper)
+{
+  //
+  // Lower and higher cut independant of the centrality
+  //
+
+  for(Int_t k=0; k < 12; k++) {
+    fSigmaBordersTOFLower[k] = lower;
+    fSigmaBordersTOFUpper[k] = upper;
+  }
+
+  SetBit(kSigmaBand, kTRUE);
+
+}
+//___________________________________________________________________
+void AliHFEpidTOF::SetTOFnSigmaBandCentrality(Float_t lower, Float_t upper, Int_t centralityBin)
+{
+  //
+  // Lower and higher cut as function of centrality
+  //
+
+  if(centralityBin < 11) {
+    fSigmaBordersTOFLower[centralityBin+1] = lower;
+    fSigmaBordersTOFUpper[centralityBin+1] = upper;
+  }
+
+  SetBit(kSigmaBand, kTRUE);
+
+}