12 double momentum[nfile] = {150, 200, 300, 500, 1000};
13 double sigma[nfile][25] = {0};
14 double error[nfile][25] = {0};
16 int l(0),i,file,last(-1);
19 ifstream fin(
"log",ios::in);
23 while(std::getline(fin, strcom)){
25 if(l == last)
continue;
40 TAxis *x_axis,*y_axis;
41 TGraphErrors *gr_sigma_pt;
42 TCanvas *c_pt =
new TCanvas(
"sigma_pt",
"sigma_pt",2500,2500 );
44 for(
int i=0;i<25;i++){
45 TGraphErrors *gr_sigma_pt =
new TGraphErrors();
46 for(
int file=0;file<nfile;file++){
48 gr_sigma_pt->SetPoint(file,
momentum[file],sigma[file][i]);
49 gr_sigma_pt->SetPointError(file,0,error[file][i]);
52 gr_sigma_pt->Draw(
"APLsame");
53 gr_sigma_pt->SetMarkerStyle(20);
54 gr_sigma_pt->SetMarkerSize(1.0);
55 gr_sigma_pt->SetMarkerColor(3);
56 gr_sigma_pt->SetLineColor(3);
57 x_axis = gr_sigma_pt->GetXaxis();
58 y_axis = gr_sigma_pt->GetYaxis();
59 x_axis->SetTitle(
"transverse momentum (MeV)");
60 x_axis->CenterTitle();
61 x_axis->SetTitleSize(0.05);
62 x_axis->SetLabelSize(0.04);
63 x_axis->SetTitleOffset(1.05);
64 y_axis->SetTitle(
"#sigma (cm)");
65 y_axis->CenterTitle();
66 y_axis->SetTitleSize(0.05);
67 y_axis->SetLabelSize(0.04);
70 if(i<3){ssname <<
"layer"<<i+1;}
71 else if(i<15){ssname <<
"layer"<<i+6;}
72 else if(i<22){ssname <<
"layer"<<i+22;}
73 else if(i==22){ssname <<
"1~3layer";}
74 else if(i==23){ssname <<
"9~20layer";}
75 else if(i==24){ssname <<
"37~43layer";}
84 gr_sigma_pt->SetTitle(name);
86 c_pt->SaveAs(
"sigma_pt.png");
87 c_pt->SaveAs(
"sigma_pt.pdf");
88 c_pt->SaveAs(
"sigma_pt.eps");
89 TCanvas *c_pt_layer =
new TCanvas(
"sigma_pt_layer",
"sigma_pt_layer",1000,1000 );
90 TLegend* leg =
new TLegend(0.30,0.60,0.60,0.88);
91 for(
int file=0;file<nfile;file++){
92 TGraphErrors *gr_sigma_pt_layer =
new TGraphErrors();
93 for(
int i=0;i<22;i++){
96 else if(i<15){layer = i+6;}
97 else if(i<22){layer = i+22;}
99 gr_sigma_pt_layer->SetPoint(i,layer,sigma[file][i]);
100 gr_sigma_pt_layer->SetPointError(i,0,error[file][i]);
102 if(file==0)gr_sigma_pt_layer->Draw(
"APLsame");
103 else gr_sigma_pt_layer->Draw(
"PLsame");
104 gr_sigma_pt_layer->SetMarkerStyle(20);
105 gr_sigma_pt_layer->SetMarkerSize(1.0);
106 gr_sigma_pt_layer->SetMarkerColor(file+1);
107 gr_sigma_pt_layer->SetLineColor(file+1);
108 x_axis = gr_sigma_pt_layer->GetXaxis();
109 y_axis = gr_sigma_pt_layer->GetYaxis();
110 x_axis->SetTitle(
"layer");
111 x_axis->CenterTitle();
112 x_axis->SetTitleSize(0.05);
113 x_axis->SetLabelSize(0.04);
114 x_axis->SetTitleOffset(1.05);
115 y_axis->SetTitle(
"#sigma (cm)");
116 y_axis->CenterTitle();
117 y_axis->SetTitleSize(0.05);
118 y_axis->SetLabelSize(0.04);
137 sname = ssname.str();
138 name = sname.c_str();
139 gr_sigma_pt_layer->SetTitle(
"sigma_layer");
140 leg->AddEntry(gr_sigma_pt_layer,name,
"pl");
144 leg->SetFillColor(kWhite);
145 leg->SetLineColor(kWhite);
146 c_pt_layer->SaveAs(
"sigma_pt_layer.png");
147 c_pt_layer->SaveAs(
"sigma_pt_layer.pdf");
148 c_pt_layer->SaveAs(
"sigma_pt_layer.eps");
192 gr_bin_height->Draw("APLsame");
193 gr_bin_height->SetMinimum(0.0);
194 gr_bin_height->SetMaximum(1.20);
195 x_axis = gr_bin_height->GetXaxis();
196 y_axis = gr_bin_height->GetYaxis();
197 x_axis->SetTitle("peak height");
198 x_axis->CenterTitle();
199 x_axis->SetTitleSize(0.05);
200 x_axis->SetLabelSize(0.04);
201 x_axis->SetTitleOffset(1.05);
202 y_axis->SetTitle("bin number");
203 y_axis->CenterTitle();
204 y_axis->SetTitleSize(0.05);
205 y_axis->SetLabelSize(0.04);
207 else gr_bin_height->Draw("PLsame");
208 gr_bin_height->SetMarkerStyle(20);
209 gr_bin_height->SetMarkerSize(1.0);
210 gr_bin_height->SetMarkerColor(ff+1);
211 gr_bin_height->SetLineColor(ff+1);
213 ssname <<point[ff]<<"point per bin";
214 sname = ssname.str();
215 name = sname.c_str();
216 leg->AddEntry(gr_bin_height,name,"pl");
217 //gr_bin_height->SetTitle("sigma_layer");
221 leg->SetFillColor(kWhite);
222 leg->SetLineColor(kWhite);
223 c_pt_layer->SaveAs("hit_rate_of_peak.png");
224 c_pt_layer->SaveAs("hit_rate_of_peak.pdf");
225 c_pt_layer->SaveAs("hit_rate_of_peak.eps");
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum