]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnValue.h
Added the possibility to define variable bins in output histograms.
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnValue.h
1 //
2 // Class AliRsnValue
3 //
4 // Definition of a single value which can be computed
5 // from any of the defined input objects implemented
6 // in the resonance package.
7 //
8
9 #ifndef ALIRSNVALUE_H
10 #define ALIRSNVALUE_H
11
12 #include "TNamed.h"
13 #include "TArrayD.h"
14
15 class AliRsnPairDef;
16 class AliRsnMother;
17
18 class AliRsnValue : public TNamed
19 {
20   public:
21
22     enum EValueType
23     {
24       kTrack1P,
25       kTrack2P,
26       kTrack1Pt,
27       kTrack2Pt,
28       kPairInvMass,
29       kPairInvMassMC,
30       kPairInvMassRes,
31       kPairPt,
32       kPairEta,
33       kPairMt,
34       kPairY,
35       kPairCosThetaStar,
36       kPairCosThetaStar1,
37       kPairCosThetaStar2,
38       kPairCosThetaStarMC1,
39       kPairCosThetaStarMC2,
40       kEventMult,
41       kValueTypes
42     };
43
44     AliRsnValue();
45     AliRsnValue(const char *name, EValueType type, Int_t n = 0, Double_t min = 0.0, Double_t max = 0.0);
46     AliRsnValue(const char *name, EValueType type, Double_t min, Double_t max, Double_t step);
47     AliRsnValue(const char *name, EValueType type, Int_t n, Double_t *array);
48     AliRsnValue(const AliRsnValue& copy) : TNamed(copy),fType(copy.fType),fValue(copy.fValue),fArray(copy.fArray) {}
49     AliRsnValue& operator=(const AliRsnValue& copy) {SetName(copy.GetName());fType=copy.fType;fValue=copy.fValue;fArray=copy.fArray;return (*this);}
50     virtual ~AliRsnValue() { }
51     
52     TArrayD     GetArray() const {return fArray;}
53     Double_t    GetValue() const {return fValue;}
54     EValueType  GetValueType() {return fType;}
55
56     void        SetValueType(EValueType type) {fType = type;}
57     void        SetBins(Int_t n, Double_t min, Double_t max);
58     void        SetBins(Double_t min, Double_t max, Double_t step);
59     void        SetBins(Int_t n, Double_t *array);
60     
61     Bool_t      Eval(AliRsnMother * const mother, AliRsnPairDef * const pairDef, AliRsnEvent * const event);
62
63   private:
64
65     EValueType fType;    // value type
66     Double_t   fValue;   // computed value
67     TArrayD    fArray;   // array of bins (when necessary)
68     
69     // ROOT dictionary
70     ClassDef(AliRsnValue, 1)
71 };
72
73 #endif