2 // Class AliRsnCutPrimaryVertex
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()]
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.
15 // authors: Martin Vala (martin.vala@cern.ch)
16 // Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
19 // #include "AliLog.h"
20 // #include "AliESDEvent.h"
21 // #include "AliESDVertex.h"
23 // #include "AliRsnEvent.h"
24 // #include "AliRsnCutPrimaryVertex.h"
26 // #include "Riostream.h"
29 // #include "AliLog.h"
30 // #include "AliESDEvent.h"
31 // #include "AliESDVertex.h"
33 // #include "AliRsnEvent.h"
34 #include "AliRsnCutPrimaryVertex.h"
36 ClassImp(AliRsnCutPrimaryVertex)
38 //_________________________________________________________________________________________________
39 AliRsnCutPrimaryVertex::AliRsnCutPrimaryVertex() :
43 // Default constructor.
47 //_________________________________________________________________________________________________
48 AliRsnCutPrimaryVertex::AliRsnCutPrimaryVertex
49 (const char *name, Int_t nContributors) :
50 AliRsnCut(name, 0, nContributors)
54 // the cut range is outside the interval 0 - min number of contributors.
58 //_________________________________________________________________________________________________
59 Bool_t AliRsnCutPrimaryVertex::IsSelected(AliRsnCut::ETarget /*tgt*/, AliRsnDaughter*/*const track*/) const
64 AliWarning("Cannot apply this cut to particles");
68 //_________________________________________________________________________________________________
69 Bool_t AliRsnCutPrimaryVertex::IsSelected(AliRsnCut::ETarget, AliRsnPairParticle*/*const pair*/) const
75 AliWarning("Cannot apply this cut to pairs");
79 //_________________________________________________________________________________________________
80 Bool_t AliRsnCutPrimaryVertex::IsSelected(AliRsnCut::ETarget, AliRsnEvent*event)
87 AliESDEvent *esd = dynamic_cast<AliESDEvent*>(event->GetRef());
89 AliDebug(AliLog::kDebug+2, "NO ESD");
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");
105 fCutValueI = v->GetNContributors();
110 //_________________________________________________________________________________________________
111 Bool_t AliRsnCutPrimaryVertex::IsSelected(AliRsnCut::ETarget, AliRsnEvent*/*ev1*/, AliRsnEvent*/*ev2*/) const
117 AliWarning("Cannot apply this cut to event mixing");