]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnValue.h
Added the possibility to compute centrality values using all the three validated...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnValue.h
1 #ifndef ALIRSNVALUE_H
2 #define ALIRSNVALUE_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6  
7 ////////////////////////////////////////////////////////////////////////////////
8 //
9 //  Collection of all values which can be computed within the package
10 //
11 ////////////////////////////////////////////////////////////////////////////////
12
13 #include "TArrayD.h"
14 #include "AliRsnTarget.h"
15
16 class AliRsnValue : public AliRsnTarget {
17 public:
18
19    // this enumeration lists all available computations
20    // any user feedback proposing new ones is welcome
21    enum EValueType {
22       kTrackP,               // single track total momentum
23       kTrackPt,              // single track transverse momentum
24       kTrackEta,             // single track pseudo-rapidity
25       kTrackY,               // single track rapidity
26       kTrackITSsignal,       // single track ITS signal
27       kTrackTPCsignal,       // single track TPC signal
28       kTrackTOFsignal,       // single track TOF signal
29       kTrackLength,          // single track integrated length
30       kTrackValues,          // --- limitator for track values ---------------------------------------
31                              
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       kPairValues,           // --- limitator for pair values ----------------------------------------
54                              
55       kEventLeadingPt,       // transverse momentum of the event leading particle
56       kEventMult,            // multiplicity computed as the number of tracks
57       kEventMultMC,          // multiplicity from MC
58       kEventMultESDCuts,     // multiplicity computed as the number of track passing an ESD quality cut (need this cut defined)
59       kEventVz,              // Z position of event primary vertex
60       kEventCentralityV0,    // event centrality (V0 method)
61       kEventCentralityTrack, // event centrality (tracks method)
62       kEventCentralityCL1,   // event centrality (CL1 method)
63       kValueTypes            // --- last value (used to have a meaningless enum value) ---------------
64    };
65
66    AliRsnValue();
67    AliRsnValue(const char *name, EValueType type, Int_t nbins = 0, Double_t min = 0.0, Double_t max = 0.0);
68    AliRsnValue(const char *name, EValueType type, Double_t min, Double_t max, Double_t step);
69    AliRsnValue(const char *name, EValueType type, Int_t nbins, Double_t *array);
70    AliRsnValue(const AliRsnValue& copy);
71    AliRsnValue& operator=(const AliRsnValue& copy);
72    virtual ~AliRsnValue() { /*does nothing, since pointers are not owned by this object*/ }
73
74    TArrayD     GetArray() const               {return fBinArray;}
75    Double_t    GetComputedValue() const       {return fComputedValue;}
76    EValueType  GetValueType() const           {return fValueType;}
77    const char* GetValueTypeName() const;
78    TObject*    GetSupportObject()             {return fSupportObject;}
79    void        SetSupportObject(TObject *obj) {fSupportObject = obj;}
80    void        SetValueType(EValueType type)  {fValueType = type; fTargetType = TargetType(type);}
81
82    void        SetBins(Int_t n, Double_t min, Double_t max);
83    void        SetBins(Int_t n, Double_t *array);
84    void        SetBins(Double_t min, Double_t max, Double_t step);
85
86    void        Set(EValueType type, Int_t n, Double_t min, Double_t max)       {SetValueType(type); SetBins(n, min, max);}
87    void        Set(EValueType type, Int_t n, Double_t *array)                  {SetValueType(type); SetBins(n, array);}
88    void        Set(EValueType type, Double_t min, Double_t max, Double_t step) {SetValueType(type); SetBins(min, max, step);}
89
90    virtual Bool_t    Eval(TObject *object, Bool_t useMC = kFALSE);
91    virtual void      Print(Option_t *option = "") const;
92    static  RSNTARGET TargetType(EValueType type);
93
94 protected:
95
96    Double_t        fComputedValue;  // computed value
97    EValueType      fValueType;      // value type
98    TArrayD         fBinArray;       // array of bins (when used for a histogram axis)
99    TObject        *fSupportObject;  // support object needed for computing some of the values
100
101    // ROOT dictionary
102    ClassDef(AliRsnValue, 2)
103 };
104
105 #endif