7int wirebind[44] = {0,40,84,132,188,252,324,404,484,560,636,724,812,912,1012,1124,1236,1364,1492,1632,1772,1932,2092,2252,2412,2588,2764,2940,3116,3324,3532,3740,3948,4188,4428,4668,4908,5164,5420,5676,5932,6220,6508,6796};
28 file.push_back(
"../../WireGain/wiregain.root");
29 file.push_back(
"wiregain.root");
35 const int FileNo =
file.size();
36 TH2F*** h =
new TH2F**[
LayNo];
37 stringstream histname;
38 TCanvas*** c =
new TCanvas**[
LayNo];
39 TLegend*** lgd =
new TLegend**[
LayNo];
40 gStyle->SetOptStat(0);
41 gStyle->SetCanvasColor(10);
42 for(
int i=0;i<
LayNo;i++)
44 h[i] =
new TH2F*[FileNo/2];
45 c[i] =
new TCanvas*[FileNo/2];
46 lgd[i] =
new TLegend*[FileNo/2];
56 stringstream ss_file1;
57 stringstream ss_file2;
61 stringstream legendheader;
64 for(
int k=0;k<FileNo;k+=2)
69 f1=
new TFile(ss_file1.str().c_str());
70 tree1=(TTree*)
f1->Get(
"wiregcalib");
71 tree1->SetBranchAddress(
"wireg", wireg1);
74 tree1->SetMarkerStyle(22);
75 tree1->SetMarkerColor(4);
76 tree1->SetLineColor(4);
81 f2=
new TFile(ss_file2.str().c_str());
82 tree2=(TTree*)f2->Get(
"wiregcalib");
83 tree2->SetBranchAddress(
"wireg", wireg2);
86 tree2->SetMarkerStyle(20);
87 tree2->SetMarkerColor(2);
88 tree2->SetLineColor(2);
93 cout<<
"layer= "<<i<<endl;
108 cout<<
"Norm1= "<<Norm1<<
" Norm2= "<<Norm2<<endl;
110 legendheader.str(
"");
112 lgd[i][k/2] =
new TLegend(.3, .75, .89, .89);
113 lgd[i][k/2] ->SetFillColor(10);
114 lgd[i][k/2] ->SetBorderSize(1);
115 lgd[i][k/2] ->SetHeader(legendheader.str().c_str());
117 histname<<
"lay"<<i<<
"_"<<
file[k]<<
"-"<<
file[k+1];
119 else h[i][k/2] =
new TH2F(histname.str().c_str(),
"",100,
wirebind[i],
wirebind[i+1],100,(Norm1+Norm2)/2-
delta,(Norm1+Norm2)/2+
delta);
120 h[i][k/2] ->
GetYaxis()->SetTitle(
"wiregain");
121 h[i][k/2] ->
GetYaxis()->SetTitleOffset(1.);
122 h[i][k/2] ->
GetXaxis()->SetTitle(
"wire");
123 c[i][k/2] =
new TCanvas(histname.str().c_str(),histname.str().c_str(),800,600);
129 cout<<
"cut: "<<
cut.str().c_str()<<endl;
133 if(
NormFlag) ss1<<
"wireg/"<<Norm1<<
":wire";
134 else ss1<<
"wireg"<<
":wire";
135 tree1->Draw(ss1.str().c_str(),
cut.str().c_str(),
"sameLP");
136 lgd[i][k/2] ->AddEntry(tree1, ss_file1.str().c_str() ,
"p");
143 if(
NormFlag) ss2<<
"wireg/"<<Norm2<<
":wire";
144 else ss2<<
"wireg"<<
":wire";
145 tree2->Draw(ss2.str().c_str(),
cut.str().c_str(),
"sameLP");
146 lgd[i][k/2] ->AddEntry(tree2, ss_file2.str().c_str() ,
"p");
148 lgd[i][k/2] ->Draw();
165 c1->Print(
"diff_wire.ps[");
168 for(
int k=0;k<FileNo;k+=2)
172 c[i][k/2]->DrawClonePad();
173 c[i][k/2] ->
Close();
174 lgd[i][k/2] ->Delete();
177 c1->Print(
"diff_wire.ps");
179 c1->Print(
"diff_wire.ps]");
185 for(
int k=0;k<FileNo;k+=2)
void wiregVsWire_bylayer()
mg GetYaxis() -> SetRangeUser(0.8, 1.02)
mg GetXaxis() -> SetRangeUser(0.5, 1.9)