Skip to content

Commit 0982be1

Browse files
committed
clang-format
1 parent 6953483 commit 0982be1

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

hist/hist/src/TH1.cxx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3362,8 +3362,9 @@ void TH1::FillRandom(TH1 *h, Int_t ntimes)
33623362
if (fDimension != h->GetDimension()) {
33633363
Error("FillRandom", "Histograms with different dimensions"); return;
33643364
}
3365-
if (std::isnan( h->ComputeIntegral(true) )) {
3366-
Error("FillRandom", "Histograms contains negative bins, does not represent probabilities"); return;
3365+
if (std::isnan(h->ComputeIntegral(true))) {
3366+
Error("FillRandom", "Histograms contains negative bins, does not represent probabilities");
3367+
return;
33673368
}
33683369

33693370
//in case the target histogram has the same binning and ntimes much greater
@@ -4593,7 +4594,7 @@ Double_t TH1::GetRandom() const
45934594
}
45944595
Int_t nbinsx = GetNbinsX();
45954596
// compute integral checking that all bins have positive content (see ROOT-5894)
4596-
Double_t integral = ((TH1*)this)->ComputeIntegral(true);
4597+
Double_t integral = ((TH1 *)this)->ComputeIntegral(true);
45974598
if (integral == 0) return 0;
45984599
// return a NaN in case some bins have negative content
45994600
if (integral == TMath::QuietNaN() ) return TMath::QuietNaN();
@@ -7478,13 +7479,14 @@ Double_t TH1::KolmogorovTest(const TH1 *h2, Option_t *option) const
74787479
const Int_t nEXPT = 1000;
74797480
if (opt.Contains("X") && !(afunc1 || afunc2 ) ) {
74807481
Double_t dSEXPT;
7481-
TH1 *h1_cpy = (TH1*)(gDirectory ? gDirectory->CloneObject(this,kFALSE) : gROOT->CloneObject(this,kFALSE));
7482+
TH1 *h1_cpy = (TH1 *)(gDirectory ? gDirectory->CloneObject(this, kFALSE) : gROOT->CloneObject(this, kFALSE));
74827483
TH1 *hExpt = (TH1*)(gDirectory ? gDirectory->CloneObject(this,kFALSE) : gROOT->CloneObject(this,kFALSE));
74837484

74847485
if (h1_cpy->GetMinimum() < 0.0) {
7485-
// With negative bins we can't draw random samples in a meaningful way.
7486-
Warning("KolmogorovTest", "Detected bins with negative weights, these have been ignored and output might be skewed. Reduce number of bins for histogram?");
7487-
while(h1_cpy->GetMinimum() < 0.0) {
7486+
// With negative bins we can't draw random samples in a meaningful way.
7487+
Warning("KolmogorovTest", "Detected bins with negative weights, these have been ignored and output might be "
7488+
"skewed. Reduce number of bins for histogram?");
7489+
while (h1_cpy->GetMinimum() < 0.0) {
74887490
Int_t idx = h1_cpy->GetMinimumBin();
74897491
h1_cpy->SetBinContent(idx, 0.0);
74907492
}
@@ -7494,7 +7496,7 @@ Double_t TH1::KolmogorovTest(const TH1 *h2, Option_t *option) const
74947496
prb3 = 0;
74957497
for (Int_t i=0; i < nEXPT; i++) {
74967498
hExpt->Reset();
7497-
hExpt->FillRandom(h1_cpy,(Int_t)esum2);
7499+
hExpt->FillRandom(h1_cpy, (Int_t)esum2);
74987500
dSEXPT = KolmogorovTest(hExpt,"M");
74997501
if (dSEXPT>dfmax) prb3 += 1.0;
75007502
}

0 commit comments

Comments
 (0)