11 int hbdchanIHC[4][4] = {{16, 12, 8, 4},
16 float sim_out_start[4] = {6.1,5.9,5.5,5.5};
17 float sim_out_stop[4] = {15.0,15.0,15.0,15.0};
18 float raw_out_start[4] = {1000.0,500.0,1000.0,1000.0};
19 float raw_out_stop[4] = {5000.0,2500.0,6000.0,5000.0};
21 float energy[16] = {-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0};
22 float adc[16] = {-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0};
77 string inputfile_raw = Form(
"/sphenix/user/xusun/TestBeam/TowerCalibAna/Proto4TowerInfoRAW_%s.root",det.c_str());
78 TFile *File_InPut_RAW = TFile::Open(inputfile_raw.c_str());
80 TH1F *h_hcal_tower_raw[16];
81 TF1 *f_landau_hcal_raw[16];
82 for(
int i_tower = 0; i_tower < 16; ++i_tower)
84 string HistName = Form(
"h_m%s_RAW_twr_%d",det.c_str(),i_tower);
85 h_hcal_tower_raw[i_tower] = (TH1F*)File_InPut_RAW->Get(HistName.c_str())->Clone();
86 string FuncName = Form(
"f_m%s_RAW_twr_%d",det.c_str(),i_tower);
87 f_landau_hcal_raw[i_tower] =
new TF1(FuncName.c_str(),
"landau",0,16000);
90 TCanvas *c_hcal_raw =
new TCanvas(
"c_hcal_raw",
"c_hcal_raw",10,10,1600,1600);
91 c_hcal_raw->Divide(4,4);
92 for(
int i_row = 0; i_row < 4; ++i_row)
94 for(
int i_col = 0; i_col < 4; ++i_col)
96 int i_pad = 4*i_row+i_col+1;
97 int i_tower = hbdchanIHC[i_row][i_col]-1;
98 c_hcal_raw->cd(i_pad);
99 h_hcal_tower_raw[i_tower]->Draw();
101 for(
int i_par = 0; i_par < 3; ++i_par)
103 f_landau_hcal_raw[i_tower]->ReleaseParameter(i_par);
105 f_landau_hcal_raw[i_tower]->SetParameter(0,10.0);
106 f_landau_hcal_raw[i_tower]->SetParameter(1,10.0);
107 f_landau_hcal_raw[i_tower]->SetParameter(2,10.0);
108 if(det ==
"HCALIN") f_landau_hcal_raw[i_tower]->SetRange(2000.0,8000.0);
109 if(det ==
"HCALOUT") f_landau_hcal_raw[i_tower]->SetRange(raw_out_start[i_row],raw_out_stop[i_row]);
110 if(h_hcal_tower_raw[i_tower]->GetEntries() > 100)
112 h_hcal_tower_raw[i_tower]->Fit(f_landau_hcal_raw[i_tower],
"R");
113 adc[i_tower] = f_landau_hcal_raw[i_tower]->GetParameter(1);
114 string lable = Form(
"MPV %4.1f",f_landau_hcal_raw[i_tower]->
GetParameter(1));
115 TLegend *
leg =
new TLegend(0.4,0.5,0.8,0.8);
116 leg->SetFillColor(0);
117 leg->SetBorderSize(0);
118 leg->AddEntry(h_hcal_tower_raw[i_tower],lable.c_str(),
"L");
123 string fig_raw = Form(
"./figures/HCAL_TowerMap/c_%s_raw.eps",det.c_str());
124 c_hcal_raw->SaveAs(fig_raw.c_str());