]>
Commit | Line | Data |
---|---|---|
b68ef516 | 1 | // |
2 | // Class AliRsnCutESDPrimary | |
3 | // | |
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()] | |
7 | // | |
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. | |
14 | // | |
15 | // authors: Martin Vala (martin.vala@cern.ch) | |
16 | // Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it) | |
17 | // | |
b68ef516 | 18 | |
19 | #include "AliRsnDaughter.h" | |
20 | #include "AliRsnCutESDPrimary.h" | |
21 | ||
22 | ClassImp(AliRsnCutESDPrimary) | |
23 | ||
24 | //_________________________________________________________________________________________________ | |
25 | AliRsnCutESDPrimary::AliRsnCutESDPrimary() : | |
4fbb2459 | 26 | AliRsnCut(), |
27 | fCuts() | |
b68ef516 | 28 | { |
29 | // | |
30 | // Default constructor. | |
31 | // | |
32 | } | |
33 | ||
34 | //_________________________________________________________________________________________________ | |
35 | AliRsnCutESDPrimary::AliRsnCutESDPrimary | |
36 | (const char *name) : | |
4fbb2459 | 37 | AliRsnCut(name, 0.0, 0.0), |
38 | fCuts() | |
b68ef516 | 39 | { |
40 | // | |
41 | // Main constructor. | |
42 | // | |
43 | } | |
44 | ||
45 | //_________________________________________________________________________________________________ | |
4fbb2459 | 46 | Bool_t AliRsnCutESDPrimary::IsSelected(ETarget tgt, AliRsnDaughter * const track) |
b68ef516 | 47 | { |
48 | // | |
49 | // Cut checker. | |
50 | // | |
51 | ||
52 | // coherence check | |
4fbb2459 | 53 | if (tgt != AliRsnCut::kParticle) { |
1d8bfdee | 54 | AliError(Form("[%s] Wrong target. Skipping cut", GetName())); |
b68ef516 | 55 | return kTRUE; |
56 | } | |
57 | ||
58 | // retrieve the TPC signal | |
59 | AliVParticle *vpart = track->GetRef(); | |
60 | AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(vpart); | |
61 | if (!esdTrack) { | |
62 | AliError("ESD information unavailable"); | |
63 | return kTRUE; | |
64 | } | |
65 | ||
66 | // check cut | |
67 | return fCuts.IsSelected(esdTrack); | |
68 | } | |
69 | ||
70 | //_________________________________________________________________________________________________ | |
71 | Bool_t AliRsnCutESDPrimary::IsSelected(ETarget /*tgt*/, AliRsnPairParticle* /*pair*/) | |
72 | { | |
73 | // | |
74 | // Cut checker | |
75 | // | |
76 | ||
77 | AliWarning("Cannot apply this cut to pairs"); | |
78 | return kTRUE; | |
79 | } | |
80 | ||
81 | //_________________________________________________________________________________________________ | |
82 | Bool_t AliRsnCutESDPrimary::IsSelected(ETarget /*tgt*/, AliRsnEvent* /*event*/) | |
83 | { | |
84 | // | |
85 | // Cut checker | |
86 | // | |
87 | ||
88 | AliWarning("Cannot apply this cut to events"); | |
89 | return kTRUE; | |
90 | } | |
91 | ||
92 | //_________________________________________________________________________________________________ | |
93 | Bool_t AliRsnCutESDPrimary::IsSelected(ETarget /*tgt*/, AliRsnEvent* /*ev1*/, AliRsnEvent* /*ev2*/) | |
94 | { | |
95 | // | |
96 | // Cut checker | |
97 | // | |
98 | ||
99 | AliWarning("Cannot apply this cut to event mixing"); | |
100 | return kTRUE; | |
101 | } |