]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnCut.h
Code:
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCut.h
CommitLineData
e2bafbbc 1//
06351446 2// Class AliRsnCut
3//
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 [--> IsEqual() ]
7// In all cases, the reference value(s) is (are) given as data members
8// and each kind of cut requires a given value type (Int, UInt, Double),
9// but the cut check procedure is then automatized and chosen thanks to
10// an enumeration of the implemented cut types.
11// At the end, the user (or any other point which uses this object) has
12// to use the method IsSelected() to check if this cut has been passed.
13//
14// authors: Martin Vala (martin.vala@cern.ch)
15// Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
e2bafbbc 16//
06351446 17
18#ifndef ALIRSNCUT_H
19#define ALIRSNCUT_H
20
21#include "TNamed.h"
22
23class AliRsnDaughter;
24class AliRsnPairParticle;
25class AliRsnPairDef;
e2bafbbc 26class AliRsnEvent;
06351446 27
28class AliRsnCut : public TNamed
29{
aec0ec32 30 public:
31
32 // available cut types
33 // some ones work both for pairs and single tracks
34 enum EType {
35 kMomentum = 0,
36 kTransMomentum,
37 kEta,
38 kRadialImpactParam,
39 kMomentumMC,
40 kTransMomentumMC,
41 kEtaMC,
42 kNSigma,
43 kNSigmaCalculate,
44 kStatus,
45 kIsLabelEqual,
46 kIsTruePair,
922688c0 47 kIsPrimary,
aec0ec32 48 kChargePos,
49 kChargeNeg,
50 kPIDType,
51 kPIDProb,
52 kMultiplicity,
e0baff8c 53 kMultiplicityDifference,
78b94cbd 54 kMultiplicityRatio,
e0baff8c 55 kPhiMeanDifference,
56 kVzDifference,
aec0ec32 57 kLastCutType
58 };
59
60 // types of cut variables
61 enum EVarType {
62 kDouble_t = 0,
63 kInt_t,
64 kUInt_t
65 };
66
67 // possible targets for a cut
68 enum ETarget {
69 kParticle = 0,
70 kPair,
71 kEvent,
e0baff8c 72 kMixEvent,
aec0ec32 73 kLastCutTarget
74 };
75
76 AliRsnCut();
77 AliRsnCut(const char *name, const char *title, EType type);
78 AliRsnCut(const char *name, const char *title, EType type, Double_t min, Double_t max = 1e-100);
79 AliRsnCut(const char *name, const char *title, EType type, Int_t min, Int_t max = 32767);
80 AliRsnCut(const char *name, const char *title, EType type, UInt_t min, UInt_t max = 65534);
81 AliRsnCut(const char *name, const char *title, EType type, ULong_t min, ULong_t max = 65534);
82
83 ~AliRsnCut();
84
85 void SetCutValues(EType type, const Double_t& theValue, const Double_t& theValue2);
86 void SetCutValues(EType type, const Int_t& theValue, const Int_t& theValue2);
87 void SetCutValues(EType type, const UInt_t& theValue, const UInt_t& theValue2);
88 void SetCutValues(EType type, const ULong_t& theValue, const ULong_t& theValue2);
89
90 Bool_t IsSelected(ETarget tgt, AliRsnDaughter *daughter);
91 Bool_t IsSelected(ETarget tgt, AliRsnPairParticle *pair);
92 Bool_t IsSelected(ETarget tgt, AliRsnEvent *event);
e0baff8c 93 Bool_t IsSelected(ETarget tgt, AliRsnEvent *ev1, AliRsnEvent *ev2);
aec0ec32 94
95 void PrintAllValues();
96
97 Bool_t IsBetween(const Double_t &theValue);
98 Bool_t IsBetween(const Int_t &theValue);
99 Bool_t MatchesValue(const Int_t &theValue);
100 Bool_t MatchesValue(const UInt_t &theValue);
101 Bool_t MatchesValue(const ULong_t &theValue);
102 Bool_t MatchesValue(const Double_t &theValue);
103
104 private:
105
106 Double_t fDMin; // min. double value
107 Double_t fDMax; // max. double value
108 Int_t fIMin; // min. int value
109 Int_t fIMax; // max. int value
110 UInt_t fUIMin; // min. uint value
111 UInt_t fUIMax; // max. uint value
112 ULong_t fULMin; // min. ulong value
113 ULong_t fULMax; // max. ulong value
114
115 EType fType; // cut type
116 EVarType fVarType; // variable type
117
118 static const Double_t fgkDSmallNumber; // small double value
119 static const Double_t fgkDBigNumber; // big double value
120 static const Int_t fgkIBigNumber; // big int value
121
122 ClassDef(AliRsnCut, 1)
06351446 123};
124
125#endif