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