11 #include "Riostream.h"
19 in.open(
"SC_PTC.txt");
20 Float_t sector, z, z_err, t, t_err,
sigma,sigma_err;
23 SC_PTC.open (
"PTC_1DFits.txt", std::ofstream::out);
24 auto f = TFile::Open(
"PTC_NS.root",
"RECREATE");
25 TNtuple ntuple(
"ntuple",
"data from ascii file",
"sector:z:z_err:t:t_err:sigma:sigma_err");
27 in >> sector >> z >> z_err >> t >> t_err >> sigma >> sigma_err;
28 if (!in.good())
break;
29 if (nlines < 5)
printf(
"sector=%8f, z=%8f, z_err=%8f,t=%8f t_err=%8f sigma=%8f sigma_err=%8f\n",sector,z,z_err,t,t_err,sigma,sigma_err);
30 ntuple.Fill(sector,z,z_err,t,t_err,sigma,sigma_err);
33 auto c1 =
new TCanvas(
"c1",
"c1",600,500);
36 ntuple.Draw(
"z:z_err:t:t_err",
"sector >0 & sector <2 " );
37 TGraphErrors *
gr =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
39 gr->SetTitle(
"Sector 1");
42 TFitResultPtr sec1_r1 = gr->Fit(
"pol1",
"S",
"",10,44);
43 double sec1_r1_intcp = sec1_r1->Parameter(0);
44 double sec1_r1_slope = sec1_r1->Parameter(1);
45 TFitResultPtr sec1_r2 = gr->Fit(
"pol1",
"S+",
"",44,52);
46 double sec1_r2_intcp = sec1_r2->Parameter(0);
47 double sec1_r2_slope = sec1_r2->Parameter(1);
48 TFitResultPtr sec1_r3 = gr->Fit(
"pol1",
"S+",
"",52,60);
49 double sec1_r3_intcp = sec1_r3->Parameter(0);
50 double sec1_r3_slope = sec1_r3->Parameter(1);
52 ntuple.Draw(
"z:z_err:t:t_err",
"sector >1 & sector <3 " );
53 TGraphErrors *
gr2 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
55 gr2->SetTitle(
"Sector 2");
58 TFitResultPtr sec2_r1 = gr2->Fit(
"pol1",
"S",
"",10,44);
59 double sec2_r1_intcp = sec2_r1->Parameter(0);
60 double sec2_r1_slope = sec2_r1->Parameter(1);
61 TFitResultPtr sec2_r2 = gr2->Fit(
"pol1",
"S+",
"",44,52);
62 double sec2_r2_intcp = sec2_r2->Parameter(0);
63 double sec2_r2_slope = sec2_r2->Parameter(1);
64 TFitResultPtr sec2_r3 = gr2->Fit(
"pol1",
"S+",
"",52,60);
65 double sec2_r3_intcp = sec2_r3->Parameter(0);
66 double sec2_r3_slope = sec2_r3->Parameter(1);
68 ntuple.Draw(
"z:z_err:t:t_err",
"sector >2 & sector <4 " );
69 TGraphErrors *
gr3 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
71 gr3->SetTitle(
"Sector 3");
74 TFitResultPtr sec3_r1 = gr3->Fit(
"pol1",
"S",
"",10,44);
75 double sec3_r1_intcp = sec3_r1->Parameter(0);
76 double sec3_r1_slope = sec3_r1->Parameter(1);
77 TFitResultPtr sec3_r2 = gr3->Fit(
"pol1",
"S+",
"",44,52);
78 double sec3_r2_intcp = sec3_r2->Parameter(0);
79 double sec3_r2_slope = sec3_r2->Parameter(1);
80 TFitResultPtr sec3_r3 = gr3->Fit(
"pol1",
"S+",
"",52,60);
81 double sec3_r3_intcp = sec3_r3->Parameter(0);
82 double sec3_r3_slope = sec3_r3->Parameter(1);
84 ntuple.Draw(
"z:z_err:t:t_err",
"sector >3 & sector <5 " );
85 TGraphErrors *gr4 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
87 gr4->SetTitle(
"Sector 4");
90 TFitResultPtr sec4_r1 = gr4->Fit(
"pol1",
"S",
"",10,44);
91 double sec4_r1_intcp = sec4_r1->Parameter(0);
92 double sec4_r1_slope = sec4_r1->Parameter(1);
93 TFitResultPtr sec4_r2 = gr4->Fit(
"pol1",
"S+",
"",44,52);
94 double sec4_r2_intcp = sec4_r2->Parameter(0);
95 double sec4_r2_slope = sec4_r2->Parameter(1);
96 TFitResultPtr sec4_r3 = gr4->Fit(
"pol1",
"S+",
"",52,60);
97 double sec4_r3_intcp = sec4_r3->Parameter(0);
98 double sec4_r3_slope = sec4_r3->Parameter(1);
100 ntuple.Draw(
"z:z_err:t:t_err",
"sector >4 & sector <6 " );
101 TGraphErrors *gr5 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
103 gr5->SetTitle(
"Sector 5");
104 gr5->SetMaximum(4.0);
105 gr5->SetMinimum(0.0);
106 TFitResultPtr sec5_r1 = gr5->Fit(
"pol1",
"S",
"",10,44);
107 double sec5_r1_intcp = sec5_r1->Parameter(0);
108 double sec5_r1_slope = sec5_r1->Parameter(1);
109 TFitResultPtr sec5_r2 = gr5->Fit(
"pol1",
"S+",
"",44,52);
110 double sec5_r2_intcp = sec5_r2->Parameter(0);
111 double sec5_r2_slope = sec5_r2->Parameter(1);
112 TFitResultPtr sec5_r3 = gr5->Fit(
"pol1",
"S+",
"",52,60);
113 double sec5_r3_intcp = sec5_r3->Parameter(0);
114 double sec5_r3_slope = sec5_r3->Parameter(1);
116 ntuple.Draw(
"z:z_err:t:t_err",
"sector >5 & sector <7 " );
117 TGraphErrors *gr6 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
119 gr6->SetTitle(
"Sector 6");
120 gr6->SetMaximum(4.0);
121 gr6->SetMinimum(0.0);
122 TFitResultPtr sec6_r1 = gr6->Fit(
"pol1",
"S",
"",10,44);
123 double sec6_r1_intcp = sec6_r1->Parameter(0);
124 double sec6_r1_slope = sec6_r1->Parameter(1);
125 TFitResultPtr sec6_r2 = gr6->Fit(
"pol1",
"S+",
"",44,52);
126 double sec6_r2_intcp = sec6_r2->Parameter(0);
127 double sec6_r2_slope = sec6_r2->Parameter(1);
128 TFitResultPtr sec6_r3 = gr6->Fit(
"pol1",
"S+",
"",52,60);
129 double sec6_r3_intcp = sec6_r3->Parameter(0);
130 double sec6_r3_slope = sec6_r3->Parameter(1);
131 auto c2 =
new TCanvas(
"c2",
"c2",600,500);
134 ntuple.Draw(
"z:z_err:t:t_err",
"sector >6 & sector <8 " );
135 TGraphErrors *gr7 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
137 gr7->SetTitle(
"Sector 7");
138 gr7->SetMaximum(4.0);
139 gr7->SetMinimum(0.0);
140 TFitResultPtr sec7_r1 = gr7->Fit(
"pol1",
"S",
"",10,44);
141 double sec7_r1_intcp = sec7_r1->Parameter(0);
142 double sec7_r1_slope = sec7_r1->Parameter(1);
143 TFitResultPtr sec7_r2 = gr7->Fit(
"pol1",
"S+",
"",44,52);
144 double sec7_r2_intcp = sec7_r2->Parameter(0);
145 double sec7_r2_slope = sec7_r2->Parameter(1);
146 TFitResultPtr sec7_r3 = gr7->Fit(
"pol1",
"S+",
"",52,60);
147 double sec7_r3_intcp = sec7_r3->Parameter(0);
148 double sec7_r3_slope = sec7_r3->Parameter(1);
150 ntuple.Draw(
"z:z_err:t:t_err",
"sector >7 & sector <9 " );
151 TGraphErrors *gr8 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
153 gr8->SetTitle(
"Sector 8");
154 gr8->SetMaximum(4.0);
156 TFitResultPtr sec8_r1 = gr8->Fit(
"pol1",
"S",
"",10,44);
157 double sec8_r1_intcp = sec8_r1->Parameter(0);
158 double sec8_r1_slope = sec8_r1->Parameter(1);
159 TFitResultPtr sec8_r2 = gr8->Fit(
"pol1",
"S+",
"",44,52);
160 double sec8_r2_intcp = sec8_r2->Parameter(0);
161 double sec8_r2_slope = sec8_r2->Parameter(1);
162 TFitResultPtr sec8_r3 = gr8->Fit(
"pol1",
"S+",
"",52,60);
163 double sec8_r3_intcp = sec8_r3->Parameter(0);
164 double sec8_r3_slope = sec8_r3->Parameter(1);
166 ntuple.Draw(
"z:z_err:t:t_err",
"sector >8 & sector <10 " );
167 TGraphErrors *gr9 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
169 gr9->SetTitle(
"Sector 9");
170 gr9->SetMaximum(4.0);
172 TFitResultPtr sec9_r1 = gr9->Fit(
"pol1",
"S",
"",10,44);
173 double sec9_r1_intcp = sec9_r1->Parameter(0);
174 double sec9_r1_slope = sec9_r1->Parameter(1);
175 TFitResultPtr sec9_r2 = gr9->Fit(
"pol1",
"S+",
"",44,52);
176 double sec9_r2_intcp = sec9_r2->Parameter(0);
177 double sec9_r2_slope = sec9_r2->Parameter(1);
178 TFitResultPtr sec9_r3 = gr9->Fit(
"pol1",
"S+",
"",52,60);
179 double sec9_r3_intcp = sec9_r3->Parameter(0);
180 double sec9_r3_slope = sec9_r3->Parameter(1);
183 ntuple.Draw(
"z:z_err:t:t_err",
"sector >9 & sector <11 " );
184 TGraphErrors *gr10 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
186 gr10->SetTitle(
"Sector 10");
187 gr10->SetMaximum(4.0);
188 gr10->SetMinimum(0.0);
189 TFitResultPtr sec10_r1 = gr10->Fit(
"pol1",
"S",
"",10,44);
190 double sec10_r1_intcp = sec10_r1->Parameter(0);
191 double sec10_r1_slope = sec10_r1->Parameter(1);
192 TFitResultPtr sec10_r2 = gr10->Fit(
"pol1",
"S+",
"",44,52);
193 double sec10_r2_intcp = sec10_r2->Parameter(0);
194 double sec10_r2_slope = sec10_r2->Parameter(1);
195 TFitResultPtr sec10_r3 = gr10->Fit(
"pol1",
"S+",
"",52,60);
196 double sec10_r3_intcp = sec10_r3->Parameter(0);
197 double sec10_r3_slope = sec10_r3->Parameter(1);
199 ntuple.Draw(
"z:z_err:t:t_err",
"sector >10 & sector <12 " );
200 TGraphErrors *
gr11 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
202 gr11->SetTitle(
"Sector 11");
203 gr11->SetMaximum(4.0);
204 gr11->SetMinimum(0.);
205 TFitResultPtr sec11_r1 = gr11->Fit(
"pol1",
"S",
"",10,44);
206 double sec11_r1_intcp = sec11_r1->Parameter(0);
207 double sec11_r1_slope = sec11_r1->Parameter(1);
208 TFitResultPtr sec11_r2 = gr11->Fit(
"pol1",
"S+",
"",44,52);
209 double sec11_r2_intcp = sec11_r2->Parameter(0);
210 double sec11_r2_slope = sec11_r2->Parameter(1);
211 TFitResultPtr sec11_r3 = gr11->Fit(
"pol1",
"S+",
"",52,60);
212 double sec11_r3_intcp = sec11_r3->Parameter(0);
213 double sec11_r3_slope = sec11_r3->Parameter(1);
215 ntuple.Draw(
"z:z_err:t:t_err",
"sector >11 & sector <13 " );
216 TGraphErrors *
gr12 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
218 gr12->SetTitle(
"Sector 12");
219 gr12->SetMaximum(4.0);
220 gr12->SetMinimum(0.);
221 TFitResultPtr sec12_r1 = gr12->Fit(
"pol1",
"S",
"",10,44);
222 double sec12_r1_intcp = sec12_r1->Parameter(0);
223 double sec12_r1_slope = sec12_r1->Parameter(1);
224 TFitResultPtr sec12_r2 = gr12->Fit(
"pol1",
"S+",
"",44,52);
225 double sec12_r2_intcp = sec12_r2->Parameter(0);
226 double sec12_r2_slope = sec12_r2->Parameter(1);
227 TFitResultPtr sec12_r3 = gr12->Fit(
"pol1",
"S+",
"",52,60);
228 double sec12_r3_intcp = sec12_r3->Parameter(0);
229 double sec12_r3_slope = sec12_r3->Parameter(1);
230 auto c3 =
new TCanvas(
"c3",
"c3",600,500);
233 ntuple.Draw(
"z:z_err:t:t_err",
"sector >12 & sector <14 " );
234 TGraphErrors *gr13 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
236 gr13->SetTitle(
"Sector 13");
237 gr13->SetMaximum(4.0);
238 gr13->SetMinimum(0.);
239 TFitResultPtr sec13_r1 = gr13->Fit(
"pol1",
"S",
"",10,44);
240 double sec13_r1_intcp = sec13_r1->Parameter(0);
241 double sec13_r1_slope = sec13_r1->Parameter(1);
242 TFitResultPtr sec13_r2 = gr13->Fit(
"pol1",
"S+",
"",44,52);
243 double sec13_r2_intcp = sec13_r2->Parameter(0);
244 double sec13_r2_slope = sec13_r2->Parameter(1);
245 TFitResultPtr sec13_r3 = gr13->Fit(
"pol1",
"S+",
"",52,60);
246 double sec13_r3_intcp = sec13_r3->Parameter(0);
247 double sec13_r3_slope = sec13_r3->Parameter(1);
249 ntuple.Draw(
"z:z_err:t:t_err",
"sector >13 & sector <15 " );
250 TGraphErrors *gr14 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
252 gr14->SetTitle(
"Sector 14");
253 gr14->SetMaximum(4.0);
254 gr14->SetMinimum(0.0);
255 TFitResultPtr sec14_r1 = gr14->Fit(
"pol1",
"S",
"",10,44);
256 double sec14_r1_intcp = sec14_r1->Parameter(0);
257 double sec14_r1_slope = sec14_r1->Parameter(1);
258 TFitResultPtr sec14_r2 = gr14->Fit(
"pol1",
"S+",
"",44,52);
259 double sec14_r2_intcp = sec14_r2->Parameter(0);
260 double sec14_r2_slope = sec14_r2->Parameter(1);
261 TFitResultPtr sec14_r3 = gr14->Fit(
"pol1",
"S+",
"",52,60);
262 double sec14_r3_intcp = sec14_r3->Parameter(0);
263 double sec14_r3_slope = sec14_r3->Parameter(1);
265 ntuple.Draw(
"z:z_err:t:t_err",
"sector >14 & sector <16 " );
266 TGraphErrors *gr15 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
268 gr15->SetTitle(
"Sector 15");
269 gr15->SetMaximum(4.0);
270 gr15->SetMinimum(0.0);
271 TFitResultPtr sec15_r1 = gr15->Fit(
"pol1",
"S",
"",10,44);
272 double sec15_r1_intcp = sec15_r1->Parameter(0);
273 double sec15_r1_slope = sec15_r1->Parameter(1);
274 TFitResultPtr sec15_r2 = gr15->Fit(
"pol1",
"S+",
"",44,52);
275 double sec15_r2_intcp = sec15_r2->Parameter(0);
276 double sec15_r2_slope = sec15_r2->Parameter(1);
277 TFitResultPtr sec15_r3 = gr15->Fit(
"pol1",
"S+",
"",52,60);
278 double sec15_r3_intcp = sec15_r3->Parameter(0);
279 double sec15_r3_slope = sec15_r3->Parameter(1);
281 ntuple.Draw(
"z:z_err:t:t_err",
"sector >15 & sector <17 " );
282 TGraphErrors *gr16 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
284 gr16->SetTitle(
"Sector 16");
285 gr16->SetMaximum(4.0);
286 gr16->SetMinimum(0.0);
287 TFitResultPtr sec16_r1 = gr16->Fit(
"pol1",
"S",
"",10,44);
288 double sec16_r1_intcp = sec16_r1->Parameter(0);
289 double sec16_r1_slope = sec16_r1->Parameter(1);
290 TFitResultPtr sec16_r2 = gr16->Fit(
"pol1",
"S+",
"",44,52);
291 double sec16_r2_intcp = sec16_r2->Parameter(0);
292 double sec16_r2_slope = sec16_r2->Parameter(1);
293 TFitResultPtr sec16_r3 = gr16->Fit(
"pol1",
"S+",
"",52,60);
294 double sec16_r3_intcp = sec16_r3->Parameter(0);
295 double sec16_r3_slope = sec16_r3->Parameter(1);
297 ntuple.Draw(
"z:z_err:t:t_err",
"sector >16 & sector <18 " );
298 TGraphErrors *gr17 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
300 gr17->SetTitle(
"Sector 17");
301 gr17->SetMaximum(4.0);
302 gr17->SetMinimum(0.);
303 TFitResultPtr sec17_r1 = gr17->Fit(
"pol1",
"S",
"",10,44);
304 double sec17_r1_intcp = sec17_r1->Parameter(0);
305 double sec17_r1_slope = sec17_r1->Parameter(1);
306 TFitResultPtr sec17_r2 = gr17->Fit(
"pol1",
"S+",
"",44,52);
307 double sec17_r2_intcp = sec17_r2->Parameter(0);
308 double sec17_r2_slope = sec17_r2->Parameter(1);
309 TFitResultPtr sec17_r3 = gr17->Fit(
"pol1",
"S+",
"",52,60);
310 double sec17_r3_intcp = sec17_r3->Parameter(0);
311 double sec17_r3_slope = sec17_r3->Parameter(1);
313 ntuple.Draw(
"z:z_err:t:t_err",
"sector >17 & sector <19 " );
314 TGraphErrors *gr18 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
316 gr18->SetTitle(
"Sector 18");
317 gr18->SetMaximum(4.0);
318 gr18->SetMinimum(0.);
319 TFitResultPtr sec18_r1 = gr18->Fit(
"pol1",
"S",
"",10,44);
320 double sec18_r1_intcp = sec18_r1->Parameter(0);
321 double sec18_r1_slope = sec18_r1->Parameter(1);
322 TFitResultPtr sec18_r2 = gr18->Fit(
"pol1",
"S+",
"",44,52);
323 double sec18_r2_intcp = sec18_r2->Parameter(0);
324 double sec18_r2_slope = sec18_r2->Parameter(1);
325 TFitResultPtr sec18_r3 = gr18->Fit(
"pol1",
"S+",
"",52,60);
326 double sec18_r3_intcp = sec18_r3->Parameter(0);
327 double sec18_r3_slope = sec18_r3->Parameter(1);
328 auto c4 =
new TCanvas(
"c4",
"c4",600,500);
331 ntuple.Draw(
"z:z_err:t:t_err",
"sector >18 & sector <20 " );
332 TGraphErrors *gr19 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
334 gr19->SetTitle(
"Sector 19");
335 gr19->SetMaximum(4.0);
336 gr19->SetMinimum(0.);
337 TFitResultPtr sec19_r1 = gr19->Fit(
"pol1",
"S",
"",10,44);
338 double sec19_r1_intcp = sec19_r1->Parameter(0);
339 double sec19_r1_slope = sec19_r1->Parameter(1);
340 TFitResultPtr sec19_r2 = gr19->Fit(
"pol1",
"S+",
"",44,52);
341 double sec19_r2_intcp = sec19_r2->Parameter(0);
342 double sec19_r2_slope = sec19_r2->Parameter(1);
343 TFitResultPtr sec19_r3 = gr19->Fit(
"pol1",
"S+",
"",52,60);
344 double sec19_r3_intcp = sec19_r3->Parameter(0);
345 double sec19_r3_slope = sec19_r3->Parameter(1);
347 ntuple.Draw(
"z:z_err:t:t_err",
"sector >19 & sector <21 " );
348 TGraphErrors *gr20 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
350 gr20->SetTitle(
"Sector 20");
351 gr20->SetMaximum(4.0);
352 gr20->SetMinimum(0.);
353 TFitResultPtr sec20_r1 = gr20->Fit(
"pol1",
"S",
"",10,44);
354 double sec20_r1_intcp = sec20_r1->Parameter(0);
355 double sec20_r1_slope = sec20_r1->Parameter(1);
356 TFitResultPtr sec20_r2 = gr20->Fit(
"pol1",
"S+",
"",44,52);
357 double sec20_r2_intcp = sec20_r2->Parameter(0);
358 double sec20_r2_slope = sec20_r2->Parameter(1);
359 TFitResultPtr sec20_r3 = gr20->Fit(
"pol1",
"S+",
"",52,60);
360 double sec20_r3_intcp = sec20_r3->Parameter(0);
361 double sec20_r3_slope = sec20_r3->Parameter(1);
363 ntuple.Draw(
"z:z_err:t:t_err",
"sector >20 & sector <22 " );
364 TGraphErrors *gr21 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
366 gr21->SetTitle(
"Sector 21");
367 gr21->SetMaximum(4.0);
368 gr21->SetMinimum(0.);
369 TFitResultPtr sec21_r1 = gr21->Fit(
"pol1",
"S",
"",10,44);
370 double sec21_r1_intcp = sec21_r1->Parameter(0);
371 double sec21_r1_slope = sec21_r1->Parameter(1);
372 TFitResultPtr sec21_r2 = gr21->Fit(
"pol1",
"S+",
"",44,52);
373 double sec21_r2_intcp = sec21_r2->Parameter(0);
374 double sec21_r2_slope = sec21_r2->Parameter(1);
375 TFitResultPtr sec21_r3 = gr21->Fit(
"pol1",
"S+",
"",52,60);
376 double sec21_r3_intcp = sec21_r3->Parameter(0);
377 double sec21_r3_slope = sec21_r3->Parameter(1);
379 ntuple.Draw(
"z:z_err:t:t_err",
"sector >21 & sector <23 " );
380 TGraphErrors *gr22 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
382 gr22->SetTitle(
"Sector 22");
383 gr22->SetMaximum(4.0);
384 gr22->SetMinimum(0.0);
385 TFitResultPtr sec22_r1 = gr22->Fit(
"pol1",
"S",
"",10,44);
386 double sec22_r1_intcp = sec22_r1->Parameter(0);
387 double sec22_r1_slope = sec22_r1->Parameter(1);
388 TFitResultPtr sec22_r2 = gr22->Fit(
"pol1",
"S+",
"",44,52);
389 double sec22_r2_intcp = sec22_r2->Parameter(0);
390 double sec22_r2_slope = sec22_r2->Parameter(1);
391 TFitResultPtr sec22_r3 = gr22->Fit(
"pol1",
"S+",
"",52,60);
392 double sec22_r3_intcp = sec22_r3->Parameter(0);
393 double sec22_r3_slope = sec22_r3->Parameter(1);
395 ntuple.Draw(
"z:z_err:t:t_err",
"sector >22 & sector <24 " );
396 TGraphErrors *gr23 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
398 gr23->SetTitle(
"Sector 23");
399 gr23->SetMaximum(4.0);
400 gr23->SetMinimum(0.);
401 TFitResultPtr sec23_r1 = gr23->Fit(
"pol1",
"S",
"",10,44);
402 double sec23_r1_intcp = sec23_r1->Parameter(0);
403 double sec23_r1_slope = sec23_r1->Parameter(1);
404 TFitResultPtr sec23_r2 = gr23->Fit(
"pol1",
"S+",
"",44,52);
405 double sec23_r2_intcp = sec23_r2->Parameter(0);
406 double sec23_r2_slope = sec23_r2->Parameter(1);
407 TFitResultPtr sec23_r3 = gr23->Fit(
"pol1",
"S+",
"",52,60);
408 double sec23_r3_intcp = sec23_r3->Parameter(0);
409 double sec23_r3_slope = sec23_r3->Parameter(1);
411 ntuple.Draw(
"z:z_err:t:t_err",
"sector >23 & sector <25 " );
412 TGraphErrors *gr24 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
414 gr24->SetTitle(
"Sector 24");
415 gr24->SetMaximum(4.0);
416 gr24->SetMinimum(0.);
417 TFitResultPtr sec24_r1 = gr24->Fit(
"pol1",
"S",
"",10,44);
418 double sec24_r1_intcp = sec24_r1->Parameter(0);
419 double sec24_r1_slope = sec24_r1->Parameter(1);
420 TFitResultPtr sec24_r2 = gr24->Fit(
"pol1",
"S+",
"",44,52);
421 double sec24_r2_intcp = sec24_r2->Parameter(0);
422 double sec24_r2_slope = sec24_r2->Parameter(1);
423 TFitResultPtr sec24_r3 = gr24->Fit(
"pol1",
"S+",
"",52,60);
424 double sec24_r3_intcp = sec24_r3->Parameter(0);
425 double sec24_r3_slope = sec24_r3->Parameter(1);
426 auto c5 =
new TCanvas(
"c5",
"c5",600,500);
429 ntuple.Draw(
"z:z_err:t:t_err",
"sector >24 & sector <26 " );
430 TGraphErrors *gr25 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
432 gr25->SetTitle(
"Sector 25");
433 gr25->SetMaximum(4.0);
434 gr25->SetMinimum(0.);
435 TFitResultPtr sec25_r1 = gr25->Fit(
"pol1",
"S",
"",10,44);
436 double sec25_r1_intcp = sec25_r1->Parameter(0);
437 double sec25_r1_slope = sec25_r1->Parameter(1);
438 TFitResultPtr sec25_r2 = gr25->Fit(
"pol1",
"S+",
"",44,52);
439 double sec25_r2_intcp = sec25_r2->Parameter(0);
440 double sec25_r2_slope = sec25_r2->Parameter(1);
441 TFitResultPtr sec25_r3 = gr25->Fit(
"pol1",
"S+",
"",52,60);
442 double sec25_r3_intcp = sec25_r3->Parameter(0);
443 double sec25_r3_slope = sec25_r3->Parameter(1);
445 ntuple.Draw(
"z:z_err:t:t_err",
"sector >25 & sector <27 " );
446 TGraphErrors *gr26 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
448 gr26->SetTitle(
"Sector 26");
449 gr26->SetMaximum(4.0);
450 gr26->SetMinimum(0.);
451 TFitResultPtr sec26_r1 = gr26->Fit(
"pol1",
"S",
"",10,44);
452 double sec26_r1_intcp = sec26_r1->Parameter(0);
453 double sec26_r1_slope = sec26_r1->Parameter(1);
454 TFitResultPtr sec26_r2 = gr26->Fit(
"pol1",
"S+",
"",44,52);
455 double sec26_r2_intcp = sec26_r2->Parameter(0);
456 double sec26_r2_slope = sec26_r2->Parameter(1);
457 TFitResultPtr sec26_r3 = gr26->Fit(
"pol1",
"S+",
"",52,60);
458 double sec26_r3_intcp = sec26_r3->Parameter(0);
459 double sec26_r3_slope = sec26_r3->Parameter(1);
461 ntuple.Draw(
"z:z_err:t:t_err",
"sector >26 & sector <28 " );
462 TGraphErrors *gr27 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
464 gr27->SetTitle(
"Sector 27");
465 gr27->SetMaximum(4.0);
466 gr27->SetMinimum(0.);
467 TFitResultPtr sec27_r1 = gr27->Fit(
"pol1",
"S",
"",10,44);
468 double sec27_r1_intcp = sec27_r1->Parameter(0);
469 double sec27_r1_slope = sec27_r1->Parameter(1);
470 TFitResultPtr sec27_r2 = gr27->Fit(
"pol1",
"S+",
"",44,52);
471 double sec27_r2_intcp = sec27_r2->Parameter(0);
472 double sec27_r2_slope = sec27_r2->Parameter(1);
473 TFitResultPtr sec27_r3 = gr27->Fit(
"pol1",
"S+",
"",52,60);
474 double sec27_r3_intcp = sec27_r3->Parameter(0);
475 double sec27_r3_slope = sec27_r3->Parameter(1);
477 ntuple.Draw(
"z:z_err:t:t_err",
"sector >27 & sector <29 " );
478 TGraphErrors *gr28 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
480 gr28->SetTitle(
"Sector 28");
481 gr28->SetMaximum(4.0);
482 gr28->SetMinimum(0.0);
483 TFitResultPtr sec28_r1 = gr28->Fit(
"pol1",
"S",
"",10,44);
484 double sec28_r1_intcp = sec28_r1->Parameter(0);
485 double sec28_r1_slope = sec28_r1->Parameter(1);
486 TFitResultPtr sec28_r2 = gr28->Fit(
"pol1",
"S+",
"",44,52);
487 double sec28_r2_intcp = sec28_r2->Parameter(0);
488 double sec28_r2_slope = sec28_r2->Parameter(1);
489 TFitResultPtr sec28_r3 = gr28->Fit(
"pol1",
"S+",
"",52,60);
490 double sec28_r3_intcp = sec28_r3->Parameter(0);
491 double sec28_r3_slope = sec28_r3->Parameter(1);
493 ntuple.Draw(
"z:z_err:t:t_err",
"sector >28 & sector <30 " );
494 TGraphErrors *gr29 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
496 gr29->SetTitle(
"Sector 29");
497 gr29->SetMaximum(4.0);
498 gr29->SetMinimum(0.);
499 TFitResultPtr sec29_r1 = gr29->Fit(
"pol1",
"S",
"",10,44);
500 double sec29_r1_intcp = sec29_r1->Parameter(0);
501 double sec29_r1_slope = sec29_r1->Parameter(1);
502 TFitResultPtr sec29_r2 = gr29->Fit(
"pol1",
"S+",
"",44,52);
503 double sec29_r2_intcp = sec29_r2->Parameter(0);
504 double sec29_r2_slope = sec29_r2->Parameter(1);
505 TFitResultPtr sec29_r3 = gr29->Fit(
"pol1",
"S+",
"",52,60);
506 double sec29_r3_intcp = sec29_r3->Parameter(0);
507 double sec29_r3_slope = sec29_r3->Parameter(1);
509 ntuple.Draw(
"z:z_err:t:t_err",
"sector >29 & sector <31 " );
510 TGraphErrors *gr30 =
new TGraphErrors(ntuple.GetSelectedRows(), ntuple.GetV1(), ntuple.GetV3(),ntuple.GetV2(), ntuple.GetV4());
512 gr30->SetTitle(
"Sector 30");
513 gr30->SetMaximum(4.0);
514 gr30->SetMinimum(0.);
515 TFitResultPtr sec30_r1 = gr30->Fit(
"pol1",
"S",
"",10,44);
516 double sec30_r1_intcp = sec30_r1->Parameter(0);
517 double sec30_r1_slope = sec30_r1->Parameter(1);
518 TFitResultPtr sec30_r2 = gr30->Fit(
"pol1",
"S+",
"",44,52);
519 double sec30_r2_intcp = sec30_r2->Parameter(0);
520 double sec30_r2_slope = sec30_r2->Parameter(1);
521 TFitResultPtr sec30_r3 = gr30->Fit(
"pol1",
"S+",
"",52,60);
522 double sec30_r3_intcp = sec30_r3->Parameter(0);
523 double sec30_r3_slope = sec30_r3->Parameter(1);
526 SC_PTC << sec1_r1_intcp <<
"\t" << sec1_r1_slope <<
"\t" << sec1_r2_intcp <<
"\t" << sec1_r2_slope <<
"\t" <<sec1_r3_intcp <<
"\t" << sec1_r3_slope <<endl;
527 SC_PTC << sec2_r1_intcp <<
"\t" << sec2_r1_slope <<
"\t" << sec2_r2_intcp <<
"\t" << sec2_r2_slope <<
"\t" <<sec2_r3_intcp <<
"\t" << sec2_r3_slope <<endl;
528 SC_PTC << sec3_r1_intcp <<
"\t" << sec3_r1_slope <<
"\t" << sec3_r2_intcp <<
"\t" << sec3_r2_slope <<
"\t" <<sec3_r3_intcp <<
"\t" << sec3_r3_slope <<endl;
529 SC_PTC << sec4_r1_intcp <<
"\t" << sec4_r1_slope <<
"\t" << sec4_r2_intcp <<
"\t" << sec4_r2_slope <<
"\t" <<sec4_r3_intcp <<
"\t" << sec4_r3_slope <<endl;
530 SC_PTC << sec5_r1_intcp <<
"\t" << sec5_r1_slope <<
"\t" << sec5_r2_intcp <<
"\t" << sec5_r2_slope <<
"\t" <<sec5_r3_intcp <<
"\t" << sec5_r3_slope <<endl;
531 SC_PTC << sec6_r1_intcp <<
"\t" << sec6_r1_slope <<
"\t" << sec6_r2_intcp <<
"\t" << sec6_r2_slope <<
"\t" <<sec6_r3_intcp <<
"\t" << sec6_r3_slope <<endl;
532 SC_PTC << sec7_r1_intcp <<
"\t" << sec7_r1_slope <<
"\t" << sec7_r2_intcp <<
"\t" << sec7_r2_slope <<
"\t" <<sec7_r3_intcp <<
"\t" << sec7_r3_slope <<endl;
533 SC_PTC << sec8_r1_intcp <<
"\t" << sec8_r1_slope <<
"\t" << sec8_r2_intcp <<
"\t" << sec8_r2_slope <<
"\t" <<sec8_r3_intcp <<
"\t" << sec8_r3_slope <<endl;
534 SC_PTC << sec9_r1_intcp <<
"\t" << sec9_r1_slope <<
"\t" << sec9_r2_intcp <<
"\t" << sec9_r2_slope <<
"\t" <<sec9_r3_intcp <<
"\t" << sec9_r3_slope <<endl;
536 SC_PTC << sec10_r1_intcp <<
"\t" << sec10_r1_slope <<
"\t" << sec10_r2_intcp <<
"\t" << sec10_r2_slope <<
"\t" <<sec10_r3_intcp <<
"\t" << sec10_r3_slope <<endl;
537 SC_PTC << sec11_r1_intcp <<
"\t" << sec11_r1_slope <<
"\t" << sec11_r2_intcp <<
"\t" << sec11_r2_slope <<
"\t" <<sec11_r3_intcp <<
"\t" << sec11_r3_slope <<endl;
538 SC_PTC << sec12_r1_intcp <<
"\t" << sec12_r1_slope <<
"\t" << sec12_r2_intcp <<
"\t" << sec12_r2_slope <<
"\t" <<sec12_r3_intcp <<
"\t" << sec12_r3_slope <<endl;
539 SC_PTC << sec13_r1_intcp <<
"\t" << sec13_r1_slope <<
"\t" << sec13_r2_intcp <<
"\t" << sec13_r2_slope <<
"\t" <<sec13_r3_intcp <<
"\t" << sec13_r3_slope << endl;
540 SC_PTC << sec14_r1_intcp <<
"\t" << sec14_r1_slope <<
"\t" << sec14_r2_intcp <<
"\t" << sec14_r2_slope <<
"\t" <<sec14_r3_intcp <<
"\t" << sec14_r3_slope <<endl;
541 SC_PTC << sec15_r1_intcp <<
"\t" << sec15_r1_slope <<
"\t" << sec15_r2_intcp <<
"\t" << sec15_r2_slope <<
"\t" <<sec15_r3_intcp <<
"\t" << sec15_r3_slope<<endl;
542 SC_PTC << sec16_r1_intcp <<
"\t" << sec16_r1_slope <<
"\t" << sec16_r2_intcp <<
"\t" << sec16_r2_slope <<
"\t" <<sec16_r3_intcp <<
"\t" << sec16_r3_slope<<endl;
543 SC_PTC << sec17_r1_intcp <<
"\t" << sec17_r1_slope <<
"\t" << sec17_r2_intcp <<
"\t" << sec17_r2_slope <<
"\t" <<sec17_r3_intcp <<
"\t" << sec17_r3_slope<<endl;
544 SC_PTC << sec18_r1_intcp <<
"\t" << sec18_r1_slope <<
"\t" << sec18_r2_intcp <<
"\t" << sec18_r2_slope <<
"\t" <<sec18_r3_intcp <<
"\t" << sec18_r3_slope<<endl;
545 SC_PTC << sec19_r1_intcp <<
"\t" << sec19_r1_slope <<
"\t" << sec19_r2_intcp <<
"\t" << sec19_r2_slope <<
"\t" <<sec19_r3_intcp <<
"\t" << sec19_r3_slope<<endl;
546 SC_PTC << sec20_r1_intcp <<
"\t" << sec20_r1_slope <<
"\t" << sec20_r2_intcp <<
"\t" << sec20_r2_slope <<
"\t" <<sec20_r3_intcp <<
"\t" << sec20_r3_slope<<endl;
547 SC_PTC << sec21_r1_intcp <<
"\t" << sec21_r1_slope <<
"\t" << sec21_r2_intcp <<
"\t" << sec21_r2_slope <<
"\t" <<sec21_r3_intcp <<
"\t" << sec21_r3_slope<<endl;
548 SC_PTC << sec22_r1_intcp <<
"\t" << sec22_r1_slope <<
"\t" << sec22_r2_intcp <<
"\t" << sec22_r2_slope <<
"\t" <<sec22_r3_intcp <<
"\t" << sec22_r3_slope<<endl;
549 SC_PTC << sec23_r1_intcp <<
"\t" << sec23_r1_slope <<
"\t" << sec23_r2_intcp <<
"\t" << sec23_r2_slope <<
"\t" <<sec23_r3_intcp <<
"\t" << sec23_r3_slope<<endl;
550 SC_PTC << sec24_r1_intcp <<
"\t" << sec24_r1_slope <<
"\t" << sec24_r2_intcp <<
"\t" << sec24_r2_slope <<
"\t" <<sec24_r3_intcp <<
"\t" << sec24_r3_slope<<endl;
551 SC_PTC << sec25_r1_intcp <<
"\t" << sec25_r1_slope <<
"\t" << sec25_r2_intcp <<
"\t" << sec25_r2_slope <<
"\t" <<sec25_r3_intcp <<
"\t" << sec25_r3_slope<<endl;
552 SC_PTC << sec26_r1_intcp <<
"\t" << sec26_r1_slope <<
"\t" << sec26_r2_intcp <<
"\t" << sec26_r2_slope <<
"\t" <<sec26_r3_intcp <<
"\t" << sec26_r3_slope<<endl;
553 SC_PTC << sec27_r1_intcp <<
"\t" << sec27_r1_slope <<
"\t" << sec27_r2_intcp <<
"\t" << sec27_r2_slope <<
"\t" <<sec27_r3_intcp <<
"\t" << sec27_r3_slope<<endl;
554 SC_PTC << sec28_r1_intcp <<
"\t" << sec28_r1_slope <<
"\t" << sec28_r2_intcp <<
"\t" << sec28_r2_slope <<
"\t" <<sec28_r3_intcp <<
"\t" << sec28_r3_slope<<endl;
555 SC_PTC << sec29_r1_intcp <<
"\t" << sec29_r1_slope <<
"\t" << sec29_r2_intcp <<
"\t" << sec29_r2_slope <<
"\t" <<sec29_r3_intcp <<
"\t" << sec29_r3_slope<<endl;
556 SC_PTC << sec30_r1_intcp <<
"\t" << sec30_r1_slope <<
"\t" << sec30_r2_intcp <<
"\t" << sec30_r2_slope <<
"\t" <<sec30_r3_intcp <<
"\t" << sec30_r3_slope<<endl;
void SC_PTC(char const *input_filename)
static TGraphErrors * gr12
Double_t sigma[NCHANNELS]
static TGraphErrors * gr11
printf("string=%s", string)