X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PWG2%2FRESONANCES%2FAliRsnCutManager.h;h=7bbf1de350bd6c5db037cc44ddea1e13d5dc64a8;hb=173925664b0c94ebba8b04cc47fd474472a4c2df;hp=b4829e6b49c196bd860d125bca9ed0e81d96f194;hpb=2a1c76964ec70e2a3df481d30b458763eb997722;p=u%2Fmrichter%2FAliRoot.git diff --git a/PWG2/RESONANCES/AliRsnCutManager.h b/PWG2/RESONANCES/AliRsnCutManager.h index b4829e6b49c..7bbf1de350b 100644 --- a/PWG2/RESONANCES/AliRsnCutManager.h +++ b/PWG2/RESONANCES/AliRsnCutManager.h @@ -42,6 +42,7 @@ public: AliRsnCutSet* GetDaughter2Cuts() {return &fDaughterCuts2;} AliRsnCutSet* GetMotherCuts() {return &fMotherCuts;} + Bool_t IsSelected(TObject *object); Bool_t PassCommonDaughterCuts(AliRsnDaughter *daughter) {return fDaughterCutsCommon.IsSelected(daughter);} Bool_t PassDaughter1Cuts(AliRsnDaughter *daughter) {return fDaughterCuts1.IsSelected(daughter);} Bool_t PassDaughter2Cuts(AliRsnDaughter *daughter) {return fDaughterCuts2.IsSelected(daughter);} @@ -59,4 +60,26 @@ private: ClassDef(AliRsnCutManager, 2) // dictionary }; +inline Bool_t AliRsnCutManager::IsSelected(TObject *object) +{ +// +// Check all selection cuts +// + + if (object->InheritsFrom(AliRsnDaughter::Class())) { + return PassCommonDaughterCuts((AliRsnDaughter*)object); + } else if (object->InheritsFrom(AliRsnMother::Class())) { + AliRsnMother *mother = (AliRsnMother*)object; + if (!PassCommonDaughterCuts(mother->GetDaughter(0))) return kFALSE; + if (!PassCommonDaughterCuts(mother->GetDaughter(1))) return kFALSE; + if (!PassDaughter1Cuts(mother->GetDaughter(0))) return kFALSE; + if (!PassDaughter2Cuts(mother->GetDaughter(1))) return kFALSE; + if (!PassMotherCuts(mother)) return kFALSE; + return kTRUE; + } else { + AliError("AliRsnCutManager can check only daughters and mothers"); + return kFALSE; + } +} + #endif