change Ds selection
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCutPrimaryVertex.cxx
CommitLineData
96ab9736 1//
2// Class AliRsnCutPrimaryVertex
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//
96ab9736 18
4fbb2459 19// #include "AliLog.h"
20// #include "AliESDEvent.h"
21// #include "AliESDVertex.h"
22//
23// #include "AliRsnEvent.h"
24// #include "AliRsnCutPrimaryVertex.h"
25
26// #include "Riostream.h"
27// #include "TMath.h"
28//
29// #include "AliLog.h"
30// #include "AliESDEvent.h"
31// #include "AliESDVertex.h"
32//
33// #include "AliRsnEvent.h"
96ab9736 34#include "AliRsnCutPrimaryVertex.h"
35
36ClassImp(AliRsnCutPrimaryVertex)
37
38//_________________________________________________________________________________________________
39AliRsnCutPrimaryVertex::AliRsnCutPrimaryVertex() :
4fbb2459 40 AliRsnCut()
96ab9736 41{
42//
43// Default constructor.
44//
45}
46
47//_________________________________________________________________________________________________
48AliRsnCutPrimaryVertex::AliRsnCutPrimaryVertex
49(const char *name, Int_t nContributors) :
4fbb2459 50 AliRsnCut(name, 0, nContributors)
96ab9736 51{
52//
53// Main constructor.
54// the cut range is outside the interval 0 - min number of contributors.
55//
56}
57
58//_________________________________________________________________________________________________
9c67a289 59Bool_t AliRsnCutPrimaryVertex::IsSelected(AliRsnCut::ETarget /*tgt*/, AliRsnDaughter*/*const track*/)
96ab9736 60{
61//
62// Cut checker.
63//
96ab9736 64 AliWarning("Cannot apply this cut to particles");
65 return kTRUE;
66}
67
68//_________________________________________________________________________________________________
9c67a289 69Bool_t AliRsnCutPrimaryVertex::IsSelected(AliRsnCut::ETarget, AliRsnPairParticle*/*const pair*/)
96ab9736 70{
71//
72// Cut checker
73//
74
75 AliWarning("Cannot apply this cut to pairs");
76 return kTRUE;
77}
78
79//_________________________________________________________________________________________________
4fbb2459 80Bool_t AliRsnCutPrimaryVertex::IsSelected(AliRsnCut::ETarget, AliRsnEvent*event)
96ab9736 81{
82//
83// Cut checker
84//
85
86 // retrieve ESD event
87 AliESDEvent *esd = dynamic_cast<AliESDEvent*>(event->GetRef());
88 if (!esd) {
89 AliDebug(AliLog::kDebug+2, "NO ESD");
90 return kTRUE;
91 }
92
93 // check primary vertex and eventually fill step 1
94 // if a vertex with tracks was successfully reconstructed,
95 // it is used for computing DCA;
96 // otherwise, the one computed with SPD is used.
97 // This is known from the "Status" parameter of the vertex itself.
98 const AliESDVertex *v = esd->GetPrimaryVertex();
99 if (!v->GetStatus()) v = esd->GetPrimaryVertexSPD();
100 if (!v->GetStatus()) {
101 AliDebug(AliLog::kDebug+2, "Bad vertex status");
102 return kFALSE;
103 }
104
105 fCutValueI = v->GetNContributors();
106
107 return !OkRange();
108}
109
110//_________________________________________________________________________________________________
9c67a289 111Bool_t AliRsnCutPrimaryVertex::IsSelected(AliRsnCut::ETarget, AliRsnEvent*/*ev1*/, AliRsnEvent*/*ev2*/)
96ab9736 112{
113//
114// Cut checker
115//
116
117 AliWarning("Cannot apply this cut to event mixing");
118 return kTRUE;
119}