]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/RESONANCES/AliRsnCut.h
flat friends update
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCut.h
1 //
2 // *** Class AliRsnCut ***
3 //
4 // Cut base class: all other cuts inherit from it.
5 // The 'core' of the class is the method "IsSelected()" which
6 // must be overloaded by any specific cut implementation.
7 //
8 // This class provides some default instruments to check values
9 // against a reference or an allowed range, in order to permit
10 // a unique way to execute such kind of checks.
11 // Moreover, if one checks values and ranges using default methods
12 // a debug message can be printed on request.
13 //
14 // authors: Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
15 //          Martin Vala (martin.vala@cern.ch)
16 //
17
18 #ifndef ALIRSNCUT_H
19 #define ALIRSNCUT_H
20
21 #include "AliRsnTarget.h"
22
23 class AliRsnCut : public AliRsnTarget {
24 public:
25
26    AliRsnCut(const char *name = "dummy", RSNTARGET target = AliRsnTarget::kTargetTypes);
27    AliRsnCut(const char *name, RSNTARGET target, Int_t    imin, Int_t    imax = 0 , Double_t dmin = 0., Double_t dmax = 0.);
28    AliRsnCut(const char *name, RSNTARGET target, Double_t dmin, Double_t dmax = 0., Int_t    imin = 0 , Int_t    imax = 0);
29    AliRsnCut(const AliRsnCut &copy);
30    AliRsnCut &operator=(const AliRsnCut &copy);
31    virtual ~AliRsnCut() { };
32
33    Int_t            GetMinI()      const {return fMinI;}
34    Int_t            GetMaxI()      const {return fMaxI;}
35    Double_t         GetMinD()      const {return fMinD;}
36    Double_t         GetMaxD()      const {return fMaxD;}
37    Int_t            GetCutValueI() const {return fCutValueI;}
38    Double_t         GetCutValueD() const {return fCutValueD;}
39    Bool_t           GetCutResult() const {return fCutResult;}
40
41    void             SetRangeI(Int_t    min, Int_t    max) {fMinI = min; fMaxI = max;}
42    void             SetRangeD(Double_t min, Double_t max) {fMinD = min; fMaxD = max;}
43
44    void             SetValueI(Int_t value)    {fMinI = value;}
45    void             SetValueD(Double_t value) {fMinD = value;}
46
47    void             SetMaxPt(Double_t value) {fMaxPt = value;}
48    void             SetMinPt(Double_t value) {fMinPt = value;}
49    void             SetPtDepCut(Bool_t flag) {fPtDepCut = flag;}
50    void             SetPtDepCutMaxFormula(const char *formula) {fPtDepCutMaxFormula = formula;}
51    void             SetPtDepCutMinFormula(const char *formula) {fPtDepCutMinFormula = formula;}
52
53    Bool_t           OkValueI();
54    Bool_t           OkRangeI();
55    Bool_t           OkValueD();
56    Bool_t           OkRangeD();
57
58    virtual Bool_t   IsSelected(TObject *object);
59    virtual void     Print(Option_t *opt = "") const;
60
61 protected:
62
63    Int_t        fMinI;       //  lower edge of INT range or ref. value for INT CUT
64    Int_t        fMaxI;       //  upper edge of INT range (not used for value cuts)
65    Double_t     fMinD;       //  lower edge of DOUBLE range or ref. value for DOUBLE CUT
66    Double_t     fMaxD;       //  upper edge of DOUBLE range (not used for value cuts)
67    
68    Int_t        fMinIptdep;  //  lower edge of INT range or ref. value for INT CUT -- pt dependent
69    Int_t        fMaxIptdep;  //  upper edge of INT range (not used for value cuts) -- pt dependent
70    Double_t     fMinDptdep;  //  lower edge of DOUBLE range or ref. value for DOUBLE CUT -- pt dependent
71    Double_t     fMaxDptdep;  //  upper edge of DOUBLE range (not used for value cuts) -- pt dependent
72
73    Int_t        fCutValueI;  //  cut value INT
74    Double_t     fCutValueD;  //  cut value DOUBLE
75    Bool_t       fPtDepCut;     // flag to enable a pt dependent pair cut
76    Double_t     fRefPtValueD;  //  pt value for a pt dependent pair cut
77    Double_t     fMaxPt;        // maximum pt at which applying a pt dependent cut
78    Double_t     fMinPt;        // minimum pt at which applying a pt dependent cut
79    TString      fPtDepCutMaxFormula; //pt dependent cut formula
80    TString      fPtDepCutMinFormula; //pt dependent cut formula
81
82    Bool_t       fCutResult;  //  tells if the cut is passed or not
83
84    ClassDef(AliRsnCut, 3)
85 };
86
87 #endif