139 if constexpr (std::is_base_of_v<TH1, Obj> && !std::is_base_of_v<TH2, Obj> && !std::is_base_of_v<TH3, Obj>) {
141 double maxY = fMaximum;
142 if (std::isnan(maxY)) {
143 auto HistMax = [](
const Obj* lhs,
const Obj* rhs) {
return lhs->GetMaximum() < rhs->GetMaximum(); };
144 maxY = (*std::max_element(fvpObjects.cbegin(), fvpObjects.cend(), HistMax))->GetMaximum();
145 maxY *= (1. + kIndentFromMax);
147 double minY = fMinimum;
148 if (std::isnan(minY)) {
149 auto HistMin = [](
const Obj* lhs,
const Obj* rhs) {
return lhs->GetMinimum() < rhs->GetMinimum(); };
150 minY = (*std::min_element(fvpObjects.cbegin(), fvpObjects.cend(), HistMin))->GetMaximum();
151 minY = (minY < 0.) ? minY : 0.;
155 for (
auto it = fvpObjects.begin(); it != fvpObjects.end(); ++it) {
156 (*it)->SetStats(
false);
157 (*it)->SetMinimum(minY);
158 (*it)->SetMaximum(maxY);
159 (*it)->Draw(it == fvpObjects.begin() ?
"" :
"same");
162 else if constexpr (std::is_base_of_v<TH2, Obj> || std::is_base_of_v<TH3, Obj>) {
163 int nObjects = fvpObjects.size();
164 int nRows =
static_cast<int>(std::sqrt(nObjects));
165 int nCols = nObjects / nRows;
166 if (nCols * nRows < nObjects) {
169 gPad->Divide(nCols, nRows);
171 for (
auto it = fvpObjects.begin(); it != fvpObjects.end(); ++it) {
172 if constexpr (std::is_base_of_v<TH2, Obj>) {
183 double legX0 = kLegRightBound - kLegEntryWidth;
184 double legX1 = kLegRightBound;
185 double legY0 = kLegTopBound - kLegEntryHight * fvpObjects.size();
186 double legY1 = kLegTopBound;
188 auto* pLeg =
new TLegend(legX0, legY0, legX1, legY1);
189 pLeg->SetTextSize(kLegTextSize);
190 for (
int iObj = 0; iObj < (int) fvpObjects.size(); ++iObj) {
191 pLeg->AddEntry(fvpObjects[iObj], fvsLegEntries[iObj],
"lp");