replaced MANY by ONLY
[u/mrichter/AliRoot.git] / HBTAN / AliHBTPairCut.h
CommitLineData
1b446896 1//Piotr Skowronski@cern.ch
2//Class implemnts cut on the pair of particles
3//
4//more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
5
6#ifndef ALIHBTPAIRCUT_H
7#define ALIHBTPAIRCUT_H
8
9
10#include "AliHBTParticleCut.h"
11#include "AliHBTPair.h"
12
13class AliHbtBasePairCut;
14
15enum AliHBTPairCutProperty
16 {
17 kHbtPairCutPropQInv, //Q invariant
bce80f3b 18 kHbtPairCutPropKt,
1b446896 19 kHbtPairCutPropNone
20 };
21
22class AliHBTPairCut: public TObject
23{
24 public:
25 AliHBTPairCut();
26 AliHBTPairCut(const AliHBTPairCut&);
27
28 virtual ~AliHBTPairCut();
29 virtual Bool_t Pass(AliHBTPair*);
30
31 void SetFirstPartCut(AliHBTParticleCut*); //sets the cut on the first particle
32 void SetSecondPartCut(AliHBTParticleCut*); //sets the cut on the first particle
33
34 void SetPartCut(AliHBTParticleCut*);//sets the the same cut on both particles
35
36 void AddBasePairCut(AliHbtBasePairCut*);
37
38 void SetQInvRange(Double_t min, Double_t max);
bce80f3b 39 void SetKtRange(Double_t min, Double_t max);
1b446896 40 protected:
41 AliHBTParticleCut* fFirstPartCut;
42 AliHBTParticleCut* fSecondPartCut;
43
44 AliHbtBasePairCut** fCuts; //!
45 Int_t fNCuts;
46
47
48 AliHbtBasePairCut* FindCut(AliHBTPairCutProperty);
49 private:
50 static const Int_t fkgMaxCuts;
51 public:
52 ClassDef(AliHBTPairCut,1)
53
54};
55/******************************************************************/
56/******************************************************************/
57/******************************************************************/
58
59class AliHBTEmptyPairCut: public AliHBTPairCut
60{
61//Empty - it passes possitively all particles - it means returns always False
62//Class describing cut on pairs of particles
63 public:
64 AliHBTEmptyPairCut(){};
65 AliHBTEmptyPairCut(const AliHBTEmptyPairCut&){};
66 virtual ~AliHBTEmptyPairCut(){};
67
68 Bool_t Pass(AliHBTPair*) {return kFALSE;} //accpept everything
69
70 ClassDef(AliHBTEmptyPairCut,1)
71
72};
73
74
75
76/******************************************************************/
77/******************************************************************/
78/******************************************************************/
79
80class AliHbtBasePairCut: public TObject
81 {
82 //This class defines the range of some property - pure virtual
83 //Property is coded by AliHBTCutTypes type
84
85 public:
86
87 AliHbtBasePairCut(Double_t min = 0.0, Double_t max = 0.0, AliHBTPairCutProperty prop= kHbtPairCutPropNone):
88 fMin(min),fMax(max),fProperty(prop){}
89
90 virtual ~AliHbtBasePairCut(){}
91
92 Bool_t Pass(AliHBTPair*);
93
94 void SetRange(Double_t min, Double_t max){fMin = min; fMax = max;}
95
96 void SetMinimum(Double_t min){fMin = min;}
97 void SetMaximum(Double_t max){fMax = max;}
98
99 Double_t GetMinimum() const {return fMin;}
100 Double_t GetMaximum() const {return fMax;}
101
102 AliHBTPairCutProperty GetProperty() const {return fProperty;}
103
104 protected:
105 virtual Double_t GetValue(AliHBTPair*) = 0;
106
107 Double_t fMin;
108 Double_t fMax;
109
110 AliHBTPairCutProperty fProperty;
111
112 private:
113 public:
114 ClassDef(AliHbtBasePairCut,1)
115
116 };
117
118inline Bool_t
119AliHbtBasePairCut::Pass(AliHBTPair* pair)
120 {
121 Double_t value = GetValue(pair);
122 if ( (value > fMin) && (value <fMax ) ) return kFALSE; //accepted
123 else return kTRUE; //rejected
124 }
125/******************************************************************/
126/******************************************************************/
127/******************************************************************/
128class AliHBTQInvCut: public AliHbtBasePairCut
129 {
130 public:
131 AliHBTQInvCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBasePairCut(min,max,kHbtPairCutPropQInv){}
132 virtual ~AliHBTQInvCut(){}
133 protected:
134 virtual Double_t GetValue(AliHBTPair* pair){return pair->GetQInv();}
135 private:
136 public:
137 ClassDef(AliHBTQInvCut,1)
138 };
139
bce80f3b 140
141class AliHBTKtCut: public AliHbtBasePairCut
142 {
143 public:
144 AliHBTKtCut(Double_t min = 0.0, Double_t max = 0.0):AliHbtBasePairCut(min,max,kHbtPairCutPropKt){}
145 virtual ~AliHBTKtCut(){}
146 protected:
147 virtual Double_t GetValue(AliHBTPair* pair){return pair->GetKt();}
148 private:
149 public:
150 ClassDef(AliHBTKtCut,1)
151 };
152
1b446896 153#endif