]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnCut.h
fix for bug #70582 (change from L. Molnar)
[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;
e2bafbbc 25class AliRsnEvent;
06351446 26
27class AliRsnCut : public TNamed
28{
5eb970a4 29 public:
30
31 // possible targets for a cut
32 enum ETarget {
33 kParticle = 0,
34 kPair,
35 kEvent,
36 kMixEvent,
37 kLastCutTarget
38 };
39
40 // data type for check
41 enum EVarType {
42 kInt = 0,
43 kULong,
44 kDouble
45 };
46
47 AliRsnCut();
413bbf44 48 AliRsnCut(const AliRsnCut& copy);
49 AliRsnCut& operator=(const AliRsnCut& copy);
5eb970a4 50 AliRsnCut(const char *name, Int_t min, Int_t max = 0);
51 AliRsnCut(const char *name, ULong_t min, ULong_t max = 0);
52 AliRsnCut(const char *name, Double_t min, Double_t max = 0);
4fbb2459 53 virtual ~AliRsnCut() {;};
5eb970a4 54
55 void SetRange(Int_t min, Int_t max) {fMinI = min; fMaxI = max; fVarType = kInt;}
56 void SetRange(ULong_t min, ULong_t max) {fMinU = min; fMaxU = max; fVarType = kULong;}
57 void SetRange(Double_t min, Double_t max) {fMinD = min; fMaxD = max; fVarType = kDouble;}
58
59 void SetValue(Int_t value) {fMinI = value; fVarType = kInt;}
60 void SetValue(ULong_t value) {fMinU = value; fVarType = kULong;}
61 void SetValue(Double_t value) {fMinD = value; fVarType = kDouble;}
62
413bbf44 63 void SetEvent(AliRsnEvent *event) {fEvent = event;}
64
5eb970a4 65 virtual Bool_t IsSelected(ETarget tgt, AliRsnDaughter *daughter);
66 virtual Bool_t IsSelected(ETarget tgt, AliRsnPairParticle *pair);
67 virtual Bool_t IsSelected(ETarget tgt, AliRsnEvent *event);
68 virtual Bool_t IsSelected(ETarget tgt, AliRsnEvent *ev1, AliRsnEvent *ev2);
69
4fbb2459 70 protected:
5eb970a4 71
72 Bool_t OkValue();
73 Bool_t OkRange();
74
75 EVarType fVarType; // type of checked variable
76
77 Int_t fMinI; // lower edge of INT range or ref. value for INT CUT
78 Int_t fMaxI; // upper edge of INT range (not used for value cuts)
79 ULong_t fMinU; // lower edge of ULONG range or ref. value for INT CUT
80 ULong_t fMaxU; // upper edge of ULONG range (not used for value cuts)
81 Double_t fMinD; // lower edge of DOUBLE range or ref. value for INT CUT
82 Double_t fMaxD; // upper edge of DOUBLE range (not used for value cuts)
83
84 Int_t fCutValueI; // cut value
85 ULong_t fCutValueU; // cut value
86 Double_t fCutValueD; // cut value
87 Bool_t fCutResult; // tells if the cut is passed or not
88
413bbf44 89 AliRsnEvent *fEvent; //! pointer to current event (can be needed sometimes)
90
5eb970a4 91 ClassDef(AliRsnCut, 1)
06351446 92};
93
94#endif