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 "AliRsnDaughter.h"
15 #include "AliRsnEvent.h"
16 #include "AliRsnCutSet.h"
17 #include "AliRsnCutMgr.h"
19 ClassImp (AliRsnCutMgr)
21 //_____________________________________________________________________________
22 AliRsnCutMgr::AliRsnCutMgr() :
23 TNamed("defaultName", "defaultTitle")
26 // Constructor without arguments.
30 for (i = 0; i < AliRsnCut::kLastCutTarget; i++) {
35 //_____________________________________________________________________________
36 AliRsnCutMgr::AliRsnCutMgr (const char *name, const char *title) :
40 // Constructor with name and title.
44 for (i = 0; i < AliRsnCut::kLastCutTarget; i++) {
49 //_____________________________________________________________________________
50 AliRsnCutMgr::~AliRsnCutMgr()
54 // Deletes all cut definitions.
58 for (i = 0; i < AliRsnCut::kLastCutTarget; i++) {
63 //_____________________________________________________________________________
64 void AliRsnCutMgr::SetCutSet (AliRsnCut::ETarget type, AliRsnCutSet* cutset)
67 // Assign a cut set to a given target
70 if (!fCutSets[type]) fCutSets[type] = (AliRsnCutSet*) cutset->Clone();
71 AliDebug (AliLog::kDebug, Form ("DatasetName %s", fCutSets[type]->GetName()));
74 //_____________________________________________________________________________
75 Bool_t AliRsnCutMgr::IsSelected ( AliRsnCut::ETarget type,TObject *obj )
78 // Check if a given object passes the cuts defined for it.
79 // The target of the check is here a TObject, in order to allo generality
80 // but then the kind of cut to be used is defined as first argument, and
81 // in the single cut it will be checked if it is appropriate for passed target
84 AliDebug (AliLog::kDebug, "<-");
85 if (!fCutSets[type]) return kTRUE;
88 case AliRsnCut::kParticle:
89 return fCutSets[type]->IsSelected (type, (AliRsnDaughter*)obj);
91 case AliRsnCut::kPair:
92 return fCutSets[type]->IsSelected (type, (AliRsnPairParticle*)obj);
94 case AliRsnCut::kEvent:
95 return fCutSets[type]->IsSelected (type, (AliRsnEvent*)obj);
98 AliWarning ("Wrong target selected.");