{ TFile *f1=new TFile("MinBiasResponseOutput_MinBias_EPOS_13TeV_MagnetOff_CASTORm.root"); TFile *f2=new TFile("MinBiasResponseOutput_MinBias_CUETP8M1_13TeV-pythia8_Magne.root"); TH1D* h1 = (TH1D*)f1->Get("MinBias_EPOS_13TeV_MagnetOff_CASTORmeasured_newNoise_newVertexReconstruction/Gen_EnergyEmEta") TH1D* h2 = (TH1D*) f2->Get("MinBias_CUETP8M1_13TeV-pythia8_MagnetOff_CASTORmeasured_newNoise_newVertexReconstruction/Gen_EnergyEmEta"); TCanvas *c1 = new TCanvas("Gen_EnergyEmEta","Gen_EnergyEmEta"); c1->cd(); h2->SetLineWidth(2); //h2->SetMarkerStyle(21); h1->SetLineColor(kBlue); h2->SetMarkerColor(kBlue); h2->SetLineColor(kGreen); h1->SetMarkerColor(kGreen); h1->SetXTitle("hadronic_energy"); h1->SetYTitle("Energy_Destribution"); TLegend *leg = new TLegend(0.5,0.5,0.95,0.95); leg->SetHeader("Electromagnetic_energy_per_eta_generator"); //leg->AddEntry(Gen_EnergyEmEta,"EPOS","l"); //leg->AddEntry(Gen_EnergyEmEta,"CUETP8M1_pythia8","l"); leg->AddEntry(h1,"EPOS","l"); leg->AddEntry(h2,"CUETP8M1_pythia8","l"); h1->Draw(); h2->Draw("same"); leg->Draw(); }