4 TDirectory *
dir = (TDirectory*)gDirectory->FindObjectAny(
"FDC_Efficiency");
8 gDirectory->cd(
"Residuals");
10 TCanvas *cWireTiming =
new TCanvas(
"cWireTiming",
"WireTiming", 1000, 800);
11 cWireTiming->Divide(6,4);
27 for(
unsigned int icell=1; icell<=24; icell++){
28 cWireTiming->cd(icell);
30 cell[icell-1] = icell;
31 cell_err[icell-1] = 0;
34 sprintf(hname,
"hWireTime_cell[%d]", icell);
35 TH1 *hWire = (TH1*)(gDirectory->Get(hname));
37 hWire->GetXaxis()->SetTitle(
"Wire Time (ns)");
40 int tzero_bin = hWire->GetMaximumBin();
41 double tzero = hWire->GetXaxis()->GetBinCenter(tzero_bin);
43 TF1 *fwire =
new TF1(
"fwire",
"gaus(0)", tzero - 10, tzero + 10);
44 fwire->SetLineColor(2);
46 fwire->SetParameter(1,tzero);
47 hWire->Fit(
"fwire",
"q0r");
48 wire[icell-1] = fwire->GetParameter(1);
49 wire_err[icell-1] = fwire->GetParError(1);
51 sprintf(hname,
"hCathodeTime_cell[%d]", icell);
52 TH1 *hCathode = (TH1*)(gDirectory->Get(hname));
54 hCathode->GetXaxis()->SetTitle(
"Cathode Time (ns)");
57 tzero_bin = hCathode->GetMaximumBin();
58 tzero = hCathode->GetXaxis()->GetBinCenter(tzero_bin);
59 hCathode->GetXaxis()->SetRangeUser(tzero-40,tzero+40);
61 TF1 *fcath =
new TF1(
"fcath",
"gaus(0)", tzero - 20, tzero + 20);
62 fcath->SetLineColor(2);
64 fcath->SetParameter(1,tzero);
65 hCathode->Fit(
"fcath",
"qr");
66 cath[icell-1] = fcath->GetParameter(1);
67 cath_err[icell-1] = fcath->GetParError(1);
69 sprintf(hname,
"hDeltaTime_cell[%d]", icell);
70 TH1 *hDelta = (TH1*)(gDirectory->Get(hname));
72 hDelta->GetXaxis()->SetTitle(
"Wire Time - Cathode Time (ns)");
75 tzero_bin = hDelta->GetMaximumBin();
76 tzero = hDelta->GetXaxis()->GetBinCenter(tzero_bin);
78 TF1 *fdelta =
new TF1(
"fdelta",
"gaus(0)", tzero - 5, tzero + 5);
79 fdelta->SetLineColor(2);
81 fdelta->SetParameter(1,tzero);
82 hDelta->Fit(
"fdelta",
"qr");
83 delta[icell-1] = fdelta->GetParameter(1);
84 delta_err[icell-1] = fdelta->GetParError(1);
86 sprintf(hname,
"hPullTime_cell[%d]", icell);
87 TH1 *hPull = (TH1*)(gDirectory->Get(hname));
89 hPull->GetXaxis()->SetTitle(
"Pseudo Time (from pull) (ns)");
92 tzero_bin = hPull->GetMaximumBin();
93 tzero = hPull->GetXaxis()->GetBinCenter(tzero_bin);
94 hPull->GetXaxis()->SetRangeUser(tzero-10,tzero+10);
96 TF1 *fpull =
new TF1(
"fpull",
"gaus(0)", tzero - 5, tzero + 3);
97 fpull->SetLineColor(2);
99 fpull->SetParameter(1,tzero);
100 hPull->Fit(
"fpull",
"q0r");
101 pull[icell-1] = fpull->GetParameter(1);
102 pull_err[icell-1] = fpull->GetParError(1);
106 TCanvas *cTiming =
new TCanvas(
"cTiming",
"Timing", 1400, 1000);
107 cTiming->Divide(2,2);
110 TGraphErrors *gWireTiming =
new TGraphErrors(24, cell, wire, cell_err, wire_err);
111 gWireTiming->SetTitle(
"; Cell # ; Wire Timing (ns)");
112 gWireTiming->SetMarkerColor(1);
113 gWireTiming->SetMarkerStyle(8);
114 gWireTiming->Draw(
"AP");
117 TGraphErrors *gCathTiming =
new TGraphErrors(24, cell, cath, cell_err, cath_err);
118 gCathTiming->SetTitle(
"; Cell # ; Cathode Timing (ns)");
119 gCathTiming->SetMarkerColor(2);
120 gCathTiming->SetMarkerStyle(8);
121 gCathTiming->Draw(
"AP");
124 TGraphErrors *gDelta =
new TGraphErrors(24, cell, delta, cell_err, delta_err);
125 gDelta->SetTitle(
"; Cell # ; Wire - Cathode Timing (ns)");
126 gDelta->SetMarkerColor(4);
127 gDelta->SetMarkerStyle(8);
131 TGraphErrors *gPull =
new TGraphErrors(24, cell, pull, cell_err, pull_err);
132 gPull->SetTitle(
"; Cell # ; Pseudo Time from Pull (ns)");
133 gPull->SetMarkerColor(6);
134 gPull->SetMarkerStyle(8);
sprintf(text,"Post KinFit Cut")