]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliEventCut.cxx
renamed CorrectionMatrix class
[u/mrichter/AliRoot.git] / ANALYSIS / AliEventCut.cxx
index 9124460c5a245db4fd129a7b23dac8e025496bcb..447787c06b2ed28dc4c0ebf519a5cefc71efc62e 100644 (file)
@@ -1,22 +1,20 @@
 #include "AliEventCut.h"
-//________________________________
+
 ///////////////////////////////////////////////////////////
 //
-// class AliRunAnalysis
-//
-//
-//
+// class AliEventCut
 //
+// Event cut. It has list of base event cuts. 
+// Each of base event cut checks only one property.
+// Logical base cuts also exists that point to other base cuts.
+// Using them one can build complicated cut with binary tree structure
+// Author: Piotr.Skowronski@cern.ch
 ///////////////////////////////////////////////////////////
 
-#include <TObjArray.h>
-//#include <TIter.h>
-
 #include "AliEventBaseCut.h"
 
 ClassImp(AliEventCut)
 
-
 AliEventCut::AliEventCut():
  fBaseCuts(10)
 {
@@ -40,7 +38,7 @@ AliEventCut::~AliEventCut()
 
 /*********************************************************/
 
-Bool_t AliEventCut::Pass(AliAOD* aod) const
+Bool_t AliEventCut::Rejected(AliAOD* aod) const
 {
   //returns kTRUE if rejected
   if (aod == 0x0)
@@ -53,7 +51,7 @@ Bool_t AliEventCut::Pass(AliAOD* aod) const
   AliEventBaseCut* becut;
   while (( becut = (AliEventBaseCut*)iter() ))
    {
-     if (becut->Pass(aod)) return kTRUE;
+     if (becut->Rejected(aod)) return kTRUE;
    }
   return kFALSE;
 }
@@ -67,7 +65,7 @@ void AliEventCut::AddBasePartCut(AliEventBaseCut* ebcut)
     return;
   }
  
- if (ebcut->GetProperty() != kNone)
+ if (ebcut->GetProperty() != AliEventBaseCut::kNone)
   {
     if (FindCut(ebcut->GetProperty()))
      {
@@ -80,7 +78,7 @@ void AliEventCut::AddBasePartCut(AliEventBaseCut* ebcut)
 }
 /*********************************************************/
 
-AliEventBaseCut* AliEventCut::FindCut(EEventCutProperty prop)
+AliEventBaseCut* AliEventCut::FindCut(AliEventBaseCut::EEventCutProperty prop)
 {
 //Finds and returns pointer to the cut with given property
  Int_t n = fBaseCuts.GetEntries();
@@ -99,7 +97,7 @@ AliEventBaseCut* AliEventCut::FindCut(EEventCutProperty prop)
 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));
+  AliNChargedCut* cut = dynamic_cast<AliNChargedCut*>(FindCut(AliEventBaseCut::kNChargedCut));
   if(cut) 
    { 
      cut->SetRange(min,max);
@@ -107,7 +105,33 @@ void AliEventCut::SetNChargedRange(Int_t min,Int_t max,Double_t etamin,Double_t
    }  
   else fBaseCuts.Add(new AliNChargedCut(min,max,etamin,etamax));
 }
+/*********************************************************/
 
+void AliEventCut::SetVertexXRange(Double_t min, Double_t max)
+{
+  //Sets range of z coordinate of a primary vertex
+  AliEventBaseCut* cut = FindCut(AliEventBaseCut::kPrimVertexXCut);
+  if (cut) cut->SetRange(min,max);
+  else fBaseCuts.Add(new AliPrimVertexXCut(min,max));
+}
+/*********************************************************/
+
+void AliEventCut::SetVertexYRange(Double_t min, Double_t max)
+{
+  //Sets range of z coordinate of a primary vertex
+  AliEventBaseCut* cut = FindCut(AliEventBaseCut::kPrimVertexYCut);
+  if (cut) cut->SetRange(min,max);
+  else fBaseCuts.Add(new AliPrimVertexYCut(min,max));
+}
+/*********************************************************/
+
+void AliEventCut::SetVertexZRange(Double_t min, Double_t max)
+{
+  //Sets range of z coordinate of a primary vertex
+  AliEventBaseCut* cut = FindCut(AliEventBaseCut::kPrimVertexZCut);
+  if (cut) cut->SetRange(min,max);
+  else fBaseCuts.Add(new AliPrimVertexZCut(min,max));
+}
 /*********************************************************/
 /*********************************************************/
 /*********************************************************/