]>
Commit | Line | Data |
---|---|---|
13787886 | 1 | { |
2 | ||
3 | gROOT->Reset(); | |
4 | ||
5 | TFile f("SDD_histos_test.root"); | |
6 | ||
7 | Int_t nbins = 18; | |
8 | Float_t dmax = 36.; | |
9 | ||
10 | a = local->ProjectionX(); | |
11 | t = local->ProjectionY(); | |
12 | ||
13 | TF1 *faa = new TF1("faa","gaus",-100.,100.); | |
14 | a->Fit("faa","R","Q",-100.,100.); | |
15 | TF1 *fat = new TF1("fat","gaus",-50,50); | |
16 | t->Fit("fat","R","Q",-50,50); | |
17 | ||
18 | TH1F *anode_resolution = new TH1F("anoder","Anode resolution vs Drift Path",nbins,0.,dmax); | |
19 | TH1D *anodes[nbins]; | |
20 | Float_t res_anodes[nbins]; | |
21 | Float_t errres_anodes[nbins]; | |
22 | Float_t dmin = 60.; | |
23 | ||
24 | for(Int_t i=0;i<nbins;i++){ | |
25 | if(i>6) dmin = 70.; | |
26 | if(i>11) dmin = 90.; | |
27 | TString *aa = new TString("aa_"); | |
28 | Char_t ai[2]; | |
29 | sprintf(ai,"%d",i+1); | |
30 | aa->Append(ai); | |
31 | anodes[i] = at->ProjectionY(aa->Data(),i,i+1); | |
32 | TF1 *fa = new TF1("fa","gaus",-1.*dmin,dmin); | |
33 | anodes[i]->Fit("fa","R","Q",-1.*dmin,dmin); | |
34 | res_anodes[i] = fa->GetParameter(2); | |
35 | Float_t RMS = anodes[i]->GetRMS(); | |
36 | //if(res_anodes[i] > RMS) | |
37 | res_anodes[i] = RMS; | |
38 | errres_anodes[i] = fa->GetParError(2); | |
39 | anode_resolution->Fill(i*dmax/nbins+dmax/(2*nbins),res_anodes[i]); | |
40 | anode_resolution->SetBinError(i+1,(Stat_t) errres_anodes[i]); | |
41 | anode_resolution->SetMarkerColor(2); | |
42 | anode_resolution->SetLineColor(2); | |
43 | } | |
44 | ||
45 | f->cd(); | |
46 | ||
47 | TH1F *time_resolution = new TH1F("timer","Time resolution vs Drift Path",nbins,0.,dmax); | |
48 | TH1D *times[nbins]; | |
49 | Float_t res_times[nbins]; | |
50 | Float_t errres_times[nbins]; | |
51 | for(Int_t i=0;i<nbins;i++){ | |
52 | TString *ta = new TString("tt_"); | |
53 | Char_t ti[2]; | |
54 | sprintf(ti,"%d",i+1); | |
55 | ta->Append(ti); | |
56 | times[i] = tt->ProjectionY(ta->Data(),i,i+1); | |
57 | TF1 *ft = new TF1("ft","gaus",-50,50); | |
58 | times[i]->Fit("ft","R","Q",-50,50); | |
59 | res_times[i] = ft->GetParameter(2); | |
60 | Float_t RMS = times[i]->GetRMS(); | |
61 | //if(res_times[i] > RMS) | |
62 | res_times[i] = RMS; | |
63 | errres_times[i] = ft->GetParError(2); | |
64 | time_resolution->Fill(i*dmax/nbins+dmax/(2*nbins),res_times[i]); | |
65 | time_resolution->SetBinError(i+1,(Stat_t) errres_times[i]); | |
66 | time_resolution->SetMarkerColor(6); | |
67 | time_resolution->SetLineColor(6); | |
68 | } | |
69 | Float_t x1 = 4000.; | |
70 | Float_t x2 = x1; | |
71 | Float_t y1 = 94; | |
72 | Float_t y2 = 84; | |
73 | ||
74 | TMarker *m1 = new TMarker(x1,y1,21); | |
75 | TMarker *m2 = new TMarker(x2,y2,22); | |
76 | Text_t *text1 = "Anode"; | |
77 | Text_t *text2 = "Time"; | |
78 | TText *t1 = new TText(x1 + 250,y1-2,text1); | |
79 | TText *t2 = new TText(x2 + 250,y2-2,text2); | |
80 | ||
81 | anode_resolution->SetMarkerStyle(21); | |
82 | anode_resolution->SetMaximum(100.); | |
83 | time_resolution->SetMarkerStyle(23); | |
84 | ||
85 | c1->Clear(); | |
86 | at->Draw(); | |
87 | c1->SaveAs("ITS_at.ps"); | |
88 | ||
89 | c1->Clear(); | |
90 | tt->Draw(); | |
91 | c1->SaveAs("ITS_tt.ps"); | |
92 | ||
93 | nanodes->ProfileX(); | |
94 | nanodes_pfx->Draw(); | |
95 | nsampls->ProfileX(); | |
96 | nsampls_pfx->Draw(); | |
97 | nanodes_pfx->SetLineColor(2); | |
98 | nanodes_pfx->Draw("SAME"); | |
99 | c1->SaveAs("ITS_clsize.ps"); | |
100 | ||
101 | f.cd(); | |
102 | anoder->SetMinimum(0.); | |
103 | anoder->Draw(); | |
104 | anoder->SetXTitle("Drift Path (mm)"); | |
105 | anoder->SetYTitle("Resolution (um)"); | |
106 | TMarker *mk0 = new TMarker(16.,54.,23); | |
107 | mk0->SetMarkerColor(6); | |
108 | mk0->Draw(); | |
109 | TMarker *mk3 = new TMarker(16.,46.,21); | |
110 | mk3->SetMarkerColor(2); | |
111 | mk3->Draw(); | |
112 | Text_t *text = "294 um pitch detector"; | |
113 | TText *t3 = new TText(2,90,text); | |
114 | Text_t *text0 = "Spatial Resolution"; | |
115 | TText *t0 = new TText(2,82,text0); | |
116 | Text_t *text2 = "Simulation (Anode)"; | |
117 | TText *t2 = new TText(18,44,text2); | |
118 | Text_t *text4 = "Simulation (Time)"; | |
119 | TText *t4 = new TText(18,52,text4); | |
120 | t4->Draw(); | |
121 | t3->Draw(); | |
122 | t2->Draw(); | |
123 | t0->Draw(); | |
124 | timer->Draw("SAME"); | |
125 | c1->SaveAs("ITS_res_check_294.ps"); | |
126 | ||
127 | f.cd(); | |
128 | nanodes_pfx->SetXTitle("Drift Time (ns)"); | |
129 | nanodes_pfx->SetYTitle("Anodes/Cluster"); | |
130 | nanodes_pfx->SetMaximum(3.); | |
131 | nanodes_pfx->SetMarkerStyle(21); | |
132 | nanodes_pfx->SetLineColor(2); | |
133 | nanodes_pfx->SetMarkerColor(2); | |
134 | nanodes_pfx->Draw(); | |
135 | TMarker *mk2 = new TMarker(4000.,0.3,21); | |
136 | mk2->SetMarkerColor(2); | |
137 | mk2->Draw(); | |
138 | Text_t *text = "294 um pitch detector"; | |
139 | TText *t3 = new TText(200,2.7,text); | |
140 | Text_t *text0 = "Average Number of Anodes/Cluster"; | |
141 | TText *t0 = new TText(200,2.4,text0); | |
142 | Text_t *text2 = "Simulation"; | |
143 | TText *t2 = new TText(4200,0.2,text2); | |
144 | t3->Draw(); | |
145 | t0->Draw(); | |
146 | t2->Draw(); | |
147 | c1->SaveAs("ITS_and_check_294.ps"); | |
148 | ||
149 | f.cd(); | |
150 | nsampls_pfx->SetXTitle("Drift Time (ns)"); | |
151 | nsampls_pfx->SetYTitle("Time bins/Anode/Cluster"); | |
152 | nsampls_pfx->SetMaximum(10.); | |
153 | nsampls_pfx->SetMarkerStyle(21); | |
154 | nsampls_pfx->SetLineColor(2); | |
155 | nsampls_pfx->SetMarkerColor(2); | |
156 | nsampls_pfx->Draw(); | |
157 | TMarker *mk2 = new TMarker(4000.,1.,21); | |
158 | mk2->SetMarkerColor(2); | |
159 | mk2->Draw(); | |
160 | Text_t *text = "294 um pitch detector"; | |
161 | TText *t3 = new TText(200,9.,text); | |
162 | Text_t *text0 = "Average Number of Time bins/Anode/Cluster"; | |
163 | TText *t0 = new TText(200,8.,text0); | |
164 | Text_t *text2 = "Simulation"; | |
165 | TText *t2 = new TText(4200,0.8,text2); | |
166 | t3->Draw(); | |
167 | t0->Draw(); | |
168 | t2->Draw(); | |
169 | c1->SaveAs("ITS_tim_check_294.ps"); | |
170 | ||
171 | f.cd(); | |
172 | amplit->ProfileX(); | |
173 | amplit_pfx->SetLineColor(2); | |
174 | amplit_pfx->SetMaximum(500.); | |
175 | amplit_pfx->SetMarkerStyle(21); | |
176 | amplit_pfx->SetMarkerColor(2); | |
177 | amplit_pfx->Draw(); | |
178 | TMarker *mk2 = new TMarker(500.,50,21); | |
179 | mk2->SetMarkerColor(2); | |
180 | mk2->Draw(); | |
181 | Text_t *text = "294 um pitch detector"; | |
182 | TText *t3 = new TText(1000,450.,text); | |
183 | Text_t *text0 = "Peak Amplitude"; | |
184 | TText *t0 = new TText(1000,400.,text0); | |
185 | Text_t *text2 = "Simulation"; | |
186 | TText *t2 = new TText(700,40.,text2); | |
187 | t3->Draw(); | |
188 | t0->Draw(); | |
189 | t2->Draw(); | |
190 | c1->SaveAs("ITS_amp_check_294.ps"); | |
191 | ||
192 | f.cd(); | |
193 | chp->ProfileX(); | |
194 | chp_pfx->SetLineColor(2); | |
195 | chp_pfx->SetMaximum(2000.); | |
196 | chp_pfx->SetMarkerStyle(21); | |
197 | chp_pfx->SetMarkerColor(2); | |
198 | chp_pfx->Draw(); | |
199 | TMarker *mk2 = new TMarker(500.,200.,21); | |
200 | mk2->SetMarkerColor(2); | |
201 | mk2->Draw(); | |
202 | Text_t *text = "294 um pitch detector"; | |
203 | TText *t3 = new TText(300,1800.,text); | |
204 | Text_t *text0 = "Total Charge"; | |
205 | TText *t0 = new TText(300,1600.,text0); | |
206 | Text_t *text2 = "Simulation"; | |
207 | TText *t2 = new TText(700,150.,text2); | |
208 | t3->Draw(); | |
209 | t0->Draw(); | |
210 | t2->Draw(); | |
211 | c1->SaveAs("ITS_cha_check_294.ps"); | |
212 | ||
213 | TH1F *eff = f.Get("rec_vs_time"); | |
214 | TH1F *efh = f.Get("hit_vs_time"); | |
215 | eff->Divide(efh); | |
216 | ||
217 | TH1F *effn = new TH1F("effn","Efficiency vs. drift path (mm)",18,0.,36.); | |
218 | effn->SetMinimum(0.9); | |
219 | ||
220 | for(Int_t i=1;i<=36;i++) { | |
221 | Float_t cont = eff->GetBinContent(i); | |
222 | i++; | |
223 | cont += eff->GetBinContent(i); | |
224 | cont /= 2.; | |
225 | effn->SetBinContent(i/2,cont); | |
226 | } | |
227 | ||
228 | effn->SetXTitle("Drift Path (mm)"); | |
229 | effn->SetYTitle("Reconstruction Efficiency"); | |
230 | effn->SetMaximum(1.2); | |
231 | effn->SetMinimum(0.6); | |
232 | effn->SetMarkerStyle(21); | |
233 | effn->SetLineColor(2); | |
234 | effn->SetMarkerColor(2); | |
235 | effn->Draw("p"); | |
236 | TMarker *mk2 = new TMarker(20.,0.7,21); | |
237 | mk2->SetMarkerColor(2); | |
238 | mk2->Draw(); | |
239 | Text_t *text = "294 um pitch detector"; | |
240 | TText *t3 = new TText(2.,1.13,text); | |
241 | Text_t *text2 = "Simulation"; | |
242 | TText *t2 = new TText(22,0.685,text2); | |
243 | t3->Draw(); | |
244 | t0->Draw(); | |
245 | t2->Draw(); | |
246 | c1->SaveAs("ITS_eff_check_294.ps"); | |
247 | ||
248 | f.cd(); | |
249 | ntotal->ProfileX(); | |
250 | ntotal->SetMarkerStyle(21); | |
251 | ntotal->SetLineColor(2); | |
252 | ntotal->SetMarkerColor(2); | |
253 | ntotal_pfx->SetMaximum(20); | |
254 | ntotal_pfx->SetMarkerStyle(21); | |
255 | ntotal_pfx->SetMarkerColor(2); | |
256 | ntotal_pfx->SetLineColor(2); | |
257 | ntotal_pfx->SetXTitle("Drift Time (ns)"); | |
258 | ntotal_pfx->SetYTitle("N_total"); | |
259 | ntotal_pfx->Draw(); | |
260 | /* | |
261 | TH1F *nsi = new TH1F("nsi","nsi",28,0.,7000.); | |
262 | for(Int_t i=1;i<=28;i++) { | |
263 | f->cd(); | |
264 | Float_t tscal = nsampls_pfx->GetBinContent(i); | |
265 | Float_t cont = nanodes_pfx->GetBinContent(i); | |
266 | cont *= tscal; | |
267 | nsi->SetMaximum(20.); | |
268 | nsi->SetBinContent(i,cont); | |
269 | } | |
270 | nsi->SetMarkerStyle(21); | |
271 | nsi->SetMarkerColor(2); | |
272 | nsi->SetLineColor(2); | |
273 | nsi->Draw("p,SAME"); | |
274 | */ | |
275 | TMarker *mk2 = new TMarker(300.,2.,21); | |
276 | mk2->SetMarkerColor(2); | |
277 | mk2->Draw(); | |
278 | Text_t *text = "294 um pitch detector"; | |
279 | TText *t3 = new TText(300.,18.,text); | |
280 | Text_t *text2 = "Simulation"; | |
281 | TText *t2 = new TText(500,1.8,text2); | |
282 | t3->Draw(); | |
283 | t2->Draw(); | |
284 | ||
285 | c1->SaveAs("ITS_ncl_check_294.ps"); | |
286 | ||
287 | } |