]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/AliEventBaseCut.cxx
Access to the ESD objects stored in a tree. Coding conventions (T.Kuhr)
[u/mrichter/AliRoot.git] / ANALYSIS / AliEventBaseCut.cxx
1 #include "AliEventBaseCut.h"
2 //________________________________
3 ///////////////////////////////////////////////////////////
4 //
5 // class AliEventBaseCut
6 //
7 //
8 //
9 //
10 ///////////////////////////////////////////////////////////
11
12 #include <AliAOD.h>
13 ClassImp(AliEventBaseCut)
14
15 AliEventBaseCut::AliEventBaseCut():
16  fMin(0.0),
17  fMax(0.0),
18  fProperty(kNone)
19 {
20 //ctor  
21 }
22 /**********************************************************/
23
24 AliEventBaseCut::AliEventBaseCut(Double_t min, Double_t max, EEventCutProperty prop):
25  fMin(min),
26  fMax(max),
27  fProperty(prop)
28 {
29  //ctor
30 }
31 /**********************************************************/
32
33 Bool_t AliEventBaseCut::Rejected(AliAOD* aod) const
34 {
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;
40   return kFALSE;
41 }
42 /**********************************************************/
43 /**********************************************************/
44 /**********************************************************/
45 ClassImp(AliPrimVertexXCut)
46
47 Double_t AliPrimVertexXCut::GetValue(AliAOD* aod) const
48 {
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 /**********************************************************/
56 /**********************************************************/
57 ClassImp(AliPrimVertexYCut)
58
59 Double_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 /**********************************************************/
69 ClassImp(AliPrimVertexZCut)
70
71 Double_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
83 ClassImp(AliNChargedCut)
84
85 Double_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 }