]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/RESONANCES/AliRsnMiniAxis.h
Fix for coverity 24399, 24400, 24401
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnMiniAxis.h
CommitLineData
03d23846 1#ifndef ALIRSNMINIAXIS_H
2#define ALIRSNMINIAXIS_H
3
4//
5// All implementations related to definition of an axis
6// which is used in the output histogams.
7// Simpler than TAxis, it defines an array of edges
8// which is then ported to the output histogram definition.
9// currently ported only in mini-package, but it could
10// become a default also for general package.
11//
12
13#include "TObject.h"
14#include "TArrayD.h"
15
16class AliRsnMiniAxis : public TObject {
17
18public:
19
20 AliRsnMiniAxis(Int_t valID = -1) : fValueID(valID), fBins(0) { }
21 AliRsnMiniAxis(Int_t valID, Int_t nbins, Double_t min, Double_t max) : fValueID(valID), fBins(0) {Set(nbins, min, max);}
22 AliRsnMiniAxis(Int_t valID, Double_t min, Double_t max, Double_t step) : fValueID(valID), fBins(0) {Set(min, max, step);}
23 AliRsnMiniAxis(Int_t valID, Int_t nbins, Double_t *bins) : fValueID(valID), fBins(0) {Set(nbins, bins);}
61f275d1 24 AliRsnMiniAxis(const AliRsnMiniAxis &copy) : TObject(copy), fValueID(copy.fValueID), fBins(copy.fBins) { }
25 AliRsnMiniAxis &operator=(const AliRsnMiniAxis &copy) {if (this==&copy) return *this; fValueID = copy.fValueID; fBins = copy.fBins; return (*this);}
26
03d23846 27 void SetValueID(Int_t id) {fValueID = id;}
28 Int_t GetValueID() const {return fValueID;}
61f275d1 29
03d23846 30 Int_t NBins() {return fBins.GetSize() - 1;}
31 TArrayD *Bins() {return &fBins;}
32 Double_t *BinArray() {return fBins.GetArray();}
61f275d1 33
03d23846 34 void Set(Int_t nbins, Double_t min, Double_t max);
35 void Set(Int_t nbins, Double_t *bins);
36 void Set(Double_t min, Double_t max, Double_t step);
61f275d1 37
03d23846 38private:
39
40 Int_t fValueID; // index of used value in task collection
41 TArrayD fBins; // bins
61f275d1 42
03d23846 43 ClassDef(AliRsnMiniAxis,1)
44};
45
46#endif