Skip to content

Commit 7f1977d

Browse files
committed
[tutorials][hist] Refactor histogram tutorials to return void instead of TCanvas*
1 parent c4b3303 commit 7f1977d

File tree

8 files changed

+7
-24
lines changed

8 files changed

+7
-24
lines changed

tutorials/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -550,13 +550,6 @@ set(returncode_1 math/fit/fit2a.C
550550
visualisation/graphics/tmathtext.C visualisation/graphics/tmathtext2.C
551551
visualisation/graphs/gr106_exclusiongraph.C
552552
visualisation/graphs/gr016_struct.C
553-
hist/hist102_TH2_contour_list.C
554-
hist/hist006_TH1_bar_charts.C
555-
hist/hist037_TH2Poly_boxes.C
556-
hist/hist060_TH1_stats.C
557-
hist/hist014_TH1_cumulative.C
558-
hist/hist004_TH1_labels.C
559-
hist/hist036_TH2_labels.C
560553
analysis/tree/h1analysis.C
561554
math/chi2test.C
562555
math/r/SimpleFitting.C)

tutorials/hist/hist004_TH1_labels.C

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// \date November 2024
1212
/// \author Rene Brun
1313

14-
TCanvas *hist004_TH1_labels()
14+
void hist004_TH1_labels()
1515
{
1616
// Create the histogram
1717
const std::array people{"Jean", "Pierre", "Marie", "Odile", "Sebastien", "Fons", "Rene",
@@ -56,6 +56,4 @@ TCanvas *hist004_TH1_labels()
5656
pt->AddText(" \">\" to sort by decreasing values");
5757
pt->AddText(" \"<\" to sort by increasing values");
5858
pt->Draw();
59-
60-
return c1;
6159
}

tutorials/hist/hist006_TH1_bar_charts.C

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/// \date November 2024
1010
/// \author Rene Brun
1111

12-
TCanvas *hist006_TH1_bar_charts()
12+
void hist006_TH1_bar_charts()
1313
{
1414
// Try to open first the file cernstaff.root in tutorials/io/tree directory
1515
TString filedir = gROOT->GetTutorialDir();
@@ -88,6 +88,4 @@ TCanvas *hist006_TH1_bar_charts()
8888
legend->Draw();
8989

9090
c1->cd();
91-
92-
return c1;
9391
}

tutorials/hist/hist014_TH1_cumulative.C

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "TCanvas.h"
1818
#include "TRandom.h"
1919

20-
TCanvas *hist014_TH1_cumulative()
20+
void hist014_TH1_cumulative()
2121
{
2222
TH1 *h = new TH1D("h", "h", 100, -5., 5.);
2323
gRandom->SetSeed();
@@ -37,6 +37,4 @@ TCanvas *hist014_TH1_cumulative()
3737
c->cd(2);
3838
hc->Draw();
3939
c->Update();
40-
41-
return c;
4240
}

tutorials/hist/hist036_TH2_labels.C

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/// \date July 2016
1010
/// \author Rene Brun
1111

12-
TCanvas *hist036_TH2_labels()
12+
void hist036_TH2_labels()
1313
{
1414
const Int_t nx = 12;
1515
const Int_t ny = 20;
@@ -44,5 +44,4 @@ TCanvas *hist036_TH2_labels()
4444
pt->AddText(" \">\" to sort by decreasing values");
4545
pt->AddText(" \"<\" to sort by increasing values");
4646
pt->Draw();
47-
return c1;
4847
}

tutorials/hist/hist037_TH2Poly_boxes.C

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// \date August 2016
1111
/// \author Olivier Couet
1212

13-
TCanvas *hist037_TH2Poly_boxes()
13+
void hist037_TH2Poly_boxes()
1414
{
1515
TCanvas *ch2p2 = new TCanvas("ch2p2", "ch2p2", 600, 400);
1616
gStyle->SetPalette(57);
@@ -44,5 +44,4 @@ TCanvas *hist037_TH2Poly_boxes()
4444
}
4545

4646
h2p->Draw("COLZ");
47-
return ch2p2;
4847
}

tutorials/hist/hist060_TH1_stats.C

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/// \date August 2016
1414
/// \author Olivier Couet
1515

16-
TCanvas *hist060_TH1_stats()
16+
void hist060_TH1_stats()
1717
{
1818
// Create and plot a test histogram with stats
1919
TCanvas *se = new TCanvas;
@@ -44,5 +44,4 @@ TCanvas *hist060_TH1_stats()
4444
h->SetStats(0);
4545

4646
se->Modified();
47-
return se;
4847
}

tutorials/hist/hist102_TH2_contour_list.C

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
Double_t SawTooth(Double_t x, Double_t WaveLen);
2222

23-
TCanvas *hist102_TH2_contour_list()
23+
void hist102_TH2_contour_list()
2424
{
2525

2626
const Double_t PI = TMath::Pi();
@@ -157,7 +157,6 @@ TCanvas *hist102_TH2_contour_list()
157157
printf("\n\n\tExtracted %d Contours and %d Graphs \n", TotalConts, nGraphs);
158158
gStyle->SetTitleW(0.);
159159
gStyle->SetTitleH(0.);
160-
return c1;
161160
}
162161

163162
Double_t SawTooth(Double_t x, Double_t WaveLen)

0 commit comments

Comments
 (0)