]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/EventMixing/AliMixEventCutObj.h
Fix for event mixing, when it was selecting events out of range of multiplicity cut
[u/mrichter/AliRoot.git] / ANALYSIS / EventMixing / AliMixEventCutObj.h
1 //
2 // Class AliMixEventCutObj
3 //
4 // AliMixEventCutObj object contains information about one cut on for event mixing
5 // used by AliMixEventPool class
6 //
7 // authors:
8 //          Martin Vala (martin.vala@cern.ch)
9 //
10
11 #ifndef ALIMIXEVENTCUTOBJ_H
12 #define ALIMIXEVENTCUTOBJ_H
13
14 #include <TObject.h>
15 class AliVEvent;
16 class AliAODEvent;
17 class AliESDEvent;
18 class AliMixEventCutObj : public TObject {
19 public:
20    enum EEPAxis_t {kMultiplicity = 0, kZVertex = 1, kNumberV0s = 2, kNumberTracklets = 3, kAllEventAxis = 4};
21
22    AliMixEventCutObj(EEPAxis_t type = kMultiplicity, Float_t min = 0.0, Float_t max = 0.0, Float_t step = 1.0);
23    AliMixEventCutObj(const AliMixEventCutObj &obj);
24    AliMixEventCutObj &operator=(const AliMixEventCutObj &obj);
25
26    virtual void Print(const Option_t *) const;
27    void PrintCurrentInterval();
28    void Reset();
29    void AddStep();
30
31    Bool_t      HasMore() const;
32
33    Int_t       GetNumberOfBins() const;
34    Float_t     GetMin() const { return fCurrentVal; }
35    Float_t     GetMax() const { return fCurrentVal + fCutStep - fCutSmallVal; }
36    Float_t     GetStep() const { return fCutStep; }
37    Short_t     GetType() const { return fCutType; }
38    Int_t       GetBinNumber(Float_t num) const;
39    Int_t       GetIndex(AliVEvent *ev);
40    Int_t       GetIndex(AliESDEvent *ev);
41    Int_t       GetIndex(AliAODEvent *ev);
42    const char *GetCutName(Int_t index = -1) const;
43
44    void        SetCurrentValueToIndex(Int_t index);
45
46 private:
47    Int_t       fCutType;       // cut type
48    Float_t     fCutMin;        // cut min
49    Float_t     fCutMax;        // cut max
50    Float_t     fCutStep;       // cut step
51    Float_t     fCutSmallVal;   // small value
52
53    Float_t     fCurrentVal;    // current value
54
55    ClassDef(AliMixEventCutObj, 1)
56 };
57
58 #endif