8 TDirectory *
dir = (TDirectory*)gDirectory->FindObjectAny(
"FDC_Efficiency");
12 gDirectory->cd(
"Track_Quality");
13 TCanvas *cTrackQuality =
new TCanvas(
"cTrackQuality",
"Track Quality Histograms", 900, 800);
14 cTrackQuality->Divide(3,2);
17 TH1 *tmom = (TH1*) gDirectory->Get(
"hMom");
18 TH1 *tmom_acc = (TH1*) gDirectory->Get(
"hMom_accepted");
20 tmom_acc->SetLineColor(2);
21 tmom_acc->Draw(
"same");
24 TH1 *ttheta = (TH1*) gDirectory->Get(
"hTheta");
25 TH1 *ttheta_acc = (TH1*) gDirectory->Get(
"hTheta_accepted");
27 ttheta_acc->SetLineColor(2);
28 ttheta_acc->Draw(
"same");
31 TH1 *tphi = (TH1*) gDirectory->Get(
"hPhi");
32 TH1 *tphi_acc = (TH1*) gDirectory->Get(
"hPhi_accepted");
33 tphi->SetMinimum(0.0);
35 tphi_acc->SetLineColor(2);
36 tphi_acc->Draw(
"same");
39 TH1 *tchi = (TH1*) gDirectory->Get(
"hChi2OverNDF");
40 TH1 *tchi_acc = (TH1*) gDirectory->Get(
"hChi2OverNDF_accepted");
42 tchi_acc->SetLineColor(2);
43 tchi_acc->Draw(
"same");
46 TH1 *tcells = (TH1*) gDirectory->Get(
"hCellsHit");
47 TH1 *tcells_acc = (TH1*) gDirectory->Get(
"hCellsHit_accepted");
49 tcells_acc->SetLineColor(2);
50 tcells_acc->Draw(
"same");
53 TH1 *trings = (TH1*) gDirectory->Get(
"hRingsHit");
54 TH1 *trings_acc = (TH1*) gDirectory->Get(
"hRingsHit_accepted");
56 trings_acc->SetLineColor(2);
57 trings_acc->Draw(
"same");
62 gDirectory->cd(
"../FDC_View");
63 TCanvas *cEfficiency_Wire =
new TCanvas(
"cEfficiency_Wire",
"Wire Efficiency", 1200, 800);
64 cEfficiency_Wire->Divide(6,4);
66 TGraphAsymmErrors *EffWire[24];
68 for(
unsigned int icell=1; icell<=24; icell++){
69 cEfficiency_Wire->cd(icell);
71 sprintf(hname1,
"fdc_wire_measured_cell[%d]", icell);
72 TH1 *
h1 = (TH1*)(gDirectory->Get(hname1));
74 sprintf(hname2,
"fdc_wire_expected_cell[%d]", icell);
75 TH1 *
h2 = (TH1*)(gDirectory->Get(hname2));
78 EffWire[icell-1] =
new TGraphAsymmErrors(h1, h2,
"ac");
79 EffWire[icell-1]->Draw(
"ap");
80 EffWire[icell-1]->SetMinimum(minScale);
81 EffWire[icell-1]->SetMaximum(maxScale);
82 EffWire[icell-1]->SetTitle(
"");
83 EffWire[icell-1]->GetXaxis()->SetTitle(
"Wire Number");
84 EffWire[icell-1]->GetYaxis()->SetTitle(
"Efficiency");
85 EffWire[icell-1]->GetYaxis()->SetTitleOffset(1.15);
86 EffWire[icell-1]->SetMinimum(minScale);
87 EffWire[icell-1]->SetMaximum(maxScale);
90 if (save) cEfficiency_Wire->SaveAs(
"cEfficiencyWire.pdf");
92 TCanvas *cEfficiency_Pseudo =
new TCanvas(
"cEfficiency_Pseudo",
"Pseudo Hit Efficiency", 1200, 800);
93 cEfficiency_Pseudo->Divide(6,4);
97 for(
unsigned int icell=1; icell<=24; icell++){
98 cEfficiency_Pseudo->cd(icell);
100 sprintf(hname3,
"fdc_pseudo_measured_cell[%d]", icell);
101 TH2 *
h3 = (TH2*)(gDirectory->Get(hname3));
103 sprintf(hname4,
"fdc_pseudo_expected_cell[%d]", icell);
104 TH2 *
h4 = (TH2*)(gDirectory->Get(hname4));
107 eff[icell-1] = (double) h3->GetEntries();
108 eff[icell-1] /= (double) h4->GetEntries();
111 h3->SetMinimum(minScale);
112 h3->SetMaximum(maxScale);
113 h3->GetXaxis()->SetTitle(
"X Position (cm)");
114 h3->GetYaxis()->SetTitle(
"Y Position (cm)");
118 cout <<
"Pseudo-Efficiency of cell " << icell <<
" : " << eff[icell-1] << endl;
123 cout <<
"Total : " << tot/24. << endl;
127 TCanvas *cEfficiency_vs =
new TCanvas(
"cEfficiency_vs",
"Efficiency vs Things", 900, 600);
128 cEfficiency_vs->Divide(3,2);
130 cEfficiency_vs->cd(1);
131 TH1I *
MeasDOCA = (TH1I*)(gDirectory->Get(
"Offline/Measured Hits Vs DOCA"));
132 TH1I *
ExpDOCA = (TH1I*)(gDirectory->Get(
"Offline/Expected Hits Vs DOCA"));
133 if(MeasDOCA && ExpDOCA){
134 TGraphAsymmErrors *EffDOCA =
new TGraphAsymmErrors(MeasDOCA, ExpDOCA,
"ac");
136 EffDOCA->SetMinimum(minScale);
137 EffDOCA->SetMaximum(maxScale);
138 EffDOCA->SetTitle(
"FDC Per Wire Efficiency Vs. DOCA");
139 EffDOCA->GetXaxis()->SetTitle(
"Closest distance between track and wire [cm]");
140 EffDOCA->GetYaxis()->SetTitle(
"Efficiency");
141 TLine *lcut =
new TLine(0.5,minScale,0.5,maxScale);
142 lcut->SetLineColor(2);
143 lcut->SetLineStyle(2);
144 lcut->SetLineWidth(2);
148 cEfficiency_vs->cd(2);
149 TH1I *
MeasTrackingFOM = (TH1I*)(gDirectory->Get(
"Offline/Measured Hits Vs Tracking FOM"));
150 TH1I *
ExpTrackingFOM = (TH1I*)(gDirectory->Get(
"Offline/Expected Hits Vs Tracking FOM"));
151 if(MeasTrackingFOM && ExpTrackingFOM){
152 TGraphAsymmErrors *EffTrackingFOM =
new TGraphAsymmErrors(MeasTrackingFOM, ExpTrackingFOM,
"ac");
153 EffTrackingFOM->Draw(
"ap");
154 EffTrackingFOM->SetMinimum(minScale);
155 EffTrackingFOM->SetMaximum(maxScale);
156 EffTrackingFOM->SetTitle(
"FDC Per Wire Efficiency Vs. Tracking FOM");
157 EffTrackingFOM->GetXaxis()->SetTitle(
"Tracking FOM");
158 EffTrackingFOM->GetYaxis()->SetTitle(
"Efficiency");
161 cEfficiency_vs->cd(3);
162 TH1I *
Meastheta = (TH1I*)(gDirectory->Get(
"Offline/Measured Hits Vs theta"));
163 TH1I *
Exptheta = (TH1I*)(gDirectory->Get(
"Offline/Expected Hits Vs theta"));
164 if(Meastheta && Exptheta){
165 TGraphAsymmErrors *Efftheta =
new TGraphAsymmErrors(Meastheta, Exptheta,
"ac");
166 Efftheta->Draw(
"ap");
167 Efftheta->SetMinimum(minScale);
168 Efftheta->SetMaximum(maxScale);
169 Efftheta->SetTitle(
"FDC Per Wire Efficiency Vs. #theta");
170 Efftheta->GetXaxis()->SetTitle(
"Track #theta [deg.]");
171 Efftheta->GetYaxis()->SetTitle(
"Efficiency");
174 cEfficiency_vs->cd(4);
175 TH1I *Measphi = (TH1I*)(gDirectory->Get(
"Offline/Measured Hits Vs phi"));
176 TH1I *Expphi = (TH1I*)(gDirectory->Get(
"Offline/Expected Hits Vs phi"));
177 if(Measphi && Expphi){
178 TGraphAsymmErrors *Effphi =
new TGraphAsymmErrors(Measphi, Expphi,
"ac");
180 Effphi->SetMinimum(minScale);
181 Effphi->SetMaximum(maxScale);
182 Effphi->SetTitle(
"FDC Per Wire Efficiency Vs. #phi");
183 Effphi->GetXaxis()->SetTitle(
"Track #phi [deg.]");
184 Effphi->GetYaxis()->SetTitle(
"Efficiency");
187 cEfficiency_vs->cd(5);
188 TH1I *
Measp = (TH1I*)(gDirectory->Get(
"Offline/Measured Hits Vs p"));
189 TH1I *
Expp = (TH1I*)(gDirectory->Get(
"Offline/Expected Hits Vs p"));
191 TGraphAsymmErrors *Effp =
new TGraphAsymmErrors(Measp, Expp,
"ac");
193 Effp->SetMinimum(minScale);
194 Effp->SetMaximum(maxScale);
195 Effp->SetTitle(
"FDC Per Wire Efficiency Vs. p");
196 Effp->GetXaxis()->SetTitle(
"Track Momentum [GeV/c]");
197 Effp->GetYaxis()->SetTitle(
"Efficiency");
200 cEfficiency_vs->cd(6);
201 TH1I *Meascells = (TH1I*)(gDirectory->Get(
"Offline/Measured Hits Vs Hit Cells"));
202 TH1I *Expcells = (TH1I*)(gDirectory->Get(
"Offline/Expected Hits Vs Hit Cells"));
203 if(Meascells && Expcells){
204 TGraphAsymmErrors *Effcells =
new TGraphAsymmErrors(Meascells, Expcells,
"ac");
205 Effcells->Draw(
"ap");
206 Effcells->SetMinimum(minScale);
207 Effcells->SetMaximum(maxScale);
208 Effcells->SetTitle(
"FDC Per Wire Efficiency Vs. Contributing Cells");
209 Effcells->GetXaxis()->SetTitle(
"FDC Cells");
210 Effcells->GetYaxis()->SetTitle(
"Efficiency");
213 if (save) cEfficiency_vs->SaveAs(
"cEfficiency_vs.pdf");
216 gDirectory->cd(
"Residuals");
219 TCanvas *cResidual_Pseudo =
new TCanvas(
"cResidual_Pseudo",
"Pseudo Hit Resolution", 1000, 800);
220 cResidual_Pseudo->Divide(6,4);
223 double meanV_err[24];
225 double meanU_err[24];
227 for(
unsigned int icell=1; icell<=24; icell++){
228 cResidual_Pseudo->cd(icell);
230 sprintf(hname5,
"hPseudoResV_cell[%d]", icell);
231 TH1 *h5 = (TH1*)(gDirectory->Get(hname5));
233 sprintf(hname6,
"hPseudoResU_cell[%d]", icell);
234 TH1 *h6 = (TH1*)(gDirectory->Get(hname6));
236 h5->GetXaxis()->SetTitle(
"Position Resolution (cm)");
237 h5->GetXaxis()->SetRangeUser(-1,1);
239 h5->Fit(
"gaus",
"q0");
240 TF1 *fgaus5 = h5->GetFunction(
"gaus");
241 meanV[icell-1] = fgaus5->GetParameter(1);
243 meanV_err[icell-1] = fgaus5->GetParameter(2);
247 h6->Fit(
"gaus",
"q0");
248 TF1 *fgaus6 = h6->GetFunction(
"gaus");
249 meanU[icell-1] = fgaus6->GetParameter(1);
251 meanU_err[icell-1] = fgaus6->GetParameter(2);
255 const unsigned int rad = 1;
257 TCanvas *cResidual_Pseudo2 =
new TCanvas(
"cResidual_Pseudo2",
"Pseudo Hit Resolution 2D", 1000, 800);
258 cResidual_Pseudo2->Divide(6,4);
260 for(
unsigned int icell=1; icell<=24; icell++){
261 cResidual_Pseudo2->cd(icell);
262 for (
unsigned int r=0; r<
rad; r++){
264 sprintf(hname7,
"hPseudoResUvsV_cell[%d]_radius[%d]", icell, (r+1)*(45/rad));
265 TH2 *h7 = (TH2*)(gDirectory->Get(hname7));
268 h7->GetYaxis()->SetTitle(
"Position reconstructed along Wire (cm)");
269 h7->GetYaxis()->SetRangeUser(-0.5,0.5);
270 h7->GetXaxis()->SetTitle(
"Position perp. to Wire (cm)");
271 h7->GetXaxis()->SetRangeUser(-0.5,0.5);
278 double slope[
rad][24];
279 double slope_err[
rad][24];
280 double cell[
rad][24];
281 double cell_err[
rad][24];
282 TCanvas *cResidual_Profile =
new TCanvas(
"cResidual_Profile",
"Pseudo Resolution Profile", 1000, 800);
283 cResidual_Profile->Divide(6,4);
285 for(
unsigned int icell=1; icell<=24; icell++){
286 cResidual_Profile->cd(icell);
287 for (
unsigned int r=0; r<
rad; r++){
288 cell[r][icell-1] = icell + 0.1*r;
289 cell_err[r][icell-1] = 0;
291 sprintf(hname8,
"hPseudoResUvsV_cell[%d]_radius[%d]_pfy", icell, (r+1)*(45/rad));
292 TH1 *h8 = (TH1*)(gDirectory->Get(hname8));
295 h8->GetXaxis()->SetTitle(
"Position reconstructed along Wire (cm)");
296 h8->GetXaxis()->SetRangeUser(-0.15,0.15);
297 h8->GetYaxis()->SetTitle(
"Position perp. to Wire (cm)");
298 h8->GetYaxis()->SetRangeUser(-0.5,0.5);
299 h8->GetYaxis()->SetTitleFont(42);
300 h8->GetYaxis()->SetTitleSize(0.035);
301 h8->GetYaxis()->SetLabelFont(42);
302 h8->GetYaxis()->SetLabelSize(0.035);
303 h8->SetLineColor(r+1);
309 TF1 *fp1 =
new TF1(
"fp1",
"[0]+x*[1]",-0.08,0.08);
310 fp1->SetLineColor(r+1);
312 slope[r][icell-1] = fp1->GetParameter(1);
313 slope_err[r][icell-1] = fp1->GetParError(1);
317 slope[r][icell-1] = 0;
318 slope_err[r][icell-1] = 0;
323 TCanvas *cAlignment =
new TCanvas(
"cAlignment",
"Alignment", 1200, 1000);
324 cAlignment->Divide(2,2);
327 TGraphErrors *galignV =
new TGraphErrors(24, cell[0], meanV, cell_err[0], meanV_err);
328 galignV->SetTitle(
"Alignment along Wire (Error Bars: Sigma); Cell # ; V_{Hit} - V_{Track} (cm)");
329 galignV->SetMarkerColor(1);
330 galignV->SetMarkerStyle(2);
333 TLine *lpack12 =
new TLine(6.5, -0.1, 6.5, 0.1);
334 lpack12->SetLineColor(2);
335 lpack12->SetLineStyle(2);
336 lpack12->SetLineWidth(2);
338 TLine *lpack23 =
new TLine(12.5, -0.1, 12.5, 0.1);
339 lpack23->SetLineColor(2);
340 lpack23->SetLineStyle(2);
341 lpack23->SetLineWidth(2);
343 TLine *lpack34 =
new TLine(18.5, -0.1, 18.5, 0.1);
344 lpack34->SetLineColor(2);
345 lpack34->SetLineStyle(2);
346 lpack34->SetLineWidth(2);
350 TGraphErrors *galignU =
new TGraphErrors(24, cell[0], meanU, cell_err[0], meanU_err);
351 galignU->SetTitle(
"Alignment perp. to Wire (Error Bars: Sigma); Cell # ; U_{Hit} - U_{Track} (cm)");
352 galignU->SetMarkerColor(1);
353 galignU->SetMarkerStyle(2);
361 TGraphErrors *gmagnet[
rad];
362 for (
unsigned int r=0; r<
rad; r++){
363 gmagnet[r] =
new TGraphErrors(24, cell[r], slope[r], cell_err[r], slope_err[r]);
364 gmagnet[r]->SetTitle(
"Value for slope of magnetic deflection; Cell # ; Slope (cm^{-1})");
365 gmagnet[r]->SetMarkerColor(r+1);
366 gmagnet[r]->SetMarkerStyle(2);
368 gmagnet[r]->Draw(
"AP");
370 gmagnet[r]->Draw(
"Psame");
void FDC_Efficiency(bool save=0)
sprintf(text,"Post KinFit Cut")