2 // Class AliRsnCutValue
4 // General implementation of a single cut strategy, which can be:
5 // - a value contained in a given interval [--> IsBetween() ]
6 // - a value equal to a given reference [--> MatchesValue()]
8 // In all cases, the reference value(s) is (are) given as data members
9 // and each kind of cut requires a given value type (Int, UInt, Double),
10 // but the cut check procedure is then automatized and chosen thanks to
11 // an enumeration of the implemented cut types.
12 // At the end, the user (or any other point which uses this object) has
13 // to use the method IsSelected() to check if this cut has been passed.
15 // authors: Martin Vala (martin.vala@cern.ch)
16 // Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
20 #include <TLorentzVector.h>
23 #include "AliMCEvent.h"
24 #include "AliRsnDaughter.h"
25 #include "AliRsnMother.h"
26 #include "AliRsnEvent.h"
27 #include "AliRsnValue.h"
29 #include "AliRsnCutValue.h"
31 ClassImp(AliRsnCutValue)
33 //_________________________________________________________________________________________________
34 AliRsnCutValue::AliRsnCutValue() :
40 // Default constructor.
44 //_________________________________________________________________________________________________
45 AliRsnCutValue::AliRsnCutValue
46 (const char *name, ETarget target, Double_t min, Double_t max, AliRsnPairDef *pd) :
47 AliRsnCut(name, target, min, max),
48 fValue(Form("val_%s", name), AliRsnValue::kValueTypes),
56 //_________________________________________________________________________________________________
57 AliRsnCutValue::AliRsnCutValue(const AliRsnCutValue& copy) :
60 fPairDef(copy.fPairDef)
67 //_________________________________________________________________________________________________
68 AliRsnCutValue& AliRsnCutValue::operator=(const AliRsnCutValue& copy)
71 // Assignment operator
76 fPairDef = copy.fPairDef;
81 //_________________________________________________________________________________________________
82 Bool_t AliRsnCutValue::IsSelected(TObject *obj1, TObject * /*obj2*/)
86 // Calls the appropriate AliRsnValue::Eval() method
87 // depending on the type of passed object.
88 // It is up to the user to be sure that the association is meaningful
91 AliRsnDaughter *daughter = dynamic_cast<AliRsnDaughter*>(obj1);
92 AliRsnMother *mother = dynamic_cast<AliRsnMother*>(obj1);
96 if (!fValue.Eval(daughter, fEvent)) return kFALSE;
97 fCutValueD = fValue.GetValue();
101 if (!fValue.Eval(mother, fPairDef, fEvent)) return kFALSE;
102 fCutValueD = fValue.GetValue();