]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnCutESDPrimary.cxx
removed obsolete commented methods
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCutESDPrimary.cxx
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 //
18 #include "TMath.h"
19
20 #include "AliLog.h"
21 #include "AliESDtrack.h"
22 #include "AliESDtrackCuts.h"
23
24 #include "AliRsnDaughter.h"
25 #include "AliRsnCutESDPrimary.h"
26
27 ClassImp(AliRsnCutESDPrimary)
28
29 //_________________________________________________________________________________________________
30 AliRsnCutESDPrimary::AliRsnCutESDPrimary() :
31   AliRsnCut(),
32   fCuts()
33 {
34 //
35 // Default constructor.
36 //
37 }
38
39 //_________________________________________________________________________________________________
40 AliRsnCutESDPrimary::AliRsnCutESDPrimary
41 (const char *name) :
42   AliRsnCut(name, 0.0, 0.0),
43   fCuts()
44 {
45 //
46 // Main constructor.
47 //
48 }
49
50 //_________________________________________________________________________________________________
51 Bool_t AliRsnCutESDPrimary::IsSelected(ETarget tgt, AliRsnDaughter *track)
52 {
53 //
54 // Cut checker.
55 //
56
57   // coherence check
58   if (tgt != AliRsnCut::kParticle)
59   {
60     AliError(Form("Wrong target. Skipping cut", GetName()));
61     return kTRUE;
62   }
63
64   // retrieve the TPC signal
65   AliVParticle *vpart = track->GetRef();
66   AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(vpart);
67   if (!esdTrack) {
68     AliError("ESD information unavailable");
69     return kTRUE;
70   }
71
72   // check cut
73   return fCuts.IsSelected(esdTrack);
74 }
75
76 //_________________________________________________________________________________________________
77 Bool_t AliRsnCutESDPrimary::IsSelected(ETarget /*tgt*/, AliRsnPairParticle* /*pair*/)
78 {
79 //
80 // Cut checker
81 //
82
83   AliWarning("Cannot apply this cut to pairs");
84   return kTRUE;
85 }
86
87 //_________________________________________________________________________________________________
88 Bool_t AliRsnCutESDPrimary::IsSelected(ETarget /*tgt*/, AliRsnEvent* /*event*/)
89 {
90 //
91 // Cut checker
92 //
93
94   AliWarning("Cannot apply this cut to events");
95   return kTRUE;
96 }
97
98 //_________________________________________________________________________________________________
99 Bool_t AliRsnCutESDPrimary::IsSelected(ETarget /*tgt*/, AliRsnEvent* /*ev1*/, AliRsnEvent* /*ev2*/)
100 {
101 //
102 // Cut checker
103 //
104
105   AliWarning("Cannot apply this cut to event mixing");
106   return kTRUE;
107 }