void tree501_cernstaff()
{
dir.
Append(
"/io/tree/cernstaff.C");
if (
gSystem->AccessPathName(
"cernstaff.root")) {
gROOT->SetMacroPath(dir);
gROOT->ProcessLine(
".x tree500_cernbuild.C");
}
auto c1 =
new TCanvas(
"c1",
"CERN staff", 10, 10, 1000, 750);
T->Draw("Nation:Division>>hN", "", "text");
gPad->SetLeftMargin(0.12);
T->Draw("Cost:Nation>>hNation", "", "prof,goff");
hNation->
SetTitle(
"Average Cost per Nation");
auto hGrades =
new THStack(
"hGrades",
"Nations versus Grade");
auto hFR =
new TH1F(
"hFR",
"FR", 12, 3, 15);
hFR->SetFillColor(
kCyan);
hGrades->Add(hFR);
T->Draw("Grade>>hFR", "Nation==\"FR\"");
auto hCH =
new TH1F(
"hCH",
"CH", 12, 3, 15);
hGrades->Add(hCH);
T->Draw("Grade>>hCH","Nation==\"CH\"");
auto hIT =
new TH1F(
"hIT",
"IT", 12, 3, 15);
hGrades->Add(hIT);
T->Draw("Grade>>hIT","Nation==\"IT\"");
auto hDE =
new TH1F(
"hDE",
"DE", 12, 3, 15);
hGrades->Add(hDE);
T->Draw("Grade>>hDE","Nation==\"DE\"");
auto hGB =
new TH1F(
"hGB",
"GB", 12, 3, 15);
hGB->SetFillColor(
kBlue);
hGrades->Add(hGB);
T->Draw("Grade>>hGB","Nation==\"GB\"");
hGrades->Draw();
auto legend =
new TLegend(0.7, 0.65, 0.86, 0.88);
legend->AddEntry(hGB,"GB","f");
legend->AddEntry(hDE,"DE","f");
legend->AddEntry(hIT,"IT","f");
legend->AddEntry(hCH,"CH","f");
legend->AddEntry(hFR,"FR","f");
legend->Draw();
T->Draw("Age");
T->Draw("Age>>hRetired", "Age>(65-2002+1988)", "same");
arrow->SetFillStyle(1001);
auto pt =
new TPaveText(0.12, 0.8, 0.55, 0.88,
"brNDC");
pt->AddText(
"People at CERN in 1988");
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.