]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnValue.h
Macro to add the energy distribution task to the train
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnValue.h
CommitLineData
b9bbd271 1//
2// Class AliRsnValue
3//
32992791 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.
b9bbd271 13//
14
15#ifndef ALIRSNVALUE_H
16#define ALIRSNVALUE_H
17
2dab9030 18#include "TArrayD.h"
32992791 19#include "AliRsnTarget.h"
b9bbd271 20
32992791 21class AliRsnValue : public AliRsnTarget
b9bbd271 22{
23 public:
32992791 24
25 // this enumeration lists all available computations
26 // any user feedback proposing new ones is welcome
2dab9030 27 enum EValueType
b9bbd271 28 {
32992791 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)
5faf5a07 56 kEventVz, // Z position of event primary vertex
32992791 57
58 kValueTypes // last value is used to have a meaningless enum value for initializations
b9bbd271 59 };
60
2dab9030 61 AliRsnValue();
32992791 62 AliRsnValue(const char *name, EValueType type, Int_t nbins = 0, Double_t min = 0.0, Double_t max = 0.0);
0d73200d 63 AliRsnValue(const char *name, EValueType type, Double_t min, Double_t max, Double_t step);
32992791 64 AliRsnValue(const char *name, EValueType type, Int_t nbins, Double_t *array);
52944696 65 AliRsnValue(const AliRsnValue& copy);
66 AliRsnValue& operator=(const AliRsnValue& copy);
32992791 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();
2dab9030 77
2dab9030 78 void SetBins(Int_t n, Double_t min, Double_t max);
b2b08ca2 79 void SetBins(Int_t n, Double_t *array);
32992791 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
2dab9030 86
32992791 87 virtual Bool_t Eval(TObject *object, Bool_t useMC = kFALSE);
2941485c 88 virtual void Print(Option_t *option = "") const;
b9bbd271 89
63a2738c 90 protected:
91
32992791 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
2dab9030 96
b9bbd271 97 // ROOT dictionary
32992791 98 ClassDef(AliRsnValue, 2)
b9bbd271 99};
100
101#endif