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.
14 // authors: Martin Vala (martin.vala@cern.ch)
15 // Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
24 class AliRsnPairParticle;
27 class AliRsnCut : public TNamed
31 // possible targets for a cut
40 // data type for check
48 AliRsnCut(const char *name, Int_t min, Int_t max = 0);
49 AliRsnCut(const char *name, ULong_t min, ULong_t max = 0);
50 AliRsnCut(const char *name, Double_t min, Double_t max = 0);
51 virtual ~AliRsnCut() {;};
53 void SetRange(Int_t min, Int_t max) {fMinI = min; fMaxI = max; fVarType = kInt;}
54 void SetRange(ULong_t min, ULong_t max) {fMinU = min; fMaxU = max; fVarType = kULong;}
55 void SetRange(Double_t min, Double_t max) {fMinD = min; fMaxD = max; fVarType = kDouble;}
57 void SetValue(Int_t value) {fMinI = value; fVarType = kInt;}
58 void SetValue(ULong_t value) {fMinU = value; fVarType = kULong;}
59 void SetValue(Double_t value) {fMinD = value; fVarType = kDouble;}
61 virtual Bool_t IsSelected(ETarget tgt, AliRsnDaughter *daughter);
62 virtual Bool_t IsSelected(ETarget tgt, AliRsnPairParticle *pair);
63 virtual Bool_t IsSelected(ETarget tgt, AliRsnEvent *event);
64 virtual Bool_t IsSelected(ETarget tgt, AliRsnEvent *ev1, AliRsnEvent *ev2);
71 EVarType fVarType; // type of checked variable
73 Int_t fMinI; // lower edge of INT range or ref. value for INT CUT
74 Int_t fMaxI; // upper edge of INT range (not used for value cuts)
75 ULong_t fMinU; // lower edge of ULONG range or ref. value for INT CUT
76 ULong_t fMaxU; // upper edge of ULONG range (not used for value cuts)
77 Double_t fMinD; // lower edge of DOUBLE range or ref. value for INT CUT
78 Double_t fMaxD; // upper edge of DOUBLE range (not used for value cuts)
80 Int_t fCutValueI; // cut value
81 ULong_t fCutValueU; // cut value
82 Double_t fCutValueD; // cut value
83 Bool_t fCutResult; // tells if the cut is passed or not
85 ClassDef(AliRsnCut, 1)