couet
36
void afzaal() {
auto f1 = new TFile("aluminium.root");
TH1D *h_first = (TH1D*)f1->Get("h1");
h_first->SetLineWidth(2);
h_first->SetLineColor(kBlack);
h_first->SetMarkerColor(kBlack);
h_first->SetMarkerStyle(2);
h_first->Draw("hist");
auto f2 = new TFile("glass.root");
TH1D* h_second = (TH1D*)f1->Get("h1");
h_second->SetLineWidth(2);
h_second->SetLineColor(kRed);
h_second->SetMarkerColor(kRed);
h_second->SetMarkerStyle(2);
h_second->Draw("hist same");
auto f3 = new TFile("bakelite.root");
TH1D* h_third = (TH1D*)f1->Get("h1");
h_third->SetLineWidth(2);
h_third->SetLineColor(kGreen);
h_third->SetMarkerColor(kGreen);
h_third->SetMarkerStyle(2);
h_third->Draw("hist same");
auto legend = new TLegend(0.1,0.7,0.48,0.9);
legend->AddEntry(h_first, "aluminium");
legend->AddEntry(h_second, "glass");
legend->AddEntry(h_third, "bakelite");
legend->Draw();
// Double_t scale=1./h1->Integral();
// h1->Scale(1/h1->Integral());
// h1->Draw("hist same");
}