]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnCut.h
Renamed classes: these with old name are removed and newly named will be added in...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCut.h
1 //
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)
16 //
17
18 #ifndef ALIRSNCUT_H
19 #define ALIRSNCUT_H
20
21 #include "TNamed.h"
22
23 class AliRsnDaughter;
24 class AliRsnPairParticle;
25 class AliRsnPairDef;
26 class AliRsnEvent;
27
28 class AliRsnCut : public TNamed
29 {
30 public:
31
32     // available cut types
33     // some ones work both for pairs and single tracks
34     enum EType
35     {
36         kMomentum = 0,
37         kTransMomentum,
38         kEta,
39         kRadialImpactParam,
40         kMomentumMC,
41         kTransMomentumMC,
42         kEtaMC,
43         kNSigma,
44         kNSigmaCalculate,
45         kStatus,
46         kIsLabelEqual,
47         kIsTruePair,
48         kChargePos,
49         kChargeNeg,
50         kPIDType,
51         kPIDProb,
52         kMultiplicity,
53         kLastCutType
54     };
55
56     // types of cut variables
57     enum EVarType
58     {
59         kDouble_t = 0,
60         kInt_t,
61         kUInt_t
62     };
63
64     // possible targets for a cut
65     enum ETarget
66     {
67         kParticle = 0,
68         kPair,
69         kEvent,
70         kMixEventFinderCut,
71         kLastCutTarget
72     };
73
74     AliRsnCut();
75     AliRsnCut (const char *name, const char *title, EType type);
76     AliRsnCut (const char *name, const char *title, EType type, Double_t min, Double_t max = 1e-100);
77     AliRsnCut (const char *name, const char *title, EType type, Int_t min, Int_t max = 32767);
78     AliRsnCut (const char *name, const char *title, EType type, UInt_t min, UInt_t max = 65534);
79
80     ~AliRsnCut();
81
82     void      SetCutValues (EType type, const Double_t& theValue, const Double_t& theValue2);
83     void      SetCutValues (EType type, const Int_t& theValue, const Int_t& theValue2);
84     void      SetCutValues (EType type, const UInt_t& theValue, const UInt_t& theValue2);
85
86     Bool_t    IsSelected (ETarget tgt,  AliRsnDaughter *daughter);
87     Bool_t    IsSelected (ETarget tgt,  AliRsnPairParticle *pair);
88     Bool_t    IsSelected (ETarget tgt,  AliRsnEvent *event);
89
90     void      PrintAllValues();
91
92     Bool_t    IsBetween (const Double_t &theValue);
93     Bool_t    IsBetween (const Int_t &theValue);
94     Bool_t    MatchesValue (const Int_t &theValue);
95     Bool_t    MatchesValue (const UInt_t &theValue);
96     Bool_t    MatchesValue (const Double_t &theValue);
97
98 private:
99
100     Double_t        fDMin;          // min. double value
101     Double_t        fDMax;          // max. double value
102     Int_t           fIMin;          // min. int value
103     Int_t           fIMax;          // max. int value
104     UInt_t          fUIMin;         // min. uint value
105     UInt_t          fUIMax;         // max. uint value
106
107     EType           fType;          // cut type
108     EVarType        fVarType;       // variable type
109
110     static const Double_t fgkDSmallNumber;  // small double value
111     static const Double_t fgkDBigNumber;    // big double value
112     static const Int_t    fgkIBigNumber;    // big int value
113
114     ClassDef (AliRsnCut, 1)
115 };
116
117 #endif