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