]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnValue.h
Removed old ME classes, since the nex event mixing has been introduced and is integra...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnValue.h
1 //
2 // Class AliRsnValue
3 //
4 // This class implements all the computations which could be useful
5 // during the analysis, both for cuts and for output histograms.
6 //
7 // It inherits from the AliRsnTarget base class since it can operate
8 // on tracks, pairs and events, and the kind of expected object to
9 // be processed depends on the kind of requested computation.
10 //
11 // Since this class is used to produce the outputs, it contains the
12 // facilities to define a binning in an output histogram.
13 //
14
15 #ifndef ALIRSNVALUE_H
16 #define ALIRSNVALUE_H
17
18 #include "TArrayD.h"
19 #include "AliRsnTarget.h"
20
21 class AliRsnValue : public AliRsnTarget {
22 public:
23
24    // this enumeration lists all available computations
25    // any user feedback proposing new ones is welcome
26    enum EValueType {
27       kTrackP,             // single track total momentum
28       kTrackPt,            // single track transverse momentum
29       kTrackEta,           // single track pseudo-rapidity
30       kPairP1,             // total momentum of 1st daughter of a pair
31       kPairP2,             // total momentum of 2nd daughter of a pair
32       kPairP1t,            // total momentum of 1st daughter of a pair
33       kPairP2t,            // total momentum of 2nd daughter of a pair
34       kPairP1z,            // total momentum of 1st daughter of a pair
35       kPairP2z,            // total momentum of 2nd daughter of a pair
36       kPairInvMass,        // pair invariant mass (with reconstructed momenta)
37       kPairInvMassMC,      // pair invariant mass (with MC momenta)
38       kPairInvMassRes,     // pair invariant mass resolution
39       kPairPt,             // pair transverse momentum
40       kPairPz,             // pair longitudinal momentum
41       kPairEta,            // pair pseudo-rapidity
42       kPairMt,             // pair transverse mass (need a reference mass)
43       kPairY,              // pair rapidity (need a reference mass)
44       kPairPhi,            // pair azimuthal angle (with reconstructed momenta)
45       kPairPhiMC,          // pair azimuthal angle (with MC momenta)
46       kPairPtRatio,        // ratio |pt1 - pt2|/(pt1 + pt2) of daughter transverse momenta
47       kPairDipAngle,       // inverse cosine of the angle between daughter vector momenta
48       kPairCosThetaStar,   // polarization angle
49       kPairQInv,           // invariant relative momentum of the two daughters
50       kPairAngleToLeading, // angle between the pair momentum and that of the event leading particle
51       kEventLeadingPt,     // transverse momentum of the event leading particle
52       kEventMult,          // multiplicity computed as the number of tracks
53       kEventMultESDCuts,   // multiplicity computed as the number of track passing an ESD quality cut (need this cut defined)
54       kEventVz,            // Z position of event primary vertex
55
56       kValueTypes          // last value is used to have a meaningless enum value for initializations
57    };
58
59    AliRsnValue();
60    AliRsnValue(const char *name, EValueType type, Int_t nbins = 0, Double_t min = 0.0, Double_t max = 0.0);
61    AliRsnValue(const char *name, EValueType type, Double_t min, Double_t max, Double_t step);
62    AliRsnValue(const char *name, EValueType type, Int_t nbins, Double_t *array);
63    AliRsnValue(const AliRsnValue& copy);
64    AliRsnValue& operator=(const AliRsnValue& copy);
65    virtual ~AliRsnValue() { /*does nothing, since pointers are not owned by this object*/ }
66
67    TArrayD     GetArray() const               {return fBinArray;}
68    Double_t    GetComputedValue() const       {return fComputedValue;}
69    EValueType  GetValueType() const           {return fValueType;}
70    const char* GetValueTypeName() const;
71    TObject*    GetSupportObject()             {return fSupportObject;}
72    void        SetSupportObject(TObject *obj) {fSupportObject = obj;}
73    void        SetValueType(EValueType type)  {fValueType = type;}
74    void        AssignTarget();
75
76    void        SetBins(Int_t n, Double_t min, Double_t max);
77    void        SetBins(Int_t n, Double_t *array);
78    void        SetBins(Double_t min, Double_t max, Double_t step);
79
80    void        Set(EValueType type, Int_t n, Double_t min, Double_t max)       {fValueType = type; AssignTarget(); SetBins(n, min, max);}
81    void        Set(EValueType type, Int_t n, Double_t *array)                  {fValueType = type; AssignTarget(); SetBins(n, array);}
82    void        Set(EValueType type, Double_t min, Double_t max, Double_t step) {fValueType = type; AssignTarget(); SetBins(min, max, step);}
83
84
85    virtual Bool_t  Eval(TObject *object, Bool_t useMC = kFALSE);
86    virtual void    Print(Option_t *option = "") const;
87
88 protected:
89
90    Double_t        fComputedValue;  // computed value
91    EValueType      fValueType;      // value type
92    TArrayD         fBinArray;       // array of bins (when used for a histogram axis)
93    TObject        *fSupportObject;  // support object needed for computing some of the values
94
95    // ROOT dictionary
96    ClassDef(AliRsnValue, 2)
97 };
98
99 #endif