Skip to content

Commit 799b9f7

Browse files
committed
[hist] disambiguate interface by specifiying dimension in function name
as suggested by guitargeek [nfc] realign header to keep sorting alphabetical column alignment [nfc] minor hint
1 parent 6e2a0f4 commit 799b9f7

File tree

7 files changed

+28
-21
lines changed

7 files changed

+28
-21
lines changed

hist/hist/inc/THLimitsFinder.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ class THLimitsFinder : public TObject {
3434
THLimitsFinder();
3535
~THLimitsFinder() override;
3636
virtual Int_t FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax);
37-
virtual Int_t FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Int_t newbinsx = 0, Int_t newbinsy = 0);
38-
virtual Int_t FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax, Int_t newbinsx = 0, Int_t newbinsy = 0, Int_t newbinsz = 0);
37+
virtual Int_t FindGoodLimitsXY(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax,
38+
Int_t newbinsx = 0, Int_t newbinsy = 0);
39+
virtual Int_t FindGoodLimitsXYZ(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax,
40+
Int_t newbinsx = 0, Int_t newbinsy = 0, Int_t newbinsz = 0);
3941

40-
static void Optimize(Double_t A1, Double_t A2, Int_t nold
41-
,Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="");
42+
static void Optimize(Double_t A1, Double_t A2, Int_t nold,
43+
Double_t &BinLow, Double_t &BinHigh, Int_t &nbins, Double_t &BWID, Option_t *option="");
4244
static void OptimizeLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger);
4345
static THLimitsFinder *GetLimitsFinder();
4446
static void SetLimitsFinder(THLimitsFinder *finder);

hist/hist/src/TH2.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ Int_t TH2::BufferEmpty(Int_t action)
281281
}
282282
}
283283
if (xbinAuto || ybinAuto) {
284-
THLimitsFinder::GetLimitsFinder()->FindGoodLimits(this, xmin, xmax, ymin, ymax, xbinAuto ? 0 : fXaxis.GetNbins(), ybinAuto ? 0 : fYaxis.GetNbins());
284+
THLimitsFinder::GetLimitsFinder()->FindGoodLimitsXY(
285+
this, xmin, xmax, ymin, ymax, xbinAuto ? 0 : fXaxis.GetNbins(), ybinAuto ? 0 : fYaxis.GetNbins());
285286
} else {
286287
fBuffer = nullptr;
287288
Int_t keep = fBufferSize; fBufferSize = 0;

hist/hist/src/TH3.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ Int_t TH3::BufferEmpty(Int_t action)
270270
}
271271
}
272272
if (xbinAuto || ybinAuto || zbinAuto) {
273-
THLimitsFinder::GetLimitsFinder()->FindGoodLimits(this, xmin, xmax, ymin, ymax, zmin, zmax, xbinAuto ? 0 : fXaxis.GetNbins(), ybinAuto ? 0 : fYaxis.GetNbins(), zbinAuto ? 0 : fZaxis.GetNbins());
273+
THLimitsFinder::GetLimitsFinder()->FindGoodLimitsXYZ(
274+
this, xmin, xmax, ymin, ymax, zmin, zmax, xbinAuto ? 0 : fXaxis.GetNbins(),
275+
ybinAuto ? 0 : fYaxis.GetNbins(), zbinAuto ? 0 : fZaxis.GetNbins());
274276
} else {
275277
fBuffer = nullptr;
276278
Int_t keep = fBufferSize; fBufferSize = 0;

hist/hist/src/THLimitsFinder.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ Int_t THLimitsFinder::FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax)
7777
/// If the bit kIsInteger is set, the number of channels is also recomputed.
7878
/// The axis parameters are replaced by the optimized parameters
7979

80-
Int_t THLimitsFinder::FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Int_t newbinsx,
81-
Int_t newbinsy)
80+
Int_t THLimitsFinder::FindGoodLimitsXY(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax,
81+
Int_t newbinsx, Int_t newbinsy)
8282
{
8383
TAxis *xaxis = h->GetXaxis();
8484
TAxis *yaxis = h->GetYaxis();
@@ -115,8 +115,8 @@ Int_t THLimitsFinder::FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax, Doubl
115115
/// If the bit kIsInteger is set, the number of channels is also recomputed.
116116
/// The axis parameters are replaced by the optimized parameters
117117

118-
Int_t THLimitsFinder::FindGoodLimits(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin,
119-
Double_t zmax, Int_t newbinsx, Int_t newbinsy, Int_t newbinsz)
118+
Int_t THLimitsFinder::FindGoodLimitsXYZ(TH1 *h, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax,
119+
Double_t zmin, Double_t zmax, Int_t newbinsx, Int_t newbinsy, Int_t newbinsz)
120120
{
121121
TAxis *xaxis = h->GetXaxis();
122122
TAxis *yaxis = h->GetYaxis();
@@ -171,8 +171,8 @@ THLimitsFinder *THLimitsFinder::GetLimitsFinder()
171171
////////////////////////////////////////////////////////////////////////////////
172172
/// This static function can be used to specify a finder derived from THLimitsFinder.
173173
///
174-
/// The finder may redefine the functions FindGoodLimits.
175-
/// Note that the redefined functions may call THLimitsFinder::FindGoodLimits.
174+
/// The finder may redefine the functions FindGoodLimits*.
175+
/// Note that the redefined functions may call THLimitsFinder::FindGoodLimits*.
176176

177177
void THLimitsFinder::SetLimitsFinder(THLimitsFinder *finder)
178178
{

hist/hist/src/TProfile2D.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ Int_t TProfile2D::BufferEmpty(Int_t action)
316316
if (y > ymax) ymax = y;
317317
}
318318
if (fXaxis.GetXmax() <= fXaxis.GetXmin() || fYaxis.GetXmax() <= fYaxis.GetXmin()) {
319-
THLimitsFinder::GetLimitsFinder()->FindGoodLimits(this,xmin,xmax,ymin,ymax);
319+
THLimitsFinder::GetLimitsFinder()->FindGoodLimitsXY(this, xmin, xmax, ymin, ymax);
320320
} else {
321321
fBuffer = nullptr;
322322
Int_t keep = fBufferSize; fBufferSize = 0;

hist/hist/src/TProfile3D.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Int_t TProfile3D::BufferEmpty(Int_t action)
276276
if (z > zmax) zmax = z;
277277
}
278278
if (fXaxis.GetXmax() <= fXaxis.GetXmin() || fYaxis.GetXmax() <= fYaxis.GetXmin() || fZaxis.GetXmax() <= fZaxis.GetXmin()) {
279-
THLimitsFinder::GetLimitsFinder()->FindGoodLimits(this,xmin,xmax,ymin,ymax,zmin,zmax);
279+
THLimitsFinder::GetLimitsFinder()->FindGoodLimitsXYZ(this, xmin, xmax, ymin, ymax, zmin, zmax);
280280
} else {
281281
fBuffer = nullptr;
282282
Int_t keep = fBufferSize; fBufferSize = 0;

tree/treeplayer/src/TSelectorDraw.cxx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,7 @@ void TSelectorDraw::TakeAction()
14021402
if (fVmin[1] > fVal[1][i]) fVmin[1] = fVal[1][i];
14031403
if (fVmax[1] < fVal[1][i]) fVmax[1] = fVal[1][i];
14041404
}
1405-
THLimitsFinder::GetLimitsFinder()->FindGoodLimits(h2, fVmin[1], fVmax[1], fVmin[0], fVmax[0]);
1405+
THLimitsFinder::GetLimitsFinder()->FindGoodLimitsXY(h2, fVmin[1], fVmax[1], fVmin[0], fVmax[0]);
14061406
}
14071407
TGraph *pm = new TGraph(fNfill, fVal[1], fVal[0]);
14081408
pm->SetEditable(false);
@@ -1588,7 +1588,7 @@ void TSelectorDraw::TakeEstimate()
15881588
if (fVmin[1] > fVal[1][i]) fVmin[1] = fVal[1][i];
15891589
if (fVmax[1] < fVal[1][i]) fVmax[1] = fVal[1][i];
15901590
}
1591-
THLimitsFinder::GetLimitsFinder()->FindGoodLimits(h2, fVmin[1], fVmax[1], fVmin[0], fVmax[0]);
1591+
THLimitsFinder::GetLimitsFinder()->FindGoodLimitsXY(h2, fVmin[1], fVmax[1], fVmin[0], fVmax[0]);
15921592
}
15931593
for (i = 0; i < fNfill; i++) h2->Fill(fVal[1][i], fVal[0][i], fW[i]);
15941594
//__________________________Profile histogram_______________________
@@ -1614,7 +1614,7 @@ void TSelectorDraw::TakeEstimate()
16141614
if (fVmin[1] > fVal[1][i]) fVmin[1] = fVal[1][i];
16151615
if (fVmax[1] < fVal[1][i]) fVmax[1] = fVal[1][i];
16161616
}
1617-
THLimitsFinder::GetLimitsFinder()->FindGoodLimits(h2, fVmin[1], fVmax[1], fVmin[0], fVmax[0]);
1617+
THLimitsFinder::GetLimitsFinder()->FindGoodLimitsXY(h2, fVmin[1], fVmax[1], fVmin[0], fVmax[0]);
16181618
// In case the new lower limits of h2 axis are 0, it is better to set them to the minimum of
16191619
// the data set (which should be >0) to avoid data cut when plotting in log scale.
16201620
TAxis *aX = h2->GetXaxis();
@@ -1701,7 +1701,7 @@ void TSelectorDraw::TakeEstimate()
17011701
if (fVmax[2] < fVal[2][i]) fVmax[2] = fVal[2][i];
17021702
}
17031703
}
1704-
THLimitsFinder::GetLimitsFinder()->FindGoodLimits(h2, fVmin[1], fVmax[1], fVmin[0], fVmax[0]);
1704+
THLimitsFinder::GetLimitsFinder()->FindGoodLimitsXY(h2, fVmin[1], fVmax[1], fVmin[0], fVmax[0]);
17051705
// In case the new lower limits of h2 axis are 0, it is better to set them to the minimum of
17061706
// the data set (which should be >0) to avoid data cut when plotting in log scale.
17071707
TAxis *aX = h2->GetXaxis();
@@ -1731,7 +1731,8 @@ void TSelectorDraw::TakeEstimate()
17311731
if (fVmin[2] > fVal[2][i]) fVmin[2] = fVal[2][i];
17321732
if (fVmax[2] < fVal[2][i]) fVmax[2] = fVal[2][i];
17331733
}
1734-
THLimitsFinder::GetLimitsFinder()->FindGoodLimits(h3, fVmin[2], fVmax[2], fVmin[1], fVmax[1], fVmin[0], fVmax[0]);
1734+
THLimitsFinder::GetLimitsFinder()->FindGoodLimitsXYZ(h3, fVmin[2], fVmax[2], fVmin[1], fVmax[1], fVmin[0],
1735+
fVmax[0]);
17351736
}
17361737
if (fAction == 3) {
17371738
for (i = 0; i < fNfill; i++) h3->Fill(fVal[2][i], fVal[1][i], fVal[0][i], fW[i]);
@@ -1783,7 +1784,7 @@ void TSelectorDraw::TakeEstimate()
17831784
if (fVmin[2] > fVal[2][i]) fVmin[2] = fVal[2][i];
17841785
if (fVmax[2] < fVal[2][i]) fVmax[2] = fVal[2][i];
17851786
}
1786-
THLimitsFinder::GetLimitsFinder()->FindGoodLimits(hp, fVmin[2], fVmax[2], fVmin[1], fVmax[1]);
1787+
THLimitsFinder::GetLimitsFinder()->FindGoodLimitsXY(hp, fVmin[2], fVmax[2], fVmin[1], fVmax[1]);
17871788
}
17881789
for (i = 0; i < fNfill; i++) hp->Fill(fVal[2][i], fVal[1][i], fVal[0][i], fW[i]);
17891790
//__________________________4D scatter plot_______________________
@@ -1804,7 +1805,8 @@ void TSelectorDraw::TakeEstimate()
18041805
if (fVmin[3] > fVal[3][i]) fVmin[3] = fVal[3][i];
18051806
if (fVmax[3] < fVal[3][i]) fVmax[3] = fVal[3][i];
18061807
}
1807-
THLimitsFinder::GetLimitsFinder()->FindGoodLimits(h3, fVmin[2], fVmax[2], fVmin[1], fVmax[1], fVmin[0], fVmax[0]);
1808+
THLimitsFinder::GetLimitsFinder()->FindGoodLimitsXYZ(h3, fVmin[2], fVmax[2], fVmin[1], fVmax[1], fVmin[0],
1809+
fVmax[0]);
18081810
} else {
18091811
for (i = 0; i < fNfill; i++) {
18101812
if (fVmin[3] > fVal[3][i]) fVmin[3] = fVal[3][i];

0 commit comments

Comments
 (0)