From 03d01e7d4ffc61c800dc2a65772d86d6e370217d Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Wed, 2 Sep 2026 06:06:47 +0000 Subject: [PATCH] [core] Add missing standard library includes Several files use std::cout/std::cerr or std::ostream without including or themselves, and only compile because Math/ParamFunctor.h transitively pulls in . Add the includes where they are used, so that ParamFunctor.h can drop its own include without breaking these translation units. Where a file already listed standard library headers before its ROOT includes, reorder them to follow the convention of ROOT headers first, then other libraries, then the standard library. --- hist/hist/src/TEfficiency.cxx | 15 ++++++++------- hist/hist/src/TF12.cxx | 1 + hist/hist/test/test_tkde.cxx | 1 + math/mathcore/test/fit/testGraphFit.cxx | 1 + math/mathcore/test/testDistSampler.cxx | 3 +++ test/stress.cxx | 4 +++- tutorials/analysis/unfold/testUnfold2.C | 2 ++ tutorials/hist/hist101_TH1_autobinning.C | 2 ++ tutorials/math/fit/FitHistoInFile.C | 2 ++ tutorials/math/goftest.C | 4 +++- 10 files changed, 26 insertions(+), 9 deletions(-) diff --git a/hist/hist/src/TEfficiency.cxx b/hist/hist/src/TEfficiency.cxx index 18ceb70536091..eefa76d5a277c 100644 --- a/hist/hist/src/TEfficiency.cxx +++ b/hist/hist/src/TEfficiency.cxx @@ -1,13 +1,6 @@ #ifndef ROOT_TEfficiency_cxx #define ROOT_TEfficiency_cxx -//standard header -#include -#include -#include -#include -#include - //ROOT headers #include "Math/DistFuncMathCore.h" #include "TBinomialEfficiencyFitter.h" @@ -33,6 +26,14 @@ // file with extra class for FC method #include "TEfficiencyHelper.h" +//standard header +#include +#include +#include +#include +#include +#include + //default values const Double_t kDefBetaAlpha = 1; const Double_t kDefBetaBeta = 1; diff --git a/hist/hist/src/TF12.cxx b/hist/hist/src/TF12.cxx index 3ce7ba0939bb3..5d41745e241da 100644 --- a/hist/hist/src/TF12.cxx +++ b/hist/hist/src/TF12.cxx @@ -13,6 +13,7 @@ #include "TH1.h" #include "TVirtualPad.h" +#include /** \class TF12 \ingroup Functions diff --git a/hist/hist/test/test_tkde.cxx b/hist/hist/test/test_tkde.cxx index 3d828a9b765eb..0f2fdc0b90d6f 100644 --- a/hist/hist/test/test_tkde.cxx +++ b/hist/hist/test/test_tkde.cxx @@ -10,6 +10,7 @@ #include "TH1.h" #include "Math/DistFuncMathCore.h" +#include struct TestKDE { diff --git a/math/mathcore/test/fit/testGraphFit.cxx b/math/mathcore/test/fit/testGraphFit.cxx index e04772e4f4048..0b8efc9e82149 100644 --- a/math/mathcore/test/fit/testGraphFit.cxx +++ b/math/mathcore/test/fit/testGraphFit.cxx @@ -20,6 +20,7 @@ #include "TStyle.h" #include +#include #include #include diff --git a/math/mathcore/test/testDistSampler.cxx b/math/mathcore/test/testDistSampler.cxx index 2e32a475c2066..86e2b4d082acc 100644 --- a/math/mathcore/test/testDistSampler.cxx +++ b/math/mathcore/test/testDistSampler.cxx @@ -9,6 +9,9 @@ #include "TRandom.h" #include "TError.h" #include "TCanvas.h" + +#include + // double Pdf(double x) { // } diff --git a/test/stress.cxx b/test/stress.cxx index b52e6600a02cd..51c814e2ff9a7 100644 --- a/test/stress.cxx +++ b/test/stress.cxx @@ -71,7 +71,6 @@ //_____________________________batch only_____________________ #ifndef __CLING__ -#include #include #include #include @@ -100,6 +99,9 @@ #include #include "Event.h" +#include +#include + void stress(Int_t nevent, Int_t style, Int_t printSubBenchmark, UInt_t portion ); void stress1(); void stress2(); diff --git a/tutorials/analysis/unfold/testUnfold2.C b/tutorials/analysis/unfold/testUnfold2.C index 6c997314b268c..c1e6fa8fa6ee5 100644 --- a/tutorials/analysis/unfold/testUnfold2.C +++ b/tutorials/analysis/unfold/testUnfold2.C @@ -78,6 +78,8 @@ #include #include "TUnfold.h" +#include + TRandom *rnd=nullptr; diff --git a/tutorials/hist/hist101_TH1_autobinning.C b/tutorials/hist/hist101_TH1_autobinning.C index dc19339939595..f3f838d716710 100644 --- a/tutorials/hist/hist101_TH1_autobinning.C +++ b/tutorials/hist/hist101_TH1_autobinning.C @@ -19,6 +19,8 @@ #include "TFile.h" #include "TStyle.h" +#include + TF1 *gam = new TF1("gam", "1/(1+0.1*x*0.1*x)", -100., 100.); TF1 *gam1 = new TF1("gam", "1/(1+0.1*x*0.1*x)", -1., .25); TF1 *iga = new TF1("inv gam", "1.-1/(1+0.1*x*0.1*x)", -100., 100.); diff --git a/tutorials/math/fit/FitHistoInFile.C b/tutorials/math/fit/FitHistoInFile.C index 2b79f43513dbd..50f9dd07789d6 100644 --- a/tutorials/math/fit/FitHistoInFile.C +++ b/tutorials/math/fit/FitHistoInFile.C @@ -19,6 +19,8 @@ #include "TFile.h" #include "TStyle.h" +#include + // Function parameters are passed as an array to TF1. Here, we // define the position of each parameter in this array. // Note: N_PAR will give us the total number of parameters. Make diff --git a/tutorials/math/goftest.C b/tutorials/math/goftest.C index 8d36e2071ed7d..256fb796a1545 100644 --- a/tutorials/math/goftest.C +++ b/tutorials/math/goftest.C @@ -13,7 +13,6 @@ /// /// \author Bartolomeu Rabacal -#include #include "TCanvas.h" #include "TPaveText.h" #include "TH1.h" @@ -23,6 +22,9 @@ #include "TRandom3.h" #include "Math/DistFunc.h" +#include +#include + // need to use Functor1D double landau(double x) { return ROOT::Math::landau_pdf(x);