]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnHistoDef.cxx
New classes required for revision of package
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnHistoDef.cxx
CommitLineData
2a445445 1//
2// Class AliRsnHistoDef
3//
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
10//
11
13f28255 12#include <TObject.h>
2a445445 13
13f28255 14//#include "AliLog.h"
2a445445 15#include "AliRsnHistoDef.h"
16
17ClassImp(AliRsnHistoDef)
18
19//_____________________________________________________________________________
20AliRsnHistoDef::AliRsnHistoDef() :
e0baff8c 21 fNBins(0),
22 fMin(0.0),
23 fMax(0.0)
2a445445 24{
25//
26// Default constructor
27//
28}
29
30//_____________________________________________________________________________
31AliRsnHistoDef::AliRsnHistoDef
32(Int_t nbins, Double_t min, Double_t max) :
e0baff8c 33 fNBins(0),
34 fMin(0.0),
35 fMax(0.0)
2a445445 36{
37//
38// 1D histo definition.
39//
e0baff8c 40 SetBins(nbins, min, max);
2a445445 41}
2a445445 42
5eb970a4 43//_____________________________________________________________________________
44AliRsnHistoDef::AliRsnHistoDef
45(Double_t min, Double_t max, Double_t step) :
46 fNBins(0),
47 fMin(0.0),
48 fMax(0.0)
49{
50//
51// 1D histo definition.
52//
53 SetBins(min, max, step);
54}
55
2a445445 56//_____________________________________________________________________________
57void AliRsnHistoDef::SetBins(Int_t n, Double_t min, Double_t max)
58{
59//
aec0ec32 60// Binning for histogram.
2a445445 61//
5eb970a4 62
e0baff8c 63 fNBins = n;
64
65 if (min < max)
66 {
67 fMin = min;
68 fMax = max;
69 }
70 else
71 {
72 fMin = max;
73 fMax = min;
74 }
2a445445 75}
5eb970a4 76
77//_____________________________________________________________________________
78void AliRsnHistoDef::SetBins(Double_t min, Double_t max, Double_t step)
79{
80//
81// Binning for histogram.
82//
83
84 if (min < max)
85 {
86 fMin = min;
87 fMax = max;
88 }
89 else
90 {
91 fMin = max;
92 fMax = min;
93 }
94
95 fNBins = (Int_t)((fMax - fMin) / (step)) + 1;
96}