]>
Commit | Line | Data |
---|---|---|
69fbb331 | 1 | // |
32992791 | 2 | // *** Class AliRsnCutValue *** |
69fbb331 | 3 | // |
2a1c7696 | 4 | // This cut implementation can be used to cut generically on |
32992791 | 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 | |
69fbb331 | 14 | // |
32992791 | 15 | // author: Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it) |
69fbb331 | 16 | // |
69fbb331 | 17 | |
69fbb331 | 18 | #include "AliRsnDaughter.h" |
19 | #include "AliRsnMother.h" | |
20 | #include "AliRsnEvent.h" | |
32992791 | 21 | #include "AliRsnPairDef.h" |
69fbb331 | 22 | |
23 | #include "AliRsnCutValue.h" | |
24 | ||
25 | ClassImp(AliRsnCutValue) | |
26 | ||
27 | //_________________________________________________________________________________________________ | |
28 | AliRsnCutValue::AliRsnCutValue() : | |
2a1c7696 | 29 | AliRsnCut(), |
07d7c31d | 30 | fValue() |
69fbb331 | 31 | { |
32 | // | |
33 | // Default constructor. | |
34 | // | |
35 | } | |
36 | ||
37 | //_________________________________________________________________________________________________ | |
38 | AliRsnCutValue::AliRsnCutValue | |
07d7c31d | 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) | |
69fbb331 | 42 | { |
43 | // | |
44 | // Main constructor. | |
07d7c31d | 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 | |
69fbb331 | 48 | // |
49 | } | |
50 | ||
51 | //_________________________________________________________________________________________________ | |
52 | AliRsnCutValue::AliRsnCutValue(const AliRsnCutValue& copy) : | |
2a1c7696 | 53 | AliRsnCut(copy), |
07d7c31d | 54 | fValue(copy.fValue) |
69fbb331 | 55 | { |
56 | // | |
32992791 | 57 | // Copy constructor. |
58 | // Does not duplicate memory allocation. | |
69fbb331 | 59 | // |
60 | } | |
61 | ||
62 | //_________________________________________________________________________________________________ | |
63 | AliRsnCutValue& AliRsnCutValue::operator=(const AliRsnCutValue& copy) | |
64 | { | |
65 | // | |
32992791 | 66 | // Assignment operator. |
67 | // Does not duplicate memory allocation. | |
69fbb331 | 68 | // |
69 | ||
2a1c7696 | 70 | AliRsnCut::operator=(copy); |
07d7c31d | 71 | fValue = copy.fValue; |
2a1c7696 | 72 | |
73 | return (*this); | |
69fbb331 | 74 | } |
75 | ||
76 | //_________________________________________________________________________________________________ | |
32992791 | 77 | Bool_t AliRsnCutValue::IsSelected(TObject *object) |
69fbb331 | 78 | { |
79 | // | |
80 | // Checks the cut. | |
32992791 | 81 | // Calls the AliRsnValue::Eval() method and then checks its output. |
69fbb331 | 82 | // |
83 | ||
2a1c7696 | 84 | // try to compute values |
85 | Bool_t success = fValue.Eval(object); | |
86 | ||
87 | // check success | |
88 | if (!success) { | |
89 | AliWarning(Form("[%s] Failed to compute value", GetName())); | |
90 | return kFALSE; | |
91 | } | |
92 | ||
93 | // check in range | |
94 | fCutValueD = fValue.GetComputedValue(); | |
95 | return OkRangeD(); | |
69fbb331 | 96 | } |
aa24e021 | 97 | |
98 | //_________________________________________________________________________________________________ | |
99 | void AliRsnCutValue::Print(const Option_t *) const | |
100 | { | |
101 | // | |
102 | // Print information on this cut | |
103 | // | |
104 | ||
2a1c7696 | 105 | AliInfo(Form("Cut name : %s", GetName())); |
106 | AliInfo(Form("Cut value : %s", fValue.GetValueTypeName())); | |
107 | AliInfo(Form("Cut range : %f - %f", fMinD, fMaxD)); | |
aa24e021 | 108 | } |