Event Cut developed; Spacial event move implemented; and few others
[u/mrichter/AliRoot.git] / ANALYSIS / AliBaseEventCut.cxx
CommitLineData
b26900d0 1#include "AliBaseEventCut.h"
2//________________________________
3///////////////////////////////////////////////////////////
4//
5// class AliBaseEventCut
6//
7//
8//
9//
10///////////////////////////////////////////////////////////
11
0d8a4589 12#include <AliAOD.h>
b26900d0 13ClassImp(AliBaseEventCut)
14
15AliBaseEventCut::AliBaseEventCut():
16 fMin(0.0),
0d8a4589 17 fMax(0.0)
b26900d0 18{
0d8a4589 19//ctor
b26900d0 20}
21/**********************************************************/
22
0d8a4589 23AliBaseEventCut::AliBaseEventCut(Double_t min, Double_t max):
24 fMin(min),
25 fMax(max)
b26900d0 26{
0d8a4589 27 //ctor
28}
29/**********************************************************/
30
31Bool_t AliBaseEventCut::Pass(AliAOD* aod) const
32{
33 if ( (GetValue(aod) < fMin) || (GetValue(aod) > fMax) ) return kTRUE;
b26900d0 34 return kFALSE;
0d8a4589 35}
36/**********************************************************/
37/**********************************************************/
38/**********************************************************/
39ClassImp(AliPrimVertexXCut)
40
41Double_t AliPrimVertexXCut::GetValue(AliAOD* aod) const
b26900d0 42{
0d8a4589 43 //returns x coordinate of the primary vertex
44 Double_t x = 0, y = 0, z = 0;
45 if (aod) aod->GetPrimaryVertex(x,y,z);
46 return x;
47}
48/**********************************************************/
49/**********************************************************/
b26900d0 50/**********************************************************/
0d8a4589 51ClassImp(AliPrimVertexYCut)
52
53Double_t AliPrimVertexYCut::GetValue(AliAOD* aod) const
54{
55 //returns x coordinate of the primary vertex
56 Double_t x = 0, y = 0, z = 0;
57 if (aod) aod->GetPrimaryVertex(x,y,z);
58 return y;
59}
60/**********************************************************/
61/**********************************************************/
62/**********************************************************/
63ClassImp(AliPrimVertexZCut)
64
65Double_t AliPrimVertexZCut::GetValue(AliAOD* aod) const
66{
67 //returns x coordinate of the primary vertex
68 Double_t x = 0, y = 0, z = 0;
69 if (aod) aod->GetPrimaryVertex(x,y,z);
70 return z;
71}
72
73/**********************************************************/
74/**********************************************************/
75/**********************************************************/
76
77ClassImp(AliNChargedCut)
78
79Double_t AliNChargedCut::GetValue(AliAOD* aod) const
80{
81 //returns number of charged particles
82 if (aod)
83 {
84 return aod->GetNumberOfCharged(fEtaMin,fEtaMax);
85 }
86 Error("GetValue","Pointer to AOD is NULL");
87 return 0.0;
88}