40 map<TString, TNamed*>::iterator it;
41 for (it =
fMap.begin(); it !=
fMap.end(); it++) {
48 map<TString, TNamed*>::iterator it;
49 for (it =
fMap.begin(); it !=
fMap.end(); it++) {
50 if (it->second->IsA()->InheritsFrom(
TH1::Class()))
51 static_cast<TH1*
>(it->second)->Reset();
58 cout <<
"-I- BmnHistManager::ReadFromFile" << endl;
63 while ((key = (
TKey*)nextkey()) !=
nullptr) {
77 map<TString, TNamed*>::iterator it;
78 for (it =
fMap.begin(); it !=
fMap.end(); it++) {
86 TH1* hist =
H1(histName);
88 Int_t minShrinkBin = std::numeric_limits<Int_t>::max();
89 Int_t maxShrinkBin = std::numeric_limits<Int_t>::min();
91 for (
Int_t iBin = 1; iBin <= nofBins; iBin++) {
94 minShrinkBin = std::min(iBin, minShrinkBin);
95 maxShrinkBin = std::max(iBin, maxShrinkBin);
107 TH1* hist =
H2(histName);
110 Int_t minShrinkBinX = std::numeric_limits<Int_t>::max();
111 Int_t maxShrinkBinX = std::numeric_limits<Int_t>::min();
112 Int_t minShrinkBinY = std::numeric_limits<Int_t>::max();
113 Int_t maxShrinkBinY = std::numeric_limits<Int_t>::min();
115 for (
Int_t iBinX = 1; iBinX <= nofBinsX; iBinX++) {
116 for (
Int_t iBinY = 1; iBinY <= nofBinsY; iBinY++) {
119 minShrinkBinX = std::min(iBinX, minShrinkBinX);
120 maxShrinkBinX = std::max(iBinX, maxShrinkBinX);
121 minShrinkBinY = std::min(iBinY, minShrinkBinY);
122 maxShrinkBinY = std::max(iBinY, maxShrinkBinY);
140 TH1* hist =
H1(histName);
146 TH1* hist =
H1(histName);
155 TString str =
"BmnHistManager list of histograms:\n";
156 map<TString, TNamed*>::const_iterator it;
157 for (it =
fMap.begin(); it !=
fMap.end(); it++) {
158 str += it->first +
"\n";
virtual ~BmnHistManager()
Destructor.
void Add(const TString &name, TNamed *object)
Add new named object to manager.
map< TString, TNamed * > fMap
void ResetHists()
Reset all histograms.
void ShrinkEmptyBinsH2(const TString &histName)
Shrink empty bins in H2.
BmnHistManager()
Constructor.
void Rebin(const TString &histName, Int_t ngroup)
Rebin histogram.
void Scale(const TString &histName, Double_t scale)
Scale histogram.
TH2 * H2(const TString &name) const
Return pointer to TH2 histogram.
void WriteToFile()
Write all histograms to current opened file.
void Clear()
Clear memory.
TString ToString() const
Return string representation of class.
void NormalizeToIntegral(const TString &histName)
Normalize histogram to integral.
TH1 * H1(const TString &name) const
Return pointer to TH1 histogram.
void ReadFromFile(TFile *file)
Read histograms from file.
void ShrinkEmptyBinsH1(const TString &histName)
Shrink empty bins in H1.
virtual void SetRange(Int_t first=0, Int_t last=0)
Bool_t InheritsFrom(const char *cl) const override
T * Get(const char *namecycle)
virtual TList * GetListOfKeys() const
virtual Int_t GetNbinsY() const
virtual Int_t GetNbinsX() const
virtual TH1 * Rebin(Int_t ngroup=2, const char *newname="", const Double_t *xbins=nullptr)
virtual Double_t Integral(Int_t binx1, Int_t binx2, Option_t *option="") const
virtual Double_t GetBinContent(Int_t bin) const
virtual void Scale(Double_t c1=1, Option_t *option="")
virtual TObject * ReadObj()
const char * GetName() const override
virtual TClass * IsA() const