]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/TPC/AliTPCPerformanceSummary.cxx
Updating DA to store TDC offsets
[u/mrichter/AliRoot.git] / PWG1 / TPC / AliTPCPerformanceSummary.cxx
CommitLineData
b832d719 1//------------------------------------------------------------------------------
2// Implementation of AliTPCPerformanceSummary class.
3// It has only static member functions to extract some TPC Performance
4// parameters and produce trend graphs.
5// The function MakeReport is to be called for every run. It reads AliPerformanceTPC
6// and AliPerformanceDEdx objects from file and produces a
7// rootfile with the results stored in a TTree.
8// The function MakeReport needs a list of these rootfiles as input
9// and writes the output (tree and histograms) to another rootfile.
10//
814d192f 11// by M.Knichel 15/10/2010
b832d719 12//------------------------------------------------------------------------------
13
14#include <fstream>
15
16#include "TSystem.h"
17#include "TMath.h"
18#include "TVectorD.h"
19#include "TList.h"
20#include "TFile.h"
21#include "TGrid.h"
22#include "TF1.h"
23#include "TH1.h"
24#include "TH2.h"
0cb93e70 25#include "TH3.h"
b832d719 26#include "TProfile.h"
27#include "THnSparse.h"
28#include "TTree.h"
29#include "TChain.h"
30#include "TGraph.h"
31#include "TPad.h"
32#include "TCanvas.h"
33
0cb93e70 34#include "AliGRPObject.h"
35#include "AliTPCcalibDB.h"
36#include "AliTPCcalibDButil.h"
b832d719 37#include "TTreeStream.h"
38#include "AliPerformanceTPC.h"
39#include "AliPerformanceDEdx.h"
40#include "AliPerformanceDCA.h"
f69eb048 41#include "AliPerformanceMatch.h"
b832d719 42
43#include "AliTPCPerformanceSummary.h"
44
45ClassImp(AliTPCPerformanceSummary)
46
0cb93e70 47Bool_t AliTPCPerformanceSummary::fgForceTHnSparse = kFALSE;
48
49
b832d719 50//_____________________________________________________________________________
1833a193 51void AliTPCPerformanceSummary::WriteToTTreeSRedirector(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pTPCMatch,const AliPerformanceMatch* pTPCPull, TTreeSRedirector* const pcstream, Int_t run)
b832d719 52{
0cb93e70 53 //
b832d719 54 // Extracts performance parameters from pTPC and pTPCgain.
55 // Output is written to pcstream.
56 // The run number must be provided since it is not stored in
57 // AliPerformanceTPC or AliPerformanceDEdx.
58 //
814d192f 59 if (run <= 0 ) {
f69eb048 60 if (pTPCMatch) {run = pTPCMatch->GetRunNumber(); }
814d192f 61 if (pTPCgain) {run = pTPCgain->GetRunNumber(); }
62 if (pTPC) { run = pTPC->GetRunNumber(); }
63 }
f69eb048 64 TObjString runType;
f1fb93e0 65
66 //AliTPCcalibDB *calibDB=0;
67
0cb93e70 68// AliTPCcalibDButil *dbutil =0;
69 Int_t startTimeGRP=0;
70 Int_t stopTimeGRP=0;
71 Int_t time=0;
814d192f 72 Int_t duration=0;
f1fb93e0 73
74 //Float_t currentL3 =0;
75 //Int_t polarityL3 = 0;
76 //Float_t bz = 0;
77
78 //calibDB = AliTPCcalibDB::Instance();
79
0cb93e70 80// dbutil= new AliTPCcalibDButil;
f69eb048 81
f1fb93e0 82 //printf("Processing run %d ...\n",run);
83 //if (calibDB) {
84 //AliTPCcalibDB::Instance()->SetRun(run);
85
0cb93e70 86// dbutil->UpdateFromCalibDB();
87// dbutil->SetReferenceRun(run);
88// dbutil->UpdateRefDataFromOCDB();
89
f1fb93e0 90 //if (calibDB->GetGRP(run)){
91 //startTimeGRP = AliTPCcalibDB::GetGRP(run)->GetTimeStart();
92 //stopTimeGRP = AliTPCcalibDB::GetGRP(run)->GetTimeEnd();
93 //currentL3 = AliTPCcalibDB::GetL3Current(run);
94 //polarityL3 = AliTPCcalibDB::GetL3Polarity(run);
95 //bz = AliTPCcalibDB::GetBz(run);
814d192f 96
f1fb93e0 97 //}
98 //runType = AliTPCcalibDB::GetRunType(run).Data();
99 //}
0cb93e70 100 time = (startTimeGRP+stopTimeGRP)/2;
814d192f 101 duration = (stopTimeGRP-startTimeGRP);
b832d719 102
f69eb048 103 if (!pcstream) return;
0cb93e70 104 (*pcstream)<<"tpcQA"<<
105 "run="<<run<<
106 "time="<<time<<
107 "startTimeGRP="<<startTimeGRP<<
108 "stopTimeGRP="<<stopTimeGRP<<
814d192f 109 "duration="<<
0cb93e70 110 "runType.="<<&runType;
814d192f 111 if (pTPC) {
112 pTPC->GetTPCTrackHisto()->GetAxis(9)->SetRangeUser(0.5,1.5);
113 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0.25,10);
114 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-1,1);
f69eb048 115 AnalyzeNCL(pTPC, pcstream);
116 AnalyzeDrift(pTPC, pcstream);
117 AnalyzeDriftPos(pTPC, pcstream);
118 AnalyzeDriftNeg(pTPC, pcstream);
119 AnalyzeDCARPhi(pTPC, pcstream);
120 AnalyzeDCARPhiPos(pTPC, pcstream);
121 AnalyzeDCARPhiNeg(pTPC, pcstream);
122 AnalyzeEvent(pTPC, pcstream);
10d5d625 123
124 AnalyzePt(pTPC,pcstream);
125 AnalyzeChargeOverPt(pTPC,pcstream);
126
127
814d192f 128 pTPC->GetTPCTrackHisto()->GetAxis(9)->SetRangeUser(-10,10);
129 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0,100);
f69eb048 130 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-10,10);
814d192f 131 }
f69eb048 132 AnalyzeGain(pTPCgain, pcstream);
133 AnalyzeMatch(pTPCMatch, pcstream);
1833a193 134 AnalyzePull(pTPCPull, pcstream);
b832d719 135 (*pcstream)<<"tpcQA"<<"\n";
b832d719 136}
137
138//_____________________________________________________________________________
1833a193 139void AliTPCPerformanceSummary::WriteToFile(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pMatch, const AliPerformanceMatch* pPull, const Char_t* outfile, Int_t run)
b832d719 140{
141 //
142 // Extracts performance parameters from pTPC and pTPCgain.
143 // Output is written to a TTree saved in outfile.
144 // The run number must be provided since it is not stored in
145 // AliPerformanceTPC or AliPerformanceDEdx.
146 //
147 // The function creates a TTreeSRedirector and calls the
148 // function WriteToTTreeSRedirector.
149 //
150
f69eb048 151 if (!outfile) return;
b832d719 152 TTreeSRedirector* pcstream = 0;
153 pcstream = new TTreeSRedirector(outfile);
f69eb048 154 if (!pcstream) return;
1833a193 155 WriteToTTreeSRedirector(pTPC, pTPCgain, pMatch, pPull, pcstream, run);
f69eb048 156 if (pcstream) { delete pcstream; pcstream = 0; }
b832d719 157
158}
159
160//_____________________________________________________________________________
161Int_t AliTPCPerformanceSummary::MakeReport(const Char_t* infile, const Char_t* outfile, Int_t run)
162{
163 //
164 // Reads QA information (AliPerformanceTPC and AliPerformanceDEdx) from
165 // infile (this must be a rootfile) and writes the output to a TTree
166 // stored in outfile.
167 // The run number must be provided since it is not stored in
168 // AliPerformanceTPC or AliPerformanceDEdx.
169 //
170 // The input objects must be named "AliPerformanceTPC" and
171 // "AliPerformanceDEdxTPCInner" and stored in a TList which name must
172 // be one of the following: "TPC", "TPCQA", "TPC_PerformanceQA"
173 // or "TPC_PerformanceQA/TPC" (with directory)
174 //
175
176 if (!infile) return -1;
177 if (!outfile) return -1;
178 TFile *f =0;
179 f=TFile::Open(infile,"read");
180 if (!f) {
181 printf("File %s not available\n", infile);
182 return -1;
183 }
184 TList* list = 0;
185 list = dynamic_cast<TList*>(f->Get("TPC"));
186 if (!list) { list = dynamic_cast<TList*>(f->Get("TPCQA")); }
b832d719 187 if (!list) { list = dynamic_cast<TList*>(f->Get("TPC_PerformanceQA/TPCQA")); }
0cb93e70 188 if (!list) { list = dynamic_cast<TList*>(f->Get("TPC_PerformanceQA")); }
1833a193 189 if (!list) { list = dynamic_cast<TList*>(f->Get("ITSTPCMatch")); }
b832d719 190 if (!list) {
191 printf("QA %s not available\n", infile);
192 return -1;
193 }
194 AliPerformanceTPC* pTPC = 0;
195 AliPerformanceDEdx* pTPCgain = 0;
f69eb048 196 AliPerformanceMatch* pTPCmatch = 0;
1833a193 197 AliPerformanceMatch* pTPCPull = 0;
f69eb048 198 if (list) { pTPC = dynamic_cast<AliPerformanceTPC*>(list->FindObject("AliPerformanceTPC")); }
199 if (list) { pTPCgain = dynamic_cast<AliPerformanceDEdx*>(list->FindObject("AliPerformanceDEdxTPCInner")); }
200 if (list) { pTPCmatch = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchTPCITS")); }
1833a193 201 if (list) { pTPCPull = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchITSTPC")); }
b832d719 202
203 Int_t returncode = 0;
1833a193 204 WriteToFile(pTPC, pTPCgain, pTPCmatch , pTPCPull, outfile, run);
b832d719 205 if (f) { delete f; f=0; }
206 return returncode;
207}
208
209//_____________________________________________________________________________
210Int_t AliTPCPerformanceSummary::ProduceTrends(const Char_t* infilelist, const Char_t* outfile)
211{
212 //
213 // Produces trend graphs.
214 //
215 // Input: infilelist is a textfile with one rootfile per line.
216 // There should be one rootfile for each run, the rootfile must
217 // contain the output of the MakeReport function
218 // Output: the information for all runs is merged into a TTree
219 // that is saved in outfile along with the trend graphs.
220 // Trend graphs are stored as TCanvas objects to include axis labels etc.
221 //
222
223 if (!infilelist) return -1;
224 if (!outfile) return -1;
225
226 TChain* chain = new TChain("tpcQA");
26a35193 227 if(!chain) return -1;
228
b832d719 229 ifstream in;
230 in.open(infilelist);
231
232 TString currentFile;
233 while(in.good()) {
234 in >> currentFile;
235
236 if (!currentFile.Contains("root")) continue; // protection
237 chain->Add(currentFile.Data());
238 }
239 in.close();
240 //TTree *tree = chain;
241 TTree *tree = chain->CopyTree("1");
26a35193 242 if(!tree) return -1;
b832d719 243 if (chain) { delete chain; chain=0; }
244 //TGraph* graph = dynamic_cast<TGraph*>(tree->DrawClone("run:run"));
245 //TGraph *graph = (TGraph*)gPad->GetPrimitive("Graph");
246
247 TFile* out = new TFile(outfile,"RECREATE");
26a35193 248 if(!out) return -1;
249
b832d719 250 out->cd();
c6d45264 251 const Char_t* condition = "meanTPCncl>0";
b832d719 252 SaveGraph(tree,"meanTPCnclF","run",condition);
253 SaveGraph(tree,"rmsTPCnclF","run",condition);
254 SaveGraph(tree,"meanTPCChi2","run",condition);
255 SaveGraph(tree,"rmsTPCChi2","run",condition);
256 SaveGraph(tree,"slopeATPCnclF","run",condition);
257 SaveGraph(tree,"slopeCTPCnclF","run",condition);
258 SaveGraph(tree,"slopeATPCnclFErr","run",condition);
259 SaveGraph(tree,"slopeCTPCnclFErr","run",condition);
260 SaveGraph(tree,"meanTPCncl","run",condition);
261 SaveGraph(tree,"rmsTPCncl","run",condition);
262 SaveGraph(tree,"slopeATPCncl","run",condition);
263 SaveGraph(tree,"slopeCTPCncl","run",condition);
264 SaveGraph(tree,"slopeATPCnclErr","run",condition);
265 SaveGraph(tree,"slopeCTPCnclErr","run",condition);
266
267 SaveGraph(tree,"offsetdRA","run",condition);
268 SaveGraph(tree,"slopedRA","run",condition);
269 SaveGraph(tree,"offsetdRC","run",condition);
270 SaveGraph(tree,"slopedRC","run",condition);
271 SaveGraph(tree,"offsetdRAErr","run",condition);
272 SaveGraph(tree,"slopedRAErr","run",condition);
273 SaveGraph(tree,"offsetdRCErr","run",condition);
274 SaveGraph(tree,"slopedRCErr","run",condition);
275 SaveGraph(tree,"offsetdRAchi2","run",condition);
276 SaveGraph(tree,"slopedRAchi2","run",condition);
277 SaveGraph(tree,"offsetdRCchi2","run",condition);
278 SaveGraph(tree,"slopedRCchi2","run",condition);
279
280 SaveGraph(tree,"offsetdRAPos","run",condition);
281
282 SaveGraph(tree,"slopedRAPos","run",condition);
283 SaveGraph(tree,"offsetdRCPos","run",condition);
284 SaveGraph(tree,"slopedRCPos","run",condition);
285 SaveGraph(tree,"offsetdRAErrPos","run",condition);
286 SaveGraph(tree,"slopedRAErrPos","run",condition);
287 SaveGraph(tree,"offsetdRCErrPos","run",condition);
288 SaveGraph(tree,"slopedRCErrPos","run",condition);
289 SaveGraph(tree,"offsetdRAchi2Pos","run",condition);
290 SaveGraph(tree,"slopedRAchi2Pos","run",condition);
291 SaveGraph(tree,"offsetdRCchi2Pos","run",condition);
292 SaveGraph(tree,"slopedRCchi2Pos","run",condition);
293
294 SaveGraph(tree,"offsetdRANeg","run",condition);
295 SaveGraph(tree,"slopedRANeg","run",condition);
296 SaveGraph(tree,"offsetdRCNeg","run",condition);
297 SaveGraph(tree,"slopedRCNeg","run",condition);
298 SaveGraph(tree,"offsetdRAErrNeg","run",condition);
299 SaveGraph(tree,"slopedRAErrNeg","run",condition);
300 SaveGraph(tree,"offsetdRCErrNeg","run",condition);
301 SaveGraph(tree,"slopedRCErrNeg","run",condition);
302 SaveGraph(tree,"offsetdRAchi2Neg","run",condition);
303 SaveGraph(tree,"slopedRAchi2Neg","run",condition);
304 SaveGraph(tree,"offsetdRCchi2Neg","run",condition);
305 SaveGraph(tree,"slopedRCchi2Neg","run",condition);
306
307 SaveGraph(tree,"offsetdZAPos","run",condition);
308 SaveGraph(tree,"slopedZAPos","run",condition);
309 SaveGraph(tree,"offsetdZCPos","run",condition);
310 SaveGraph(tree,"slopedZCPos","run",condition);
311 SaveGraph(tree,"offsetdZAErrPos","run",condition);
312 SaveGraph(tree,"slopedZAErrPos","run",condition);
313 SaveGraph(tree,"offsetdZCErrPos","run",condition);
314 SaveGraph(tree,"slopedZCErrPos","run",condition);
315 SaveGraph(tree,"offsetdZAchi2Pos","run",condition);
316 SaveGraph(tree,"slopedZAchi2Pos","run",condition);
317 SaveGraph(tree,"offsetdZCchi2Pos","run",condition);
318 SaveGraph(tree,"slopedZCchi2Pos","run",condition);
319
320 SaveGraph(tree,"offsetdZANeg","run",condition);
321 SaveGraph(tree,"slopedZANeg","run",condition);
322 SaveGraph(tree,"offsetdZCNeg","run",condition);
323 SaveGraph(tree,"slopedZCNeg","run",condition);
324 SaveGraph(tree,"offsetdZAErrNeg","run",condition);
325 SaveGraph(tree,"slopedZAErrNeg","run",condition);
326 SaveGraph(tree,"offsetdZCErrNeg","run",condition);
327 SaveGraph(tree,"slopedZCErrNeg","run",condition);
328 SaveGraph(tree,"offsetdZAchi2Neg","run",condition);
329 SaveGraph(tree,"slopedZAchi2Neg","run",condition);
330 SaveGraph(tree,"offsetdZCchi2Neg","run",condition);
331 SaveGraph(tree,"slopedZCchi2Neg","run",condition);
332
333 SaveGraph(tree,"offsetdZA","run",condition);
334 SaveGraph(tree,"slopedZA","run",condition);
335 SaveGraph(tree,"offsetdZC","run",condition);
336 SaveGraph(tree,"slopedZC","run",condition);
337 SaveGraph(tree,"offsetdZAErr","run",condition);
338 SaveGraph(tree,"slopedZAErr","run",condition);
339 SaveGraph(tree,"offsetdZCErr","run",condition);
340 SaveGraph(tree,"slopedZCErr","run",condition);
341 SaveGraph(tree,"offsetdZAchi2","run",condition);
342 SaveGraph(tree,"slopedZAchi2","run",condition);
343 SaveGraph(tree,"offsetdZCchi2","run",condition);
344 SaveGraph(tree,"slopedZCchi2","run",condition);
345
346 SaveGraph(tree,"meanVertX","run",condition);
347 SaveGraph(tree,"rmsVertX","run",condition);
348 SaveGraph(tree,"meanVertY","run",condition);
349 SaveGraph(tree,"rmsVertY","run",condition);
350 SaveGraph(tree,"meanVertZ","run",condition);
351 SaveGraph(tree,"rmsVertZ","run",condition);
352 SaveGraph(tree,"vertStatus","run",condition);
353 SaveGraph(tree,"meanMult","run",condition);
354 SaveGraph(tree,"rmsMult","run",condition);
355 SaveGraph(tree,"meanMultPos","run",condition);
356 SaveGraph(tree,"rmsMultPos","run",condition);
357 SaveGraph(tree,"meanMultNeg","run",condition);
358 SaveGraph(tree,"rmsMultNeg","run",condition);
359 SaveGraph(tree,"vertAll","run",condition);
360 SaveGraph(tree,"vertOK","run",condition);
361
10d5d625 362
363 SaveGraph(tree,"meanPtAPos","run",condition);
364 SaveGraph(tree,"mediumPtAPos","run",condition);
365 SaveGraph(tree,"highPtAPos","run",condition);
366 SaveGraph(tree,"meanPtCPos","run",condition);
367 SaveGraph(tree,"mediumPtCPos","run",condition);
368 SaveGraph(tree,"highPtCPos","run",condition);
369 SaveGraph(tree,"meanPtANeg","run",condition);
370 SaveGraph(tree,"mediumPtANeg","run",condition);
371 SaveGraph(tree,"highPtANeg","run",condition);
372 SaveGraph(tree,"meanPtCNeg","run",condition);
373 SaveGraph(tree,"mediumPtCNeg","run",condition);
374 SaveGraph(tree,"highPtCNeg","run",condition);
375
376 SaveGraph(tree,"qOverPt","run",condition);
377 SaveGraph(tree,"qOverPtA","run",condition);
378 SaveGraph(tree,"qOverPtC","run",condition);
1833a193 379
380 condition = "";
381 SaveGraph(tree,"tpcItsMatchA","run",condition);
382 SaveGraph(tree,"tpcItsMatchHighPtA","run",condition);
383 SaveGraph(tree,"tpcItsMatchC","run",condition);
384 SaveGraph(tree,"tpcItsMatchHighPtC","run",condition);
385
386 SaveGraph(tree,"phiPull","run",condition);
387 SaveGraph(tree,"phiPullHighPt","run",condition);
388 SaveGraph(tree,"ptPull","run",condition);
389 SaveGraph(tree,"ptPullHighPt","run",condition);
390 SaveGraph(tree,"yPull","run",condition);
391 SaveGraph(tree,"yPullHighPt","run",condition);
392 SaveGraph(tree,"zPull","run",condition);
393 SaveGraph(tree,"zPullHighPt","run",condition);
394 SaveGraph(tree,"lambdaPull","run",condition);
395 SaveGraph(tree,"lambdaPullHighPt","run",condition);
396
10d5d625 397
b832d719 398 tree->Write();
399
400 out->Close();
401 if (tree) { delete tree; tree=0; }
402 if (out) { delete out; out=0; }
1833a193 403 return 0;
b832d719 404}
405
406//_____________________________________________________________________________
407Int_t AliTPCPerformanceSummary::SaveGraph(TTree* tree, const Char_t* y, const Char_t* x, const Char_t* condition)
408{
409 //
410 // Creates a Graph and writes the canvas to the current directory
411 // called by ProduceTrends function.
412 //
413
414 TString s(y);
415 s += ':';
416 s += x;
417 tree->Draw(s.Data(),condition,"goff");
418 TCanvas* c = new TCanvas(s.Data(),s.Data());
419 c->cd();
420 TPad* p = new TPad("pad0","pad0",0,0,1,1);
421 p->Draw();
422 p->cd();
423 if (tree->GetSelectedRows() > 0) {
424 TGraph* graph = new TGraph(tree->GetSelectedRows(), tree->GetV2(), tree->GetV1());
425 graph->Draw("AP");
426 graph->GetXaxis()->SetTitle(x);
427 graph->GetYaxis()->SetTitle(y);
428 c->Write(s.Data());
429 delete graph;
430 }
431 //graph->Write(s.Data());
432 delete c;
433
434return 0;
435}
436
437//_____________________________________________________________________________
70f4b25f 438Int_t AliTPCPerformanceSummary::AnalyzeDCARPhi(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 439{
440 //
441 // Analyse DCA R imperfections
442 //
443
444 if (!pcstream) return 8;
445 if (!pTPC) return 8;
446
447 // variables:
448 static Double_t offsetdRA=0;
449 static Double_t slopedRA=0;
450 static Double_t offsetdRC=0;
451 static Double_t slopedRC=0;
452 static Double_t offsetdRAErr=0;
453 static Double_t slopedRAErr=0;
454 static Double_t offsetdRCErr=0;
455 static Double_t slopedRCErr=0;
456 static Double_t offsetdRAchi2=0;
457 static Double_t slopedRAchi2=0;
458 static Double_t offsetdRCchi2=0;
459 static Double_t slopedRCchi2=0;
460
461 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
0cb93e70 462
b832d719 463 TH1* his1D=0;
464 TH2* his2D=0;
0cb93e70 465 TH3* his3D=0;
466
28bb9d1f 467 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7")) {
468 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7"));
26a35193 469 if(!his3D) return 8;
0cb93e70 470 his3D->GetYaxis()->SetRangeUser(-1,1);
471 his3D->GetZaxis()->SetRangeUser(0.25,10);
472 }
473
b832d719 474 static TF1 *fpol1 = new TF1("fpol1","pol1");
475 TObjArray arrayFit;
0cb93e70 476 if (his3D && !fgForceTHnSparse) {
477 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
478 } else {
479 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
480 }
26a35193 481 if(!his2D) return 8;
0cb93e70 482
483
b832d719 484 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
485 delete his2D;
486 his1D = (TH1*) arrayFit.At(1);
487 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
488 offsetdRC=fpol1->GetParameter(0);
489 slopedRC=fpol1->GetParameter(1);
490 offsetdRCchi2=fpol1->GetChisquare();
491 slopedRCchi2=fpol1->GetChisquare();
492 //
493 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
494 offsetdRA=fpol1->GetParameter(0);
495 slopedRA=fpol1->GetParameter(1);
496 offsetdRAErr=fpol1->GetParError(0);
497 slopedRAErr=fpol1->GetParError(1);
498 offsetdRAchi2=fpol1->GetChisquare();
499 slopedRAchi2=fpol1->GetChisquare();
500 //
501 printf("DCA R QA report\n");
502 printf("offsetdRA\t%f\n",offsetdRA);
503 printf("slopedRA\t%f\n",slopedRA);
504 printf("offsetdRC\t%f\n",offsetdRC);
505 printf("slopedRC\t%f\n",slopedRC);
506 //
507 // dump values
508 //
509 (*pcstream)<<"tpcQA"<<
510 "offsetdRA="<< offsetdRA<<
511 "slopedRA="<< slopedRA<<
512 "offsetdRC="<< offsetdRC<<
513 "slopedRC="<<slopedRC<<
514 //
515 "offsetdRAErr="<< offsetdRAErr<<
516 "slopedRAErr="<< slopedRAErr<<
517 "offsetdRCErr="<< offsetdRCErr<<
518 "slopedRCErr="<<slopedRCErr<<
519 //
520 "offsetdRAchi2="<< offsetdRAchi2<<
521 "slopedRAchi2="<< slopedRAchi2<<
522 "offsetdRCchi2="<< offsetdRCchi2<<
523 "slopedRCchi2="<<slopedRCchi2;
524
525 return 0;
526}
527
528//_____________________________________________________________________________
70f4b25f 529Int_t AliTPCPerformanceSummary::AnalyzeDCARPhiPos(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 530{
531 //
532 // Analyse DCA R imperfections for positive particles
533 //
534
535 if (!pcstream) return 16;
536 if (!pTPC) return 16;
537
538 // variables:
539 static Double_t offsetdRAPos=0;
540 static Double_t slopedRAPos=0;
541 static Double_t offsetdRCPos=0;
542 static Double_t slopedRCPos=0;
543 static Double_t offsetdRAErrPos=0;
544 static Double_t slopedRAErrPos=0;
545 static Double_t offsetdRCErrPos=0;
546 static Double_t slopedRCErrPos=0;
547 static Double_t offsetdRAchi2Pos=0;
548 static Double_t slopedRAchi2Pos=0;
549 static Double_t offsetdRCchi2Pos=0;
550 static Double_t slopedRCchi2Pos=0;
551
552 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
553 TH1* his1D=0;
554 TH2* his2D=0;
0cb93e70 555 TH3* his3D=0;
556
28bb9d1f 557 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
558 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
26a35193 559 if(!his3D) return 16;
0cb93e70 560 his3D->GetYaxis()->SetRangeUser(-1,1);
561 his3D->GetZaxis()->SetRangeUser(0.25,10);
562 }
563
b832d719 564 static TF1 *fpol1 = new TF1("fpol1","pol1");
565 TObjArray arrayFit;
0cb93e70 566 if (his3D && !fgForceTHnSparse) {
567 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
568 } else {
5ca104e5 569 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(0,1.5);
0cb93e70 570 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
5ca104e5 571 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
0cb93e70 572 }
26a35193 573 if(!his2D) return 16;
0cb93e70 574
b832d719 575 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
0cb93e70 576 delete his2D;
b832d719 577 his1D = (TH1*) arrayFit.At(1);
578 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
579 offsetdRCPos=fpol1->GetParameter(0);
580 slopedRCPos=fpol1->GetParameter(1);
581 offsetdRCchi2Pos=fpol1->GetChisquare();
582 slopedRCchi2Pos=fpol1->GetChisquare();
583 //
584 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
585 offsetdRAPos=fpol1->GetParameter(0);
586 slopedRAPos=fpol1->GetParameter(1);
587 offsetdRAErrPos=fpol1->GetParError(0);
588 slopedRAErrPos=fpol1->GetParError(1);
589 offsetdRAchi2Pos=fpol1->GetChisquare();
590 slopedRAchi2Pos=fpol1->GetChisquare();
591 //
592 printf("DCA R QA Pos report\n");
593 printf("offsetdRAPos\t%f\n",offsetdRAPos);
594 printf("slopedRAPos\t%f\n",slopedRAPos);
595 printf("offsetdRCPos\t%f\n",offsetdRCPos);
596 printf("slopedRCPos\t%f\n",slopedRCPos);
597 //
598 // dump values
599 //
600 (*pcstream)<<"tpcQA"<<
601 "offsetdRAPos="<< offsetdRAPos<<
602 "slopedRAPos="<< slopedRAPos<<
603 "offsetdRCPos="<< offsetdRCPos<<
604 "slopedRCPos="<<slopedRCPos<<
605 //
606 "offsetdRAErrPos="<< offsetdRAErrPos<<
607 "slopedRAErrPos="<< slopedRAErrPos<<
608 "offsetdRCErrPos="<< offsetdRCErrPos<<
609 "slopedRCErrPos="<<slopedRCErrPos<<
610 //
611 "offsetdRAchi2Pos="<< offsetdRAchi2Pos<<
612 "slopedRAchi2Pos="<< slopedRAchi2Pos<<
613 "offsetdRCchi2Pos="<< offsetdRCchi2Pos<<
614 "slopedRCchi2Pos="<<slopedRCchi2Pos;
615
616 return 0;
617}
618
619//_____________________________________________________________________________
70f4b25f 620Int_t AliTPCPerformanceSummary::AnalyzeDCARPhiNeg(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 621{
622 //
623 // Analyse DCA R imperfections for negative particles
624 //
625 if (!pcstream) return 32;
626 if (!pTPC) return 32;
627
628 // variables:
629 static Double_t offsetdRANeg=0;
630 static Double_t slopedRANeg=0;
631 static Double_t offsetdRCNeg=0;
632 static Double_t slopedRCNeg=0;
633 static Double_t offsetdRAErrNeg=0;
634 static Double_t slopedRAErrNeg=0;
635 static Double_t offsetdRCErrNeg=0;
636 static Double_t slopedRCErrNeg=0;
637 static Double_t offsetdRAchi2Neg=0;
638 static Double_t slopedRAchi2Neg=0;
639 static Double_t offsetdRCchi2Neg=0;
640 static Double_t slopedRCchi2Neg=0;
641
642 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
643 TH1* his1D=0;
644 TH2* his2D=0;
0cb93e70 645 TH3* his3D=0;
646
28bb9d1f 647 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
648 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
26a35193 649 if(!his3D) return 32;
0cb93e70 650 his3D->GetYaxis()->SetRangeUser(-1,1);
651 his3D->GetZaxis()->SetRangeUser(0.25,10);
652 }
653
b832d719 654 static TF1 *fpol1 = new TF1("fpol1","pol1");
655 TObjArray arrayFit;
0cb93e70 656 if (his3D && !fgForceTHnSparse) {
657 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
658 } else {
5ca104e5 659 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,0);
0cb93e70 660 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
5ca104e5 661 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
0cb93e70 662 }
26a35193 663 if(!his2D) return 32;
664
b832d719 665 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
0cb93e70 666 delete his2D;
b832d719 667 his1D = (TH1*) arrayFit.At(1);
668 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
669 offsetdRCNeg=fpol1->GetParameter(0);
670 slopedRCNeg=fpol1->GetParameter(1);
671 offsetdRCchi2Neg=fpol1->GetChisquare();
672 slopedRCchi2Neg=fpol1->GetChisquare();
673 //
674 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
675 offsetdRANeg=fpol1->GetParameter(0);
676 slopedRANeg=fpol1->GetParameter(1);
677 offsetdRAErrNeg=fpol1->GetParError(0);
678 slopedRAErrNeg=fpol1->GetParError(1);
679 offsetdRAchi2Neg=fpol1->GetChisquare();
680 slopedRAchi2Neg=fpol1->GetChisquare();
681 //
682 printf("DCA R QA Neg report\n");
683 printf("offsetdRANeg\t%f\n",offsetdRANeg);
684 printf("slopedRANeg\t%f\n",slopedRANeg);
685 printf("offsetdRCNeg\t%f\n",offsetdRCNeg);
686 printf("slopedRCNeg\t%f\n",slopedRCNeg);
687 //
688 // dump drift QA values
689 //
690 (*pcstream)<<"tpcQA"<<
691 "offsetdRANeg="<< offsetdRANeg<<
692 "slopedRANeg="<< slopedRANeg<<
693 "offsetdRCNeg="<< offsetdRCNeg<<
694 "slopedRCNeg="<<slopedRCNeg<<
695 //
696 "offsetdRAErrNeg="<< offsetdRAErrNeg<<
697 "slopedRAErrNeg="<< slopedRAErrNeg<<
698 "offsetdRCErrNeg="<< offsetdRCErrNeg<<
699 "slopedRCErrNeg="<<slopedRCErrNeg<<
700 //
701 "offsetdRAchi2Neg="<< offsetdRAchi2Neg<<
702 "slopedRAchi2Neg="<< slopedRAchi2Neg<<
703 "offsetdRCchi2Neg="<< offsetdRCchi2Neg<<
704 "slopedRCchi2Neg="<<slopedRCchi2Neg;
705
706 return 0;
707}
708
709//_____________________________________________________________________________
70f4b25f 710Int_t AliTPCPerformanceSummary::AnalyzeNCL(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 711{
712 //
713 // Analyse number of TPC clusters
714 //
715
716 if (!pcstream) return 1;
717 if (!pTPC) return 1;
718
719 // variables:
720 static Double_t meanTPCnclF=0;
721 static Double_t rmsTPCnclF=0;
722 static Double_t meanTPCChi2=0;
723 static Double_t rmsTPCChi2=0;
724 static Double_t slopeATPCnclF=0;
725 static Double_t slopeCTPCnclF=0;
726 static Double_t slopeATPCnclFErr=0;
727 static Double_t slopeCTPCnclFErr=0;
728 static Double_t meanTPCncl=0;
729 static Double_t rmsTPCncl=0;
730 static Double_t slopeATPCncl=0;
731 static Double_t slopeCTPCncl=0;
732 static Double_t slopeATPCnclErr=0;
733 static Double_t slopeCTPCnclErr=0;
70f4b25f 734 //
b832d719 735 TH1* his1D=0;
70f4b25f 736 TH3* his3D0=0;
737 TH3* his3D1=0;
738 TH3* his3D2=0;
b832d719 739 TProfile* hprof=0;
740 static TF1 *fpol1 = new TF1("fpol1","pol1");
741 //
742 // all clusters
0cb93e70 743 // only events with rec. vertex
b832d719 744 // eta cut - +-1
0cb93e70 745 // pt cut - 0.250 GeV
b832d719 746 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-1.,1.);
747 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0.25,10);
0cb93e70 748
28bb9d1f 749 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7")) {
70f4b25f 750 his3D0 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7"));
26a35193 751 if(!his3D0) return 1;
70f4b25f 752 his3D0->GetYaxis()->SetRangeUser(-1,1);
753 his3D0->GetZaxis()->SetRangeUser(0.25,10);
0cb93e70 754 }
28bb9d1f 755 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7")) {
70f4b25f 756 his3D1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7"));
26a35193 757 if(!his3D1) return 1;
70f4b25f 758 his3D1->GetYaxis()->SetRangeUser(-1,1);
759 his3D1->GetZaxis()->SetRangeUser(0.25,10);
0cb93e70 760 }
28bb9d1f 761 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7")) {
70f4b25f 762 his3D2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7"));
26a35193 763 if(!his3D2) return 1;
70f4b25f 764 his3D2->GetYaxis()->SetRangeUser(-1,1);
765 his3D2->GetZaxis()->SetRangeUser(0.25,10);
766 his3D2->GetXaxis()->SetRangeUser(0.4,1.1);
0cb93e70 767 }
768
769
70f4b25f 770 if (his3D0 && !fgForceTHnSparse) {
771 his1D = his3D0->Project3D("x");
0cb93e70 772 } else {
773 his1D = pTPC->GetTPCTrackHisto()->Projection(0);
774 }
775
b832d719 776 meanTPCncl= his1D->GetMean();
777 rmsTPCncl= his1D->GetRMS();
778 delete his1D;
0cb93e70 779
70f4b25f 780 if (his3D1 && !fgForceTHnSparse) {
781 his1D = his3D1->Project3D("x");
0cb93e70 782 } else {
783 his1D = pTPC->GetTPCTrackHisto()->Projection(1);
784 }
785
b832d719 786 meanTPCChi2= his1D->GetMean();
787 rmsTPCChi2= his1D->GetRMS();
788 delete his1D;
0cb93e70 789
70f4b25f 790 if (his3D0 && !fgForceTHnSparse) {
791 hprof = (dynamic_cast<TH2*>(his3D0->Project3D("xy")))->ProfileX();
0cb93e70 792 } else {
793 hprof = pTPC->GetTPCTrackHisto()->Projection(0,5)->ProfileX();
794 }
26a35193 795 if(!hprof) return 1;
0cb93e70 796
797 hprof->Fit(fpol1,"QNR","QNR",0.1,0.8);
b832d719 798 slopeATPCncl= fpol1->GetParameter(1);
799 slopeATPCnclErr= fpol1->GetParError(1);
0cb93e70 800 hprof->Fit(fpol1,"QNR","QNR",-0.8,-0.1);
b832d719 801 slopeCTPCncl= fpol1->GetParameter(1);
802 slopeCTPCnclErr= fpol1->GetParameter(1);
803 delete hprof;
0cb93e70 804
b832d719 805 //
806 // findable clusters
807 //
0cb93e70 808
70f4b25f 809 if (his3D2 && !fgForceTHnSparse) {
810 his1D = his3D2->Project3D("x");
0cb93e70 811 } else {
812 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0.4,1.1);
813 his1D = pTPC->GetTPCTrackHisto()->Projection(2);
814 }
814d192f 815
b832d719 816 meanTPCnclF= his1D->GetMean();
817 rmsTPCnclF= his1D->GetRMS();
818 delete his1D;
0cb93e70 819
70f4b25f 820 if (his3D2 && !fgForceTHnSparse) {
821 his1D = (dynamic_cast<TH2*>(his3D2->Project3D("xy")))->ProfileX();
0cb93e70 822 } else {
823 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0.4,1.1);
824 his1D = pTPC->GetTPCTrackHisto()->Projection(2,5)->ProfileX();
825 }
26a35193 826 if(!his1D) return 1;
0cb93e70 827
828 his1D->Fit(fpol1,"QNR","QNR",0.1,0.8);
b832d719 829 slopeATPCnclF= fpol1->GetParameter(1);
830 slopeATPCnclFErr= fpol1->GetParError(1);
0cb93e70 831 his1D->Fit(fpol1,"QNR","QNR",-0.8,-0.1);
b832d719 832 slopeCTPCnclF= fpol1->GetParameter(1);
833 slopeCTPCnclFErr= fpol1->GetParameter(1);
834 delete his1D;
0cb93e70 835
836 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0,10);
837
b832d719 838 printf("Cluster QA report\n");
839 printf("meanTPCnclF=\t%f\n",meanTPCnclF);
840 printf("rmsTPCnclF=\t%f\n",rmsTPCnclF);
841 printf("slopeATPCnclF=\t%f\n",slopeATPCnclF);
842 printf("slopeCTPCnclF=\t%f\n",slopeCTPCnclF);
843 printf("meanTPCncl=\t%f\n",meanTPCncl);
844 printf("rmsTPCncl=\t%f\n",rmsTPCncl);
845 printf("slopeATPCncl=\t%f\n",slopeATPCncl);
846 printf("slopeCTPCncl=\t%f\n",slopeCTPCncl);
847 printf("meanTPCChi2=\t%f\n",meanTPCChi2);
848 printf("rmsTPCChi2=\t%f\n",rmsTPCChi2);
849 //
850 // dump results to the tree
851 //
852 (*pcstream)<<"tpcQA"<<
853 "meanTPCnclF="<<meanTPCnclF <<
854 "rmsTPCnclF="<<rmsTPCnclF <<
855 "meanTPCChi2="<<meanTPCChi2 <<
856 "rmsTPCChi2="<<rmsTPCChi2 <<
857 "slopeATPCnclF="<< slopeATPCnclF<<
858 "slopeCTPCnclF="<< slopeCTPCnclF<<
859 "slopeATPCnclFErr="<< slopeATPCnclFErr<<
860 "slopeCTPCnclFErr="<< slopeCTPCnclFErr<<
861 "meanTPCncl="<<meanTPCncl <<
862 "rmsTPCncl="<< rmsTPCncl<<
863 "slopeATPCncl="<< slopeATPCncl<<
864 "slopeCTPCncl="<< slopeCTPCncl<<
865 "slopeATPCnclErr="<< slopeATPCnclErr<<
866 "slopeCTPCnclErr="<< slopeCTPCnclErr;
867
868 return 0;
869}
870
871//_____________________________________________________________________________
70f4b25f 872Int_t AliTPCPerformanceSummary::AnalyzeDrift(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 873{
874 //
875 // Analyse DCA Z imperferctions (drift velocity)
876 //
877
878 if (!pcstream) return 2;
879 if (!pTPC) return 2;
880
881 // variables:
882 static Double_t offsetdZA=0;
883 static Double_t slopedZA=0;
884 static Double_t offsetdZC=0;
885 static Double_t slopedZC=0;
886 static Double_t offsetdZAErr=0;
887 static Double_t slopedZAErr=0;
888 static Double_t offsetdZCErr=0;
889 static Double_t slopedZCErr=0;
890 static Double_t offsetdZAchi2=0;
891 static Double_t slopedZAchi2=0;
892 static Double_t offsetdZCchi2=0;
893 static Double_t slopedZCchi2=0;
894 TH1* his1D=0;
895 TH2* his2D=0;
0cb93e70 896 TH3* his3D=0;
897
28bb9d1f 898 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7")) {
899 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7"));
26a35193 900 if(!his3D) return 2;
0cb93e70 901 his3D->GetYaxis()->SetRangeUser(-1,1);
902 his3D->GetZaxis()->SetRangeUser(0.25,10);
26a35193 903 }
904
0cb93e70 905 if (his3D && !fgForceTHnSparse) {
906 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
907 } else {
908 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
909 }
26a35193 910 if(!his2D) return 2;
0cb93e70 911
b832d719 912 static TF1 *fpol1 = new TF1("fpol1","pol1");
913 TObjArray arrayFit;
b832d719 914 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
915 delete his2D;
916 his1D = (TH1*) arrayFit.At(1);
917 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
918 offsetdZC=fpol1->GetParameter(0);
919 slopedZC=fpol1->GetParameter(1);
920 offsetdZCErr=fpol1->GetParError(0);
921 slopedZCErr=fpol1->GetParError(1);
922 offsetdZCchi2=fpol1->GetChisquare();
923 slopedZCchi2=fpol1->GetChisquare();
924 //
925 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
926 offsetdZA=fpol1->GetParameter(0);
927 slopedZA=fpol1->GetParameter(1);
928 offsetdZAErr=fpol1->GetParError(0);
929 slopedZAErr=fpol1->GetParError(1);
930 offsetdZAchi2=fpol1->GetChisquare();
931 slopedZAchi2=fpol1->GetChisquare();
932 //
933 printf("Drift velocity QA report\n");
934 printf("offsetdZA\t%f\n",offsetdZA);
935 printf("slopedZA\t%f\n",slopedZA);
936 printf("offsetdZC\t%f\n",offsetdZC);
937 printf("slopedZC\t%f\n",slopedZC);
938 //
939 // dump drift QA values
940 //
941 (*pcstream)<<"tpcQA"<<
942 "offsetdZA="<< offsetdZA<<
943 "slopedZA="<< slopedZA<<
944 "offsetdZC="<< offsetdZC<<
945 "slopedZC="<<slopedZC<<
946 //
947 "offsetdZAErr="<< offsetdZAErr<<
948 "slopedZAErr="<< slopedZAErr<<
949 "offsetdZCErr="<< offsetdZCErr<<
950 "slopedZCErr="<<slopedZCErr<<
951 //
952 "offsetdZAchi2="<< offsetdZAchi2<<
953 "slopedZAchi2="<< slopedZAchi2<<
954 "offsetdZCchi2="<< offsetdZCchi2<<
955 "slopedZCchi2="<<slopedZCchi2;
956
957 return 0;
958}
959
960//_____________________________________________________________________________
70f4b25f 961Int_t AliTPCPerformanceSummary::AnalyzeDriftPos(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 962{
963 //
964 // Analyse DCA Z imperferctions (drift velocity)
965 // for positive particles
966 //
967 if (!pcstream) return 64;
968 if (!pTPC) return 64;
969
970 // variables:
971 static Double_t offsetdZAPos=0;
972 static Double_t slopedZAPos=0;
973 static Double_t offsetdZCPos=0;
974 static Double_t slopedZCPos=0;
975 static Double_t offsetdZAErrPos=0;
976 static Double_t slopedZAErrPos=0;
977 static Double_t offsetdZCErrPos=0;
978 static Double_t slopedZCErrPos=0;
979 static Double_t offsetdZAchi2Pos=0;
980 static Double_t slopedZAchi2Pos=0;
981 static Double_t offsetdZCchi2Pos=0;
982 static Double_t slopedZCchi2Pos=0;
983 TH1* his1D=0;
984 TH2* his2D=0;
0cb93e70 985 TH3* his3D=0;
986
28bb9d1f 987 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7")) {
988 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7"));
26a35193 989 if(!his3D) return 64;
0cb93e70 990 his3D->GetYaxis()->SetRangeUser(-1,1);
991 his3D->GetZaxis()->SetRangeUser(0.25,10);
26a35193 992 }
993
0cb93e70 994 if (his3D && !fgForceTHnSparse) {
995 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
996 } else {
997 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
998 }
26a35193 999 if(!his2D) return 64;
0cb93e70 1000
b832d719 1001 static TF1 *fpol1 = new TF1("fpol1","pol1");
1002 TObjArray arrayFit;
b832d719 1003 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
1004 delete his2D;
0cb93e70 1005
b832d719 1006 his1D = (TH1*) arrayFit.At(1);
1007 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
1008 offsetdZCPos=fpol1->GetParameter(0);
1009 slopedZCPos=fpol1->GetParameter(1);
1010 offsetdZCErrPos=fpol1->GetParError(0);
1011 slopedZCErrPos=fpol1->GetParError(1);
1012 offsetdZCchi2Pos=fpol1->GetChisquare();
1013 slopedZCchi2Pos=fpol1->GetChisquare();
1014 //
1015 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
1016 offsetdZAPos=fpol1->GetParameter(0);
1017 slopedZAPos=fpol1->GetParameter(1);
1018 offsetdZAErrPos=fpol1->GetParError(0);
1019 slopedZAErrPos=fpol1->GetParError(1);
1020 offsetdZAchi2Pos=fpol1->GetChisquare();
1021 slopedZAchi2Pos=fpol1->GetChisquare();
1022 //
1023 printf("Drift velocity QA report\n");
1024 printf("offsetdZAPos\t%f\n",offsetdZAPos);
1025 printf("slopedZAPos\t%f\n",slopedZAPos);
1026 printf("offsetdZCPos\t%f\n",offsetdZCPos);
1027 printf("slopedZCPos\t%f\n",slopedZCPos);
1028 //
1029 // dump drift QA values
1030 //
1031 (*pcstream)<<"tpcQA"<<
1032 "offsetdZAPos="<< offsetdZAPos<<
1033 "slopedZAPos="<< slopedZAPos<<
1034 "offsetdZCPos="<< offsetdZCPos<<
1035 "slopedZCPos="<<slopedZCPos<<
1036 //
1037 "offsetdZAErrPos="<< offsetdZAErrPos<<
1038 "slopedZAErrPos="<< slopedZAErrPos<<
1039 "offsetdZCErrPos="<< offsetdZCErrPos<<
1040 "slopedZCErrPos="<<slopedZCErrPos<<
1041 //
1042 "offsetdZAchi2Pos="<< offsetdZAchi2Pos<<
1043 "slopedZAchi2Pos="<< slopedZAchi2Pos<<
1044 "offsetdZCchi2Pos="<< offsetdZCchi2Pos<<
1045 "slopedZCchi2Pos="<<slopedZCchi2Pos;
1046
1047 return 0;
1048}
1049
1050//_____________________________________________________________________________
70f4b25f 1051Int_t AliTPCPerformanceSummary::AnalyzeDriftNeg(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 1052{
1053 //
1054 // Analyse DCA Z imperferctions (drift velocity)
1055 // for negative particles
1056 //
1057 if (!pcstream) return 128;
1058 if (!pTPC) return 128;
1059
1060 // variables:
1061 static Double_t offsetdZANeg=0;
1062 static Double_t slopedZANeg=0;
1063 static Double_t offsetdZCNeg=0;
1064 static Double_t slopedZCNeg=0;
1065 static Double_t offsetdZAErrNeg=0;
1066 static Double_t slopedZAErrNeg=0;
1067 static Double_t offsetdZCErrNeg=0;
1068 static Double_t slopedZCErrNeg=0;
1069 static Double_t offsetdZAchi2Neg=0;
1070 static Double_t slopedZAchi2Neg=0;
1071 static Double_t offsetdZCchi2Neg=0;
1072 static Double_t slopedZCchi2Neg=0;
1073 TH1* his1D=0;
1074 TH2* his2D=0;
0cb93e70 1075 TH3* his3D=0;
1076
0cb93e70 1077
28bb9d1f 1078 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7")) {
1079 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7"));
26a35193 1080 if(!his3D) return 128;
0cb93e70 1081 his3D->GetYaxis()->SetRangeUser(-1,1);
1082 his3D->GetZaxis()->SetRangeUser(0.25,10);
1083 }
1084 if (his3D && !fgForceTHnSparse) {
1085 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
1086 } else {
1087 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
1088 }
26a35193 1089 if(!his2D) return 128;
0cb93e70 1090
b832d719 1091 static TF1 *fpol1 = new TF1("fpol1","pol1");
1092 TObjArray arrayFit;
b832d719 1093 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
1094 delete his2D;
0cb93e70 1095
b832d719 1096 his1D = (TH1*) arrayFit.At(1);
1097 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
1098 offsetdZCNeg=fpol1->GetParameter(0);
1099 slopedZCNeg=fpol1->GetParameter(1);
1100 offsetdZCErrNeg=fpol1->GetParError(0);
1101 slopedZCErrNeg=fpol1->GetParError(1);
1102 offsetdZCchi2Neg=fpol1->GetChisquare();
1103 slopedZCchi2Neg=fpol1->GetChisquare();
1104 //
1105 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
1106 offsetdZANeg=fpol1->GetParameter(0);
1107 slopedZANeg=fpol1->GetParameter(1);
1108 offsetdZAErrNeg=fpol1->GetParError(0);
1109 slopedZAErrNeg=fpol1->GetParError(1);
1110 offsetdZAchi2Neg=fpol1->GetChisquare();
1111 slopedZAchi2Neg=fpol1->GetChisquare();
1112 //
1113 printf("Drift velocity QA report\n");
1114 printf("offsetdZANeg\t%f\n",offsetdZANeg);
1115 printf("slopedZANeg\t%f\n",slopedZANeg);
1116 printf("offsetdZCNeg\t%f\n",offsetdZCNeg);
1117 printf("slopedZCNeg\t%f\n",slopedZCNeg);
1118 //
1119 // dump drift QA values
1120 //
1121 (*pcstream)<<"tpcQA"<<
1122 "offsetdZANeg="<< offsetdZANeg<<
1123 "slopedZANeg="<< slopedZANeg<<
1124 "offsetdZCNeg="<< offsetdZCNeg<<
1125 "slopedZCNeg="<<slopedZCNeg<<
1126 //
1127 "offsetdZAErrNeg="<< offsetdZAErrNeg<<
1128 "slopedZAErrNeg="<< slopedZAErrNeg<<
1129 "offsetdZCErrNeg="<< offsetdZCErrNeg<<
1130 "slopedZCErrNeg="<<slopedZCErrNeg<<
1131 //
1132 "offsetdZAchi2Neg="<< offsetdZAchi2Neg<<
1133 "slopedZAchi2Neg="<< slopedZAchi2Neg<<
1134 "offsetdZCchi2Neg="<< offsetdZCchi2Neg<<
1135 "slopedZCchi2Neg="<<slopedZCchi2Neg;
1136
1137 return 0;
1138}
1139
1140//_____________________________________________________________________________
70f4b25f 1141Int_t AliTPCPerformanceSummary::AnalyzeGain(const AliPerformanceDEdx* pTPCgain, TTreeSRedirector* const pcstream)
b832d719 1142{
1143 //
1144 // Analyse Gain
1145 //
1146
1147 if (!pcstream) return 4;
1148 if (!pTPCgain) return 4;
1149
1150 static TVectorD meanMIPvsSector(36);
1151 static TVectorD sector(36);
1152 static Float_t meanMIP = 0;
1153 static Float_t resolutionMIP = 0;
1154 static Float_t attachSlopeC = 0;
1155 static Float_t attachSlopeA = 0;
1156
69878f59 1157 TH1 * his1D = 0;
814d192f 1158 //TH1 * hisProj1D=0;
1159 TH2* his2D=0;
1160
69878f59 1161
b832d719 1162 meanMIPvsSector.Zero();
1163 //
1164 // select MIP particles
1165 //
1166 pTPCgain->GetDeDxHisto()->GetAxis(7)->SetRangeUser(0.4,0.55);
1167 pTPCgain->GetDeDxHisto()->GetAxis(0)->SetRangeUser(35,60);
1168 pTPCgain->GetDeDxHisto()->GetAxis(6)->SetRangeUser(80,160);
1169 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-1,1);
1170 //
1171 // MIP position and resolution
814d192f 1172 //
b832d719 1173 TF1 gausFit("gausFit","gaus");
814d192f 1174
1175 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_0") && !fgForceTHnSparse) {
1176 his1D = dynamic_cast<TH1*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_0")->Clone());
1177 } else {
1178 his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1179 }
26a35193 1180 if(!his1D) return 4;
814d192f 1181 his1D->Fit(&gausFit,"QN","QN");
1182
b832d719 1183 meanMIP = gausFit.GetParameter(1);
1184 resolutionMIP = 0;
1185 if (meanMIP!=0) resolutionMIP = gausFit.GetParameter(2)/meanMIP;
814d192f 1186 //removedtotest// delete his1D;
b832d719 1187 //
1188 // MIP position vs. dip angle (attachment)
814d192f 1189 //
1190 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-3,0); // C side
1191 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_5") && !fgForceTHnSparse) {
1192 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_5")->Clone());
1193 } else {
1194 his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
1195 }
26a35193 1196 if(!his2D) return 4;
1197
b832d719 1198 TF1 * fpol = new TF1("fpol","pol1");
1199 TObjArray arrayFit;
814d192f 1200 his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
69878f59 1201 his1D = (TH1*) arrayFit.At(1);
b832d719 1202 his1D->Fit(fpol,"QNROB=0.8","QNR",-1,0);
1203 attachSlopeC = fpol->GetParameter(1);
814d192f 1204 //removedtotest// delete his2D;
1205 //removedtotest// delete his1D;
b832d719 1206 //
814d192f 1207 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(0,3); // A side
1208 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_5") && !fgForceTHnSparse) {
1209 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_5")->Clone());
1210 } else {
1211 his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
1212 }
26a35193 1213 if(!his2D) return 4;
1214
b832d719 1215 TF1 * fpolA = new TF1("fpolA","pol1");
1216 TObjArray arrayFitA;
814d192f 1217 his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
1218 his1D = (TH1*) arrayFit.At(1);
1219 his1D->Fit(fpolA,"QNROB=0.8","QN",0,1);
b832d719 1220 attachSlopeA = fpolA->GetParameter(1);
814d192f 1221 //removedtotest// delete his2D;
1222 //removedtotest// delete his1D;
b832d719 1223 //
1224 // MIP position vs. sector
1225 //
1226 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-3,0); // C side
814d192f 1227 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_1") && !fgForceTHnSparse) {
1228 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_1")->Clone());
1229 } else {
1230 his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
1231 }
26a35193 1232 if(!his2D) return 4;
1233
b832d719 1234 for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
0285b6f5 1235 //TH1* his1D=0;
b832d719 1236 Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
1237 Float_t phiUp = -TMath::Pi() + (i+1)*(20./360.)*(2*TMath::Pi());
814d192f 1238 //pTPCgain->GetDeDxHisto()->GetAxis(1)->SetRangeUser(phiLow,phiUp);
1239 his2D->GetXaxis()->SetRangeUser(phiLow,phiUp);
1240 //his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1241 his1D = his2D->ProjectionY();
b832d719 1242 TF1 gausFunc("gausFunc","gaus");
1243 his1D->Fit(&gausFunc, "QN");
1244 meanMIPvsSector(i) = gausFunc.GetParameter(1);
1245 sector(i)=i;
814d192f 1246 //removedtotest// delete his1D;
b832d719 1247 }
814d192f 1248 //removedtotest// delete his2D;
b832d719 1249 //
1250 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(0,3); // A side
814d192f 1251 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_1") && !fgForceTHnSparse) {
1252 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_1")->Clone());
1253 } else {
1254 his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
1255 }
26a35193 1256 if(!his2D) return 4;
1257
b832d719 1258 for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
69878f59 1259 //TH1* his1D=0;
b832d719 1260 Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
1261 Float_t phiUp = -TMath::Pi() + (i+1)*(20./360.)*(2*TMath::Pi());
814d192f 1262 //pTPCgain->GetDeDxHisto()->GetAxis(1)->SetRangeUser(phiLow,phiUp);
1263 his2D->GetXaxis()->SetRangeUser(phiLow,phiUp);
1264 //his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1265 his1D = his2D->ProjectionY();
b832d719 1266 TF1 gausFunc("gausFunc","gaus");
1267 his1D->Fit(&gausFunc, "QN");
1268 meanMIPvsSector(i+18) = gausFunc.GetParameter(1);
1269 sector(i+18)=i+18;
814d192f 1270 //removedtotest// delete his1D;
b832d719 1271 }
814d192f 1272 //removedtotest// delete his2D;
b832d719 1273 //
1274 printf("Gain QA report\n");
1275 printf("MIP mean\t%f\n",meanMIP);
1276 printf("MIP resolution\t%f\n",resolutionMIP);
1277 printf("MIPslopeA\t%f\n",attachSlopeA);
1278 printf("MIPslopeC\t%f\n",attachSlopeC);
814d192f 1279 //
1280
b832d719 1281 (*pcstream)<<"tpcQA"<<
1282 "MIPattachSlopeC="<<attachSlopeC<<
1283 "MIPattachSlopeA="<<attachSlopeA<<
1284 "resolutionMIP="<<resolutionMIP<<
1285 "meanMIPvsSector.="<<&meanMIPvsSector<<
1286 "sector.="<<&sector<<
1287 "meanMIP="<<meanMIP;
1288
1289 return 0;
1290}
1291
1292//_____________________________________________________________________________
70f4b25f 1293Int_t AliTPCPerformanceSummary::AnalyzeEvent(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 1294{
1295 //
1296 // Analyse Primary Vertex Distribution and Multiplicities
1297 //
1298 if (!pcstream) return 1;
1299 if (!pTPC) return 1;
1300 //
1301 //
1302 //
1303 static Double_t meanVertX=0;
1304 static Double_t rmsVertX=0;
1305 static Double_t meanVertY=0;
1306 static Double_t rmsVertY=0;
1307 static Double_t meanVertZ=0;
1308 static Double_t rmsVertZ=0;
1309 static Double_t vertStatus=0;
1310 static Double_t meanMult=0;
1311 static Double_t rmsMult=0;
1312 static Double_t meanMultPos=0;
1313 static Double_t rmsMultPos=0;
1314 static Double_t meanMultNeg=0;
1315 static Double_t rmsMultNeg=0;
1316 static Double_t vertAll = 0;
1317 static Double_t vertOK = 0;
1318
1319 TH1* his1D=0;
820afb27 1320 TH1* hc=0;
28bb9d1f 1321 if (pTPC->GetHistos()->FindObject("h_tpc_event_6") && !fgForceTHnSparse) {
1322 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_6")->Clone());
0cb93e70 1323 } else {
1324 his1D = pTPC->GetTPCEventHisto()->Projection(6);
1325 }
26a35193 1326 if(!his1D) return 1;
1327
b832d719 1328 vertAll = his1D->GetEntries();
0cb93e70 1329 vertOK = his1D->GetBinContent(2);
b832d719 1330 if (vertAll>=1) {
1331 vertStatus = vertOK / vertAll;
1332 }
0cb93e70 1333
1334 delete his1D;
1335
1336 pTPC->GetTPCEventHisto()->GetAxis(6)->SetRange(2,2);
1337
28bb9d1f 1338 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_0") && !fgForceTHnSparse) {
1339 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_0")->Clone());
0cb93e70 1340 } else {
1341 his1D = pTPC->GetTPCEventHisto()->Projection(0);
1342 }
26a35193 1343 if(!his1D) return 1;
1344
b832d719 1345 meanVertX = his1D->GetMean();
1346 rmsVertX = his1D->GetRMS();
1347 delete his1D;
1348
0cb93e70 1349
1350
1351
28bb9d1f 1352 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_1") && !fgForceTHnSparse) {
1353 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_1")->Clone());
0cb93e70 1354 } else {
1355 his1D = pTPC->GetTPCEventHisto()->Projection(1);
1356 }
26a35193 1357 if(!his1D) return 1;
1358
b832d719 1359 meanVertY = his1D->GetMean();
1360 rmsVertY = his1D->GetRMS();
1361 delete his1D;
1362
0cb93e70 1363
28bb9d1f 1364 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2") && !fgForceTHnSparse) {
820afb27 1365 hc = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2"));
1366 if(!hc) return 1;
1367 //his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2")->Clone());
1368 his1D = (TH1*)hc->Clone();
0cb93e70 1369 } else {
1370 his1D = pTPC->GetTPCEventHisto()->Projection(2);
820afb27 1371 }
26a35193 1372 if(!his1D) return 1;
1373
820afb27 1374 meanVertZ = his1D->GetMean();
b832d719 1375 rmsVertZ = his1D->GetRMS();
1376 delete his1D;
1377
0cb93e70 1378
28bb9d1f 1379 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3") && !fgForceTHnSparse) {
820afb27 1380 hc = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3"));
1381 if(!hc) return 1;
1382 //his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3")->Clone());
1383 his1D = (TH1*)hc->Clone();
0cb93e70 1384 } else {
1385 his1D = pTPC->GetTPCEventHisto()->Projection(3);
1386 }
26a35193 1387 if(!his1D) return 1;
1388
b832d719 1389 meanMult = his1D->GetMean();
1390 rmsMult = his1D->GetRMS();
1391 delete his1D;
1392
0cb93e70 1393
28bb9d1f 1394 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_4") && !fgForceTHnSparse) {
1395 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_4")->Clone());
0cb93e70 1396 } else {
1397 his1D = pTPC->GetTPCEventHisto()->Projection(4);
1398 }
26a35193 1399 if(!his1D) return 1;
1400
b832d719 1401 meanMultPos = his1D->GetMean();
1402 rmsMultPos = his1D->GetRMS();
1403 delete his1D;
1404
28bb9d1f 1405 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_5") && !fgForceTHnSparse) {
1406 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_5")->Clone());
0cb93e70 1407 } else {
1408 his1D = pTPC->GetTPCEventHisto()->Projection(5);
1409 }
26a35193 1410 if(!his1D) return 1;
1411
b832d719 1412 meanMultNeg = his1D->GetMean();
1413 rmsMultNeg = his1D->GetRMS();
1414 delete his1D;
1415
0cb93e70 1416 pTPC->GetTPCEventHisto()->GetAxis(6)->SetRange(1,2);
b832d719 1417 //
1418 (*pcstream)<<"tpcQA"<<
1419 "meanVertX="<<meanVertX<<
1420 "rmsVertX="<<rmsVertX<<
1421 "meanVertY="<<meanVertY<<
1422 "rmsVertY="<<rmsVertY<<
1423 "meanVertZ="<<meanVertZ<<
1424 "rmsVertZ="<<rmsVertZ<<
1425 "vertStatus="<<vertStatus<<
1426 "vertAll="<<vertAll<<
1427 "vertOK="<<vertOK<<
1428 "meanMult="<<meanMult<<
1429 "rmsMult="<<rmsMult<<
1430 "meanMultPos="<<meanMultPos<<
1431 "rmsMultPos="<<rmsMultPos<<
1432 "meanMultNeg="<<meanMultNeg<<
1433 "rmsMultNeg="<<rmsMultNeg;
1434
1435 return 0;
1436}
f69eb048 1437
1438//_____________________________________________________________________________
70f4b25f 1439Int_t AliTPCPerformanceSummary::AnalyzePt(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
10d5d625 1440{
1441 //
1442 // Analyse DCA R imperfections for positive particles
1443 //
1444
1445 if (!pcstream) return 256;
1446 if (!pTPC) return 256;
1447
1448 // variables:
1449 static Double_t meanPtAPos = 0;
1450 static Double_t mediumPtAPos = 0;
1451 static Double_t highPtAPos = 0;
1452 static Double_t meanPtCPos = 0;
1453 static Double_t mediumPtCPos = 0;
1454 static Double_t highPtCPos = 0;
1455
1456 static Double_t meanPtANeg = 0;
1457 static Double_t mediumPtANeg = 0;
1458 static Double_t highPtANeg = 0;
1459 static Double_t meanPtCNeg = 0;
1460 static Double_t mediumPtCNeg = 0;
1461 static Double_t highPtCNeg = 0;
1462
70f4b25f 1463 TH3* his3D1=0;
1464 TH3* his3D2=0;
10d5d625 1465
1466 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
1467
70f4b25f 1468 his3D1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
26a35193 1469 if(!his3D1) return 256;
10d5d625 1470
70f4b25f 1471 his3D1->GetYaxis()->SetRangeUser(0.1,0.8);
10d5d625 1472
70f4b25f 1473 his3D1->GetZaxis()->SetRangeUser(0.25,10);
1474 meanPtAPos = his3D1->GetMean(3);
1475 his3D1->GetZaxis()->SetRangeUser(2,5);
1476 mediumPtAPos = his3D1->GetMean(3);
1477 his3D1->GetZaxis()->SetRangeUser(5,10);
1478 highPtAPos = his3D1->GetMean(3);
10d5d625 1479
70f4b25f 1480 his3D1->GetYaxis()->SetRangeUser(-0.8,-0.1);
10d5d625 1481
70f4b25f 1482 his3D1->GetZaxis()->SetRangeUser(0.25,10);
1483 meanPtCPos = his3D1->GetMean(3);
1484 his3D1->GetZaxis()->SetRangeUser(2,5);
1485 mediumPtCPos = his3D1->GetMean(3);
1486 his3D1->GetZaxis()->SetRangeUser(5,10);
1487 highPtCPos = his3D1->GetMean(3);
10d5d625 1488
70f4b25f 1489 his3D1->GetYaxis()->SetRangeUser(-1,1);
1490 his3D1->GetZaxis()->SetRangeUser(0.25,10);
10d5d625 1491 }
1492
1493
1494 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
1495
70f4b25f 1496 his3D2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
26a35193 1497 if(!his3D2) return 256;
10d5d625 1498
70f4b25f 1499 his3D2->GetYaxis()->SetRangeUser(0.1,0.8);
1500
1501 his3D2->GetZaxis()->SetRangeUser(0.25,10);
1502 meanPtANeg = his3D2->GetMean(3);
1503 his3D2->GetZaxis()->SetRangeUser(2,5);
1504 mediumPtANeg = his3D2->GetMean(3);
1505 his3D2->GetZaxis()->SetRangeUser(5,10);
1506 highPtANeg = his3D2->GetMean(3);
10d5d625 1507
70f4b25f 1508 his3D2->GetYaxis()->SetRangeUser(-0.8,-0.1);
1509
1510 his3D2->GetZaxis()->SetRangeUser(0.25,10);
1511 meanPtCNeg = his3D2->GetMean(3);
1512 his3D2->GetZaxis()->SetRangeUser(2,5);
1513 mediumPtCNeg = his3D2->GetMean(3);
1514 his3D2->GetZaxis()->SetRangeUser(5,10);
1515 highPtCNeg = his3D2->GetMean(3);
10d5d625 1516
70f4b25f 1517 his3D2->GetYaxis()->SetRangeUser(-1,1);
1518 his3D2->GetZaxis()->SetRangeUser(0.25,10);
10d5d625 1519 }
1520
1521
1522
1523 // dump values
1524 //
1525 (*pcstream)<<"tpcQA"<<
1526 "meanPtAPos="<< meanPtAPos<<
1527 "mediumPtAPos="<< mediumPtAPos<<
1528 "highPtAPos="<< highPtAPos<<
1529 //
1530 "meanPtCPos="<< meanPtCPos<<
1531 "mediumPtCPos="<< mediumPtCPos<<
1532 "highPtCPos="<< highPtCPos<<
1533 //
1534 "meanPtANeg="<< meanPtANeg<<
1535 "mediumPtANeg="<< mediumPtANeg<<
1536 "highPtANeg="<< highPtANeg<<
1537 //
1538 "meanPtCNeg="<< meanPtCNeg<<
1539 "mediumPtCNeg="<< mediumPtCNeg<<
1540 "highPtCNeg="<< highPtCNeg;
1541
1542
1543 return 0;
1544}
1545
1546//_____________________________________________________________________________
1547
70f4b25f 1548Int_t AliTPCPerformanceSummary::AnalyzeChargeOverPt(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream){
10d5d625 1549 //
1550 // Analyse DCA R imperfections for positive particles
1551 //
1552
1553 if (!pcstream) return 512;
1554 if (!pTPC) return 512;
1555
1556 // variables:
1557 static Double_t qOverPt = 0;
1558 static Double_t qOverPtA = 0;
1559 static Double_t qOverPtC = 0;
1560
1561 TH2* his2D=0;
70f4b25f 1562 TH1* his1D1=0;
1563 TH1* his1D2=0;
1564 TH1* his1D3=0;
10d5d625 1565 TF1 *fp1 = new TF1("fp1","pol2",-1.0,1.0);
1566 TF1 *fp2 = new TF1("fp2","pol2",-1.0,1.0);
1567 TF1 *fp3 = new TF1("fp3","pol2",-1.0,1.0);
1568
1569 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8")) {
1570
1571 his2D = dynamic_cast<TH2*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8"));
26a35193 1572 if(!his2D) return 512;
10d5d625 1573
70f4b25f 1574 his1D1 = his2D->ProjectionX();
1575 his1D1->Fit(fp1,"R");
10d5d625 1576 if(fp1->GetParameter(2)!=0){
1577 qOverPt = (-1.0)*(fp1->GetParameter(1)/(2.0*fp1->GetParameter(2)));
1578 }
1579 delete fp1;
70f4b25f 1580 delete his1D1;
10d5d625 1581
1582 his2D->GetYaxis()->SetRangeUser(0.1,0.8);
70f4b25f 1583 his1D2 = his2D->ProjectionX();
1584 his1D2->Fit(fp2,"R");
10d5d625 1585 if(fp2->GetParameter(2)!=0)
1586 qOverPtA = (-1.0)*(fp2->GetParameter(1)/(2.0*fp2->GetParameter(2)));
1587 delete fp2;
70f4b25f 1588 delete his1D2;
10d5d625 1589
1590 his2D->GetYaxis()->SetRangeUser(-0.8,-0.1);
70f4b25f 1591 his1D3 = his2D->ProjectionX();
1592 his1D3->Fit(fp3,"R");
10d5d625 1593 if(fp3->GetParameter(2)!=0)
1594 qOverPtC = (-1.0)*(fp3->GetParameter(1)/(2.0*fp3->GetParameter(2)));
1595 delete fp3;
70f4b25f 1596 delete his1D3;
10d5d625 1597
1598 his2D->GetYaxis()->SetRangeUser(-1.0,1.0);
1599 }
1600
1601
1602 (*pcstream)<<"tpcQA"<<
1603 "qOverPt="<< qOverPt<<
1604 "qOverPtA="<< qOverPtA<<
1605 "qOverPtC="<< qOverPtC;
1606
1607 return 0;
1608}
1609
1833a193 1610Int_t AliTPCPerformanceSummary::AnalyzeMatch(const AliPerformanceMatch* pMatch, TTreeSRedirector* const pcstream)
f69eb048 1611{
1833a193 1612 /* if ((pMatch == 0) or (0 == pcstream)) { printf("this will not work anyway..."); }
1613 printf("funtion not implemented");*/
1614
1615 if (!pcstream) return 1024;
1616 if (!pMatch) return 1024;
1617 static Double_t tpcItsMatchA = 0;
1618 static Double_t tpcItsMatchHighPtA = 0;
1619 static Double_t tpcItsMatchC = 0;
1620 static Double_t tpcItsMatchHighPtC = 0;
1621
1622 TH2 *h2D = 0;
1623 TH2 *h2D1 = 0;
1624 if(pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_all_2_3") &&
1625 pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_tpc_2_3")){
1626 h2D = dynamic_cast<TH2*>(pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_all_2_3"));
1627 h2D1 = dynamic_cast<TH2*>(pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_tpc_2_3"));
8f5423ae 1628
1629 if(!h2D) return 4;
1630 if(!h2D1) return 4;
1833a193 1631
1632 h2D->GetXaxis()->SetRangeUser(0,1.5);
1633 h2D1->GetXaxis()->SetRangeUser(0,1.5);
1634
1635 Double_t entries,entries1;
1636 entries = h2D->GetEffectiveEntries();
1637 entries1 = h2D1->GetEffectiveEntries();
1638 if(entries > 0)
1639 tpcItsMatchA = entries1/entries;
1640
1641 h2D->GetYaxis()->SetRangeUser(4.0,20.);
1642 h2D1->GetYaxis()->SetRangeUser(4.0,20.);
1643 entries = h2D->GetEffectiveEntries();
1644 entries1 = h2D1->GetEffectiveEntries();
1645 if(entries > 0)
1646 tpcItsMatchHighPtA = entries1/entries;
1647
1648
1649 h2D->GetXaxis()->SetRangeUser(-1.5,0);
1650 h2D1->GetXaxis()->SetRangeUser(-1.5,0);
1651 h2D->GetYaxis()->SetRangeUser(0.0,20.);
1652 h2D1->GetYaxis()->SetRangeUser(0.0,20.);
1653
1654 entries = h2D->GetEffectiveEntries();
1655 entries1 = h2D1->GetEffectiveEntries();
1656 if(entries > 0)
1657 tpcItsMatchC = entries1/entries;
1658
1659 h2D->GetXaxis()->SetRangeUser(4.0,20.);
1660 h2D1->GetXaxis()->SetRangeUser(4.0,20.);
1661 entries = h2D->GetEffectiveEntries();
1662 entries1 = h2D1->GetEffectiveEntries();
1663 if(entries > 0)
1664 tpcItsMatchHighPtC = entries1/entries;
1665
1666 h2D->GetXaxis()->SetRangeUser(-1.5,1.5);
1667 h2D1->GetXaxis()->SetRangeUser(-1.5,1.5);
1668 h2D->GetYaxis()->SetRangeUser(0.0,20.);
1669 h2D1->GetYaxis()->SetRangeUser(0.0,20.);
1670 // delete h2D;
1671 // delete h2D1;
1672 }
1673
1674 (*pcstream)<<"tpcQA"<<
1675 "tpcItsMatchA="<< tpcItsMatchA<<
1676 "tpcItsMatchHighPtA="<< tpcItsMatchHighPtA<<
1677 "tpcItsMatchC="<< tpcItsMatchC<<
1678 "tpcItsMatchHighPtC="<< tpcItsMatchHighPtC;
1679
1680 return 0;
1681}
1682
1683Int_t AliTPCPerformanceSummary::AnalyzePull(const AliPerformanceMatch* pPull, TTreeSRedirector* const pcstream)
1684{
1685 /* if ((pPull == 0) or (0 == pcstream)) { printf("this will not work anyway..."); }
1686 printf("funtion not implemented");*/
1687
1688 if (!pcstream) return 2048;
1689 if (!pPull) return 2048;
1690 static Double_t phiPull = 0;
1691 static Double_t phiPullHighPt = 0;
1692 static Double_t ptPull = 0;
1693 static Double_t ptPullHighPt = 0;
1694 static Double_t yPull = 0;
1695 static Double_t yPullHighPt = 0;
1696 static Double_t zPull = 0;
1697 static Double_t zPullHighPt = 0;
1698 static Double_t lambdaPull = 0;
1699 static Double_t lambdaPullHighPt = 0;
1700
1701 TH2 *h2D1 = 0;
1702 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_2_7")){
1703 h2D1 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_2_7"));
8f5423ae 1704 if(!h2D1) return 4;
1833a193 1705 phiPull = h2D1->GetMean(2);
1706 h2D1->SetAxisRange(0.0,1.0/5.0,"X");
1707 phiPullHighPt = h2D1->GetMean(2);
1708 h2D1->SetAxisRange(0.0,10.0,"X");
1709 // delete h2D1;
1710 }
1711
1712 TH2 *h2D2 = 0;
1713 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_4_7")){
1714 h2D2 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_4_7"));
8f5423ae 1715 if(!h2D2) return 4;
1833a193 1716 ptPull = h2D2->GetMean(2);
1717
1718 h2D2->SetAxisRange(0.0,1.0/5.0,"X");
1719 ptPullHighPt = h2D2->GetMean(2);
1720 h2D2->SetAxisRange(0.0,10.0,"X");
1721 // delete h2D2;
1722 }
1723
1724 TH2 *h2D3 = 0;
1725 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_0_7")){
1726 h2D3 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_0_7"));
8f5423ae 1727 if(!h2D3) return 4;
1833a193 1728 yPull = h2D3->GetMean(2);
1729
1730 h2D3->SetAxisRange(0.0,1.0/5.0,"X");
1731 yPullHighPt = h2D3->GetMean(2);
1732 h2D3->SetAxisRange(0.0,10.0,"X");
1733 // delete h2D3;
1734 }
1735
1736 TH2 *h2D4 = 0;
1737 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_1_7")){
1738 h2D4 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_1_7"));
8f5423ae 1739 if(!h2D4) return 4;
1833a193 1740 zPull = h2D4->GetMean(2);
1741
1742 h2D4->SetAxisRange(0.0,1.0/5.0,"X");
1743 zPullHighPt = h2D4->GetMean(2);
1744 h2D4->SetAxisRange(0.0,10.0,"X");
1745 // delete h2D4;
1746 }
1747
1748 TH2 *h2D5 = 0;
1749 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_3_7")){
1750 h2D5 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_3_7"));
8f5423ae 1751 if(!h2D5) return 4;
1833a193 1752 lambdaPull = h2D5->GetMean(2);
1753
1754 h2D5->SetAxisRange(0.0,1.0/5.0,"X");
1755 lambdaPullHighPt = h2D5->GetMean(2);
1756 h2D5->SetAxisRange(0.0,10.0,"X");
1757 // delete h2D5;
1758}
1759
1760 (*pcstream)<<"tpcQA"<<
1761 "phiPull="<< phiPull<<
1762 "phiPullHighPt="<< phiPullHighPt<<
1763 "ptPull="<< ptPull<<
1764 "ptPullHighPt="<< ptPullHighPt<<
1765 "yPull="<< yPull<<
1766 "yPullHighPt="<< yPullHighPt<<
1767 "zPull="<< zPull<<
1768 "zPullHighPt="<< zPullHighPt<<
1769 "lambdaPull="<< lambdaPull<<
1770 "lambdaPullHighPt="<< lambdaPullHighPt;
1771
1772 return 0;
f69eb048 1773}