2 // Class AliRsnFunctionAxis
4 // Definition for a histogram type.
5 // Since one could do an analysis which is not an invariant mass
6 // the histogram definition should be more flexible, and it is stored
7 // separately in a new class.
8 // This class considers the possibility of a 1D or 2D histograms
9 // with its related binning, and can create a new histo from his definitions
15 #include "AliRsnEvent.h"
16 #include "AliRsnPairParticle.h"
17 #include "AliRsnPairDef.h"
18 #include "AliRsnFunctionAxis.h"
20 ClassImp(AliRsnFunctionAxis)
22 //_____________________________________________________________________________
23 AliRsnFunctionAxis::AliRsnFunctionAxis() :
30 // Default constructor
34 //_____________________________________________________________________________
35 AliRsnFunctionAxis::AliRsnFunctionAxis
36 (EAxisType type, Int_t nbins, Double_t min, Double_t max) :
43 // Main constructor (version 1)
46 SetBins(nbins, min, max);
49 //_____________________________________________________________________________
50 AliRsnFunctionAxis::AliRsnFunctionAxis
51 (EAxisType type, Double_t min, Double_t max, Double_t step) :
58 // Main constructor (version 2)
61 SetBins(min, max, step);
64 //_____________________________________________________________________________
65 const char* AliRsnFunctionAxis::GetName() const
68 // Return the name of this object defined by the type
73 case kPairInvMass: return "IM";
74 case kPairInvMassMC: return "IMMC";
75 case kPairInvMassRes: return "IMRES";
76 case kPairPt: return "PT";
77 case kPairEta: return "ETA";
78 case kEventMult: return "MULT";
79 default: return "UNDEF";
83 //_____________________________________________________________________________
84 AliRsnFunctionAxis::EAxisObject AliRsnFunctionAxis::GetAxisObject()
87 // Tells what kind of object must be evaluated for this axis
105 //_____________________________________________________________________________
106 void AliRsnFunctionAxis::SetBins(Int_t n, Double_t min, Double_t max)
109 // Set binning for histogram.
126 //_____________________________________________________________________________
127 void AliRsnFunctionAxis::SetBins(Double_t min, Double_t max, Double_t step)
130 // Binning for histogram.
144 fNBins = (Int_t)((fMax - fMin) / (step)) + 1;
147 //_____________________________________________________________________________
148 Double_t AliRsnFunctionAxis::Eval(AliRsnDaughter* /*daughter*/)
151 // EValuation method for single tracks
152 // (currently disabled)
158 //_____________________________________________________________________________
159 Double_t AliRsnFunctionAxis::Eval(AliRsnPairParticle *pair, AliRsnPairDef *pairDef)
162 // EValuation method for pairs.
163 // Requires also the pair definitions, in order to retrieve mass.
169 return pair->GetInvMass(pairDef->GetMass(0), pairDef->GetMass(1));
171 return pair->GetInvMassMC(pairDef->GetMass(0), pairDef->GetMass(1));
172 case kPairInvMassRes:
175 value = pair->GetInvMass(pairDef->GetMass(0), pairDef->GetMass(1));
176 value -= pair->GetInvMassMC(pairDef->GetMass(0), pairDef->GetMass(1));
177 value /= pair->GetInvMassMC(pairDef->GetMass(0), pairDef->GetMass(1));
181 return pair->GetPt();
183 return pair->GetEta();
185 AliWarning("This axis type cannot be applied to pairs");
190 //_____________________________________________________________________________
191 Double_t AliRsnFunctionAxis::Eval(AliRsnEvent *event)
194 // EValuation method for events
200 return (Double_t)event->GetMultiplicity();
202 AliWarning("This axis type cannot be applied to events");