11void tree501_cernstaff()
14 dir.
Append(
"/io/tree/cernstaff.C");
15 if (
gSystem->AccessPathName(
"cernstaff.root")) {
16 gROOT->SetMacroPath(dir);
17 gROOT->ProcessLine(
".x tree500_cernbuild.C");
20 auto T =
f->Get<
TTree>(
"T");
21 auto c1 =
new TCanvas(
"c1",
"CERN staff", 10, 10, 1000, 750);
26 T->Draw(
"Nation:Division>>hN",
"",
"text");
34 gPad->SetLeftMargin(0.12);
35 T->Draw(
"Cost:Nation>>hNation",
"",
"prof,goff");
37 hNation->
SetTitle(
"Average Cost per Nation");
48 auto hGrades =
new THStack(
"hGrades",
"Nations versus Grade");
49 auto hFR =
new TH1F(
"hFR",
"FR", 12, 3, 15);
50 hFR->SetFillColor(
kCyan);
52 T->Draw(
"Grade>>hFR",
"Nation==\"FR\"");
53 auto hCH =
new TH1F(
"hCH",
"CH", 12, 3, 15);
54 hCH->SetFillColor(
kRed);
56 T->Draw(
"Grade>>hCH",
"Nation==\"CH\"");
57 auto hIT =
new TH1F(
"hIT",
"IT", 12, 3, 15);
60 T->Draw(
"Grade>>hIT",
"Nation==\"IT\"");
61 auto hDE =
new TH1F(
"hDE",
"DE", 12, 3, 15);
64 T->Draw(
"Grade>>hDE",
"Nation==\"DE\"");
65 auto hGB =
new TH1F(
"hGB",
"GB", 12, 3, 15);
66 hGB->SetFillColor(
kBlue);
68 T->Draw(
"Grade>>hGB",
"Nation==\"GB\"");
70 auto legend =
new TLegend(0.7, 0.65, 0.86, 0.88);
71 legend->AddEntry(hGB,
"GB",
"f");
72 legend->AddEntry(hDE,
"DE",
"f");
73 legend->AddEntry(hIT,
"IT",
"f");
74 legend->AddEntry(hCH,
"CH",
"f");
75 legend->AddEntry(hFR,
"FR",
"f");
79 c1->cd(4);
gPad->SetGrid();
81 T->Draw(
"Age>>hRetired",
"Age>(65-2002+1988)",
"same");
86 auto arrow =
new TArrow(32, 169, 55, 74, 0.03,
"|>");
87 arrow->SetFillColor(1);
88 arrow->SetFillStyle(1001);
91 auto pt =
new TPaveText(0.12, 0.8, 0.55, 0.88,
"brNDC");
93 pt->AddText(
"People at CERN in 1988");
94 pt->AddText(
"and retired in 2002");
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
1-D histogram with a float per channel (see TH1 documentation)
void SetTitle(const char *title) override
Change/set the title.
virtual void LabelsOption(Option_t *option="h", Option_t *axis="X")
Sort bins with labels or set option(s) to draw axis with labels.
virtual void SetMaximum(Double_t maximum=-1111)
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual void SetMinimum(Double_t minimum=-1111)
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
2-D histogram with a float per channel (see TH1 documentation)
TString & Append(const char *cs)
A TTree represents a columnar dataset.