]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | .L AliGenInfo.C+ | |
3 | .L TestAnalisys.C+ | |
4 | AddChains(868); // AddChains(runNumber); | |
5 | Select(); // make default selection of data | |
6 | MakePictures("pic868"); | |
7 | */ | |
8 | ||
9 | #include "TFile.h" | |
10 | #include "TTree.h" | |
11 | #include "TChain.h" | |
12 | #include "TString.h" | |
13 | #include "TLegend.h" | |
14 | #include "TStyle.h" | |
15 | #include "TCut.h" | |
16 | #include "TF1.h" | |
17 | #include "TProfile.h" | |
18 | #include "TProfile2D.h" | |
19 | #include "TH1F.h" | |
20 | #include "TH2F.h" | |
21 | #include "TPad.h" | |
22 | #include "TCanvas.h" | |
23 | #include "TSystem.h" | |
24 | #include "TParticle.h" | |
25 | #include "TRandom.h" | |
26 | #include "TEventList.h" | |
27 | ||
28 | #include "AliTrackReference.h" | |
29 | #include "AliTPCParam.h" | |
30 | #include "AliDetector.h" | |
31 | #include "AliStack.h" | |
32 | #include "AliGenInfo.h" | |
33 | ||
34 | ||
35 | ||
36 | ||
37 | ||
38 | ||
39 | void Select(); // make default selection | |
40 | void SelectLaser(); // make default selection for laser tracks | |
41 | ||
42 | void AddChains(Int_t run); // add all the trees with selected run number to the chain | |
43 | void MakePictures(char *dirname); // make default pictures | |
44 | ||
45 | void PRFYZ(TCut cut0, TCut cut1, char * description); | |
46 | void PRFZZ(TCut cut0, TCut cut1, char * description); | |
47 | void P5Z(TCut cut0, TCut cut1, char * description); | |
48 | void P3Z(TCut cut0, TCut cut1, char * description); | |
49 | void ResYZ(TCut cut0, TCut cut1, char * description); | |
50 | void SysYX(TCut cut0, char * description); | |
51 | void SysZX(TCut cut0, char * description); | |
52 | // | |
53 | TProfile * ProfileMaxRow(TCut cut0, char *name, Int_t max); | |
54 | TProfile * ProfileMaxPhi(TCut cut0, char *name, Int_t max); | |
55 | TProfile * ProfileMaxZ(TCut cut0, char *name, Int_t max); | |
56 | TProfile * ProfileQRow(TCut cut0, char *name, Int_t max); | |
57 | TProfile * ProfileQPhi(TCut cut0, char *name, Int_t max); | |
58 | TProfile * ProfileQZ(TCut cut0, char *name, Int_t max); | |
59 | TCanvas * NoiseSector(TCut cut0, char * description, Int_t maxrow, Int_t maxpad); | |
60 | ||
61 | // | |
62 | // global variables | |
63 | // | |
64 | TChain chaincl("Tracks","Tracks"); // tpc tracks and clusters | |
65 | TChain chaincl2("Tracks","Tracks"); // tpc tracks and clusters | |
66 | TChain chainSignal("SignalB","SignalB"); // signals over threshold 50 | |
67 | ||
68 | TChain chainFit("Fit","Fit"); // fitted signals with fit parameters | |
69 | TChain chainPed("Fit","Fit"); // fitted pedestal with noise | |
70 | TString runDesc="Run "; // run descriptor | |
71 | // | |
72 | AliComparisonDraw comp; | |
73 | AliComparisonDraw compCl; | |
74 | AliComparisonDraw compF; | |
75 | AliComparisonDraw compP; | |
76 | // | |
77 | // | |
78 | // selection of data for analysis | |
79 | // | |
80 | TEventList * listTracks = new TEventList("listTracks","listTracks"); | |
81 | TEventList * listFitS = new TEventList("listFitS","listFitS"); | |
82 | TEventList * listFitPed = new TEventList("listFitPed","listFitPed"); | |
83 | ||
84 | ||
85 | ||
86 | ||
87 | void MakePictures(char *dirname){ | |
88 | // | |
89 | // | |
90 | // | |
91 | // Define Uli Style | |
92 | gROOT->SetStyle("Plain"); | |
93 | gStyle->SetFillColor(10); | |
94 | gStyle->SetPadColor(10); | |
95 | gStyle->SetCanvasColor(10); | |
96 | gStyle->SetStatColor(10); | |
97 | ||
98 | gStyle->SetPalette(1,0); | |
99 | gStyle->SetNumberContours(50); | |
100 | // | |
101 | const Int_t kMinCl = 200; | |
102 | char chshell[100]; | |
103 | sprintf(chshell,"mkdir %s", dirname); | |
104 | gSystem->Exec(chshell); | |
105 | sprintf(chshell,"cd %s", dirname); | |
106 | gSystem->Exec(chshell); | |
107 | // | |
108 | // | |
109 | // | |
110 | TCanvas c(dirname,dirname); | |
111 | for (Int_t isector=0; isector<36; isector++){ | |
112 | char chcut1[100]; | |
113 | char chcut2[100]; | |
114 | char chdesc[100]; | |
115 | TProfile * prof; | |
116 | sprintf(chshell,"Cl.fX>0&&Cl.fDetector==%d",isector); | |
117 | Int_t ncl = comp.fTree->Draw("Cl.fY",chshell); | |
118 | if (ncl<kMinCl) continue; | |
119 | printf("MakePictures sector %d\n",isector); | |
120 | // | |
121 | // charge pictures | |
122 | // | |
123 | // | |
124 | // charge row | |
125 | // | |
126 | c.cd(); | |
127 | sprintf(chdesc,"%s Sector %d IROC",runDesc.Data(), isector); | |
128 | sprintf(chcut1,"Cl.fDetector==%d", isector); | |
129 | prof = ProfileQRow(chcut1, chdesc, 70); | |
130 | sprintf(chshell,"%s/qrow_sec%dIROC.eps", dirname,isector); | |
131 | prof->Draw(); | |
132 | c.Update(); | |
133 | c.Print(chshell); | |
134 | prof = ProfileMaxRow(chcut1, chdesc, 70); | |
135 | sprintf(chshell,"%s/maxrow_sec%dIROC.eps", dirname,isector); | |
136 | prof->Draw(); | |
137 | c.Update(); | |
138 | c.Print(chshell); | |
139 | // | |
140 | sprintf(chdesc,"%s Sector %d OROC",runDesc.Data(), isector); | |
141 | sprintf(chcut1,"Cl.fDetector==%d", isector+36); | |
142 | prof = ProfileQRow(chcut1, chdesc, 100); | |
143 | sprintf(chshell,"%s/qrow_sec%dOROC.eps", dirname,isector); | |
144 | prof->Draw(); | |
145 | c.Update(); | |
146 | c.Print(chshell); | |
147 | prof = ProfileMaxRow(chcut1, chdesc, 100); | |
148 | sprintf(chshell,"%s/maxrow_sec%dOROC.eps", dirname,isector); | |
149 | prof->Draw(); | |
150 | c.Update(); | |
151 | c.Print(chshell); | |
152 | // | |
153 | // charge phi | |
154 | // | |
155 | sprintf(chdesc,"%s Sector %d IROC",runDesc.Data(), isector); | |
156 | sprintf(chcut1,"Cl.fDetector==%d", isector); | |
157 | prof = ProfileMaxPhi(chcut1, chdesc,20); | |
158 | sprintf(chshell,"%s/qphi_sec%dIROC.eps", dirname,isector); | |
159 | prof->Draw(); | |
160 | c.Update(); | |
161 | c.Print(chshell); | |
162 | // | |
163 | sprintf(chdesc,"%s Sector %d OROC",runDesc.Data(), isector); | |
164 | sprintf(chcut1,"Cl.fDetector==%d", isector+36); | |
165 | prof = ProfileMaxPhi(chcut1, chdesc,20); | |
166 | sprintf(chshell,"%s/qphi_sec%dOROC.eps", dirname,isector); | |
167 | prof->Draw(); | |
168 | c.Update(); | |
169 | c.Print(chshell); | |
170 | // | |
171 | // charge z | |
172 | // | |
173 | c.cd(); | |
174 | sprintf(chdesc,"%s Sector %d IROC",runDesc.Data(), isector); | |
175 | sprintf(chcut1,"Cl.fDetector==%d", isector); | |
176 | prof = ProfileQZ(chcut1, chdesc,20); | |
177 | sprintf(chshell,"%s/qz_sec%dIROC.eps", dirname,isector); | |
178 | // prof->Draw(); | |
179 | c.Update(); | |
180 | c.Print(chshell); | |
181 | // | |
182 | c.cd(); | |
183 | sprintf(chdesc,"%s Sector %d OROC",runDesc.Data(), isector); | |
184 | sprintf(chcut1,"Cl.fDetector==%d", isector+36); | |
185 | prof = ProfileQZ(chcut1, chdesc,20); | |
186 | sprintf(chshell,"%s/qz_sec%dOROC.eps", dirname,isector); | |
187 | //prof->Draw(); | |
188 | c.Update(); | |
189 | c.Print(chshell); | |
190 | // | |
191 | // Picture noise | |
192 | // | |
193 | sprintf(chdesc,"%s Sector %d IROC",runDesc.Data(), isector); | |
194 | sprintf(chcut1,"Sector==%d", isector); | |
195 | TCanvas *cnoise = NoiseSector(chcut1, chdesc,70,70); | |
196 | sprintf(chshell,"%s/noise_sec%dIROC.eps", dirname,isector); | |
197 | cnoise->Print(chshell); | |
198 | sprintf(chdesc,"%s Sector %d OROC",runDesc.Data(), isector); | |
199 | sprintf(chcut1,"Sector==%d", isector+36); | |
200 | cnoise = NoiseSector(chcut1, chdesc,70,70); | |
201 | sprintf(chshell,"%s/noise_sec%dOROC.eps", dirname,isector); | |
202 | cnoise->Print(chshell); | |
203 | // | |
204 | // systematic | |
205 | // | |
206 | c.cd(); | |
207 | sprintf(chdesc,"%s Sector %d",runDesc.Data(), isector); | |
208 | sprintf(chcut1,"Cl.fDetector==%d||Cl.fDetector==%d", isector, isector+36); | |
209 | SysYX(chcut1,chdesc); | |
210 | sprintf(chshell,"%s/deltayx_sec%d.eps", dirname,isector); | |
211 | c.Print(chshell); | |
212 | c.cd(); | |
213 | SysZX(chcut1,chdesc); | |
214 | sprintf(chshell,"%s/deltazx_sec%d.eps", dirname,isector); | |
215 | c.Print(chshell); | |
216 | ||
217 | // | |
218 | // picture prf | |
219 | // | |
220 | if (ncl<500) continue; //not enough statistic | |
221 | // | |
222 | sprintf(chdesc,"%s Sector %d",runDesc.Data(), isector); | |
223 | sprintf(chcut1,"Cl.fDetector==%d", isector); | |
224 | sprintf(chcut2,"Cl.fDetector==%d", isector+36); | |
225 | c.cd(); | |
226 | PRFYZ(chcut1, chcut2,chdesc); | |
227 | sprintf(chshell,"%s/prfyz_sec%d.eps", dirname,isector); | |
228 | c.Print(chshell); | |
229 | sprintf(chcut1,"Sector==%d", isector); | |
230 | sprintf(chcut2,"Sector==%d", isector+36); | |
231 | PRFZZ(chcut1, chcut2,chdesc); | |
232 | sprintf(chshell,"%s/prfzz_sec%d.eps", dirname,isector); | |
233 | c.Print(chshell); | |
234 | // | |
235 | // y resolution | |
236 | // | |
237 | sprintf(chdesc,"%s Sector %d",runDesc.Data(), isector); | |
238 | sprintf(chcut1,"Cl.fDetector==%d", isector); | |
239 | sprintf(chcut2,"Cl.fDetector==%d", isector+36); | |
240 | c.cd(); | |
241 | ResYZ(chcut1, chcut2,chdesc); | |
242 | sprintf(chshell,"%s/resyz_sec%d.eps", dirname,isector); | |
243 | c.Print(chshell); | |
244 | // | |
245 | } | |
246 | } | |
247 | ||
248 | ||
249 | ||
250 | ||
251 | ||
252 | ||
253 | void AddChains(Int_t run){ | |
254 | // | |
255 | // add files to the chains + check consistency | |
256 | // | |
257 | ifstream in0; | |
258 | ifstream in1; | |
259 | ifstream in2; | |
260 | ifstream in3; | |
261 | ifstream in4; | |
262 | TString sfile; | |
263 | char strcl[100]; | |
264 | runDesc+=run; | |
265 | // TPC tracks | |
266 | // | |
267 | sprintf(strcl,"ls *%d*/TPCtracks.root > files.txt", run); | |
268 | gSystem->Exec(strcl); | |
269 | in0.open("files.txt"); | |
270 | for (;in0>>sfile;){ | |
271 | if (sfile.Length()==0) break; | |
272 | printf("%s\n",sfile.Data()); | |
273 | TFile f(sfile.Data()); | |
274 | TTree * tree = (TTree*)f.Get("Tracks"); | |
275 | if (tree){ | |
276 | f.Close(); | |
277 | chaincl.Add(sfile.Data()); | |
278 | } | |
279 | } | |
280 | // | |
281 | // Fitted signals | |
282 | sprintf(strcl,"ls *%d*/FitSignal.root > files.txt", run); | |
283 | gSystem->Exec(strcl); | |
284 | in1.open("files.txt"); | |
285 | for (;in1>>sfile;){ | |
286 | if (sfile.Length()==0) break; | |
287 | printf("%s\n",sfile.Data()); | |
288 | TFile f(sfile.Data()); | |
289 | TTree * tree =(TTree*)f.Get("Fit"); | |
290 | if (tree){ | |
291 | f.Close(); | |
292 | chainFit.Add(sfile.Data()); | |
293 | } | |
294 | } | |
295 | // | |
296 | // Fitted pedestal | |
297 | sprintf(strcl,"ls *%d*/TPCsignal.root > files.txt", run); | |
298 | gSystem->Exec(strcl); | |
299 | in2.open("files.txt"); | |
300 | for (;in2>>sfile;){ | |
301 | if (sfile.Length()==0) break; | |
302 | printf("%s\n",sfile.Data()); | |
303 | TFile f(sfile.Data()); | |
304 | TTree * tree =(TTree*)f.Get("Fit"); | |
305 | if (tree){ | |
306 | f.Close(); | |
307 | chainPed.Add(sfile.Data()); | |
308 | } | |
309 | // chainPed.Add(sfile.Data()); | |
310 | } | |
311 | // | |
312 | // Random signals | |
313 | sprintf(strcl,"ls *%d*/TPCsignal.root > files.txt", run); | |
314 | gSystem->Exec(strcl); | |
315 | in4.open("files.txt"); | |
316 | for (;in4>>sfile;){ | |
317 | if (sfile.Length()==0) break; | |
318 | printf("%s\n",sfile.Data()); | |
319 | TFile f(sfile.Data()); | |
320 | TTree * tree =(TTree*)f.Get("SignalB"); | |
321 | if (tree){ | |
322 | f.Close(); | |
323 | chainSignal.Add(sfile.Data()); | |
324 | } | |
325 | // chainPed.Add(sfile.Data()); | |
326 | } | |
327 | // | |
328 | // Rec points trees | |
329 | // | |
330 | printf("\n IMPORT REC points"); | |
331 | sprintf(strcl,"ls *%d*/*RecPoints* > files.txt", run); | |
332 | gSystem->Exec(strcl); | |
333 | in3.open("files.txt"); | |
334 | for (;in3>>sfile;){ | |
335 | if (sfile.Length()==0) break; | |
336 | printf("%s\n",sfile.Data()); | |
337 | TFile fcl(sfile.Data()); | |
338 | char tname[100]; | |
339 | sprintf(tname,"%s/%s/TreeR",sfile.Data(),fcl.GetListOfKeys()->At(0)->GetName()); | |
340 | chaincl2.Add(tname); | |
341 | // chainPed.Add(sfile.Data()); | |
342 | } | |
343 | ||
344 | comp.fTree = &chaincl; | |
345 | compF.fTree = &chainFit; | |
346 | compP.fTree = &chainPed; | |
347 | } | |
348 | ||
349 | void Select(){ | |
350 | // | |
351 | // base cut on the tracks | |
352 | // | |
353 | comp.fTree->Draw(">>listTracks","Etrack.fTPCncls>30&&abs(Etrack.fIp.fP[4])<1"); | |
354 | comp.fTree->SetEventList(listTracks); | |
355 | // | |
356 | compF.fTree->Draw(">>listFitS","p2>0&&p2<5&&p1<900&&p0<10000&&p4<1&&p4>0&&p5<p3&&chi2<150"); | |
357 | compF.fTree->SetEventList(listFitS); | |
358 | } | |
359 | ||
360 | void SelectLaser(){ | |
361 | // | |
362 | // base cut on the tracks | |
363 | // | |
364 | comp.fTree->Draw(">>listTracks","Etrack.fTPCncls>20&&abs(Etrack.fIp.fP[4])<1&&abs(Etrack.fIp.fP[3])<0.01"); | |
365 | comp.fTree->SetEventList(listTracks); | |
366 | // | |
367 | compF.fTree->Draw(">>listFitS","p2>0&&p2<5&&p1<900&&p0<10000&&p4<1&&p4>0&&p5<p3&&chi2<150"); | |
368 | compF.fTree->SetEventList(listFitS); | |
369 | // | |
370 | // make default aliases | |
371 | // | |
372 | // laser z beam | |
373 | comp.fTree->SetAlias("lz0","abs(Etrack.fIp.fP[1]-20)<5"); | |
374 | comp.fTree->SetAlias("lz1","abs(Etrack.fIp.fP[1]-70)<20"); | |
375 | comp.fTree->SetAlias("lz2","abs(Etrack.fIp.fP[1]-150)<20"); | |
376 | comp.fTree->SetAlias("lz3","abs(Etrack.fIp.fP[1]-210)<20"); | |
377 | ||
378 | } | |
379 | ||
380 | ||
381 | ||
382 | void PRFYZ(TCut cut0, TCut cut1, char * description){ | |
383 | // | |
384 | // plot Pad response function as funtion of drift z | |
385 | // | |
386 | // | |
387 | TF1 * f1 = new TF1("fdiff","sqrt([0]*[0]+(250-x)*[1]*[1])"); | |
388 | f1->SetParameter(1,0.2); | |
389 | f1->SetParameter(0,0.2); | |
390 | comp.DrawXY("abs(Cl.fZ)","sqrt(Cl.fSigmaY2)","abs(Track.fTrackPoints.GetAngleY())<0.05","Track.fTrackPoints.fTX>0"+cut0,5,10,240,-0,1); | |
391 | TH1F * prfInnerY = (TH1F*)comp.fMean->Clone(); | |
392 | ||
393 | comp.DrawXY("abs(Cl.fZ)","sqrt(Cl.fSigmaY2)","abs(Track.fTrackPoints.GetAngleY())<0.05","Track.fTrackPoints.fTX>0"+cut1,5,10,240,-0,1); | |
394 | TH1F * prfOuterY = (TH1F*)comp.fMean->Clone(); | |
395 | // | |
396 | // | |
397 | prfOuterY->SetMinimum(0); | |
398 | prfOuterY->SetMarkerStyle(23); | |
399 | prfInnerY->SetMarkerStyle(24); | |
400 | prfOuterY->SetXTitle("Z position (cm)"); | |
401 | prfOuterY->SetYTitle("PRF width (cm)"); | |
402 | char chouter[100]; | |
403 | char chinner[100]; | |
404 | prfOuterY->Fit(f1); | |
405 | sprintf(chouter,"Outer sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
406 | prfInnerY->Fit(f1); | |
407 | sprintf(chinner,"Inner sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
408 | prfOuterY->Draw(); | |
409 | prfInnerY->Draw("same"); | |
410 | TString desc = description; | |
411 | TLegend *legend = new TLegend(0.25,0.12,0.85,0.35, desc+"\nTPC cluster shape Fit: #sigma = #sqrt{p_{0}^{2}+(z_{d}-z)p_{1}^{2}}"); | |
412 | legend->SetBorderSize(1); | |
413 | legend->AddEntry(prfOuterY,chouter); | |
414 | legend->AddEntry(prfInnerY,chinner); | |
415 | legend->Draw(); | |
416 | } | |
417 | ||
418 | ||
419 | ||
420 | void PRFZZ(TCut cut0, TCut cut1, char * description){ | |
421 | TF1 * f1 = new TF1("fdiff","sqrt([0]*[0]+x*[1]*[1])"); | |
422 | f1->SetParameter(1,0.2); | |
423 | f1->SetParameter(0,0.2); | |
424 | compF.DrawXY("p1*0.285","p2*0.285","p2>0",cut0,8,20,250,-0,2); | |
425 | TH1F * prfInnerY = (TH1F*)compF.fMean->Clone(); | |
426 | compF.DrawXY("p1*0.285","p2*0.285","p2>0",cut1,8,20,250,-0,2); | |
427 | TH1F * prfOuterY = (TH1F*)compF.fMean->Clone(); | |
428 | // | |
429 | // | |
430 | prfOuterY->SetMinimum(0); | |
431 | prfOuterY->SetMarkerStyle(23); | |
432 | prfInnerY->SetMarkerStyle(24); | |
433 | prfOuterY->SetXTitle("Drift length(cm)"); | |
434 | prfOuterY->SetYTitle("Z Sigma (cm)"); | |
435 | char chouter[100]; | |
436 | char chinner[100]; | |
437 | prfOuterY->Fit(f1); | |
438 | sprintf(chouter,"Outer sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
439 | prfInnerY->Fit(f1); | |
440 | sprintf(chinner,"Inner sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
441 | prfOuterY->Draw(); | |
442 | prfInnerY->Draw("same"); | |
443 | TString desc = description; | |
444 | TLegend *legend = new TLegend(0.25,0.12,0.85,0.35, desc+"TPC signal shape Fit: #sigma = #sqrt{p_{0}^{2}+(z)p_{1}^{2}}"); | |
445 | legend->SetBorderSize(1); | |
446 | legend->AddEntry(prfOuterY,chouter); | |
447 | legend->AddEntry(prfInnerY,chinner); | |
448 | legend->Draw(); | |
449 | } | |
450 | ||
451 | ||
452 | void ResYZ(TCut cut0, TCut cut1, char * description){ | |
453 | // | |
454 | // resolution in y coordinate as function of z | |
455 | // | |
456 | TF1 * f1 = new TF1("fdiff","sqrt([0]*[0]+(250-x)*[1]*[1])"); | |
457 | f1->SetParameter(1,0.2); | |
458 | f1->SetParameter(0,0.2); | |
459 | comp.DrawXY("abs(Cl.fZ)","Track.fTrackPoints.GetY()-Cl.GetY()","abs(Track.fTrackPoints.GetAngleY())<0.05","Track.fTrackPoints.fTX>0"+cut0,5,10,240,-0.5,0.5); | |
460 | TH1F * prfInnerY = (TH1F*)comp.fRes->Clone(); | |
461 | ||
462 | comp.DrawXY("abs(Cl.fZ)","Track.fTrackPoints.GetY()-Cl.GetY()","abs(Track.fTrackPoints.GetAngleY())<0.05","Track.fTrackPoints.fTX>0"+cut1,5,10,240,-0.5,0.5); | |
463 | TH1F * prfOuterY = (TH1F*)comp.fRes->Clone(); | |
464 | // | |
465 | // | |
466 | prfOuterY->SetMinimum(0); | |
467 | prfOuterY->SetMaximum(0.15); | |
468 | prfOuterY->SetMarkerStyle(23); | |
469 | prfInnerY->SetMarkerStyle(24); | |
470 | prfOuterY->SetXTitle("Z position (cm)"); | |
471 | prfOuterY->SetYTitle("Y resolution (cm)"); | |
472 | char chouter[100]; | |
473 | char chinner[100]; | |
474 | prfOuterY->Fit(f1); | |
475 | sprintf(chouter,"Outer sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
476 | prfInnerY->Fit(f1); | |
477 | sprintf(chinner,"Inner sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
478 | prfOuterY->Draw(); | |
479 | prfInnerY->Draw("same"); | |
480 | TString desc = description; | |
481 | TLegend *legend = new TLegend(0.25,0.12,0.85,0.35, desc+"TPC cluster resolution: #sigma = #sqrt{p_{0}^{2}+(z_{d}-z)p_{1}^{2}}"); | |
482 | legend->SetBorderSize(1); | |
483 | legend->AddEntry(prfOuterY,chouter); | |
484 | legend->AddEntry(prfInnerY,chinner); | |
485 | legend->Draw(); | |
486 | } | |
487 | ||
488 | void SysYX(TCut cut0, char * description){ | |
489 | // | |
490 | // | |
491 | // | |
492 | TProfile * profA = new TProfile("profY","profY",70,89,250); | |
493 | comp.fTree->Draw("Cl.fY-Track.fTrackPoints.GetY():Track.fTrackPoints.GetX()>>profY","abs(Cl.fY-Track.fTrackPoints.GetY())<1&&Track.fTrackPoints.fTX>10"+cut0,"prof"); | |
494 | profA->SetXTitle("Local X (cm)"); | |
495 | profA->SetYTitle("Mean #Delta Y (cm)"); | |
496 | TLegend *legend = new TLegend(0.55,0.25,0.85,0.30, description); | |
497 | legend->Draw(); | |
498 | } | |
499 | ||
500 | void SysZX(TCut cut0, char * description){ | |
501 | // | |
502 | // | |
503 | // | |
504 | TProfile * profA = new TProfile("profZ","profZ",70,89,250); | |
505 | comp.fTree->Draw("abs(Cl.fZ)-abs(Track.fTrackPoints.GetZ()):Track.fTrackPoints.GetX()>>profZ","abs(abs(Cl.fZ)-abs(Track.fTrackPoints.GetZ()))<1&&Track.fTrackPoints.fTX>10"+cut0,"prof"); | |
506 | profA->SetXTitle("Local X (cm)"); | |
507 | profA->SetYTitle("Mean #Delta Z (cm)"); | |
508 | TLegend *legend = new TLegend(0.55,0.25,0.85,0.30, description); | |
509 | legend->Draw(); | |
510 | } | |
511 | ||
512 | TProfile * ProfileMaxRow(TCut cut0, char *name, Int_t max){ | |
513 | // | |
514 | // make profile histrogram of amplitudes | |
515 | // | |
516 | TProfile *profA = new TProfile(name,name,max,0,max-1); | |
517 | char expr[100]; | |
518 | sprintf(expr,"Cl.fMax:Cl.fRow>>%s",name); | |
519 | comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); | |
520 | profA->SetXTitle("Pad Row"); | |
521 | profA->SetYTitle("Amplitude at maxima (ADC)"); | |
522 | return profA; | |
523 | } | |
524 | ||
525 | TProfile * ProfileMaxPhi(TCut cut0, char *name, Int_t max){ | |
526 | // | |
527 | // make profile histrogram of amplitudes | |
528 | // | |
529 | TProfile *profA = new TProfile(name,name,max,-0.14,0.14); | |
530 | char expr[100]; | |
531 | sprintf(expr,"Cl.fMax:Cl.fY/Cl.fX>>%s",name); | |
532 | comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); | |
533 | profA->SetXTitle("Local #phi(rad)"); | |
534 | profA->SetYTitle("Amplitude at maxima (ADC)"); | |
535 | return profA; | |
536 | } | |
537 | ||
538 | TProfile * ProfileQRow(TCut cut0, char *name, Int_t max){ | |
539 | // | |
540 | // make profile histrogram of amplitudes | |
541 | // | |
542 | TProfile *profA = new TProfile(name,name,max,0,max-1); | |
543 | char expr[100]; | |
544 | sprintf(expr,"Cl.fQ:Cl.fRow>>%s",name); | |
545 | comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); | |
546 | profA->SetXTitle("Pad Row"); | |
547 | profA->SetYTitle("Total charge(ADC)"); | |
548 | return profA; | |
549 | } | |
550 | ||
551 | TProfile * ProfileQPhi(TCut cut0, char *name, Int_t max){ | |
552 | // | |
553 | // make profile histrogram of amplitudes | |
554 | // | |
555 | TProfile *profA = new TProfile(name,name,max,-0.14,0.14); | |
556 | char expr[100]; | |
557 | sprintf(expr,"Cl.fQ:Cl.fY/Cl.fX>>%s",name); | |
558 | comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); | |
559 | profA->SetXTitle("Local #phi(rad)"); | |
560 | profA->SetYTitle("Total charge (ADC)"); | |
561 | return profA; | |
562 | } | |
563 | ||
564 | TProfile * ProfileQZ(TCut cut0, char *name, Int_t max){ | |
565 | // | |
566 | // make profile histrogram of amplitudes | |
567 | // | |
568 | TF1 * fline = new TF1("fline","[0]+[1]*[0]*(250-x)"); | |
569 | TF1 * f1 = new TF1("f1","[0]*exp(-[1]*(250-x))"); | |
570 | TProfile *profA = new TProfile(name,name,max,0,250); | |
571 | char expr[100]; | |
572 | sprintf(expr,"Cl.fQ:abs(Cl.fZ)>>%s",name); | |
573 | comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); | |
574 | profA->SetXTitle("Z position (cm)"); | |
575 | profA->SetYTitle("Amplitude (ADC)"); | |
576 | char chc[100]; | |
577 | profA->Fit(fline); | |
578 | f1->SetParameter(0,fline->GetParameter(0)); | |
579 | f1->SetParameter(1,fline->GetParameter(1)); | |
580 | profA->Fit(f1); | |
581 | sprintf(chc,"Exponential fit params: p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
582 | printf("%s",chc); | |
583 | TLegend *legend = new TLegend(0.25,0.12,0.85,0.25, chc); | |
584 | legend->Draw(); | |
585 | return profA; | |
586 | } | |
587 | ||
588 | TProfile * ProfileMaxZ(TCut cut0, char *name, Int_t max){ | |
589 | // | |
590 | // make profile histrogram of amplitudes | |
591 | // | |
592 | TF1 * f1 = new TF1("f1","[0]+[1]*[0]*(250-x)"); | |
593 | TProfile *profA = new TProfile(name,name,max,0,250); | |
594 | char expr[100]; | |
595 | sprintf(expr,"Cl.fMax:abs(Cl.fZ)>>%s",name); | |
596 | comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); | |
597 | profA->SetXTitle("Z position (cm)"); | |
598 | profA->SetYTitle("Amplitude at maxima (ADC)"); | |
599 | char chc[100]; | |
600 | profA->Fit(f1); | |
601 | sprintf(chc,"p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
602 | TLegend *legend = new TLegend(0.25,0.12,0.85,0.35, chc); | |
603 | legend->Draw(); | |
604 | return profA; | |
605 | } | |
606 | ||
607 | ||
608 | void P3Z(TCut cut0, TCut cut1, char * description){ | |
609 | // | |
610 | // first exponenent as function of z drift | |
611 | // | |
612 | TF1 * f1 = new TF1("fdiff","[0]+[1]/[0]*x"); | |
613 | f1->SetParameter(1,0.2); | |
614 | f1->SetParameter(0,0.2); | |
615 | compF.DrawXY("p1*0.285","p3","Max>250",cut0,5,20,250,-0,2); | |
616 | TH1F * prfInnerY = (TH1F*)compF.fMean->Clone(); | |
617 | compF.DrawXY("p1*0.285","p3","Max>250",cut1,5,20,250,-0,2); | |
618 | TH1F * prfOuterY = (TH1F*)compF.fMean->Clone(); | |
619 | // | |
620 | // | |
621 | prfOuterY->SetMinimum(0); | |
622 | prfOuterY->SetMaximum(1); | |
623 | prfOuterY->SetMarkerStyle(23); | |
624 | prfInnerY->SetMarkerStyle(24); | |
625 | prfOuterY->SetXTitle("Drift length (cm)"); | |
626 | prfOuterY->SetYTitle("Lambda 0 (Time Bin)"); | |
627 | char chouter[100]; | |
628 | char chinner[100]; | |
629 | prfOuterY->Fit(f1); | |
630 | sprintf(chouter,"Outer sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
631 | prfInnerY->Fit(f1); | |
632 | sprintf(chinner,"Inner sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
633 | prfOuterY->Draw(); | |
634 | prfInnerY->Draw("same"); | |
635 | TString desc = description; | |
636 | TLegend *legend = new TLegend(0.25,0.12,0.85,0.35, desc+"TPC cluster shape fit Parameter Lambda0 - P3:"); | |
637 | legend->SetBorderSize(1); | |
638 | legend->AddEntry(prfOuterY,chouter); | |
639 | legend->AddEntry(prfInnerY,chinner); | |
640 | legend->Draw(); | |
641 | } | |
642 | ||
643 | ||
644 | void P5Z(TCut cut0, TCut cut1, char * description){ | |
645 | // | |
646 | // second exponenent as function of z drift | |
647 | // | |
648 | TF1 * f1 = new TF1("fdiff","[0]+[1]/[0]*x"); | |
649 | f1->SetParameter(1,0.2); | |
650 | f1->SetParameter(0,0.2); | |
651 | compF.DrawXY("p1*0.285","p5","Max>250",cut0,5,20,250,-0,0.2); | |
652 | TH1F * prfInnerY = (TH1F*)compF.fMean->Clone(); | |
653 | compF.DrawXY("p1*0.285","p5","Max>250",cut1,5,20,250,-0,0.2); | |
654 | TH1F * prfOuterY = (TH1F*)compF.fMean->Clone(); | |
655 | // | |
656 | // | |
657 | prfOuterY->SetMinimum(0); | |
658 | prfOuterY->SetMaximum(0.15); | |
659 | prfOuterY->SetMarkerStyle(23); | |
660 | prfInnerY->SetMarkerStyle(24); | |
661 | prfOuterY->SetXTitle("Drift length (Time Bin)"); | |
662 | prfOuterY->SetYTitle("Lambda1 (Time bin)"); | |
663 | char chouter[100]; | |
664 | char chinner[100]; | |
665 | prfOuterY->Fit(f1); | |
666 | sprintf(chouter,"Outer sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
667 | prfInnerY->Fit(f1); | |
668 | sprintf(chinner,"Inner sector : p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); | |
669 | prfOuterY->Draw(); | |
670 | prfInnerY->Draw("same"); | |
671 | TString desc = description; | |
672 | TLegend *legend = new TLegend(0.25,0.12,0.85,0.35, desc+"TPC cluster shape fit Parameter Lambda1 - P5"); | |
673 | legend->SetBorderSize(1); | |
674 | legend->AddEntry(prfOuterY,chouter); | |
675 | legend->AddEntry(prfInnerY,chinner); | |
676 | legend->Draw(); | |
677 | } | |
678 | ||
679 | TCanvas * NoiseSector(TCut cut0, char * description, Int_t maxrow, Int_t maxpad){ | |
680 | // | |
681 | // draw plots of the noise | |
682 | // | |
683 | TCanvas * c = new TCanvas; | |
684 | c->Divide(2,1); | |
685 | c->Draw(); | |
686 | c->cd(1); | |
687 | compP.fTree->Draw("GSigma","GSigma<5"+cut0); | |
688 | c->cd(2); | |
689 | Float_t rand = gRandom->Rndm(); | |
690 | char name[100]; | |
691 | sprintf(name,"prof%f",rand); | |
692 | TProfile2D * prof= new TProfile2D(name,name,maxrow, 0, maxrow-1, 2*maxpad,-maxpad,maxpad); | |
693 | char expr[100]; | |
694 | sprintf(expr,"GSigma:RPad:Row>>%s",name); | |
695 | prof->SetXTitle("Pad row"); | |
696 | prof->SetYTitle("Pad number"); | |
697 | compP.fTree->Draw(expr,cut0,"profcolz"); | |
698 | c->cd(1); | |
699 | TString desc = description; | |
700 | TLegend *legend = new TLegend(0.25,0.30,0.85,0.85, desc+"Noise map"); | |
701 | legend->Draw(); | |
702 | ||
703 | return c; | |
704 | } | |
705 | ||
706 |