2 // *** Class AliRsnCutValue ***
4 // This cut implementation can be used to cut generically on
5 // any value which can be computed from AliRsnValue class.
6 // Since that value is implemented always as a Double_t one,
7 // then this cut operates only with the Double_t data members
8 // of the AliRsnCut base class.
9 // It allows to cusomize the reference AliRsnValue object by
10 // means of a getter that returns a pointer to it.
11 // This cut can apply to any kind of object, but the type of
12 // target must be one of those for which the chosen value type
13 // makes sense to be computed
15 // author: Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
18 #include "AliRsnDaughter.h"
19 #include "AliRsnMother.h"
20 #include "AliRsnEvent.h"
21 #include "AliRsnPairDef.h"
23 #include "AliRsnCutValue.h"
25 ClassImp(AliRsnCutValue)
27 //_________________________________________________________________________________________________
28 AliRsnCutValue::AliRsnCutValue() :
33 // Default constructor.
37 //_________________________________________________________________________________________________
38 AliRsnCutValue::AliRsnCutValue
39 (const char *name, AliRsnValue::EValueType type, Double_t min, Double_t max) :
40 AliRsnCut(name, AliRsnValue::TargetType(type), min, max),
41 fValue(Form("val_%s", name), type)
45 // Sets the AliRsnValue data member accordingly to arguments passed here.
46 // NOTE: if the value needs a support object, it must be passed separately
47 // using the GetValueObje() of this class
51 //_________________________________________________________________________________________________
52 AliRsnCutValue::AliRsnCutValue(const AliRsnCutValue& copy) :
58 // Does not duplicate memory allocation.
62 //_________________________________________________________________________________________________
63 AliRsnCutValue& AliRsnCutValue::operator=(const AliRsnCutValue& copy)
66 // Assignment operator.
67 // Does not duplicate memory allocation.
70 AliRsnCut::operator=(copy);
76 //_________________________________________________________________________________________________
77 Bool_t AliRsnCutValue::IsSelected(TObject *object)
81 // Calls the AliRsnValue::Eval() method and then checks its output.
84 // try to compute values
85 Bool_t success = fValue.Eval(object);
89 AliWarning(Form("[%s] Failed to compute value", GetName()));
94 fCutValueD = fValue.GetComputedValue();
98 //_________________________________________________________________________________________________
99 void AliRsnCutValue::Print(const Option_t *) const
102 // Print information on this cut
105 AliInfo(Form("Cut name : %s", GetName()));
106 AliInfo(Form("Cut value : %s", fValue.GetValueTypeName()));
107 AliInfo(Form("Cut range : %f - %f", fMinD, fMaxD));