]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnValue.h
Where possible, replaced dynamic_cast with ROOT RTTI using TClass.
[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       kTrackY,             // single track rapidity
31       kTrackITSsignal,     // single track ITS signal
32       kTrackTPCsignal,     // single track TPC signal
33       kTrackTOFsignal,     // single track TOF signal
34       kTrackLength,        // single track integrated length
35       kTrackValues,        // --- limitator for track values ---------------------------------------
36       
37       kPairP1,             // total momentum of 1st daughter of a pair
38       kPairP2,             // total momentum of 2nd daughter of a pair
39       kPairP1t,            // total momentum of 1st daughter of a pair
40       kPairP2t,            // total momentum of 2nd daughter of a pair
41       kPairP1z,            // total momentum of 1st daughter of a pair
42       kPairP2z,            // total momentum of 2nd daughter of a pair
43       kPairInvMass,        // pair invariant mass (with reconstructed momenta)
44       kPairInvMassMC,      // pair invariant mass (with MC momenta)
45       kPairInvMassRes,     // pair invariant mass resolution
46       kPairPt,             // pair transverse momentum
47       kPairPz,             // pair longitudinal momentum
48       kPairEta,            // pair pseudo-rapidity
49       kPairMt,             // pair transverse mass (need a reference mass)
50       kPairY,              // pair rapidity (need a reference mass)
51       kPairPhi,            // pair azimuthal angle (with reconstructed momenta)
52       kPairPhiMC,          // pair azimuthal angle (with MC momenta)
53       kPairPtRatio,        // ratio |pt1 - pt2|/(pt1 + pt2) of daughter transverse momenta
54       kPairDipAngle,       // inverse cosine of the angle between daughter vector momenta
55       kPairCosThetaStar,   // polarization angle
56       kPairQInv,           // invariant relative momentum of the two daughters
57       kPairAngleToLeading, // angle between the pair momentum and that of the event leading particle
58       kPairValues,         // --- limitator for pair values ----------------------------------------
59       
60       kEventLeadingPt,     // transverse momentum of the event leading particle
61       kEventMult,          // multiplicity computed as the number of tracks
62       kEventMultESDCuts,   // multiplicity computed as the number of track passing an ESD quality cut (need this cut defined)
63       kEventVz,            // Z position of event primary vertex
64       kValueTypes          // --- last value (used to have a meaningless enum value) ---------------
65    };
66
67    AliRsnValue();
68    AliRsnValue(const char *name, EValueType type, Int_t nbins = 0, Double_t min = 0.0, Double_t max = 0.0);
69    AliRsnValue(const char *name, EValueType type, Double_t min, Double_t max, Double_t step);
70    AliRsnValue(const char *name, EValueType type, Int_t nbins, Double_t *array);
71    AliRsnValue(const AliRsnValue& copy);
72    AliRsnValue& operator=(const AliRsnValue& copy);
73    virtual ~AliRsnValue() { /*does nothing, since pointers are not owned by this object*/ }
74
75    TArrayD     GetArray() const               {return fBinArray;}
76    Double_t    GetComputedValue() const       {return fComputedValue;}
77    EValueType  GetValueType() const           {return fValueType;}
78    const char* GetValueTypeName() const;
79    TObject*    GetSupportObject()             {return fSupportObject;}
80    void        SetSupportObject(TObject *obj) {fSupportObject = obj;}
81    void        SetValueType(EValueType type)  {fValueType = type;}
82    void        AssignTarget();
83
84    void        SetBins(Int_t n, Double_t min, Double_t max);
85    void        SetBins(Int_t n, Double_t *array);
86    void        SetBins(Double_t min, Double_t max, Double_t step);
87
88    void        Set(EValueType type, Int_t n, Double_t min, Double_t max)       {fValueType = type; AssignTarget(); SetBins(n, min, max);}
89    void        Set(EValueType type, Int_t n, Double_t *array)                  {fValueType = type; AssignTarget(); SetBins(n, array);}
90    void        Set(EValueType type, Double_t min, Double_t max, Double_t step) {fValueType = type; AssignTarget(); SetBins(min, max, step);}
91
92    virtual Bool_t  Eval(TObject *object, Bool_t useMC = kFALSE);
93    virtual void    Print(Option_t *option = "") const;
94
95 protected:
96
97    Double_t        fComputedValue;  // computed value
98    EValueType      fValueType;      // value type
99    TArrayD         fBinArray;       // array of bins (when used for a histogram axis)
100    TObject        *fSupportObject;  // support object needed for computing some of the values
101
102    // ROOT dictionary
103    ClassDef(AliRsnValue, 2)
104 };
105
106 #endif