diff --git a/documentation/doxygen/converttonotebook.py b/documentation/doxygen/converttonotebook.py index f0adc778df95e..f7383c96fabd5 100644 --- a/documentation/doxygen/converttonotebook.py +++ b/documentation/doxygen/converttonotebook.py @@ -261,7 +261,7 @@ def readHeaderCpp(text): newtext = '' for line in lines[i:]: newtext += (line + "\n") - + description = description.replace("\\f$", "$") return newtext, description, author, isNotebook, isJsroot, nodraw, needsHeaderFile @@ -488,25 +488,22 @@ def processmain(text): ... }''') ('TCanvas function(){\\n content of function\\n spanning several\\n lines\\n return c1\\n}', '\\n# \\n# Call the main function \\n# \\nfunction();', True , '') """ - callMainFunction = '' argumentsCell = '' - keepFunction = False - argumentesre = re.compile(r'(?<=\().*?(?=\))', flags = re.DOTALL | re.MULTILINE) - arguments = argumentesre.search(text) + argumentsre = re.compile(r'(?<=\().*?(?=\))', flags = re.DOTALL | re.MULTILINE) + arguments = argumentsre.search(text) if len(arguments.group()) > 3: + print arguments.group() argumentsCell = "# \n Arguments are defined. \n# \n" - argumentList = arguments.group().split(",") + #argumentList = arguments.group().split(",") + individualArgumentre = re.compile(r'[^/\n,]*?=[^/\n,]*') #, flags = re.DOTALL) #| re.MULTILINE) + argumentList=individualArgumentre.findall(arguments.group()) + for argument in argumentList: print "ARGUMENT:", argument , "\n\n\n" for argument in argumentList: - argumentsCell += argument.strip() + ";\n" + argumentsCell += argument.strip("\n ") + ";\n" argumentsCell += "# \n" - if text.startswith("TCanvas"): - keepfunction = True - functionname = findFunctionName(text) - callMainFunction = "\n# \n# Call the main function \n# \n%s();" % functionname - - return text, callMainFunction, keepFunction, argumentsCell + return text, argumentsCell # now define text transformers def removePaletteEditor(code): @@ -558,9 +555,23 @@ def foamRemoveIfndef(code): code = code.replace("#endif", "") return code + +def declareIncludes(code): + print code + code = re.sub(r"# \s*#include", "# \n%%cpp -d\n#include" , code) + print code + return code + +def tree4GetFiles(code): + if tutName == "tree4": + code = code.replace( + """#include \"../test/Event.h\"""" , """std::string tutDir = gROOT->GetTutorialsDir();\nTString headerDir = TString::Format("#include \\\"%s/roostats/NuMuToNuE_Oscillation.h\\\"", tutDir.c_str());\nTString impDir = TString::Format("#include \\\"%s/roostats/NuMuToNuE_Oscillation.cxx\\\"", tutDir.c_str());\ngROOT->ProcessLine(headerDir);\ngROOT->ProcessLine(impDir);""") + return code + def fixes(code): codeTransformers=[removePaletteEditor, runEventExe, getLibMathMore, - roofitRemoveSpacesComments, declareNamespace, rs401dGetFiles ,foamRemoveIfndef] + roofitRemoveSpacesComments, declareNamespace, rs401dGetFiles , + foamRemoveIfndef, declareIncludes] for transformer in codeTransformers: code = transformer(code) @@ -594,9 +605,8 @@ def mainfunction(text): # Modify text from macros to suit a notebook if isCpp(): main, helpers, rest = split(text) - main, callMainFunction, keepfunction, argumentsCell = processmain(main) - if not keepfunction: - main = cppComments(unindenter(cppFunction(main))) # Remove function, Unindent, and convert comments to Markdown cells + main, argumentsCell = processmain(main) + main = cppComments(unindenter(cppFunction(main))) # Remove function, Unindent, and convert comments to Markdown cells if argumentsCell: main = argumentsCell + main @@ -609,18 +619,12 @@ def mainfunction(text): text = "# \n# The header file must be copied to the current directory\n# \n.!cp %s%s.h .\n# \n" % (tutRelativePath, tutName) text += rest else: - text = rest + text = "# \n" + rest for helper in helpers: text += helper - if keepfunction: - text += "\n# \n# The main function is defined\n# \n%%cpp -d\n" - else: - text += "\n# \n" - text += main - if callMainFunction: - text += callMainFunction + text += ("\n# \n" + main) if extension == "py": text = pythonComments(text) # Convert comments into Markdown cells @@ -630,9 +634,9 @@ def mainfunction(text): text = fixes(text) # Add the title and header of the notebook - text = "# \n# # %s\n%s# \n# \n# **Author:** %s \n# This notebook tutorial " \ - "was automatically generated from the macro found in the ROOT repository " \ - "on %s.\n# \n%s" % (tutTitle, description, author, date, text) + text = "# \n# # %s\n%s# \n# \n# **Author:** %s \n# This notebook tutorial was automatically generated " \ + "with [ROOTBOOK-izer (Beta)](https://github.com/root-mirror/root/blob/master/documentation/doxygen/converttonotebook.py) " \ + "from the macro found in the ROOT repository on %s.\n# \n%s" % (tutTitle, description, author, date, text) # Add cell at the end of the notebook that draws all the canveses. Add a Markdown cell before explaining it. if isJsroot and not nodraw: @@ -702,7 +706,8 @@ def mainfunction(text): sys.stderr.write("NOTEBOOK_CONVERSION_WARNING: Nbconvert failed for notebook %s with return code %s\n" %(outname,r)) if isJsroot: subprocess.call(["jupyter", "trust", os.path.join(outdir + outnameconverted)]) - os.remove(outPathName) + if r == 0: # Only remove notebook without output if nbconvert succeedes + os.remove(outPathName) if __name__ == "__main__": diff --git a/documentation/doxygen/filter.cxx b/documentation/doxygen/filter.cxx index fe45badbddd12..97a43d5edf423 100644 --- a/documentation/doxygen/filter.cxx +++ b/documentation/doxygen/filter.cxx @@ -303,16 +303,8 @@ void FilterTutorial() if (gLineString.find("\\notebook") != string::npos) { ExecuteCommand(StringFormat("python converttonotebook.py %s %s/notebooks/", gFileName.c_str(), gOutDir.c_str())); - ReplaceAll(gLineString, "\\notebook -header -nodraw", StringFormat( "\\htmlonly \"View \"Open \\endhtmlonly", gMacroName.c_str() , gMacroName.c_str()) ); - - ReplaceAll(gLineString, "\\notebook -header", StringFormat( "\\htmlonly \"View \"Open \\endhtmlonly", gMacroName.c_str() , gMacroName.c_str()) ); - - ReplaceAll(gLineString, "\\notebook -js", StringFormat( "\\htmlonly \"View \"Open \\endhtmlonly", gMacroName.c_str() , gMacroName.c_str()) ); - - ReplaceAll(gLineString, "\\notebook -nodraw", StringFormat( "\\htmlonly \"View \"Open \\endhtmlonly", gMacroName.c_str() , gMacroName.c_str()) ); - - ReplaceAll(gLineString, "\\notebook", StringFormat( "\\htmlonly \"View \"Open \\endhtmlonly", gMacroName.c_str() , gMacroName.c_str()) ); + gLineString = StringFormat( "/// \\htmlonly \"View \"Open \\endhtmlonly \n", gMacroName.c_str() , gMacroName.c_str()); } // \macro_output found diff --git a/tutorials/cont/TListAndSTL.C b/tutorials/cont/TListAndSTL.C index 88c12e613ef0f..ad022864683fa 100644 --- a/tutorials/cont/TListAndSTL.C +++ b/tutorials/cont/TListAndSTL.C @@ -1,5 +1,6 @@ /// \file /// \ingroup tutorial_cont +/// \notebook -nodraw /// This is an example of using TList with STL algoritms in CINT. /// /// #### Output produced by `.x TListAndSTL.C` @@ -38,12 +39,9 @@ struct SEnumFunctor { // A functor for the find_if algorithm struct SFind { // using this ugly constructor, since there is problems with std::bindX in CINT -#ifdef __CINT__ - SFind(const SFind &oth) : fToFind(oth.fToFind) {} - SFind(const TString aStr): fToFind(aStr) { -#else + SFind(const TString &aStr): fToFind(aStr) { -#endif + } bool operator()(TObject *aObj) { TObjString *str(dynamic_cast(aObj)); @@ -60,19 +58,19 @@ void TListAndSTL() const Int_t size(10); // Initializing TList container - TList list; + TList list1; ostringstream ss; for (int i = 0; i < size; ++i) { ss << "test string #" << i; TObjString *s(new TObjString(ss.str().c_str())); - list.Add(s); + list1.Add(s); ss.str(""); } //->>>>>>> Example #1 <<<<<<<- // running the std::for_each algorithm on the list - TIter iter(&list); + TIter iter(&list1); for_each(iter.Begin(), TIter::End(), SEnumFunctor()); //->>>>>>> Example #2 <<<<<<<- @@ -82,16 +80,11 @@ void TListAndSTL() SFind func(strToFind.c_str()); -#ifdef __CINT__ - TIter found( - find_if(iter.Begin(), TIter::End(), func) - ); -#else // in compilation mode you need to use TIterCategory as an iterator for such a algorithm like find_if - TIterCategory iter_cat(&list); + + TIterCategory iter_cat(&list1); TIterCategory found( find_if(iter_cat.Begin(), TIterCategory::End(), func) ); -#endif // Checking the result if (!(*found)) { diff --git a/tutorials/eve/SplitGLView.C b/tutorials/eve/SplitGLView.C index 101b1f0f4a42f..c4cfe5ed49694 100644 --- a/tutorials/eve/SplitGLView.C +++ b/tutorials/eve/SplitGLView.C @@ -1435,12 +1435,6 @@ void SplitGLView::UpdateSummary() } } -// Linkdef -#ifdef __CINT__ - -#pragma link C++ class SplitGLView; - -#endif #ifdef __CINT__ void SplitGLView() diff --git a/tutorials/eve/alice_vsd.C b/tutorials/eve/alice_vsd.C index 03c0123d09757..0ed1bea49fb5a 100644 --- a/tutorials/eve/alice_vsd.C +++ b/tutorials/eve/alice_vsd.C @@ -19,15 +19,6 @@ /// /// \author Matevz Tadel -#if defined(__CINT__) && !defined(__MAKECINT__) -{ - Info("alice_vsd.C", - "Has to be run in compiled mode ... doing this for you."); - gSystem->CompileMacro("alice_vsd.C"); - alice_vsd(); -} -#else - #include #include diff --git a/tutorials/eve/boxset.C b/tutorials/eve/boxset.C index 4f790c16ac31e..bd1966ddc93d9 100644 --- a/tutorials/eve/boxset.C +++ b/tutorials/eve/boxset.C @@ -13,7 +13,6 @@ TEveBoxSet* boxset(Float_t x=0, Float_t y=0, Float_t z=0, TEveManager::Create(); TRandom r(0); - gStyle->SetPalette(1, 0); TEveRGBAPalette* pal = new TEveRGBAPalette(0, 130); @@ -114,7 +113,6 @@ TEveBoxSet* boxset_freebox(Int_t num=100, Bool_t registerSet=kTRUE) TEveManager::Create(); TRandom r(0); - gStyle->SetPalette(1, 0); TEveRGBAPalette* pal = new TEveRGBAPalette(0, 130); diff --git a/tutorials/eve/boxset_cones.C b/tutorials/eve/boxset_cones.C index 9dad6c5926e1f..314dedae3acd1 100644 --- a/tutorials/eve/boxset_cones.C +++ b/tutorials/eve/boxset_cones.C @@ -19,7 +19,6 @@ TEveBoxSet* boxset_cones(Float_t x=0, Float_t y=0, Float_t z=0, lines->SetLineWidth(2); TRandom r(0); - gStyle->SetPalette(1, 0); TEveRGBAPalette* pal = new TEveRGBAPalette(0, 500); TEveBoxSet* cones = new TEveBoxSet("ConeSet"); cones->SetPalette(pal); diff --git a/tutorials/eve/calorimeters.C b/tutorials/eve/calorimeters.C index b0fc511c32ebd..442f15a971899 100644 --- a/tutorials/eve/calorimeters.C +++ b/tutorials/eve/calorimeters.C @@ -98,7 +98,6 @@ TEveCaloLego* MakeCaloLego(TEveCaloData* data, TEveWindowSlot* slot) v->SetElementName("Viewer - Lego"); s->SetElementName("Scene - Lego"); - gStyle->SetPalette(1, 0); TEveCaloLego* lego = new TEveCaloLego(data); s->AddElement(lego); diff --git a/tutorials/eve/jetcone.C b/tutorials/eve/jetcone.C index ee7c3652c916d..04451c1c2e66c 100644 --- a/tutorials/eve/jetcone.C +++ b/tutorials/eve/jetcone.C @@ -29,7 +29,6 @@ void jetcone() Float_t length = 300.; // -- Define palette - gStyle->SetPalette(1, 0); TEveRGBAPalette* pal = new TEveRGBAPalette(0, 500); // ----------------------------------------------------------------------- diff --git a/tutorials/eve/pointset.C b/tutorials/eve/pointset.C index 754a079801d17..8e01c26e154ee 100644 --- a/tutorials/eve/pointset.C +++ b/tutorials/eve/pointset.C @@ -7,8 +7,6 @@ /// /// \author Matevz Tadel -#ifndef __CINT__ - #include #include #include @@ -16,7 +14,6 @@ #include #include -#endif TEvePointSet* pointset(Int_t npoints = 512, TEveElement* parent=0) { diff --git a/tutorials/eve/quadset.C b/tutorials/eve/quadset.C index f592a946d849c..ed7401fd53283 100644 --- a/tutorials/eve/quadset.C +++ b/tutorials/eve/quadset.C @@ -13,7 +13,6 @@ TEveQuadSet* quadset(Float_t x=0, Float_t y=0, Float_t z=0, TEveManager::Create(); TRandom r(0); - gStyle->SetPalette(1, 0); TEveRGBAPalette *pal = new TEveRGBAPalette(0, 130); TEveFrameBox *box = new TEveFrameBox(); @@ -73,7 +72,6 @@ TEveQuadSet* quadset_emc(Float_t x=0, Float_t y=0, Float_t z=0, Int_t num=100) TEveManager::Create(); TRandom r(0); - gStyle->SetPalette(1, 0); TEveQuadSet* q = new TEveQuadSet("EMC Supermodule"); q->SetOwnIds(kTRUE); @@ -103,7 +101,6 @@ TEveQuadSet* quadset_circ() TEveManager::Create(); TRandom rnd(0); - gStyle->SetPalette(1, 0); Float_t R = 10, dW = 1, dH = .5; @@ -152,7 +149,6 @@ TEveQuadSet* quadset_hex(Float_t x=0, Float_t y=0, Float_t z=0, TEveManager::Create(); TRandom r(0); - gStyle->SetPalette(1, 0); { TEveQuadSet* q = new TEveQuadSet("HexagonXY"); @@ -209,7 +205,6 @@ TEveQuadSet* quadset_hexid(Float_t x=0, Float_t y=0, Float_t z=0, TEveManager::Create(); TRandom r(0); - gStyle->SetPalette(1, 0); TEveQuadSet* q = new TEveQuadSet("HexagonXY"); @@ -252,7 +247,6 @@ void quadset_hierarchy(Int_t n=4) { TEveManager::Create(); - gStyle->SetPalette(1, 0); TEveRGBAPalette* pal = new TEveRGBAPalette(20, 100); pal->SetLimits(0, 120); diff --git a/tutorials/eve/track.C b/tutorials/eve/track.C index e5c17da3e98a7..38302fc45c0cf 100644 --- a/tutorials/eve/track.C +++ b/tutorials/eve/track.C @@ -23,14 +23,6 @@ /// /// \author Alja Mrak-Tadel -#if defined(__CINT__) && !defined(__MAKECINT__) -{ - Info("track.C", - "Has to be run in compiled mode, esp. if you want to pass parameters."); - gSystem->CompileMacro("track.C"); - track(); -} -#else #include "TEveTrackPropagator.h" #include "TEveTrack.h" @@ -172,10 +164,6 @@ TEveTrack* make_track(TEveTrackPropagator* prop, Int_t sign) void track(Int_t mode = 1, Bool_t isRungeKutta = kTRUE) { -#if defined (__CINT__) - Error("track.C", "Must be run in compiled mode!"); - return; -#endif gSystem->IgnoreSignal(kSigSegmentationViolation, true); TEveManager::Create(); diff --git a/tutorials/eve/triangleset.C b/tutorials/eve/triangleset.C index 6054c347cb9c7..fa37dffd4e94c 100644 --- a/tutorials/eve/triangleset.C +++ b/tutorials/eve/triangleset.C @@ -49,7 +49,6 @@ void triangleset() ts3 = TEveTriangleSet::ReadTrivialFile("broken_torus.tring"); ts3->SetName("Spectrum"); ts3->GenerateTriangleNormals(); - gStyle->SetPalette(1, 0); ts3->GenerateZNormalColors(50, -50, 50, kTRUE, kTRUE); ts3->SetMainColor(0); TGeoHMatrix m; diff --git a/tutorials/fit/ConfidenceIntervals.C b/tutorials/fit/ConfidenceIntervals.C index 9193dfa9cac99..1cddc7cf24ccf 100644 --- a/tutorials/fit/ConfidenceIntervals.C +++ b/tutorials/fit/ConfidenceIntervals.C @@ -1,6 +1,6 @@ /// \file /// \ingroup tutorial_fit -/// \notebook -js +/// \notebook /// Illustrates TVirtualFitter::GetConfidenceIntervals /// This method computes confidence intervals for the fitted function /// diff --git a/tutorials/fit/graph2dfit.C b/tutorials/fit/graph2dfit.C index bdec93e8b0ba3..3086a6e5bc99f 100644 --- a/tutorials/fit/graph2dfit.C +++ b/tutorials/fit/graph2dfit.C @@ -77,7 +77,6 @@ TCanvas* graph2dfit() h3->Fill(f2->Eval(x,y)-z); } - gStyle->SetPalette(1); c->cd(1); f2->SetTitle("Original function with Graph2D points on top"); f2->SetMaximum(zmax); diff --git a/tutorials/fit/line3Dfit.C b/tutorials/fit/line3Dfit.C index 80a2ec5532c5c..289f5e66da948 100644 --- a/tutorials/fit/line3Dfit.C +++ b/tutorials/fit/line3Dfit.C @@ -40,19 +40,8 @@ void line(double t, const double *p, double &x, double &y, double &z) { z = t; } -// calculate distance line-point -double distance2(double x,double y,double z, const double *p) { - // distance line point is D= | (xp-x0) cross ux | - // where ux is direction of line and x0 is a point in the line (like t = 0) - XYZVector xp(x,y,z); - XYZVector x0(p[0], p[2], 0. ); - XYZVector x1(p[0] + p[1], p[2] + p[3], 1. ); - XYZVector u = (x1-x0).Unit(); - double d2 = ((xp-x0).Cross(u)) .Mag2(); - return d2; -} -bool first = true; +bool first = true; // function Object to be minimized struct SumDistance2 { @@ -61,6 +50,18 @@ struct SumDistance2 { SumDistance2(TGraph2D * g) : fGraph(g) {} + // calculate distance line-point + double distance2(double x,double y,double z, const double *p) { + // distance line point is D= | (xp-x0) cross ux | + // where ux is direction of line and x0 is a point in the line (like t = 0) + XYZVector xp(x,y,z); + XYZVector x0(p[0], p[2], 0. ); + XYZVector x1(p[0] + p[1], p[2] + p[3], 1. ); + XYZVector u = (x1-x0).Unit(); + double d2 = ((xp-x0).Cross(u)) .Mag2(); + return d2; + } + // implementation of the function to be minimized double operator() (const double * par) { diff --git a/tutorials/fit/minuit2GausFit.C b/tutorials/fit/minuit2GausFit.C index 2f31de53e51ba..e760c6843c210 100644 --- a/tutorials/fit/minuit2GausFit.C +++ b/tutorials/fit/minuit2GausFit.C @@ -23,60 +23,60 @@ void testGausFit( std::string type = "Minuit2", int n = 1000) { - gRandom = new TRandom3(); - - TVirtualFitter::SetDefaultFitter(type.c_str() ); - - std::string name; - name = "h1_" + type; - TH1D * h1 = new TH1D(name.c_str(),"Chi2 Fit",100, -5, 5. ); - name = "h2_" + type; - TH1D * h2 = new TH1D(name.c_str(),"Chi2 Fit with Minos Error",100, -5, 5. ); - name = "h3_" + type; - TH1D * h3 = new TH1D(name.c_str(),"Chi2 Fit with Integral and Minos",100, -5, 5. ); - name = "h4_" + type; - TH1D * h4 = new TH1D(name.c_str(),"Likelihood Fit with Minos Error",100, -5, 5. ); - - gStyle->SetOptStat(1111111); - gStyle->SetOptFit(1111111); - - for (int i = 0; i < n; ++i) { - double x = gRandom->Gaus(0,1); - h1->Fill( x ); - h2->Fill( x ); - h3->Fill( x ); - h4->Fill( x ); - } - - std::string cname = type + "Canvas" ; - std::string ctitle = type + " Gaussian Fit" ; - TCanvas *c1 = new TCanvas(cname.c_str(),cname.c_str(),10,10,900,900); - c1->Divide(2,2); - - c1->cd(1); - cout << "\nDo Fit 1\n"; - h1->Fit("gaus","Q"); - h1->Draw(); - c1->cd(2); - cout << "\nDo Fit 2\n"; - h2->Fit("gaus","VE"); - h2->Draw(); - c1->cd(3); - cout << "\nDo Fit 3\n"; - h3->Fit("gaus","IE"); - h3->Draw(); - c1->cd(4); - cout << "\nDo Fit 4\n"; - h4->Fit("gaus","VLE"); - h4->Draw(); + gRandom = new TRandom3(); + + TVirtualFitter::SetDefaultFitter(type.c_str() ); + + std::string name; + name = "h1_" + type; + TH1D * h1 = new TH1D(name.c_str(),"Chi2 Fit",100, -5, 5. ); + name = "h2_" + type; + TH1D * h2 = new TH1D(name.c_str(),"Chi2 Fit with Minos Error",100, -5, 5. ); + name = "h3_" + type; + TH1D * h3 = new TH1D(name.c_str(),"Chi2 Fit with Integral and Minos",100, -5, 5. ); + name = "h4_" + type; + TH1D * h4 = new TH1D(name.c_str(),"Likelihood Fit with Minos Error",100, -5, 5. ); + + gStyle->SetOptStat(1111111); + gStyle->SetOptFit(1111111); + + for (int i = 0; i < n; ++i) { + double x = gRandom->Gaus(0,1); + h1->Fill( x ); + h2->Fill( x ); + h3->Fill( x ); + h4->Fill( x ); + } + + std::string cname = type + "Canvas" ; + std::string ctitle = type + " Gaussian Fit" ; + TCanvas *c1 = new TCanvas(cname.c_str(),cname.c_str(),10,10,900,900); + c1->Divide(2,2); + + c1->cd(1); + cout << "\nDo Fit 1\n"; + h1->Fit("gaus","Q"); + h1->Draw(); + c1->cd(2); + cout << "\nDo Fit 2\n"; + h2->Fit("gaus","VE"); + h2->Draw(); + c1->cd(3); + cout << "\nDo Fit 3\n"; + h3->Fit("gaus","IE"); + h3->Draw(); + c1->cd(4); + cout << "\nDo Fit 4\n"; + h4->Fit("gaus","VLE"); + h4->Draw(); } void minuit2GausFit() { - int n = 1000; - testGausFit("Minuit2",n); - testGausFit("Fumili2",n); + int n = 1000; + testGausFit("Minuit2",n); + testGausFit("Fumili2",n); } diff --git a/tutorials/fit/multidimfit.C b/tutorials/fit/multidimfit.C index 9938e7aa9a33c..0e0e03da8de17 100644 --- a/tutorials/fit/multidimfit.C +++ b/tutorials/fit/multidimfit.C @@ -39,240 +39,240 @@ void makeData(Double_t* x, Double_t& d, Double_t& e) //____________________________________________________________________ int CompareResults(TMultiDimFit *fit, bool doFit) { - //Compare results with reference run - - - // the right coefficients (before fit) - double GoodCoeffsNoFit[] = { - -4.37056, - 43.1468, - 13.432, - 13.4632, - 13.3964, - 13.328, - 13.3016, - 13.3519, - 4.49724, - 4.63876, - 4.89036, - -3.69982, - -3.98618, - -3.86195, - 4.36054, - -4.02597, - 4.57037, - 4.69845, - 2.83819, - -3.48855, - -3.97612 - }; - - // the right coefficients (after fit) - double GoodCoeffs[] = { - -4.399, - 43.15, - 13.41, - 13.49, - 13.4, - 13.23, - 13.34, - 13.29, - 4.523, - 4.659, - 4.948, - -4.026, - -4.045, - -3.939, - 4.421, - -4.006, - 4.626, - 4.378, - 3.516, - -4.111, - -3.823, - }; - -// Good Powers - int GoodPower[] = { - 1, 1, 1, 1, - 2, 1, 1, 1, - 1, 1, 1, 2, - 1, 1, 2, 1, - 1, 2, 1, 1, - 2, 2, 1, 1, - 2, 1, 1, 2, - 2, 1, 2, 1, - 1, 1, 1, 3, - 1, 3, 1, 1, - 1, 1, 5, 1, - 1, 1, 2, 2, - 1, 2, 1, 2, - 1, 2, 2, 1, - 2, 1, 1, 3, - 2, 2, 1, 2, - 2, 1, 3, 1, - 2, 3, 1, 1, - 1, 2, 2, 2, - 2, 1, 2, 2, - 2, 2, 2, 1 - }; - - Int_t nc = fit->GetNCoefficients(); - Int_t nv = fit->GetNVariables(); - const Int_t *powers = fit->GetPowers(); - const Int_t *pindex = fit->GetPowerIndex(); - if (nc != 21) return 1; - const TVectorD *coeffs = fit->GetCoefficients(); - int k = 0; - for (Int_t i=0;i 5e-5) return 2; - } - for (Int_t j=0;jProcessLine(".L MDF.C"); - - Double_t refMDF = (doFit) ? 43.95 : 43.98; - // this does not work in CLing since the function is not defined - //Double_t x[] = {5,5,5,5}; - //Double_t rMDF = MDF(x); - //LM: need to return the address of the result since it is casted to a long (this should not be in a tutorial !) - Long_t iret = gROOT->ProcessLine(" Double_t x[] = {5,5,5,5}; double result=MDF(x); &result;"); - Double_t rMDF = * ( (Double_t*)iret); - //printf("%f\n",rMDF); - if (TMath::Abs(rMDF -refMDF) > 1e-2) return 4; - return 0; + //Compare results with reference run + + + // the right coefficients (before fit) + double GoodCoeffsNoFit[] = { + -4.37056, + 43.1468, + 13.432, + 13.4632, + 13.3964, + 13.328, + 13.3016, + 13.3519, + 4.49724, + 4.63876, + 4.89036, + -3.69982, + -3.98618, + -3.86195, + 4.36054, + -4.02597, + 4.57037, + 4.69845, + 2.83819, + -3.48855, + -3.97612 + }; + + // the right coefficients (after fit) + double GoodCoeffs[] = { + -4.399, + 43.15, + 13.41, + 13.49, + 13.4, + 13.23, + 13.34, + 13.29, + 4.523, + 4.659, + 4.948, + -4.026, + -4.045, + -3.939, + 4.421, + -4.006, + 4.626, + 4.378, + 3.516, + -4.111, + -3.823, + }; + + // Good Powers + int GoodPower[] = { + 1, 1, 1, 1, + 2, 1, 1, 1, + 1, 1, 1, 2, + 1, 1, 2, 1, + 1, 2, 1, 1, + 2, 2, 1, 1, + 2, 1, 1, 2, + 2, 1, 2, 1, + 1, 1, 1, 3, + 1, 3, 1, 1, + 1, 1, 5, 1, + 1, 1, 2, 2, + 1, 2, 1, 2, + 1, 2, 2, 1, + 2, 1, 1, 3, + 2, 2, 1, 2, + 2, 1, 3, 1, + 2, 3, 1, 1, + 1, 2, 2, 2, + 2, 1, 2, 2, + 2, 2, 2, 1 + }; + + Int_t nc = fit->GetNCoefficients(); + Int_t nv = fit->GetNVariables(); + const Int_t *powers = fit->GetPowers(); + const Int_t *pindex = fit->GetPowerIndex(); + if (nc != 21) return 1; + const TVectorD *coeffs = fit->GetCoefficients(); + int k = 0; + for (Int_t i=0;i 5e-5) return 2; + } + for (Int_t j=0;jProcessLine(".L MDF.C"); + + Double_t refMDF = (doFit) ? 43.95 : 43.98; + // this does not work in CLing since the function is not defined + //Double_t x[] = {5,5,5,5}; + //Double_t rMDF = MDF(x); + //LM: need to return the address of the result since it is casted to a long (this should not be in a tutorial !) + Long_t iret = gROOT->ProcessLine(" Double_t xvalues[] = {5,5,5,5}; double result=MDF(xvalues); &result;"); + Double_t rMDF = * ( (Double_t*)iret); + //printf("%f\n",rMDF); + if (TMath::Abs(rMDF -refMDF) > 1e-2) return 4; + return 0; } //____________________________________________________________________ Int_t multidimfit(bool doFit = true) { - cout << "*************************************************" << endl; - cout << "* Multidimensional Fit *" << endl; - cout << "* *" << endl; - cout << "* By Christian Holm 14/10/00 *" << endl; - cout << "*************************************************" << endl; - cout << endl; + cout << "*************************************************" << endl; + cout << "* Multidimensional Fit *" << endl; + cout << "* *" << endl; + cout << "* By Christian Holm 14/10/00 *" << endl; + cout << "*************************************************" << endl; + cout << endl; - // Initialize global TRannom object. - gRandom = new TRandom(); + // Initialize global TRannom object. + gRandom = new TRandom(); - // Open output file - TFile* output = new TFile("mdf.root", "RECREATE"); + // Open output file + TFile* output = new TFile("mdf.root", "RECREATE"); - // Global data parameters - Int_t nVars = 4; - Int_t nData = 500; - Double_t x[4]; + // Global data parameters + Int_t nVars = 4; + Int_t nData = 500; + Double_t x[4]; - // make fit object and set parameters on it. - TMultiDimFit* fit = new TMultiDimFit(nVars, TMultiDimFit::kMonomials,"v"); + // make fit object and set parameters on it. + TMultiDimFit* fit = new TMultiDimFit(nVars, TMultiDimFit::kMonomials,"v"); - Int_t mPowers[] = { 6 , 6, 6, 6 }; - fit->SetMaxPowers(mPowers); - fit->SetMaxFunctions(1000); - fit->SetMaxStudy(1000); - fit->SetMaxTerms(30); - fit->SetPowerLimit(1); - fit->SetMinAngle(10); - fit->SetMaxAngle(10); - fit->SetMinRelativeError(.01); + Int_t mPowers[] = { 6 , 6, 6, 6 }; + fit->SetMaxPowers(mPowers); + fit->SetMaxFunctions(1000); + fit->SetMaxStudy(1000); + fit->SetMaxTerms(30); + fit->SetPowerLimit(1); + fit->SetMinAngle(10); + fit->SetMaxAngle(10); + fit->SetMinRelativeError(.01); - // variables to hold the temporary input data - Double_t d; - Double_t e; + // variables to hold the temporary input data + Double_t d; + Double_t e; - // Print out the start parameters - fit->Print("p"); + // Print out the start parameters + fit->Print("p"); - printf("======================================\n"); + printf("======================================\n"); - // Create training sample - Int_t i; - for (i = 0; i < nData ; i++) { + // Create training sample + Int_t i; + for (i = 0; i < nData ; i++) { - // Make some data - makeData(x,d,e); + // Make some data + makeData(x,d,e); - // Add the row to the fit object - fit->AddRow(x,d,e); - } - - // Print out the statistics - fit->Print("s"); - - // Book histograms - fit->MakeHistograms(); - - // Find the parameterization - fit->FindParameterization(); - - // Print coefficents - fit->Print("rc"); - - // Get the min and max of variables from the training sample, used - // for cuts in test sample. - Double_t *xMax = new Double_t[nVars]; - Double_t *xMin = new Double_t[nVars]; - for (i = 0; i < nVars; i++) { - xMax[i] = (*fit->GetMaxVariables())(i); - xMin[i] = (*fit->GetMinVariables())(i); - } - - nData = fit->GetNCoefficients() * 100; - Int_t j; - - // Create test sample - for (i = 0; i < nData ; i++) { - // Make some data - makeData(x,d,e); - - for (j = 0; j < nVars; j++) - if (x[j] < xMin[j] || x[j] > xMax[j]) - break; - - // If we get through the loop above, all variables are in range - if (j == nVars) // Add the row to the fit object - fit->AddTestRow(x,d,e); - else - i--; - } - //delete gRandom; - - // Test the parameterizatio and coefficents using the test sample. - if (doFit) - fit->Fit("M"); - - // Print result - fit->Print("fc v"); - - // Write code to file - fit->MakeCode(); - - // Write histograms to disk, and close file - output->Write(); - output->Close(); - delete output; - - // Compare results with reference run - Int_t compare = CompareResults(fit, doFit); - if (!compare) { - printf("\nmultidimfit .............................................. OK\n"); - } else { - printf("\nmultidimfit .............................................. fails case %d\n",compare); - } - - // We're done - delete fit; - return compare; + fit->AddRow(x,d,e); + } + + // Print out the statistics + fit->Print("s"); + + // Book histograms + fit->MakeHistograms(); + + // Find the parameterization + fit->FindParameterization(); + + // Print coefficents + fit->Print("rc"); + + // Get the min and max of variables from the training sample, used + // for cuts in test sample. + Double_t *xMax = new Double_t[nVars]; + Double_t *xMin = new Double_t[nVars]; + for (i = 0; i < nVars; i++) { + xMax[i] = (*fit->GetMaxVariables())(i); + xMin[i] = (*fit->GetMinVariables())(i); + } + + nData = fit->GetNCoefficients() * 100; + Int_t j; + + // Create test sample + for (i = 0; i < nData ; i++) { + // Make some data + makeData(x,d,e); + + for (j = 0; j < nVars; j++) + if (x[j] < xMin[j] || x[j] > xMax[j]) + break; + + // If we get through the loop above, all variables are in range + if (j == nVars) + // Add the row to the fit object + fit->AddTestRow(x,d,e); + else + i--; + } + //delete gRandom; + + // Test the parameterizatio and coefficents using the test sample. + if (doFit) + fit->Fit("M"); + + // Print result + fit->Print("fc v"); + + // Write code to file + fit->MakeCode(); + + // Write histograms to disk, and close file + output->Write(); + output->Close(); + delete output; + + // Compare results with reference run + Int_t compare = CompareResults(fit, doFit); + if (!compare) { + printf("\nmultidimfit .............................................. OK\n"); + } else { + printf("\nmultidimfit .............................................. fails case %d\n",compare); + } + + // We're done + delete fit; + return compare; } diff --git a/tutorials/fit/myfit.C b/tutorials/fit/myfit.C index 2b876c1b53e16..c707edc127724 100644 --- a/tutorials/fit/myfit.C +++ b/tutorials/fit/myfit.C @@ -1,6 +1,6 @@ /// \file /// \ingroup tutorial_fit -/// \notebook +/// \notebook -js /// Get in memory an histogram from a root file and fit a user defined function. /// Note that a user defined function must always be defined /// as in this example: diff --git a/tutorials/foam/foam_demo.C b/tutorials/foam/foam_demo.C index 0ad860b494f7b..bebbb3b11b6ff 100644 --- a/tutorials/foam/foam_demo.C +++ b/tutorials/foam/foam_demo.C @@ -14,14 +14,6 @@ /// /// \author Stascek Jadach -#if defined(__CINT__) && !defined(__MAKECINT__) -{ - std::cout << "Using ACliC to run this macro since it uses custom classes" << std::endl; - TString macroFileName = gSystem->UnixPathName(__FILE__); - gSystem->CompileMacro(macroFileName, "k"); - foam_demo(); -} -#else #include "Riostream.h" #include "TFile.h" diff --git a/tutorials/foam/foam_demo.root b/tutorials/foam/foam_demo.root new file mode 100644 index 0000000000000..cc2cd2c626113 Binary files /dev/null and b/tutorials/foam/foam_demo.root differ diff --git a/tutorials/foam/foam_demopers.C b/tutorials/foam/foam_demopers.C index e16e5be33a9ba..1e4a024819ea2 100644 --- a/tutorials/foam/foam_demopers.C +++ b/tutorials/foam/foam_demopers.C @@ -49,13 +49,7 @@ Int_t foam_demopers() //N.B. the integrand functions need to be reset // because cannot be made persistent - #ifdef __CINT__ - // this can be done only in CINT - TFoamIntegrand *rho= new TFDISTR(); - #else - // this should be done with AClic or Cling - TFoamIntegrand * rho = (TFoamIntegrand*) gROOT->ProcessLine("return new TFDISTR();"); - #endif + TFoamIntegrand * rho = (TFoamIntegrand*) gROOT->ProcessLine("return new TFDISTR();"); FoamX->SetRho(rho); Double_t *MCvect =new Double_t[2]; // 2-dim vector generated in the MC run diff --git a/tutorials/gl/glvox1.C b/tutorials/gl/glvox1.C index 810d9e9ac2f44..3e498b7560dac 100644 --- a/tutorials/gl/glvox1.C +++ b/tutorials/gl/glvox1.C @@ -38,7 +38,6 @@ void glvox1() } gStyle->SetCanvasPreferGL(1); - gStyle->SetPalette(1); hist->Draw("glcol"); } diff --git a/tutorials/gl/glvox2.C b/tutorials/gl/glvox2.C index 0aa4bbf76e485..b3cec9cd959a1 100644 --- a/tutorials/gl/glvox2.C +++ b/tutorials/gl/glvox2.C @@ -30,25 +30,6 @@ /// /// \author Timur Pocheptsov -#if defined(__CINT__) && !defined(__MAKECINT__) - -{ - //gSystem->AddIncludePath("-I$ROOTSYS/include"); - TString macroName; - const char *rootSysPath = gSystem->Getenv("ROOTSYS"); - if (rootSysPath) { - macroName = rootSysPath; - if (!macroName.EndsWith("/") && !macroName.EndsWith("\\")) - macroName += "/"; - macroName += "tutorials/gl/"; - } - - macroName += "glvox2.C++"; - gROOT->LoadMacro(macroName.Data()); - glvox2(); -} - -#else #include "TStyle.h" #include "TList.h" @@ -119,9 +100,7 @@ void glvox2() } gStyle->SetCanvasPreferGL(1); - gStyle->SetPalette(1); hist->Draw("glcol"); } -#endif diff --git a/tutorials/gl/viewer3DMaster.C b/tutorials/gl/viewer3DMaster.C index 882466bbef327..f9d112dc966a0 100644 --- a/tutorials/gl/viewer3DMaster.C +++ b/tutorials/gl/viewer3DMaster.C @@ -13,12 +13,6 @@ /// /// \author Richard Maunder -#if defined(__CINT__) && !defined(__MAKECINT__) -{ - gSystem->CompileMacro("viewer3DMaster.C"); - viewer3DMaster(); -} -#else #include "TVirtualViewer3D.h" #include "TBuffer3D.h" @@ -338,4 +332,3 @@ void viewer3DMaster() myGeom->Draw("ogl"); } -#endif diff --git a/tutorials/graphics/earth.C b/tutorials/graphics/earth.C index 66f2470b8de0f..85889ab49f2ff 100644 --- a/tutorials/graphics/earth.C +++ b/tutorials/graphics/earth.C @@ -15,7 +15,6 @@ TCanvas *earth(){ - gStyle->SetPalette(1); gStyle->SetOptTitle(1); gStyle->SetOptStat(0); diff --git a/tutorials/gui/QtFileDialog.C b/tutorials/gui/QtFileDialog.C index 5968117908a14..e70f715fc98d4 100644 --- a/tutorials/gui/QtFileDialog.C +++ b/tutorials/gui/QtFileDialog.C @@ -26,20 +26,13 @@ /// /// \author Valeri Fine 23/03/2006 -#ifndef __CINT__ # include # include # include "TString.h" # include -#endif + TString QtFileDialog() { -#ifdef __CINT__ - // Load the qt cint dictionary. - // One is recommended to do that at once somewhere. - // For example from one's custom rootlogon.C script - gSystem->Load("$ROOTSYS/cint/cint/include/qtcint"); -#endif QString fileName = QFileDialog::getOpenFileName (); std::string flnm = fileName.toStdString(); return TString(flnm.c_str()); diff --git a/tutorials/gui/QtMultiFileDialog.C b/tutorials/gui/QtMultiFileDialog.C index 3b947940f80c6..5a261d35a02ed 100644 --- a/tutorials/gui/QtMultiFileDialog.C +++ b/tutorials/gui/QtMultiFileDialog.C @@ -33,7 +33,6 @@ /// /// \author Valeri Fine 23/03/2006 -#ifndef __CINT__ # include # include # include @@ -42,15 +41,9 @@ # include "TObjString.h" # include "TList.h" # include -#endif + TList *QtMultiFileDialog(const char *style="") { -#ifdef __CINT__ - // Load the qt cint dictionary. - // One is recommended to do that at once somewhere. - // For example from one's custom rootlogon.C script - gSystem->Load("$ROOTSYS/cint/cint/include/qtcint"); -#endif QStyle *saveStyle = 0; if (!QString(style).isEmpty()) { saveStyle = QApplication::style(); diff --git a/tutorials/gui/QtPrintDialog.C b/tutorials/gui/QtPrintDialog.C index eacde3a14c748..b5ea940e3f8e8 100644 --- a/tutorials/gui/QtPrintDialog.C +++ b/tutorials/gui/QtPrintDialog.C @@ -24,22 +24,16 @@ /// /// \author Valeri Fine 23/03/2006 -#ifndef __CINT__ + # include # include # include # include # include # include -#endif + void QtPrintDialog(TVirtualPad *pad = 0) { -#ifdef __CINT__ - // Load the qt cint dictionary. - // One is recommended to do that at once somewhere. - // For example from one's custom rootlogon.C script - gSystem->Load("$ROOTSYS/cint/cint/include/qtcint"); -#endif TVirtualPad *pd = pad; if (!pd) pd = TPad::Pad(); // ->GetCanvas(); if (pd) { diff --git a/tutorials/hist/ContourList.C b/tutorials/hist/ContourList.C index d177ed0c01aba..3e9806a02c596 100644 --- a/tutorials/hist/ContourList.C +++ b/tutorials/hist/ContourList.C @@ -63,7 +63,6 @@ TCanvas *ContourList(){ } } - gStyle->SetPalette(1); gStyle->SetOptStat(0); gStyle->SetTitleW(0.99); gStyle->SetTitleH(0.08); diff --git a/tutorials/hist/FirstContour.C b/tutorials/hist/FirstContour.C index 04b2da74eb982..f06f551040f35 100644 --- a/tutorials/hist/FirstContour.C +++ b/tutorials/hist/FirstContour.C @@ -22,7 +22,6 @@ void FirstContour() TTree *ntuple = (TTree*)file->Get("ntuple"); TCanvas *c1 = new TCanvas("c1","Contours",10,10,800,600); - gStyle->SetPalette(1); ntuple->Draw("py:px","px*px+py*py < 20", "contz,list"); //we must call Update to force the canvas to be painted. When diff --git a/tutorials/hist/draw2dopt.C b/tutorials/hist/draw2dopt.C index 8efc19428b0d8..7a0d573345570 100644 --- a/tutorials/hist/draw2dopt.C +++ b/tutorials/hist/draw2dopt.C @@ -10,7 +10,6 @@ void draw2dopt() { gStyle->SetOptStat(0); - gStyle->SetPalette(1); gStyle->SetCanvasColor(33); gStyle->SetFrameFillColor(18); TF2 *f2 = new TF2("f2","xygaus + xygaus(5) + xylandau(10)",-4,4,-4,4); diff --git a/tutorials/hist/th2polyHoneycomb.C b/tutorials/hist/th2polyHoneycomb.C index 45fc31eaa79e8..adbaacd4de7d3 100644 --- a/tutorials/hist/th2polyHoneycomb.C +++ b/tutorials/hist/th2polyHoneycomb.C @@ -11,7 +11,6 @@ void th2polyHoneycomb(){ gStyle->SetCanvasPreferGL(true); TH2Poly *hc = new TH2Poly(); hc->Honeycomb(0,0,.1,25,25); - gStyle->SetPalette(1); TRandom ran; for (int i = 0; i<30000; i++) { diff --git a/tutorials/hist/th2polyUSA.C b/tutorials/hist/th2polyUSA.C index 84aa00ac0baa4..51f02b0d71cca 100644 --- a/tutorials/hist/th2polyUSA.C +++ b/tutorials/hist/th2polyUSA.C @@ -72,6 +72,5 @@ void th2polyUSA() for (i=0; iFill(states[i], pop[i]); gStyle->SetOptStat(11); - gStyle->SetPalette(1); p->Draw("legogl"); } diff --git a/tutorials/hsimple.C b/tutorials/hsimple.C index ebcd1edd6c26d..0e299574c78ac 100644 --- a/tutorials/hsimple.C +++ b/tutorials/hsimple.C @@ -31,14 +31,14 @@ #include #include -TFile *hsimple(Int_t get=0) +TFile *hsimple(Int_t getFile=0) { TString filename = "hsimple.root"; TString dir = gROOT->GetTutorialsDir(); dir.ReplaceAll("/./","/"); TFile *hfile = 0; - if (get) { - // if the argument get =1 return the file "hsimple.root" + if (getFile) { + // if the argument getFile =1 return the file "hsimple.root" // if the file does not exist, it is created TString fullPath = dir+"hsimple.root"; if (!gSystem->AccessPathName(fullPath,kFileExists)) { @@ -78,13 +78,13 @@ TFile *hsimple(Int_t get=0) // Fill histograms randomly - TRandom3 random; + TRandom3 randomNum; Float_t px, py, pz; const Int_t kUPDATE = 1000; for (Int_t i = 0; i < 25000; i++) { - random.Rannor(px,py); + randomNum.Rannor(px,py); pz = px*px + py*py; - Float_t rnd = random.Rndm(1); + Float_t rnd = randomNum.Rndm(1); hpx->Fill(px); hpxpy->Fill(px,py); hprof->Fill(px,pz); diff --git a/tutorials/io/mergeSelective.C b/tutorials/io/mergeSelective.C index f71e9ce8eec8f..9daff2808e37b 100644 --- a/tutorials/io/mergeSelective.C +++ b/tutorials/io/mergeSelective.C @@ -1,6 +1,6 @@ /// \file /// \ingroup tutorial_io -/// \notebook +/// \notebook -nodraw /// Merge only part of the content of a set of files. /// This macro demonstrates how to merge only a part of the content of a set /// of input files, specified via the interface. diff --git a/tutorials/math/GammaFun.C b/tutorials/math/GammaFun.C index c4448e98e4284..933b16144c108 100644 --- a/tutorials/math/GammaFun.C +++ b/tutorials/math/GammaFun.C @@ -30,7 +30,6 @@ void GammaFun() { gSystem->Load("libMathCore"); - gStyle->SetPalette(1); gStyle->SetOptStat(0); TF1 *f1a = new TF1("Gamma(x)","ROOT::Math::tgamma(x)",-2,5); diff --git a/tutorials/math/Legendre.C b/tutorials/math/Legendre.C index 16a3fde3447cf..7a5a81a600ff2 100644 --- a/tutorials/math/Legendre.C +++ b/tutorials/math/Legendre.C @@ -10,12 +10,6 @@ /// /// \author Lorenzo Moneta -#if defined(__CINT__) && !defined(__MAKECINT__) -{ - gSystem->CompileMacro("Legendre.C", "k"); - Legendre(); -} -#else #include "TMath.h" #include "TF1.h" @@ -61,4 +55,4 @@ void Legendre() Canvas->cd(); } -#endif + diff --git a/tutorials/math/LegendreAssoc.C b/tutorials/math/LegendreAssoc.C index beaaba1bf64b0..b58f88c94d3b1 100644 --- a/tutorials/math/LegendreAssoc.C +++ b/tutorials/math/LegendreAssoc.C @@ -19,12 +19,6 @@ /// /// \author Magdalena Slawinska -#if defined(__CINT__) && !defined(__MAKECINT__) -{ - gSystem->CompileMacro("LegendreAssoc.C", "k"); - LegendreAssoc(); -} -#else #include "TMath.h" #include "TF1.h" @@ -117,5 +111,3 @@ void LegendreAssoc() } } -#endif - diff --git a/tutorials/math/TSVDUnfoldExample.C b/tutorials/math/TSVDUnfoldExample.C index 52fcf5f89a23b..77656085beb00 100644 --- a/tutorials/math/TSVDUnfoldExample.C +++ b/tutorials/math/TSVDUnfoldExample.C @@ -29,9 +29,8 @@ #include "TColor.h" #include "TLine.h" -#if not defined(__CINT__) || defined(__MAKECINT__) #include "TSVDUnfold.h" -#endif + Double_t Reconstruct( Double_t xt, TRandom3& R ) { diff --git a/tutorials/math/exampleTKDE.C b/tutorials/math/exampleTKDE.C index 6be0996a40898..f110c2668c857 100644 --- a/tutorials/math/exampleTKDE.C +++ b/tutorials/math/exampleTKDE.C @@ -14,9 +14,7 @@ #include "TCanvas.h" //#include "TStopwatch.h" #include "TRandom.h" -#ifndef __CINT__ #include "Math/DistFunc.h" -#endif #include "TLegend.h" // test TKDE diff --git a/tutorials/math/kdTreeBinning.C b/tutorials/math/kdTreeBinning.C index 0f5d658447974..786b6ad41f132 100644 --- a/tutorials/math/kdTreeBinning.C +++ b/tutorials/math/kdTreeBinning.C @@ -91,7 +91,6 @@ void kdTreeBinning() { z[i] = (Double_t) h2pol->GetBinContent(h2pol->FindBin(smp[i], smp[DATASZ + i])); TGraph2D *g = new TGraph2D(DATASZ, smp, &smp[DATASZ], &z[0]); - gStyle->SetPalette(1); g->SetMarkerStyle(20); c1->cd(3); diff --git a/tutorials/math/mathcoreGenVector.C b/tutorials/math/mathcoreGenVector.C index 610d5c67dfb96..0783322fc635e 100644 --- a/tutorials/math/mathcoreGenVector.C +++ b/tutorials/math/mathcoreGenVector.C @@ -879,10 +879,6 @@ int testRotation() { void mathcoreGenVector() { - #ifdef __CINT__ - gSystem->Load("libMathCore"); - using namespace ROOT::Math ; - #endif testVector3D(); testPoint3D(); diff --git a/tutorials/math/mathcoreVectorCollection.C b/tutorials/math/mathcoreVectorCollection.C index b7fea30584695..4b8c3329b75f5 100644 --- a/tutorials/math/mathcoreVectorCollection.C +++ b/tutorials/math/mathcoreVectorCollection.C @@ -1,6 +1,6 @@ /// \file /// \ingroup tutorial_math -/// \notebook +/// \notebook -js /// Example showing how to write and read a std vector of ROOT::Math LorentzVector in a ROOT tree. /// In the write() function a variable number of track Vectors is generated /// according to a Poisson distribution with random momentum uniformly distributed @@ -152,17 +152,6 @@ double read() { int mathcoreVectorCollection() { - #if defined(__CINT__) && !defined(__MAKECINT__) - - gSystem->Load("libMathCore"); - gSystem->Load("libPhysics"); - // in CINT need to do that after having loading the library - using namespace ROOT::Math ; - - cout << "This tutorial can run only using ACliC, compiling it by doing: " << endl; - cout << "\t .x tutorials/math/mathcoreVectorCollection.C+" << endl; - return 0; -#else int nEvents = 10000; double s1 = write(nEvents); double s2 = read(); @@ -172,12 +161,9 @@ int mathcoreVectorCollection() { return -1; } return 0; -#endif } -#ifndef __CINT__ int main() { return mathcoreVectorCollection(); } -#endif diff --git a/tutorials/math/mathcoreVectorFloatIO.C b/tutorials/math/mathcoreVectorFloatIO.C index f05cd72181d2b..6a4d5f21019ae 100644 --- a/tutorials/math/mathcoreVectorFloatIO.C +++ b/tutorials/math/mathcoreVectorFloatIO.C @@ -100,7 +100,7 @@ void runIt() { #if defined(__CINT__) && !defined(__MAKECINT__) gSystem->Load("libMathCore"); gSystem->Load("libPhysics"); - using namespace ROOT::Math; + using namespace ROOT::Math ; cout << "This tutorial can run only using ACliC, you must run it by doing: " << endl; cout << "\t .L tutorials/math/mathcoreVectorFloatIO.C+" << endl; @@ -115,7 +115,7 @@ void mathcoreVectorFloatIO() { #if defined(__CINT__) && !defined(__MAKECINT__) gSystem->Load("libMathCore"); gSystem->Load("libPhysics"); - using namespace ROOT::Math; + using namespace ROOT::Math ; cout << "This tutorial can run only using ACliC, you must run it by doing: " << endl; cout << "\t .L tutorials/math/mathcoreVectorFloatIO.C+" << endl; diff --git a/tutorials/math/mathcoreVectorIO.C b/tutorials/math/mathcoreVectorIO.C index fe31d756e2e8a..4b55134f964b7 100644 --- a/tutorials/math/mathcoreVectorIO.C +++ b/tutorials/math/mathcoreVectorIO.C @@ -160,16 +160,7 @@ void read() { } void mathcoreVectorIO() { -#if defined(__CINT__) && !defined(__MAKECINT__) - gSystem->Load("libMathCore"); - gSystem->Load("libPhysics"); - // in CINT need to do that after having loading the library - using namespace ROOT::Math; - - cout << "This tutorial can run only using ACliC, compiling it by doing: " << endl; - cout << "\t .x tutorials/math/mathcoreVectorCollection.C+" << endl; - return; -#endif + int nEvents = 100000; write(nEvents); read(); diff --git a/tutorials/math/mathmoreIntegration.C b/tutorials/math/mathmoreIntegration.C index 2981612a3637e..80cfdf49d9ee1 100644 --- a/tutorials/math/mathmoreIntegration.C +++ b/tutorials/math/mathmoreIntegration.C @@ -195,12 +195,6 @@ void DrawCumulative(double x1, double x2, int n = 100){ void mathmoreIntegration(double a = -2, double b = 2) { -#if defined(__CINT__) && !defined(__MAKECINT__) - cout << "WARNING: This tutorial can run only using ACliC, you must run it by doing: " << endl; - cout << "\t .x $ROOTSYS/tutorials/math/mathmoreIntegration.C+" << endl; - return; -#endif - DrawCumulative(a, b); testIntegPerf(a, b); } diff --git a/tutorials/math/multidimSampling.C b/tutorials/math/multidimSampling.C index 1b540a3e9f647..10ca24d9ccc0a 100644 --- a/tutorials/math/multidimSampling.C +++ b/tutorials/math/multidimSampling.C @@ -95,12 +95,6 @@ using namespace ROOT::Math; void multidimSampling() { -#ifdef __CINT__ - std::cout << "DO NOT RUN WITH CINT:" << std::endl; - std::cout << "we are using a custom function which requires" << std::endl; - std::cout << "that this tutorial must be compiled with ACLIC" << std::endl; - return; -#endif const int N = 10000; //const int NBin = 1000; diff --git a/tutorials/math/normalDist.C b/tutorials/math/normalDist.C index 89b0928ef5429..b20afeaae544a 100644 --- a/tutorials/math/normalDist.C +++ b/tutorials/math/normalDist.C @@ -8,14 +8,12 @@ /// /// \author Anna Kreshuk -#ifndef __CINT__ #include "Math/DistFunc.h" #include "TF1.h" #include "TCanvas.h" #include "TSystem.h" #include "TLegend.h" #include "TAxis.h" -#endif void normalDist() { diff --git a/tutorials/math/principal.C b/tutorials/math/principal.C index 73d7273edb492..41e879a93ee86 100644 --- a/tutorials/math/principal.C +++ b/tutorials/math/principal.C @@ -39,7 +39,7 @@ void principal(Int_t n=10, Int_t m=10000) TPrincipal* principal = new TPrincipal(n,"ND"); // Use a pseudo-random number generator - TRandom* random = new TRandom; + TRandom* random1 = new TRandom; // Make the m data-points // Make a variable to hold our data @@ -50,9 +50,9 @@ void principal(Int_t n=10, Int_t m=10000) // First we create the un-correlated, random variables, according // to one of three distributions for (Int_t j = 0; j < n - c; j++) { - if (j % 3 == 0) data[j] = random->Gaus(5,1); - else if (j % 3 == 1) data[j] = random->Poisson(8); - else data[j] = random->Exp(2); + if (j % 3 == 0) data[j] = random1->Gaus(5,1); + else if (j % 3 == 1) data[j] = random1->Poisson(8); + else data[j] = random1->Exp(2); } // Then we create the correlated variables diff --git a/tutorials/math/testUnfold5c.C b/tutorials/math/testUnfold5c.C index 5933a2d3ecdee..f15f57d6aa920 100644 --- a/tutorials/math/testUnfold5c.C +++ b/tutorials/math/testUnfold5c.C @@ -1,6 +1,6 @@ /// \file /// \ingroup tutorial_unfold5 -/// \notebook +/// \notebook -nodraw /// Version 17.0 example for multi-dimensional unfolding /// /// \macro_output diff --git a/tutorials/matrix/solveLinear.C b/tutorials/matrix/solveLinear.C index 6344affd43a53..304f4ba43e389 100644 --- a/tutorials/matrix/solveLinear.C +++ b/tutorials/matrix/solveLinear.C @@ -69,7 +69,6 @@ /// /// \author Eddy Offermann -#ifndef __CINT__ #include "Riostream.h" #include "TMatrixD.h" #include "TVectorD.h" @@ -77,14 +76,10 @@ #include "TDecompChol.h" #include "TDecompSVD.h" #include "TF1.h" -#endif void solveLinear(Double_t eps = 1.e-12) { -#ifdef __CINT__ - gSystem->Load("libMatrix"); -#endif cout << "Perform the fit y = c0 + c1 * x in four different ways" << endl; const Int_t nrVar = 2; diff --git a/tutorials/net/spyserv.C b/tutorials/net/spyserv.C index 4beb0dfb0a280..4586b2106e39b 100644 --- a/tutorials/net/spyserv.C +++ b/tutorials/net/spyserv.C @@ -20,9 +20,7 @@ #include "TMessage.h" #include "TRandom.h" #include "TList.h" -#ifndef __CINT__ #include "TError.h" -#endif class SpyServ { diff --git a/tutorials/proof/getProof.C b/tutorials/proof/getProof.C index 6393bb1c2e140..17cdbdea49828 100644 --- a/tutorials/proof/getProof.C +++ b/tutorials/proof/getProof.C @@ -79,13 +79,6 @@ TProof *getProof(const char *url = "proof://localhost:40000", Int_t nwrks = -1, const char *opt = "ask", Bool_t dyn = kFALSE, Bool_t tutords = kFALSE) { -#ifdef __CINT__ - Printf("getProof: this script can only be executed via ACliC:"); - Printf("getProof: root [] .x /getProof.C+"); - Printf("getProof: or root [] .L /getProof.C+"); - Printf("getProof: root [] getProof(...)"); - return; -#endif TProof *p = 0; diff --git a/tutorials/proof/runProof.C b/tutorials/proof/runProof.C index 1c918a8b4b6e0..76ee76e7f9e0c 100644 --- a/tutorials/proof/runProof.C +++ b/tutorials/proof/runProof.C @@ -357,13 +357,7 @@ void runProof(const char *what = "simple", const char *masterurl = "proof://localhost:40000", Int_t nwrks = -1, TList *ins = 0) { -#ifdef __CINT__ - Printf("runProof: this script can only be executed via ACliC:"); - Printf("runProof: root [] .x /runProof.C+"); - Printf("runProof: or root [] .L /runProof.C+"); - Printf("runProof: root [] runProof(...)"); - return; -#endif + gEnv->SetValue("Proof.StatsHist",1); TString u(masterurl); diff --git a/tutorials/pythia/pythiaExample.C b/tutorials/pythia/pythiaExample.C index 30c0344ffa706..3de56475a6f96 100644 --- a/tutorials/pythia/pythiaExample.C +++ b/tutorials/pythia/pythiaExample.C @@ -72,7 +72,6 @@ /// /// \author Christian Holm Christensen -#ifndef __CINT__ #include "TApplication.h" #include "TPythia6.h" #include "TFile.h" @@ -87,7 +86,7 @@ #include "Riostream.h" #include using namespace std; -#endif + #define FILENAME "pythia.root" #define TREENAME "tree" diff --git a/tutorials/quadp/portfolio.C b/tutorials/quadp/portfolio.C index b31af3871e020..990a59683d884 100644 --- a/tutorials/quadp/portfolio.C +++ b/tutorials/quadp/portfolio.C @@ -180,21 +180,13 @@ TArrayF &StockReturn(TFile *f,const TString &name,Int_t sDay,Int_t eDay) b_date->GetEntry(i); b_closeAdj->GetEntry(i); if (data->fDate >= sDay && data->fDate <= eDay) -#ifdef __CINT__ - closeAdj.AddAt(data->fCloseAdj/100. , i ); -#else closeAdj[i] = data->fCloseAdj/100.; -#endif } TArrayF *r = new TArrayF(nrEntries-1); for (Int_t i = 1; i < nrEntries; i++) // (*r)[i-1] = closeAdj[i]-closeAdj[i-1]; -#ifdef __CINT__ - r->AddAt(closeAdj[i]/closeAdj[i-1],1); -#else (*r)[i-1] = closeAdj[i]/closeAdj[i-1]; -#endif return *r; } @@ -289,7 +281,7 @@ TVectorD OptimalInvest(Double_t riskFactor,TVectorD r,TMatrixDSym Covar) } #endif -//--------------------------------------------------------------------------- + //--------------------------------------------------------------------------- void portfolio() { const Int_t sDay = 20000809; diff --git a/tutorials/roofit/rf502_wspacewrite.C b/tutorials/roofit/rf502_wspacewrite.C index 81490386bb656..4d8f1f3cc53d4 100644 --- a/tutorials/roofit/rf502_wspacewrite.C +++ b/tutorials/roofit/rf502_wspacewrite.C @@ -10,9 +10,6 @@ /// \author 07/2008 - Wouter Verkerke -#ifndef __CINT__ -#include "RooGlobalFunc.h" -#endif #include "RooRealVar.h" #include "RooDataSet.h" #include "RooGaussian.h" diff --git a/tutorials/roofit/rf509_wsinteractive.C b/tutorials/roofit/rf509_wsinteractive.C index 9b15fde7121e9..c6bd85613c964 100644 --- a/tutorials/roofit/rf509_wsinteractive.C +++ b/tutorials/roofit/rf509_wsinteractive.C @@ -1,5 +1,6 @@ /// \file /// \ingroup tutorial_roofit +/// \notebook -js /// 'ORGANIZATION AND SIMULTANEOUS FITS' RooFit tutorial macro #509 /// /// Easy CINT interactive access to workspace contents through a @@ -43,13 +44,13 @@ void rf509_wsinteractive() // but this does not work anymore in CLING. // so this tutorial is an example on how to // change the code - RooWorkspace* w = new RooWorkspace("w",kTRUE) ; + RooWorkspace* w1 = new RooWorkspace("w",kTRUE) ; // Fill workspace with p.d.f. and data in a separate function - fillWorkspace(*w) ; + fillWorkspace(*w1) ; // Print workspace contents - w->Print() ; + w1->Print() ; // this does not work anymore with CLING // use normal workspace functionality @@ -65,8 +66,8 @@ void rf509_wsinteractive() //RooFitResult* r = w::model.fitTo(*d) ; // use normal workspace methods - RooAbsPdf * model = w->pdf("model"); - RooRealVar * x = w->var("x"); + RooAbsPdf * model = w1->pdf("model"); + RooRealVar * x = w1->var("x"); RooDataSet* d = model->generate(*x,1000) ; RooFitResult* r = model->fitTo(*d) ; @@ -86,7 +87,7 @@ void rf509_wsinteractive() // model.plotOn(frame,Components(bkg),LineStyle(kDashed)) ; // new correct syntax - RooAbsPdf *bkg = w->pdf("bkg"); + RooAbsPdf *bkg = w1->pdf("bkg"); model->plotOn(frame); model->plotOn(frame,Components(*bkg),LineStyle(kDashed)) ; diff --git a/tutorials/roofit/rf607_fitresult.C b/tutorials/roofit/rf607_fitresult.C index ff70dd4fcc83d..ab2a67abd5343 100644 --- a/tutorials/roofit/rf607_fitresult.C +++ b/tutorials/roofit/rf607_fitresult.C @@ -88,7 +88,6 @@ void rf607_fitresult() // Construct 2D color plot of correlation matrix gStyle->SetOptStat(0) ; - gStyle->SetPalette(1) ; TH2* hcorr = r->correlationHist() ; diff --git a/tutorials/roofit/rf608_fitresultaspdf.C b/tutorials/roofit/rf608_fitresultaspdf.C index 1bd5209b96c8e..b2a3c333919e7 100644 --- a/tutorials/roofit/rf608_fitresultaspdf.C +++ b/tutorials/roofit/rf608_fitresultaspdf.C @@ -95,10 +95,8 @@ void rf608_fitresultaspdf() // Draw the 'sigar' - gStyle->SetCanvasPreferGL(true); - gStyle->SetPalette(1) ; new TCanvas("rf608_fitresultaspdf_1","rf608_fitresultaspdf_1",600,600) ; - hh_3d->Draw("gliso") ; + hh_3d->Draw("iso") ; // Draw the 2D projections of the 3D p.d.f. TCanvas* c2 = new TCanvas("rf608_fitresultaspdf_2","rf608_fitresultaspdf_2",900,600) ; diff --git a/tutorials/roofit/rf801_mcstudy.C b/tutorials/roofit/rf801_mcstudy.C index a46e6b00a4626..e500ef347623e 100644 --- a/tutorials/roofit/rf801_mcstudy.C +++ b/tutorials/roofit/rf801_mcstudy.C @@ -115,7 +115,6 @@ void rf801_mcstudy() // Draw all plots on a canvas - gStyle->SetPalette(1) ; gStyle->SetOptStat(0) ; TCanvas* c = new TCanvas("rf801_mcstudy","rf801_mcstudy",900,900) ; c->Divide(3,3) ; diff --git a/tutorials/roofit/rf903_numintcache.C b/tutorials/roofit/rf903_numintcache.C index 1f7d895b80d5f..311bb5e955e71 100644 --- a/tutorials/roofit/rf903_numintcache.C +++ b/tutorials/roofit/rf903_numintcache.C @@ -38,14 +38,14 @@ void rf903_numintcache(Int_t mode=0) // ----------------------------------------------------------------------------------- // Make/load workspace, exit here in mode 1 - RooWorkspace* w = getWorkspace(mode) ; + RooWorkspace* w1 = getWorkspace(mode) ; if (mode==1) { // Show workspace that was created - w->Print() ; + w1->Print() ; // Show plot of cached integral values - RooDataHist* hhcache = (RooDataHist*) w->expensiveObjectCache().getObj(1) ; + RooDataHist* hhcache = (RooDataHist*) w1->expensiveObjectCache().getObj(1) ; if (hhcache) { new TCanvas("rf903_numintcache","rf903_numintcache",600,600) ; @@ -62,22 +62,22 @@ void rf903_numintcache(Int_t mode=0) // ----------------------------------------------------------------------------------- // This is always slow (need to find maximum function value empirically in 3D space) - RooDataSet* d = w->pdf("model")->generate(RooArgSet(*w->var("x"),*w->var("y"),*w->var("z")),1000) ; + RooDataSet* d = w1->pdf("model")->generate(RooArgSet(*w1->var("x"),*w1->var("y"),*w1->var("z")),1000) ; // This is slow in mode 0, but fast in mode 1 - w->pdf("model")->fitTo(*d,Verbose(kTRUE),Timer(kTRUE)) ; + w1->pdf("model")->fitTo(*d,Verbose(kTRUE),Timer(kTRUE)) ; // Projection on x (always slow as 2D integral over Y,Z at fitted value of a is not cached) - RooPlot* framex = w->var("x")->frame(Title("Projection of 3D model on X")) ; + RooPlot* framex = w1->var("x")->frame(Title("Projection of 3D model on X")) ; d->plotOn(framex) ; - w->pdf("model")->plotOn(framex) ; + w1->pdf("model")->plotOn(framex) ; // Draw x projection on canvas new TCanvas("rf903_numintcache","rf903_numintcache",600,600) ; framex->Draw() ; // Make workspace available on command line after macro finishes - gDirectory->Add(w) ; + gDirectory->Add(w1) ; return ; diff --git a/tutorials/roostats/HybridInstructional.C b/tutorials/roostats/HybridInstructional.C index a166a9f8d2aa0..dc200d6dcbb25 100644 --- a/tutorials/roostats/HybridInstructional.C +++ b/tutorials/roostats/HybridInstructional.C @@ -132,12 +132,6 @@ void HybridInstructional() { // It takes ~4 min without PROOF and ~2 min with PROOF on 4 cores. // Of course, everything looks nicer with more toys, which takes longer. - #ifdef __CINT__ - cout << "DO NOT RUN WITH CINT: we are using a custom test statistic "; - cout << "which requires that this tutorial must be compiled "; - cout << "with ACLIC" << endl; - return; - #endif TStopwatch t; diff --git a/tutorials/roostats/ModelInspector.C b/tutorials/roostats/ModelInspector.C index ee30a695fc7e0..c09e754d80cb3 100644 --- a/tutorials/roostats/ModelInspector.C +++ b/tutorials/roostats/ModelInspector.C @@ -496,10 +496,6 @@ void ModelInspector(const char* infile = "", const char* modelConfigName = "ModelConfig", const char* dataName = "obsData"){ -#ifdef __CINT__ - cout <<"You must use ACLIC for this. Use ModelInspector.C+"<factory("Poisson::px(x[150,0,500],sum::splusb(s[0,0,100],b[100,0,300]))"); - w->factory("Poisson::py(y[100,0,500],prod::taub(tau[1.],b))"); - w->factory("Uniform::prior_b(b)"); + RooWorkspace* w1 = new RooWorkspace("w",true); + w1->factory("Poisson::px(x[150,0,500],sum::splusb(s[0,0,100],b[100,0,300]))"); + w1->factory("Poisson::py(y[100,0,500],prod::taub(tau[1.],b))"); + w1->factory("Uniform::prior_b(b)"); // construct the Bayesian-averaged model (eg. a projection pdf) // p'(x|s) = \int db p(x|s+b) * [ p(y|b) * prior(b) ] - w->factory("PROJ::averagedModel(PROD::foo(px|b,py,prior_b),b)") ; + w1->factory("PROJ::averagedModel(PROD::foo(px|b,py,prior_b),b)") ; // plot it, blue is averaged model, red is b known exactly - RooPlot* frame = w->var("x")->frame() ; - w->pdf("averagedModel")->plotOn(frame) ; - w->pdf("px")->plotOn(frame,LineColor(kRed)) ; + RooPlot* frame = w1->var("x")->frame() ; + w1->pdf("averagedModel")->plotOn(frame) ; + w1->pdf("px")->plotOn(frame,LineColor(kRed)) ; frame->Draw() ; // compare analytic calculation of Z_Bi @@ -44,9 +44,9 @@ void Zbi_Zgamma() { // for an example with x = 150, y = 100 // numeric RooFit Z_Gamma - w->var("y")->setVal(100); - w->var("x")->setVal(150); - RooAbsReal* cdf = w->pdf("averagedModel")->createCdf(*w->var("x")); + w1->var("y")->setVal(100); + w1->var("x")->setVal(150); + RooAbsReal* cdf = w1->pdf("averagedModel")->createCdf(*w1->var("x")); cdf->getVal(); // get ugly print messages out of the way cout << "Hybrid p-value = " << cdf->getVal() << endl; diff --git a/tutorials/sql/sqlselect.C b/tutorials/sql/sqlselect.C index 73595ebf75545..999da7179ea1f 100644 --- a/tutorials/sql/sqlselect.C +++ b/tutorials/sql/sqlselect.C @@ -1,8 +1,7 @@ -#ifndef __CINT__ #include #include #include -#endif + void sqlselect() { diff --git a/tutorials/thread/threads.C b/tutorials/thread/threads.C index e3ff65ad4d89f..eda6c7c520e74 100644 --- a/tutorials/thread/threads.C +++ b/tutorials/thread/threads.C @@ -35,10 +35,6 @@ void *handle(void *ptr) void threads() { -#ifdef __CINT__ - printf("This script can only be executed via ACliC: .x threads.C++\n"); - return; -#endif gDebug = 1; diff --git a/tutorials/thread/threadsh1.C b/tutorials/thread/threadsh1.C index bdf73b8b6baea..1de3d54045db2 100644 --- a/tutorials/thread/threadsh1.C +++ b/tutorials/thread/threadsh1.C @@ -73,10 +73,6 @@ void closed(Int_t id) void threadsh1() { -#ifdef __CINT__ - printf("This script can only be executed via ACliC: .x threadsh1.C++\n"); - return; -#endif finished = kFALSE; //gDebug = 1; diff --git a/tutorials/thread/threadsh2.C b/tutorials/thread/threadsh2.C index b76cb4bd8df08..d6149e8a42877 100644 --- a/tutorials/thread/threadsh2.C +++ b/tutorials/thread/threadsh2.C @@ -147,11 +147,6 @@ void tryclosing(Int_t id) void threadsh2() { -#ifdef __CINT__ - printf("This script can only be executed via ACliC: .x threadsh2.C++\n"); - return; -#endif - if (gROOT->IsBatch()) { return; } diff --git a/tutorials/tree/cernbuild.C b/tutorials/tree/cernbuild.C index a59b316ec06d9..81c2cffe96644 100644 --- a/tutorials/tree/cernbuild.C +++ b/tutorials/tree/cernbuild.C @@ -6,7 +6,7 @@ /// \macro_code /// \author Rene Brun -TFile *cernbuild(Int_t get=0, Int_t print=1) { +TFile *cernbuild(Int_t getFile=0, Int_t print=1) { Int_t Category; UInt_t Flag; @@ -29,8 +29,8 @@ TFile *cernbuild(Int_t get=0, Int_t print=1) { FILE *fp = fopen(Form("%scernstaff.dat",dir.Data()),"r"); TFile *hfile = 0; - if (get) { - // if the argument get =1 return the file "cernstaff.root" + if (getFile) { + // if the argument getFile =1 return the file "cernstaff.root" // if the file does not exist, it is created if (!gSystem->AccessPathName(dir+"cernstaff.root",kFileExists)) { hfile = TFile::Open(dir+"cernstaff.root"); //in $ROOTSYS/tutorials/tree @@ -72,7 +72,7 @@ TFile *cernbuild(Int_t get=0, Int_t print=1) { fclose(fp); delete hfile; - if (get) { + if (getFile) { //we come here when the script is executed outside $ROOTSYS/tutorials/tree hfile = TFile::Open(filename); return hfile; diff --git a/tutorials/tree/drawsparse.C b/tutorials/tree/drawsparse.C index 06abf15ad6bb0..c3fc9c5113560 100644 --- a/tutorials/tree/drawsparse.C +++ b/tutorials/tree/drawsparse.C @@ -102,10 +102,6 @@ void drawsparse() { // create a THnSparse and draw it. -#ifdef __CINT__ - printf("For performance reasons we advise to run \".x drawsparse.C+\"\n"); -#endif - const Int_t ndims = 8; Int_t bins[ndims] = {10, 10, 5, 30, 10, 4, 18, 12}; Double_t xmin[ndims] = {-5., -10., -1000., -3., 0., 0., 0., 0.}; diff --git a/tutorials/tree/parallelcoord.C b/tutorials/tree/parallelcoord.C index 99110e6d63756..1a42b28a23914 100644 --- a/tutorials/tree/parallelcoord.C +++ b/tutorials/tree/parallelcoord.C @@ -36,7 +36,6 @@ void parallelcoord() { r = new TRandom();; new TCanvas("c1", "c1",0,0,800,700); - gStyle->SetPalette(1); nt = new TNtuple("nt","Demo ntuple","x:y:z:u:v:w"); diff --git a/tutorials/tree/tree0.C b/tutorials/tree/tree0.C index 5babbb6465c3b..a09913de70ae6 100644 --- a/tutorials/tree/tree0.C +++ b/tutorials/tree/tree0.C @@ -89,7 +89,6 @@ void tree0() { tree->StartViewer(); //gROOT->SetStyle("Plain"); // uncomment to set a different style - gStyle->SetPalette(1); // use precomputed color palette 1 // now draw some tree variables TCanvas *c1 = new TCanvas(); diff --git a/tutorials/tree/tree4.C b/tutorials/tree/tree4.C index 2ab49c6733891..2a0d7fa204346 100644 --- a/tutorials/tree/tree4.C +++ b/tutorials/tree/tree4.C @@ -1,6 +1,6 @@ /// \file /// \ingroup tutorial_tree -/// \notebook +/// \notebook -nodraw /// This example writes a tree with objects of the class Event. /// It is a simplified version of $ROOTSYS/test/MainEvent.cxx to /// write the tree, and $ROOTSYS/test/eventb.C diff --git a/tutorials/unuran/unuranDemo.C b/tutorials/unuran/unuranDemo.C index f2d9c847979e3..08a555be909a4 100644 --- a/tutorials/unuran/unuranDemo.C +++ b/tutorials/unuran/unuranDemo.C @@ -42,10 +42,8 @@ #include "TApplication.h" #include "TCanvas.h" -#ifndef __CINT__ // need to exclude to avoid CINT re-defining them #include "Math/ProbFunc.h" #include "Math/DistFunc.h" -#endif #include #include