]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnValue.h
Coverity fixes
[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    enum EValueType {
20       kTrackP,               // single track total momentum
21       kTrackPt,              // single track transverse momentum
22       kTrackPtpc,            // single track total momentum in the TPC inner wall
23       kTrackEta,             // single track pseudo-rapidity
24       kTrackY,               // single track rapidity
25       kTrackITSsignal,       // single track ITS signal
26       kTrackTPCsignal,       // single track TPC signal
27       kTrackTOFsignal,       // single track TOF signal
28       kTrackTOFbeta,         // single track beta from TOF
29       kTrackLength,          // single track integrated length
30       kTrackValues,          // --- limita 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,              // transverse momentum of 1st daughter of a pair
35       kPairP2t,              // transverse momentum of 2nd daughter of a pair
36       kPairP1z,              // longitudinal momentum of 1st daughter of a pair
37       kPairP2z,              // longitudinal 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 pair momentum and leading particle
53       kPairValues,           // --- limit 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 of good quality tracks
59       kEventMultSPD,         // multiplicity from SPD
60       kEventVz,              // Z position of event primary vertex
61       kEventCentralityV0,    // event centrality (V0 method)
62       kEventCentralityTrack, // event centrality (tracks method)
63       kEventCentralityCL1,   // event centrality (CL1 method)
64       kValueTypes            // --- limit for event values (and global) ----------------------------
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; fTargetType = TargetType(type);}
82
83    void        SetBins(Int_t n, Double_t min, Double_t max);
84    void        SetBins(Int_t n, Double_t *array);
85    void        SetBins(Double_t min, Double_t max, Double_t step);
86
87    void        Set(EValueType type, Int_t n, Double_t min, Double_t max)       {SetValueType(type); SetBins(n, min, max);}
88    void        Set(EValueType type, Int_t n, Double_t *array)                  {SetValueType(type); SetBins(n, array);}
89    void        Set(EValueType type, Double_t min, Double_t max, Double_t step) {SetValueType(type); SetBins(min, max, step);}
90
91    virtual Bool_t    Eval(TObject *object, Bool_t useMC = kFALSE);
92    virtual void      Print(Option_t *option = "") const;
93    static  RSNTARGET TargetType(EValueType type);
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