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 "AliRsnValue.h"
19 #include "AliRsnDaughter.h"
20 #include "AliRsnMother.h"
21 #include "AliRsnEvent.h"
22 #include "AliRsnPairDef.h"
24 #include "AliRsnCutValue.h"
26 ClassImp(AliRsnCutValue)
28 //_________________________________________________________________________________________________
29 AliRsnCutValue::AliRsnCutValue() :
34 // Default constructor.
38 //_________________________________________________________________________________________________
39 AliRsnCutValue::AliRsnCutValue
40 (const char *name, Double_t min, Double_t max) :
41 AliRsnCut(name, AliRsnTarget::kTargetTypes, min, max),
46 // Sets the AliRsnValue data member accordingly to arguments passed here.
47 // NOTE: if the value needs a support object, it must be passed separately
48 // using the GetValueObje() of this class
52 //_________________________________________________________________________________________________
53 AliRsnCutValue::AliRsnCutValue(const AliRsnCutValue ©) :
59 // Does not duplicate memory allocation.
63 //_________________________________________________________________________________________________
64 AliRsnCutValue &AliRsnCutValue::operator=(const AliRsnCutValue ©)
67 // Assignment operator.
68 // Does not duplicate memory allocation.
71 AliRsnCut::operator=(copy);
80 //_________________________________________________________________________________________________
81 Bool_t AliRsnCutValue::IsSelected(TObject *object)
85 // Calls the AliRsnValue::Eval() method and then checks its output.
88 // skip cut if value is not initialized
89 if (!fValue) return kTRUE;
92 SetTargetType(fValue->GetTargetType());
94 // try to compute values
95 Bool_t success = fValue->Eval(object);
99 AliWarning(Form("[%s] Failed to compute value", GetName()));
104 fCutValueD = fValue->GetComputedValue();
108 //_________________________________________________________________________________________________
109 void AliRsnCutValue::Print(const Option_t *) const
112 // Print information on this cut
115 AliInfo(Form("Cut name : %s", GetName()));
116 AliInfo(Form("Cut value : %s", fValue->GetName()));
117 AliInfo(Form("Cut range : %f - %f", fMinD, fMaxD));