]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnCut.h
few modifications on package, waiting for AOD compliance corrections
[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     kMomentum = 0,
36     kTransMomentum,
37     kEta,
38     kRadialImpactParam,
39     kRadialImpactParamMC,
40     kMomentumMC,
41     kTransMomentumMC,
42     kEtaMC,
43     kNSigma,
44     kNSigmaCalculate,
45     kStatus,
46     kIsLabelEqual,
47     kIsTruePair,
48     kIsPrimary,
49     kIsKinkDaughter,
50     kIsKinkMother,
51     kMCTracked,
52     kChargePos,
53     kChargeNeg,
54     kPIDType,
55     kPIDProb,
56     kPIDProbForSpecies,
57     kAssignedPID,
58     kTruePID,
59     kVz,
60     kTrueMultiplicity,
61     kMultiplicity,
62     kMultiplicityDifference,
63     kMultiplicityRatio,
64     kPhiMeanDifference,
65     kVzDifference,
66     kLastCutType
67   };
68
69   // types of cut variables
70   enum EVarType {
71     kDouble_t = 0,
72     kInt_t,
73     kUInt_t
74   };
75
76   // possible targets for a cut
77   enum ETarget {
78     kParticle = 0,
79     kPair,
80     kEvent,
81     kMixEvent,
82     kLastCutTarget
83   };
84
85   AliRsnCut();
86   AliRsnCut(const char *name, const char *title, EType type);
87   AliRsnCut(const char *name, const char *title, EType type, Double_t min, Double_t max = 1e-100);
88   AliRsnCut(const char *name, const char *title, EType type, Int_t min, Int_t max = 32767);
89   AliRsnCut(const char *name, const char *title, EType type, UInt_t min, UInt_t max = 65534);
90   AliRsnCut(const char *name, const char *title, EType type, ULong_t min, ULong_t max = 65534);
91
92   ~AliRsnCut();
93
94   void      SetCutValues(EType type, const Double_t& theValue, const Double_t& theValue2);
95   void      SetCutValues(EType type, const Int_t& theValue, const Int_t& theValue2);
96   void      SetCutValues(EType type, const UInt_t& theValue, const UInt_t& theValue2);
97   void      SetCutValues(EType type, const ULong_t& theValue, const ULong_t& theValue2);
98
99   Bool_t    IsSelected(ETarget tgt,  AliRsnDaughter *daughter);
100   Bool_t    IsSelected(ETarget tgt,  AliRsnPairParticle *pair);
101   Bool_t    IsSelected(ETarget tgt,  AliRsnEvent *event);
102   Bool_t    IsSelected(ETarget tgt,  AliRsnEvent *ev1, AliRsnEvent *ev2);
103
104   void      PrintAllValues();
105
106   Bool_t    IsBetween(const Double_t &theValue);
107   Bool_t    IsBetween(const Int_t &theValue);
108   Bool_t    MatchesValue(const Int_t &theValue);
109   Bool_t    MatchesValue(const UInt_t &theValue);
110   Bool_t    MatchesValue(const ULong_t &theValue);
111   Bool_t    MatchesValue(const Double_t &theValue);
112
113  private:
114
115   Double_t        fDMin;          // min. double value
116   Double_t        fDMax;          // max. double value
117   Int_t           fIMin;          // min. int value
118   Int_t           fIMax;          // max. int value
119   UInt_t          fUIMin;         // min. uint value
120   UInt_t          fUIMax;         // max. uint value
121   ULong_t         fULMin;         // min. ulong value
122   ULong_t         fULMax;         // max. ulong value
123
124   EType           fType;          // cut type
125   EVarType        fVarType;       // variable type
126
127   static const Double_t fgkDSmallNumber;  // small double value
128   static const Double_t fgkDBigNumber;    // big double value
129   static const Int_t    fgkIBigNumber;    // big int value
130
131   ClassDef(AliRsnCut, 1)
132 };
133
134 #endif