ROOT logo
void SetStyles(TH1 *histo,int marker, int color){
  histo->Sumw2();
  histo->SetMarkerStyle(marker);
  histo->SetMarkerColor(color);
  histo->SetLineColor(color);
  //histo->GetXaxis()->SetTitle(xtitle);
  //histo->GetYaxis()->SetTitle(ytitle);
}
void PlotMinEtFromSim(Bool_t isPhos = kFALSE){
  gStyle->SetOptTitle(0);
  gStyle->SetOptStat(0);
  gStyle->SetOptFit(0);
  Float_t min = 0;
  float max = 1;
  TString filename, detname;
  if(isPhos){
    min = 0.655;
    max = 0.785;
    detname = "PHOS";
    filename = "rootFiles/LHC11a10a_bis/Et.ESD.simPbPb.PHOS.LHC11a10a_bis.Run139465.root";
  }
  else{
    min = 0.58;
    max = 0.725;
    filename = "rootFiles/LHC11a10a_bis/Et.ESD.simPbPb.EMCal.LHC11a10a_bis.Run139465.root";
    detname = "EMCal";
  }
  
  TFile *f = TFile::Open(filename, "READ");
  TList *l = dynamic_cast<TList*>(f->Get("out1"));
  TH1F *fHistSimulatedGammaEnergyAboveThreshold = l->FindObject("fHistSimulatedGammaEnergyAboveThreshold");
  TH1F *fHistSimulatedGammaEnergy = l->FindObject("fHistSimulatedGammaEnergy");
  SetStyles(fHistSimulatedGammaEnergyAboveThreshold,20,TColor::kRed);
  fHistSimulatedGammaEnergyAboveThreshold->Divide(fHistSimulatedGammaEnergy);

    TCanvas *c1 = new TCanvas("c1","Simulation",600,400);
    c1->SetTopMargin(0.02);
    c1->SetRightMargin(0.03);
    c1->SetLeftMargin(0.11745);
    c1->SetBottomMargin(0.11745);
    c1->SetBorderSize(0);
    c1->SetFillColor(0);
    c1->SetFillColor(0);
    c1->SetBorderMode(0);
    c1->SetFrameFillColor(0);
    c1->SetFrameBorderMode(0);
    fHistSimulatedGammaEnergyAboveThreshold->SetMaximum(max +0.1);
    fHistSimulatedGammaEnergyAboveThreshold->SetMinimum(min-0.1);
    fHistSimulatedGammaEnergyAboveThreshold->GetXaxis()->SetTitle("Centrality bin");
    fHistSimulatedGammaEnergyAboveThreshold->GetYaxis()->SetTitle("f_{minEt}");
    fHistSimulatedGammaEnergyAboveThreshold->GetYaxis()->SetLabelSize(0.06);
    fHistSimulatedGammaEnergyAboveThreshold->GetXaxis()->SetLabelSize(0.06);
    fHistSimulatedGammaEnergyAboveThreshold->GetYaxis()->SetTitleSize(0.06);
    fHistSimulatedGammaEnergyAboveThreshold->GetXaxis()->SetTitleSize(0.06);
    fHistSimulatedGammaEnergyAboveThreshold->Draw();
    TLine *lineMin = new TLine(-0.5,min,19.5,min);
    lineMin->Draw();
    TLine *lineMax = new TLine(-0.5,max,19.5,max);
    lineMax->Draw();
    lineMin->SetLineColor(TColor::kBlue);
    lineMax->SetLineColor(TColor::kBlue);
    lineMin->SetLineStyle(2);
    lineMax->SetLineStyle(2);

    TString outfile = "/tmp/MinEtFromSim"+detname+".png";
    c1->SaveAs(outfile.Data());
}
 PlotMinEtFromSim.C:1
 PlotMinEtFromSim.C:2
 PlotMinEtFromSim.C:3
 PlotMinEtFromSim.C:4
 PlotMinEtFromSim.C:5
 PlotMinEtFromSim.C:6
 PlotMinEtFromSim.C:7
 PlotMinEtFromSim.C:8
 PlotMinEtFromSim.C:9
 PlotMinEtFromSim.C:10
 PlotMinEtFromSim.C:11
 PlotMinEtFromSim.C:12
 PlotMinEtFromSim.C:13
 PlotMinEtFromSim.C:14
 PlotMinEtFromSim.C:15
 PlotMinEtFromSim.C:16
 PlotMinEtFromSim.C:17
 PlotMinEtFromSim.C:18
 PlotMinEtFromSim.C:19
 PlotMinEtFromSim.C:20
 PlotMinEtFromSim.C:21
 PlotMinEtFromSim.C:22
 PlotMinEtFromSim.C:23
 PlotMinEtFromSim.C:24
 PlotMinEtFromSim.C:25
 PlotMinEtFromSim.C:26
 PlotMinEtFromSim.C:27
 PlotMinEtFromSim.C:28
 PlotMinEtFromSim.C:29
 PlotMinEtFromSim.C:30
 PlotMinEtFromSim.C:31
 PlotMinEtFromSim.C:32
 PlotMinEtFromSim.C:33
 PlotMinEtFromSim.C:34
 PlotMinEtFromSim.C:35
 PlotMinEtFromSim.C:36
 PlotMinEtFromSim.C:37
 PlotMinEtFromSim.C:38
 PlotMinEtFromSim.C:39
 PlotMinEtFromSim.C:40
 PlotMinEtFromSim.C:41
 PlotMinEtFromSim.C:42
 PlotMinEtFromSim.C:43
 PlotMinEtFromSim.C:44
 PlotMinEtFromSim.C:45
 PlotMinEtFromSim.C:46
 PlotMinEtFromSim.C:47
 PlotMinEtFromSim.C:48
 PlotMinEtFromSim.C:49
 PlotMinEtFromSim.C:50
 PlotMinEtFromSim.C:51
 PlotMinEtFromSim.C:52
 PlotMinEtFromSim.C:53
 PlotMinEtFromSim.C:54
 PlotMinEtFromSim.C:55
 PlotMinEtFromSim.C:56
 PlotMinEtFromSim.C:57
 PlotMinEtFromSim.C:58
 PlotMinEtFromSim.C:59
 PlotMinEtFromSim.C:60
 PlotMinEtFromSim.C:61
 PlotMinEtFromSim.C:62
 PlotMinEtFromSim.C:63
 PlotMinEtFromSim.C:64
 PlotMinEtFromSim.C:65
 PlotMinEtFromSim.C:66
 PlotMinEtFromSim.C:67
 PlotMinEtFromSim.C:68