Version number ++
[u/mrichter/AliRoot.git] / ANALYSIS / AliEventBaseCut.cxx
CommitLineData
b4fb427e 1#include "AliEventBaseCut.h"
b26900d0 2//________________________________
3///////////////////////////////////////////////////////////
4//
b4fb427e 5// class AliEventBaseCut
b26900d0 6//
7//
8//
9//
10///////////////////////////////////////////////////////////
11
0d8a4589 12#include <AliAOD.h>
b4fb427e 13ClassImp(AliEventBaseCut)
b26900d0 14
b4fb427e 15AliEventBaseCut::AliEventBaseCut():
b26900d0 16 fMin(0.0),
a94c0b01 17 fMax(0.0),
18 fProperty(kNone)
b26900d0 19{
0d8a4589 20//ctor
b26900d0 21}
22/**********************************************************/
23
a94c0b01 24AliEventBaseCut::AliEventBaseCut(Double_t min, Double_t max, EEventCutProperty prop):
0d8a4589 25 fMin(min),
a94c0b01 26 fMax(max),
27 fProperty(prop)
b26900d0 28{
0d8a4589 29 //ctor
30}
31/**********************************************************/
32
cea0a066 33Bool_t AliEventBaseCut::Rejected(AliAOD* aod) const
0d8a4589 34{
0a4cc279 35//Checks if value is in the range,
36// returns true if it is in the range, false otherwise
37 Double_t v = GetValue(aod);
38// Info("Rejected","Value %f Min %f Max %f",v,fMin,fMax);
39 if ( ( v < fMin) || ( v > fMax) ) return kTRUE;
b26900d0 40 return kFALSE;
0d8a4589 41}
42/**********************************************************/
43/**********************************************************/
44/**********************************************************/
45ClassImp(AliPrimVertexXCut)
46
47Double_t AliPrimVertexXCut::GetValue(AliAOD* aod) const
b26900d0 48{
0d8a4589 49 //returns x coordinate of the primary vertex
50 Double_t x = 0, y = 0, z = 0;
51 if (aod) aod->GetPrimaryVertex(x,y,z);
52 return x;
53}
54/**********************************************************/
55/**********************************************************/
b26900d0 56/**********************************************************/
0d8a4589 57ClassImp(AliPrimVertexYCut)
58
59Double_t AliPrimVertexYCut::GetValue(AliAOD* aod) const
60{
61 //returns x coordinate of the primary vertex
62 Double_t x = 0, y = 0, z = 0;
63 if (aod) aod->GetPrimaryVertex(x,y,z);
64 return y;
65}
66/**********************************************************/
67/**********************************************************/
68/**********************************************************/
69ClassImp(AliPrimVertexZCut)
70
71Double_t AliPrimVertexZCut::GetValue(AliAOD* aod) const
72{
73 //returns x coordinate of the primary vertex
74 Double_t x = 0, y = 0, z = 0;
75 if (aod) aod->GetPrimaryVertex(x,y,z);
76 return z;
77}
78
79/**********************************************************/
80/**********************************************************/
81/**********************************************************/
82
83ClassImp(AliNChargedCut)
84
85Double_t AliNChargedCut::GetValue(AliAOD* aod) const
86{
87 //returns number of charged particles
88 if (aod)
89 {
90 return aod->GetNumberOfCharged(fEtaMin,fEtaMax);
91 }
92 Error("GetValue","Pointer to AOD is NULL");
93 return 0.0;
94}