]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliEventCut.cxx
Few basic event cuts developed, coding conventions corrected
[u/mrichter/AliRoot.git] / ANALYSIS / AliEventCut.cxx
index ec20b6adc10d7274d3a74771406c65b97d0a66b5..9124460c5a245db4fd129a7b23dac8e025496bcb 100644 (file)
@@ -57,6 +57,56 @@ Bool_t AliEventCut::Pass(AliAOD* aod) const
    }
   return kFALSE;
 }
+/*********************************************************/
+void AliEventCut::AddBasePartCut(AliEventBaseCut* ebcut)
+{
+//Adds a base cut
+ if (ebcut == 0x0)
+  {
+    Error("AddBasePartCut","Pointer to base cut is NULL");
+    return;
+  }
+ if (ebcut->GetProperty() != kNone)
+  {
+    if (FindCut(ebcut->GetProperty()))
+     {
+       Warning("AddBasePartCut","Cut with this property is already in the list of base cuts");
+     }
+  }  
+  
+ fBaseCuts.Add(ebcut->Clone());
+}
+/*********************************************************/
+
+AliEventBaseCut* AliEventCut::FindCut(EEventCutProperty prop)
+{
+//Finds and returns pointer to the cut with given property
+ Int_t n = fBaseCuts.GetEntries();
+ for (Int_t i = 0; i<n; i++)
+  {
+    AliEventBaseCut* bcut = (AliEventBaseCut*)fBaseCuts.At(i);
+    if (bcut->GetProperty() == prop)
+       return bcut; //we found the cut we were searching for
+  }
+
+ return 0x0; //we did not found this cut
+
+}
+/*********************************************************/
+
+void AliEventCut::SetNChargedRange(Int_t min,Int_t max,Double_t etamin,Double_t etamax)
+{
+ //Sets renge of number of charged particles
+  AliNChargedCut* cut = dynamic_cast<AliNChargedCut*>(FindCut(kNChargedCut));
+  if(cut) 
+   { 
+     cut->SetRange(min,max);
+     cut->SetEtaRange(etamin,etamax);
+   }  
+  else fBaseCuts.Add(new AliNChargedCut(min,max,etamin,etamax));
+}
 
 /*********************************************************/
 /*********************************************************/