X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=ANALYSIS%2FAliEventCut.cxx;h=d1ff673576842ca57614fe5e5ef00085104ce046;hp=ec20b6adc10d7274d3a74771406c65b97d0a66b5;hb=2d54468654f9c68fac584dbced0e587e800dc6b5;hpb=b4fb427e863170dc3e58a4328aba165b9fe19745 diff --git a/ANALYSIS/AliEventCut.cxx b/ANALYSIS/AliEventCut.cxx index ec20b6adc10..d1ff6735768 100644 --- a/ANALYSIS/AliEventCut.cxx +++ b/ANALYSIS/AliEventCut.cxx @@ -40,7 +40,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,11 +53,87 @@ 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; } +/*********************************************************/ +void AliEventCut::AddBasePartCut(AliEventBaseCut* ebcut) +{ +//Adds a base cut + if (ebcut == 0x0) + { + Error("AddBasePartCut","Pointer to base cut is NULL"); + return; + } + + if (ebcut->GetProperty() != AliEventBaseCut::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(AliEventBaseCut::EEventCutProperty prop) +{ +//Finds and returns pointer to the cut with given property + Int_t n = fBaseCuts.GetEntries(); + for (Int_t i = 0; iGetProperty() == 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(FindCut(AliEventBaseCut::kNChargedCut)); + if(cut) + { + cut->SetRange(min,max); + cut->SetEtaRange(etamin,etamax); + } + else fBaseCuts.Add(new AliNChargedCut(min,max,etamin,etamax)); +} +/*********************************************************/ + +void AliEventCut::SetVertexXRange(Int_t min,Int_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(Int_t min,Int_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(Int_t min,Int_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)); +} /*********************************************************/ /*********************************************************/ /*********************************************************/