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