52 cout <<
"-I- BmnHistManager::ReadFromFile" << endl;
53 TDirectory* dir = gDirectory;
54 TIter nextkey(dir->GetListOfKeys());
57 while ((key = (TKey*) nextkey()) !=
nullptr)
59 TObject* obj = key->ReadObj();
60 if (obj->IsA()->InheritsFrom (TH1::Class()) || obj->IsA()->InheritsFrom (TGraph::Class()) || obj->IsA()->InheritsFrom (TGraph2D::Class())) {
61 TNamed* h = (TNamed*) obj;
62 TNamed* h1 = (TNamed*)file->Get(h->GetName());
63 Add(TString(h->GetName()), h1);
78 TH1* hist =
H1(histName);
79 Int_t nofBins = hist->GetNbinsX();
80 Int_t minShrinkBin = std::numeric_limits<Int_t>::max();
81 Int_t maxShrinkBin = std::numeric_limits<Int_t>::min();
83 for (Int_t iBin = 1; iBin <= nofBins; iBin++) {
84 Double_t content = hist->GetBinContent(iBin);
86 minShrinkBin = std::min(iBin, minShrinkBin);
87 maxShrinkBin = std::max(iBin, maxShrinkBin);
92 hist->GetXaxis()->SetRange(minShrinkBin, maxShrinkBin);
93 hist->GetYaxis()->SetRange(minShrinkBin, maxShrinkBin);
98 TH1* hist =
H2(histName);
99 Int_t nofBinsX = hist->GetNbinsX();
100 Int_t nofBinsY = hist->GetNbinsY();
101 Int_t minShrinkBinX = std::numeric_limits<Int_t>::max();
102 Int_t maxShrinkBinX = std::numeric_limits<Int_t>::min();
103 Int_t minShrinkBinY = std::numeric_limits<Int_t>::max();
104 Int_t maxShrinkBinY = std::numeric_limits<Int_t>::min();
105 Bool_t isSet =
false;
106 for (Int_t iBinX = 1; iBinX <= nofBinsX; iBinX++) {
107 for (Int_t iBinY = 1; iBinY <= nofBinsY; iBinY++) {
108 Double_t content = hist->GetBinContent(iBinX, iBinY);
110 minShrinkBinX = std::min(iBinX, minShrinkBinX);
111 maxShrinkBinX = std::max(iBinX, maxShrinkBinX);
112 minShrinkBinY = std::min(iBinY, minShrinkBinY);
113 maxShrinkBinY = std::max(iBinY, maxShrinkBinY);
119 hist->GetXaxis()->SetRange(minShrinkBinX, maxShrinkBinX);
120 hist->GetYaxis()->SetRange(minShrinkBinY, maxShrinkBinY);