4 // The cut manager: contains a complete set of cut definitions
5 // to be applied to all possible targets (one for each target),
6 // in order to ease the set-up procedure of cuts and allow to
7 // pass them at once to each object which must use them
9 // author: Martin Vala (martin.vala@cern.ch)
14 #include "AliRsnCutSet.h"
15 #include "AliRsnCutMgr.h"
17 ClassImp(AliRsnCutMgr)
19 //_____________________________________________________________________________
20 AliRsnCutMgr::AliRsnCutMgr() :
21 TNamed("defaultName", "defaultTitle")
24 // Constructor without arguments.
28 for (i = 0; i < AliRsnCut::kLastCutTarget; i++) {
33 //_____________________________________________________________________________
34 AliRsnCutMgr::AliRsnCutMgr(const char *name, const char *title) :
38 // Constructor with name and title.
42 for (i = 0; i < AliRsnCut::kLastCutTarget; i++) {
47 //_____________________________________________________________________________
48 AliRsnCutMgr::~AliRsnCutMgr()
52 // Deletes all cut definitions.
56 for (i = 0; i < AliRsnCut::kLastCutTarget; i++) {
61 //_____________________________________________________________________________
62 void AliRsnCutMgr::SetCutSet(AliRsnCut::ETarget type, AliRsnCutSet* const cutset)
65 // Assign a cut set to a given target
68 if (!fCutSets[type]) fCutSets[type] = (AliRsnCutSet*) cutset->Clone();
69 AliDebug(AliLog::kDebug, Form("DatasetName %s", fCutSets[type]->GetName()));
72 //_____________________________________________________________________________
73 Bool_t AliRsnCutMgr::IsSelected(AliRsnCut::ETarget type, TObject*const obj)
76 // Check if a given object passes the cuts defined for it.
77 // The target of the check is here a TObject, in order to allo generality
78 // but then the kind of cut to be used is defined as first argument, and
79 // in the single cut it will be checked if it is appropriate for passed target
82 AliDebug(AliLog::kDebug, "<-");
83 if (!fCutSets[type]) return kTRUE;
86 case AliRsnCut::kParticle:
87 return fCutSets[type]->IsSelected(type, (AliRsnDaughter*)obj);
89 case AliRsnCut::kPair:
90 return fCutSets[type]->IsSelected(type, (AliRsnPairParticle*)obj);
92 case AliRsnCut::kEvent:
93 return fCutSets[type]->IsSelected(type, (AliRsnEvent*)obj);
96 AliWarning("Wrong target selected.");
104 //_____________________________________________________________________________
105 void AliRsnCutMgr::SetEvent(AliRsnEvent *event)
108 // Sets reference event in all cut sets
112 for (i = 0; i < AliRsnCut::kLastCutTarget; i++)
114 if (fCutSets[i]) fCutSets[i]->SetEvent(event);