2 // All implementations related to definition of an axis
3 // which is used in the output histogams.
4 // Simpler than TAxis, it defines an array of edges
5 // which is then ported to the output histogram definition.
6 // currently ported only in mini-package, but it could
7 // become a default also for general package.
11 #include "AliRsnMiniAxis.h"
13 ClassImp(AliRsnMiniAxis)
15 //_____________________________________________________________________________
16 void AliRsnMiniAxis::Set(Int_t nbins, Double_t min, Double_t max)
19 // Set binning for the axis in equally spaced bins
20 // where the number of bins, minimum and maximum are given.
30 Double_t mymax = TMath::Max(min, max);
31 Double_t mymin = TMath::Min(min, max);
34 Double_t binSize = (mymax - mymin) / ((Double_t)nbins);
37 for (k = 1; k <= nbins; k++) fBins[k] = fBins[k - 1] + binSize;
40 //_____________________________________________________________________________
41 void AliRsnMiniAxis::Set(Double_t min, Double_t max, Double_t step)
44 // Set binning for the axis in equally spaced bins
45 // where the bin size, minimum and maximum are given.
48 Double_t dblNbins = TMath::Abs(max - min) / step;
49 Int_t intNbins = ((Int_t)dblNbins) + 1;
51 Set(intNbins, min, max);
54 //_____________________________________________________________________________
55 void AliRsnMiniAxis::Set(Int_t nbins, Double_t *array)
58 // Set binning for the axis in unequally spaced bins
59 // using the same way it is done in TAxis
69 for (i = 0; i < nbins; i++) fBins[i] = array[i];