11 string inputfile_hcalin_sim =
"/sphenix/user/xusun/software/data/cosmic/TowerCalibAna/Proto4TowerInfoSIM_HCALIN_0.root";
12 TFile *File_HCALIN_SIM = TFile::Open(inputfile_hcalin_sim.c_str());
14 TH1F *h_hcalin_tower_sim[16];
15 TF1 *f_landau_hcalin_sim[16];
16 for(
int i_tower = 0; i_tower < 16; ++i_tower)
18 string HistName = Form(
"h_mHCALIN_SIM_twr_%d",i_tower);
19 h_hcalin_tower_sim[i_tower] = (TH1F*)File_HCALIN_SIM->Get(HistName.c_str())->Clone();
20 string FuncName = Form(
"f_mHCALIN_SIM_twr_%d",i_tower);
21 f_landau_hcalin_sim[i_tower] =
new TF1(FuncName.c_str(),
"landau",0,20);
24 TCanvas *c_hcalin_sim =
new TCanvas(
"c_hcalin_sim",
"c_hcalin_sim",10,10,1600,1600);
25 c_hcalin_sim->Divide(4,4);
26 for(
int i_row = 0; i_row < 4; ++i_row)
28 for(
int i_col = 0; i_col < 4; ++i_col)
30 int i_pad = 4*(4-(i_row+1))+i_col+1;
31 int i_tower = i_row + 4*i_col;
32 c_hcalin_sim->cd(i_pad);
33 h_hcalin_tower_sim[i_tower]->GetXaxis()->SetRangeUser(2,20);
34 h_hcalin_tower_sim[i_tower]->Draw();
36 for(
int i_par = 0; i_par < 3; ++i_par)
38 f_landau_hcalin_sim[i_tower]->ReleaseParameter(i_par);
40 f_landau_hcalin_sim[i_tower]->SetParameter(0,10.0);
41 f_landau_hcalin_sim[i_tower]->SetParameter(1,10.0);
42 f_landau_hcalin_sim[i_tower]->SetParameter(2,10.0);
43 f_landau_hcalin_sim[i_tower]->SetRange(0,20);
44 if(h_hcalin_tower_sim[i_tower]->GetEntries() > 100)
46 h_hcalin_tower_sim[i_tower]->Fit(f_landau_hcalin_sim[i_tower],
"R");
47 string lable = Form(
"MPV %1.1f",f_landau_hcalin_sim[i_tower]->
GetParameter(1));
48 TLegend *
leg =
new TLegend(0.4,0.5,0.8,0.8);
50 leg->SetBorderSize(0);
51 leg->AddEntry(h_hcalin_tower_sim[i_tower],lable.c_str(),
"L");
56 c_hcalin_sim->SaveAs(
"./figures/c_hcalin_sim_col_0.eps");
58 string inputfile_hcalin_raw =
"/sphenix/user/xusun/software/data/cosmic/TowerCalibAna/Proto4TowerInfoRAW_HCALIN_0.root";
59 TFile *File_HCALIN_RAW = TFile::Open(inputfile_hcalin_raw.c_str());
61 TH1F *h_hcalin_tower_raw[16];
62 TF1 *f_landau_hcalin_raw[16];
63 for(
int i_tower = 0; i_tower < 16; ++i_tower)
65 string HistName = Form(
"h_mHCALIN_RAW_twr_%d",i_tower);
66 h_hcalin_tower_raw[i_tower] = (TH1F*)File_HCALIN_RAW->Get(HistName.c_str())->Clone();
67 string FuncName = Form(
"f_mHCALIN_RAW_twr_%d",i_tower);
68 f_landau_hcalin_raw[i_tower] =
new TF1(FuncName.c_str(),
"landau",0,20);
71 TCanvas *c_hcalin_raw =
new TCanvas(
"c_hcalin_raw",
"c_hcalin_raw",10,10,1600,1600);
72 c_hcalin_raw->Divide(4,4);
73 for(
int i_row = 0; i_row < 4; ++i_row)
75 for(
int i_col = 0; i_col < 4; ++i_col)
77 int i_pad = 4*(4-(i_row+1))+i_col+1;
78 int i_tower = i_row + 4*i_col;
79 c_hcalin_raw->cd(i_pad);
80 c_hcalin_raw->cd(i_pad)->SetLogy();
81 h_hcalin_tower_raw[i_tower]->Draw();
105 c_hcalin_raw->SaveAs(
"./figures/c_hcalin_raw_col_0.eps");