diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index 054b30cbd0cda..a2b7d97c2e9f5 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -273,10 +273,10 @@ set(gui_veto math/fit/fitpanel_playback.C visualisation/geom/building.C visualisation/geom/cheongwadae.C visualisation/geom/geom*.C visualisation/geom/lego.C visualisation/geom/robot.C visualisation/geom/south_gate.C visualisation/geom/station*.C visualisation/geom/tank.C visualisation/geom/webdemo.C visualisation/geom/web_cms.cxx visualisation/gl/glViewerExercise.C visualisation/gl/glViewerLOD.C visualisation/gl/gviz3d.C visualisation/gl/nucleus.C visualisation/gl/viewer3DLocal.C visualisation/gl/viewer3DMaster.C visualisation/gui/*.C - hist/exec1.C - hist/exec2.C - hist/tprofile2polyRealistic.C - hist/tprofile2polyRealisticModuleError.C + hist/hist057_TExec_th1.C + hist/hist057_TExec_th2.C + hist/hist041_TProfile2Poly_realistic.C + hist/hist042_TProfile2Poly_module_error.C visualisation/image/*.C visualisation/graphics/psview.C visualisation/graphics/gtime.C visualisation/graphics/graph_edit_playback.C @@ -513,13 +513,13 @@ set(returncode_1 math/fit/fit2a.C visualisation/graphics/tmathtext.C visualisation/graphics/tmathtext2.C visualisation/graphs/exclusiongraph.C visualisation/graphs/graphstruct.C - hist/ContourList.C + hist/hist102_TH2_contour_list.C hist/hist006_TH1_bar_charts.C - hist/th2polyBoxes.C - hist/statsEditing.C - hist/cumulative.C + hist/hist037_TH2Poly_boxes.C + hist/hist060_Stats.C + hist/hist014_TH1_cumulative.C hist/hist004_TH1_labels.C - hist/hlabels2.C + hist/hist036_TH2_labels.C io/tree/h1analysis.C math/chi2test.C math/r/SimpleFitting.C) diff --git a/tutorials/hist/exec1.C b/tutorials/hist/exec1.C deleted file mode 100644 index 8513dde4f7f26..0000000000000 --- a/tutorials/hist/exec1.C +++ /dev/null @@ -1,36 +0,0 @@ -/// \file -/// \ingroup tutorial_hist -/// Echo object at mouse position. -/// Example of macro called when a pad is redrawn -/// one must create a TExec object in the following way -/// ~~~{.cpp} -/// gPad->AddExec("ex1", ".x exec1.C"); -/// ~~~ -/// this macro prints the bin number and the bin content when one clicks -/// on the histogram contour of any histogram in a pad -/// -/// \macro_code -/// -/// \authors Rene Brun, Sergey Linev - - -void exec1() -{ - if (!gPad) { - Error("exec1", "gPad is null, you are not supposed to run this macro"); - return; - } - - Int_t event = gPad->GetEvent(); - int px = gPad->GetEventX(); - TObject *select = gPad->GetSelected(); - - if (select && select->InheritsFrom(TH1::Class())) { - TH1 *h = (TH1*)select; - Float_t xx = gPad->AbsPixeltoX(px); - Float_t x = gPad->PadtoX(xx); - Int_t binx = h->GetXaxis()->FindBin(x); - printf("event=%d, hist:%s, bin=%d, content=%f\n", event, h->GetName(), binx, h->GetBinContent(binx)); - } -} - diff --git a/tutorials/hist/exec2.C b/tutorials/hist/exec2.C deleted file mode 100644 index 291173e8c9d9a..0000000000000 --- a/tutorials/hist/exec2.C +++ /dev/null @@ -1,76 +0,0 @@ -/// \file -/// \ingroup tutorial_hist -/// Echo object at mouse position and show a graphics line. -/// Example of macro called when a mouse event occurs in a pad. -/// -/// Example: -/// ~~~{.cpp} -/// TFile::Open("hsimple.root"); -/// hpxpy->Draw("colz"); -/// gPad->AddExec("ex2", ".x exec2.C"); -/// ~~~ -/// When moving the mouse in the canvas, a second canvas shows the -/// projection along X of the bin corresponding to the Y position -/// of the mouse. The resulting histogram is fitted with a gaussian. -/// A "dynamic" line shows the current bin position in Y. -/// This more elaborated example can be used as a starting point -/// to develop more powerful interactive applications exploiting CLING -/// as a development engine. -/// -/// \macro_code -/// -/// \authors Rene Brun, Sergey Linev - -void exec2() -{ - if (!gPad) { - Error("exec2", "gPad is null, you are not supposed to run this macro"); - return; - } - - int px = gPad->GetEventX(); - int py = gPad->GetEventY(); - float uxmin = gPad->GetUxmin(); - float uxmax = gPad->GetUxmax(); - int pxmin = gPad->XtoAbsPixel(uxmin); - int pxmax = gPad->XtoAbsPixel(uxmax); - TObject *select = gPad->GetSelected(); - TCanvas *c2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("c2"); - - gPad->GetCanvas()->FeedbackMode(kTRUE); - - int pyold = gPad->GetUniqueID(); // misuse of pad unique for last draw position - - if (pyold && c2) { - // erase line at old position - gVirtualX->DrawLine(pxmin, pyold, pxmax, pyold); - gPad->SetUniqueID(0); - } - - TH2 *h = dynamic_cast(select); - if(!h) return; - - //erase old position and draw a line at current position - gVirtualX->DrawLine(pxmin, py, pxmax, py); - gPad->SetUniqueID(py); - - Float_t upy = gPad->AbsPixeltoY(py); - Float_t y = gPad->PadtoY(upy); - - //create or set the new canvas c2 - auto padsav = gPad; - if(c2) delete c2->GetPrimitive("Projection"); - else c2 = new TCanvas("c2","Projection Canvas",710,10,700,500); - c2->SetGrid(); - c2->cd(); - - //draw slice corresponding to mouse position - Int_t biny = h->GetYaxis()->FindBin(y); - TH1D *hp = h->ProjectionX("",biny,biny); - hp->SetName("Projection"); - hp->SetTitle(TString::Format("Projection of biny=%d",biny)); - hp->Fit("gaus","ql"); - c2->Update(); - - padsav->cd(); -} diff --git a/tutorials/legacy/hist/ratioplot.C b/tutorials/legacy/hist/ratioplot.C index c0ba63480d0e8..8664222e0a95a 100644 --- a/tutorials/legacy/hist/ratioplot.C +++ b/tutorials/legacy/hist/ratioplot.C @@ -10,11 +10,7 @@ /// \date May 2021 /// \author Olivier Couet -<<<<<<<< HEAD:tutorials/legacy/hist/ratioplot.C void ratioplot() -======== -void hist035_TRatioPlot_manual_ratio() ->>>>>>>> 677335419c (only hist/*.C files change and intorudce new naming convention):tutorials/hist/hist035_TRatioPlot_manual_ratio.C { // Define two gaussian histograms. Note the X and Y title are defined // at booking time using the convention "Hist_title ; X_title ; Y_title"