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.
11 // by M.Knichel 15/10/2010
12 //------------------------------------------------------------------------------
27 #include "THnSparse.h"
34 #include "AliGRPObject.h"
35 #include "AliTPCcalibDB.h"
36 #include "AliTPCcalibDButil.h"
37 #include "TTreeStream.h"
38 #include "AliPerformanceTPC.h"
39 #include "AliPerformanceDEdx.h"
40 #include "AliPerformanceDCA.h"
41 #include "AliPerformanceMatch.h"
43 #include "AliTPCPerformanceSummary.h"
45 ClassImp(AliTPCPerformanceSummary)
47 Bool_t AliTPCPerformanceSummary::fgForceTHnSparse = kFALSE;
50 //_____________________________________________________________________________
51 void AliTPCPerformanceSummary::WriteToTTreeSRedirector(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pTPCMatch, TTreeSRedirector* const pcstream, Int_t run)
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.
60 if (pTPCMatch) {run = pTPCMatch->GetRunNumber(); }
61 if (pTPCgain) {run = pTPCgain->GetRunNumber(); }
62 if (pTPC) { run = pTPC->GetRunNumber(); }
65 AliTPCcalibDB *calibDB=0;
66 // AliTPCcalibDButil *dbutil =0;
74 calibDB = AliTPCcalibDB::Instance();
75 // dbutil= new AliTPCcalibDButil;
77 printf("Processing run %d ...\n",run);
79 AliTPCcalibDB::Instance()->SetRun(run);
80 // dbutil->UpdateFromCalibDB();
81 // dbutil->SetReferenceRun(run);
82 // dbutil->UpdateRefDataFromOCDB();
84 if (calibDB->GetGRP(run)){
85 startTimeGRP = AliTPCcalibDB::GetGRP(run)->GetTimeStart();
86 stopTimeGRP = AliTPCcalibDB::GetGRP(run)->GetTimeEnd();
87 currentL3 = AliTPCcalibDB::GetL3Current(run);
88 polarityL3 = AliTPCcalibDB::GetL3Polarity(run);
89 bz = AliTPCcalibDB::GetBz(run);
92 runType = AliTPCcalibDB::GetRunType(run).Data();
94 time = (startTimeGRP+stopTimeGRP)/2;
95 duration = (stopTimeGRP-startTimeGRP);
97 if (!pcstream) return;
98 (*pcstream)<<"tpcQA"<<
101 "startTimeGRP="<<startTimeGRP<<
102 "stopTimeGRP="<<stopTimeGRP<<
104 "runType.="<<&runType;
106 pTPC->GetTPCTrackHisto()->GetAxis(9)->SetRangeUser(0.5,1.5);
107 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0.25,10);
108 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-1,1);
109 AnalyzeNCL(pTPC, pcstream);
110 AnalyzeDrift(pTPC, pcstream);
111 AnalyzeDriftPos(pTPC, pcstream);
112 AnalyzeDriftNeg(pTPC, pcstream);
113 AnalyzeDCARPhi(pTPC, pcstream);
114 AnalyzeDCARPhiPos(pTPC, pcstream);
115 AnalyzeDCARPhiNeg(pTPC, pcstream);
116 AnalyzeEvent(pTPC, pcstream);
118 AnalyzePt(pTPC,pcstream);
119 AnalyzeChargeOverPt(pTPC,pcstream);
122 pTPC->GetTPCTrackHisto()->GetAxis(9)->SetRangeUser(-10,10);
123 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0,100);
124 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-10,10);
126 AnalyzeGain(pTPCgain, pcstream);
127 AnalyzeMatch(pTPCMatch, pcstream);
128 (*pcstream)<<"tpcQA"<<"\n";
131 //_____________________________________________________________________________
132 void AliTPCPerformanceSummary::WriteToFile(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pMatch, const Char_t* outfile, Int_t run)
135 // Extracts performance parameters from pTPC and pTPCgain.
136 // Output is written to a TTree saved in outfile.
137 // The run number must be provided since it is not stored in
138 // AliPerformanceTPC or AliPerformanceDEdx.
140 // The function creates a TTreeSRedirector and calls the
141 // function WriteToTTreeSRedirector.
144 if (!outfile) return;
145 TTreeSRedirector* pcstream = 0;
146 pcstream = new TTreeSRedirector(outfile);
147 if (!pcstream) return;
148 WriteToTTreeSRedirector(pTPC, pTPCgain, pMatch, pcstream, run);
149 if (pcstream) { delete pcstream; pcstream = 0; }
153 //_____________________________________________________________________________
154 Int_t AliTPCPerformanceSummary::MakeReport(const Char_t* infile, const Char_t* outfile, Int_t run)
157 // Reads QA information (AliPerformanceTPC and AliPerformanceDEdx) from
158 // infile (this must be a rootfile) and writes the output to a TTree
159 // stored in outfile.
160 // The run number must be provided since it is not stored in
161 // AliPerformanceTPC or AliPerformanceDEdx.
163 // The input objects must be named "AliPerformanceTPC" and
164 // "AliPerformanceDEdxTPCInner" and stored in a TList which name must
165 // be one of the following: "TPC", "TPCQA", "TPC_PerformanceQA"
166 // or "TPC_PerformanceQA/TPC" (with directory)
169 if (!infile) return -1;
170 if (!outfile) return -1;
172 f=TFile::Open(infile,"read");
174 printf("File %s not available\n", infile);
178 list = dynamic_cast<TList*>(f->Get("TPC"));
179 if (!list) { list = dynamic_cast<TList*>(f->Get("TPCQA")); }
180 if (!list) { list = dynamic_cast<TList*>(f->Get("TPC_PerformanceQA/TPCQA")); }
181 if (!list) { list = dynamic_cast<TList*>(f->Get("TPC_PerformanceQA")); }
183 printf("QA %s not available\n", infile);
186 AliPerformanceTPC* pTPC = 0;
187 AliPerformanceDEdx* pTPCgain = 0;
188 AliPerformanceMatch* pTPCmatch = 0;
189 if (list) { pTPC = dynamic_cast<AliPerformanceTPC*>(list->FindObject("AliPerformanceTPC")); }
190 if (list) { pTPCgain = dynamic_cast<AliPerformanceDEdx*>(list->FindObject("AliPerformanceDEdxTPCInner")); }
191 if (list) { pTPCmatch = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchTPCITS")); }
193 Int_t returncode = 0;
194 WriteToFile(pTPC, pTPCgain, pTPCmatch ,outfile, run);
195 if (f) { delete f; f=0; }
199 //_____________________________________________________________________________
200 Int_t AliTPCPerformanceSummary::ProduceTrends(const Char_t* infilelist, const Char_t* outfile)
203 // Produces trend graphs.
205 // Input: infilelist is a textfile with one rootfile per line.
206 // There should be one rootfile for each run, the rootfile must
207 // contain the output of the MakeReport function
208 // Output: the information for all runs is merged into a TTree
209 // that is saved in outfile along with the trend graphs.
210 // Trend graphs are stored as TCanvas objects to include axis labels etc.
213 if (!infilelist) return -1;
214 if (!outfile) return -1;
216 TChain* chain = new TChain("tpcQA");
217 if(!chain) return -1;
226 if (!currentFile.Contains("root")) continue; // protection
227 chain->Add(currentFile.Data());
230 //TTree *tree = chain;
231 TTree *tree = chain->CopyTree("1");
233 if (chain) { delete chain; chain=0; }
234 //TGraph* graph = dynamic_cast<TGraph*>(tree->DrawClone("run:run"));
235 //TGraph *graph = (TGraph*)gPad->GetPrimitive("Graph");
237 TFile* out = new TFile(outfile,"RECREATE");
241 const Char_t* condition = "meanTPCncl>0";
242 SaveGraph(tree,"meanTPCnclF","run",condition);
243 SaveGraph(tree,"rmsTPCnclF","run",condition);
244 SaveGraph(tree,"meanTPCChi2","run",condition);
245 SaveGraph(tree,"rmsTPCChi2","run",condition);
246 SaveGraph(tree,"slopeATPCnclF","run",condition);
247 SaveGraph(tree,"slopeCTPCnclF","run",condition);
248 SaveGraph(tree,"slopeATPCnclFErr","run",condition);
249 SaveGraph(tree,"slopeCTPCnclFErr","run",condition);
250 SaveGraph(tree,"meanTPCncl","run",condition);
251 SaveGraph(tree,"rmsTPCncl","run",condition);
252 SaveGraph(tree,"slopeATPCncl","run",condition);
253 SaveGraph(tree,"slopeCTPCncl","run",condition);
254 SaveGraph(tree,"slopeATPCnclErr","run",condition);
255 SaveGraph(tree,"slopeCTPCnclErr","run",condition);
257 SaveGraph(tree,"offsetdRA","run",condition);
258 SaveGraph(tree,"slopedRA","run",condition);
259 SaveGraph(tree,"offsetdRC","run",condition);
260 SaveGraph(tree,"slopedRC","run",condition);
261 SaveGraph(tree,"offsetdRAErr","run",condition);
262 SaveGraph(tree,"slopedRAErr","run",condition);
263 SaveGraph(tree,"offsetdRCErr","run",condition);
264 SaveGraph(tree,"slopedRCErr","run",condition);
265 SaveGraph(tree,"offsetdRAchi2","run",condition);
266 SaveGraph(tree,"slopedRAchi2","run",condition);
267 SaveGraph(tree,"offsetdRCchi2","run",condition);
268 SaveGraph(tree,"slopedRCchi2","run",condition);
270 SaveGraph(tree,"offsetdRAPos","run",condition);
272 SaveGraph(tree,"slopedRAPos","run",condition);
273 SaveGraph(tree,"offsetdRCPos","run",condition);
274 SaveGraph(tree,"slopedRCPos","run",condition);
275 SaveGraph(tree,"offsetdRAErrPos","run",condition);
276 SaveGraph(tree,"slopedRAErrPos","run",condition);
277 SaveGraph(tree,"offsetdRCErrPos","run",condition);
278 SaveGraph(tree,"slopedRCErrPos","run",condition);
279 SaveGraph(tree,"offsetdRAchi2Pos","run",condition);
280 SaveGraph(tree,"slopedRAchi2Pos","run",condition);
281 SaveGraph(tree,"offsetdRCchi2Pos","run",condition);
282 SaveGraph(tree,"slopedRCchi2Pos","run",condition);
284 SaveGraph(tree,"offsetdRANeg","run",condition);
285 SaveGraph(tree,"slopedRANeg","run",condition);
286 SaveGraph(tree,"offsetdRCNeg","run",condition);
287 SaveGraph(tree,"slopedRCNeg","run",condition);
288 SaveGraph(tree,"offsetdRAErrNeg","run",condition);
289 SaveGraph(tree,"slopedRAErrNeg","run",condition);
290 SaveGraph(tree,"offsetdRCErrNeg","run",condition);
291 SaveGraph(tree,"slopedRCErrNeg","run",condition);
292 SaveGraph(tree,"offsetdRAchi2Neg","run",condition);
293 SaveGraph(tree,"slopedRAchi2Neg","run",condition);
294 SaveGraph(tree,"offsetdRCchi2Neg","run",condition);
295 SaveGraph(tree,"slopedRCchi2Neg","run",condition);
297 SaveGraph(tree,"offsetdZAPos","run",condition);
298 SaveGraph(tree,"slopedZAPos","run",condition);
299 SaveGraph(tree,"offsetdZCPos","run",condition);
300 SaveGraph(tree,"slopedZCPos","run",condition);
301 SaveGraph(tree,"offsetdZAErrPos","run",condition);
302 SaveGraph(tree,"slopedZAErrPos","run",condition);
303 SaveGraph(tree,"offsetdZCErrPos","run",condition);
304 SaveGraph(tree,"slopedZCErrPos","run",condition);
305 SaveGraph(tree,"offsetdZAchi2Pos","run",condition);
306 SaveGraph(tree,"slopedZAchi2Pos","run",condition);
307 SaveGraph(tree,"offsetdZCchi2Pos","run",condition);
308 SaveGraph(tree,"slopedZCchi2Pos","run",condition);
310 SaveGraph(tree,"offsetdZANeg","run",condition);
311 SaveGraph(tree,"slopedZANeg","run",condition);
312 SaveGraph(tree,"offsetdZCNeg","run",condition);
313 SaveGraph(tree,"slopedZCNeg","run",condition);
314 SaveGraph(tree,"offsetdZAErrNeg","run",condition);
315 SaveGraph(tree,"slopedZAErrNeg","run",condition);
316 SaveGraph(tree,"offsetdZCErrNeg","run",condition);
317 SaveGraph(tree,"slopedZCErrNeg","run",condition);
318 SaveGraph(tree,"offsetdZAchi2Neg","run",condition);
319 SaveGraph(tree,"slopedZAchi2Neg","run",condition);
320 SaveGraph(tree,"offsetdZCchi2Neg","run",condition);
321 SaveGraph(tree,"slopedZCchi2Neg","run",condition);
323 SaveGraph(tree,"offsetdZA","run",condition);
324 SaveGraph(tree,"slopedZA","run",condition);
325 SaveGraph(tree,"offsetdZC","run",condition);
326 SaveGraph(tree,"slopedZC","run",condition);
327 SaveGraph(tree,"offsetdZAErr","run",condition);
328 SaveGraph(tree,"slopedZAErr","run",condition);
329 SaveGraph(tree,"offsetdZCErr","run",condition);
330 SaveGraph(tree,"slopedZCErr","run",condition);
331 SaveGraph(tree,"offsetdZAchi2","run",condition);
332 SaveGraph(tree,"slopedZAchi2","run",condition);
333 SaveGraph(tree,"offsetdZCchi2","run",condition);
334 SaveGraph(tree,"slopedZCchi2","run",condition);
336 SaveGraph(tree,"meanVertX","run",condition);
337 SaveGraph(tree,"rmsVertX","run",condition);
338 SaveGraph(tree,"meanVertY","run",condition);
339 SaveGraph(tree,"rmsVertY","run",condition);
340 SaveGraph(tree,"meanVertZ","run",condition);
341 SaveGraph(tree,"rmsVertZ","run",condition);
342 SaveGraph(tree,"vertStatus","run",condition);
343 SaveGraph(tree,"meanMult","run",condition);
344 SaveGraph(tree,"rmsMult","run",condition);
345 SaveGraph(tree,"meanMultPos","run",condition);
346 SaveGraph(tree,"rmsMultPos","run",condition);
347 SaveGraph(tree,"meanMultNeg","run",condition);
348 SaveGraph(tree,"rmsMultNeg","run",condition);
349 SaveGraph(tree,"vertAll","run",condition);
350 SaveGraph(tree,"vertOK","run",condition);
353 SaveGraph(tree,"meanPtAPos","run",condition);
354 SaveGraph(tree,"mediumPtAPos","run",condition);
355 SaveGraph(tree,"highPtAPos","run",condition);
356 SaveGraph(tree,"meanPtCPos","run",condition);
357 SaveGraph(tree,"mediumPtCPos","run",condition);
358 SaveGraph(tree,"highPtCPos","run",condition);
359 SaveGraph(tree,"meanPtANeg","run",condition);
360 SaveGraph(tree,"mediumPtANeg","run",condition);
361 SaveGraph(tree,"highPtANeg","run",condition);
362 SaveGraph(tree,"meanPtCNeg","run",condition);
363 SaveGraph(tree,"mediumPtCNeg","run",condition);
364 SaveGraph(tree,"highPtCNeg","run",condition);
366 SaveGraph(tree,"qOverPt","run",condition);
367 SaveGraph(tree,"qOverPtA","run",condition);
368 SaveGraph(tree,"qOverPtC","run",condition);
373 if (tree) { delete tree; tree=0; }
374 if (out) { delete out; out=0; }
378 //_____________________________________________________________________________
379 Int_t AliTPCPerformanceSummary::SaveGraph(TTree* tree, const Char_t* y, const Char_t* x, const Char_t* condition)
382 // Creates a Graph and writes the canvas to the current directory
383 // called by ProduceTrends function.
389 tree->Draw(s.Data(),condition,"goff");
390 TCanvas* c = new TCanvas(s.Data(),s.Data());
392 TPad* p = new TPad("pad0","pad0",0,0,1,1);
395 if (tree->GetSelectedRows() > 0) {
396 TGraph* graph = new TGraph(tree->GetSelectedRows(), tree->GetV2(), tree->GetV1());
398 graph->GetXaxis()->SetTitle(x);
399 graph->GetYaxis()->SetTitle(y);
403 //graph->Write(s.Data());
409 //_____________________________________________________________________________
410 Int_t AliTPCPerformanceSummary::AnalyzeDCARPhi(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
413 // Analyse DCA R imperfections
416 if (!pcstream) return 8;
420 static Double_t offsetdRA=0;
421 static Double_t slopedRA=0;
422 static Double_t offsetdRC=0;
423 static Double_t slopedRC=0;
424 static Double_t offsetdRAErr=0;
425 static Double_t slopedRAErr=0;
426 static Double_t offsetdRCErr=0;
427 static Double_t slopedRCErr=0;
428 static Double_t offsetdRAchi2=0;
429 static Double_t slopedRAchi2=0;
430 static Double_t offsetdRCchi2=0;
431 static Double_t slopedRCchi2=0;
433 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
439 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7")) {
440 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7"));
442 his3D->GetYaxis()->SetRangeUser(-1,1);
443 his3D->GetZaxis()->SetRangeUser(0.25,10);
446 static TF1 *fpol1 = new TF1("fpol1","pol1");
448 if (his3D && !fgForceTHnSparse) {
449 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
451 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
456 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
458 his1D = (TH1*) arrayFit.At(1);
459 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
460 offsetdRC=fpol1->GetParameter(0);
461 slopedRC=fpol1->GetParameter(1);
462 offsetdRCchi2=fpol1->GetChisquare();
463 slopedRCchi2=fpol1->GetChisquare();
465 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
466 offsetdRA=fpol1->GetParameter(0);
467 slopedRA=fpol1->GetParameter(1);
468 offsetdRAErr=fpol1->GetParError(0);
469 slopedRAErr=fpol1->GetParError(1);
470 offsetdRAchi2=fpol1->GetChisquare();
471 slopedRAchi2=fpol1->GetChisquare();
473 printf("DCA R QA report\n");
474 printf("offsetdRA\t%f\n",offsetdRA);
475 printf("slopedRA\t%f\n",slopedRA);
476 printf("offsetdRC\t%f\n",offsetdRC);
477 printf("slopedRC\t%f\n",slopedRC);
481 (*pcstream)<<"tpcQA"<<
482 "offsetdRA="<< offsetdRA<<
483 "slopedRA="<< slopedRA<<
484 "offsetdRC="<< offsetdRC<<
485 "slopedRC="<<slopedRC<<
487 "offsetdRAErr="<< offsetdRAErr<<
488 "slopedRAErr="<< slopedRAErr<<
489 "offsetdRCErr="<< offsetdRCErr<<
490 "slopedRCErr="<<slopedRCErr<<
492 "offsetdRAchi2="<< offsetdRAchi2<<
493 "slopedRAchi2="<< slopedRAchi2<<
494 "offsetdRCchi2="<< offsetdRCchi2<<
495 "slopedRCchi2="<<slopedRCchi2;
500 //_____________________________________________________________________________
501 Int_t AliTPCPerformanceSummary::AnalyzeDCARPhiPos(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
504 // Analyse DCA R imperfections for positive particles
507 if (!pcstream) return 16;
508 if (!pTPC) return 16;
511 static Double_t offsetdRAPos=0;
512 static Double_t slopedRAPos=0;
513 static Double_t offsetdRCPos=0;
514 static Double_t slopedRCPos=0;
515 static Double_t offsetdRAErrPos=0;
516 static Double_t slopedRAErrPos=0;
517 static Double_t offsetdRCErrPos=0;
518 static Double_t slopedRCErrPos=0;
519 static Double_t offsetdRAchi2Pos=0;
520 static Double_t slopedRAchi2Pos=0;
521 static Double_t offsetdRCchi2Pos=0;
522 static Double_t slopedRCchi2Pos=0;
524 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
529 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
530 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
531 if(!his3D) return 16;
532 his3D->GetYaxis()->SetRangeUser(-1,1);
533 his3D->GetZaxis()->SetRangeUser(0.25,10);
536 static TF1 *fpol1 = new TF1("fpol1","pol1");
538 if (his3D && !fgForceTHnSparse) {
539 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
541 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(0,1.5);
542 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
543 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
545 if(!his2D) return 16;
547 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
549 his1D = (TH1*) arrayFit.At(1);
550 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
551 offsetdRCPos=fpol1->GetParameter(0);
552 slopedRCPos=fpol1->GetParameter(1);
553 offsetdRCchi2Pos=fpol1->GetChisquare();
554 slopedRCchi2Pos=fpol1->GetChisquare();
556 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
557 offsetdRAPos=fpol1->GetParameter(0);
558 slopedRAPos=fpol1->GetParameter(1);
559 offsetdRAErrPos=fpol1->GetParError(0);
560 slopedRAErrPos=fpol1->GetParError(1);
561 offsetdRAchi2Pos=fpol1->GetChisquare();
562 slopedRAchi2Pos=fpol1->GetChisquare();
564 printf("DCA R QA Pos report\n");
565 printf("offsetdRAPos\t%f\n",offsetdRAPos);
566 printf("slopedRAPos\t%f\n",slopedRAPos);
567 printf("offsetdRCPos\t%f\n",offsetdRCPos);
568 printf("slopedRCPos\t%f\n",slopedRCPos);
572 (*pcstream)<<"tpcQA"<<
573 "offsetdRAPos="<< offsetdRAPos<<
574 "slopedRAPos="<< slopedRAPos<<
575 "offsetdRCPos="<< offsetdRCPos<<
576 "slopedRCPos="<<slopedRCPos<<
578 "offsetdRAErrPos="<< offsetdRAErrPos<<
579 "slopedRAErrPos="<< slopedRAErrPos<<
580 "offsetdRCErrPos="<< offsetdRCErrPos<<
581 "slopedRCErrPos="<<slopedRCErrPos<<
583 "offsetdRAchi2Pos="<< offsetdRAchi2Pos<<
584 "slopedRAchi2Pos="<< slopedRAchi2Pos<<
585 "offsetdRCchi2Pos="<< offsetdRCchi2Pos<<
586 "slopedRCchi2Pos="<<slopedRCchi2Pos;
591 //_____________________________________________________________________________
592 Int_t AliTPCPerformanceSummary::AnalyzeDCARPhiNeg(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
595 // Analyse DCA R imperfections for negative particles
597 if (!pcstream) return 32;
598 if (!pTPC) return 32;
601 static Double_t offsetdRANeg=0;
602 static Double_t slopedRANeg=0;
603 static Double_t offsetdRCNeg=0;
604 static Double_t slopedRCNeg=0;
605 static Double_t offsetdRAErrNeg=0;
606 static Double_t slopedRAErrNeg=0;
607 static Double_t offsetdRCErrNeg=0;
608 static Double_t slopedRCErrNeg=0;
609 static Double_t offsetdRAchi2Neg=0;
610 static Double_t slopedRAchi2Neg=0;
611 static Double_t offsetdRCchi2Neg=0;
612 static Double_t slopedRCchi2Neg=0;
614 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
619 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
620 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
621 if(!his3D) return 32;
622 his3D->GetYaxis()->SetRangeUser(-1,1);
623 his3D->GetZaxis()->SetRangeUser(0.25,10);
626 static TF1 *fpol1 = new TF1("fpol1","pol1");
628 if (his3D && !fgForceTHnSparse) {
629 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
631 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,0);
632 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
633 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
635 if(!his2D) return 32;
637 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
639 his1D = (TH1*) arrayFit.At(1);
640 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
641 offsetdRCNeg=fpol1->GetParameter(0);
642 slopedRCNeg=fpol1->GetParameter(1);
643 offsetdRCchi2Neg=fpol1->GetChisquare();
644 slopedRCchi2Neg=fpol1->GetChisquare();
646 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
647 offsetdRANeg=fpol1->GetParameter(0);
648 slopedRANeg=fpol1->GetParameter(1);
649 offsetdRAErrNeg=fpol1->GetParError(0);
650 slopedRAErrNeg=fpol1->GetParError(1);
651 offsetdRAchi2Neg=fpol1->GetChisquare();
652 slopedRAchi2Neg=fpol1->GetChisquare();
654 printf("DCA R QA Neg report\n");
655 printf("offsetdRANeg\t%f\n",offsetdRANeg);
656 printf("slopedRANeg\t%f\n",slopedRANeg);
657 printf("offsetdRCNeg\t%f\n",offsetdRCNeg);
658 printf("slopedRCNeg\t%f\n",slopedRCNeg);
660 // dump drift QA values
662 (*pcstream)<<"tpcQA"<<
663 "offsetdRANeg="<< offsetdRANeg<<
664 "slopedRANeg="<< slopedRANeg<<
665 "offsetdRCNeg="<< offsetdRCNeg<<
666 "slopedRCNeg="<<slopedRCNeg<<
668 "offsetdRAErrNeg="<< offsetdRAErrNeg<<
669 "slopedRAErrNeg="<< slopedRAErrNeg<<
670 "offsetdRCErrNeg="<< offsetdRCErrNeg<<
671 "slopedRCErrNeg="<<slopedRCErrNeg<<
673 "offsetdRAchi2Neg="<< offsetdRAchi2Neg<<
674 "slopedRAchi2Neg="<< slopedRAchi2Neg<<
675 "offsetdRCchi2Neg="<< offsetdRCchi2Neg<<
676 "slopedRCchi2Neg="<<slopedRCchi2Neg;
681 //_____________________________________________________________________________
682 Int_t AliTPCPerformanceSummary::AnalyzeNCL(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
685 // Analyse number of TPC clusters
688 if (!pcstream) return 1;
692 static Double_t meanTPCnclF=0;
693 static Double_t rmsTPCnclF=0;
694 static Double_t meanTPCChi2=0;
695 static Double_t rmsTPCChi2=0;
696 static Double_t slopeATPCnclF=0;
697 static Double_t slopeCTPCnclF=0;
698 static Double_t slopeATPCnclFErr=0;
699 static Double_t slopeCTPCnclFErr=0;
700 static Double_t meanTPCncl=0;
701 static Double_t rmsTPCncl=0;
702 static Double_t slopeATPCncl=0;
703 static Double_t slopeCTPCncl=0;
704 static Double_t slopeATPCnclErr=0;
705 static Double_t slopeCTPCnclErr=0;
712 static TF1 *fpol1 = new TF1("fpol1","pol1");
715 // only events with rec. vertex
717 // pt cut - 0.250 GeV
718 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-1.,1.);
719 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0.25,10);
721 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7")) {
722 his3D0 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7"));
723 if(!his3D0) return 1;
724 his3D0->GetYaxis()->SetRangeUser(-1,1);
725 his3D0->GetZaxis()->SetRangeUser(0.25,10);
727 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7")) {
728 his3D1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7"));
729 if(!his3D1) return 1;
730 his3D1->GetYaxis()->SetRangeUser(-1,1);
731 his3D1->GetZaxis()->SetRangeUser(0.25,10);
733 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7")) {
734 his3D2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7"));
735 if(!his3D2) return 1;
736 his3D2->GetYaxis()->SetRangeUser(-1,1);
737 his3D2->GetZaxis()->SetRangeUser(0.25,10);
738 his3D2->GetXaxis()->SetRangeUser(0.4,1.1);
742 if (his3D0 && !fgForceTHnSparse) {
743 his1D = his3D0->Project3D("x");
745 his1D = pTPC->GetTPCTrackHisto()->Projection(0);
748 meanTPCncl= his1D->GetMean();
749 rmsTPCncl= his1D->GetRMS();
752 if (his3D1 && !fgForceTHnSparse) {
753 his1D = his3D1->Project3D("x");
755 his1D = pTPC->GetTPCTrackHisto()->Projection(1);
758 meanTPCChi2= his1D->GetMean();
759 rmsTPCChi2= his1D->GetRMS();
762 if (his3D0 && !fgForceTHnSparse) {
763 hprof = (dynamic_cast<TH2*>(his3D0->Project3D("xy")))->ProfileX();
765 hprof = pTPC->GetTPCTrackHisto()->Projection(0,5)->ProfileX();
769 hprof->Fit(fpol1,"QNR","QNR",0.1,0.8);
770 slopeATPCncl= fpol1->GetParameter(1);
771 slopeATPCnclErr= fpol1->GetParError(1);
772 hprof->Fit(fpol1,"QNR","QNR",-0.8,-0.1);
773 slopeCTPCncl= fpol1->GetParameter(1);
774 slopeCTPCnclErr= fpol1->GetParameter(1);
781 if (his3D2 && !fgForceTHnSparse) {
782 his1D = his3D2->Project3D("x");
784 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0.4,1.1);
785 his1D = pTPC->GetTPCTrackHisto()->Projection(2);
788 meanTPCnclF= his1D->GetMean();
789 rmsTPCnclF= his1D->GetRMS();
792 if (his3D2 && !fgForceTHnSparse) {
793 his1D = (dynamic_cast<TH2*>(his3D2->Project3D("xy")))->ProfileX();
795 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0.4,1.1);
796 his1D = pTPC->GetTPCTrackHisto()->Projection(2,5)->ProfileX();
800 his1D->Fit(fpol1,"QNR","QNR",0.1,0.8);
801 slopeATPCnclF= fpol1->GetParameter(1);
802 slopeATPCnclFErr= fpol1->GetParError(1);
803 his1D->Fit(fpol1,"QNR","QNR",-0.8,-0.1);
804 slopeCTPCnclF= fpol1->GetParameter(1);
805 slopeCTPCnclFErr= fpol1->GetParameter(1);
808 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0,10);
810 printf("Cluster QA report\n");
811 printf("meanTPCnclF=\t%f\n",meanTPCnclF);
812 printf("rmsTPCnclF=\t%f\n",rmsTPCnclF);
813 printf("slopeATPCnclF=\t%f\n",slopeATPCnclF);
814 printf("slopeCTPCnclF=\t%f\n",slopeCTPCnclF);
815 printf("meanTPCncl=\t%f\n",meanTPCncl);
816 printf("rmsTPCncl=\t%f\n",rmsTPCncl);
817 printf("slopeATPCncl=\t%f\n",slopeATPCncl);
818 printf("slopeCTPCncl=\t%f\n",slopeCTPCncl);
819 printf("meanTPCChi2=\t%f\n",meanTPCChi2);
820 printf("rmsTPCChi2=\t%f\n",rmsTPCChi2);
822 // dump results to the tree
824 (*pcstream)<<"tpcQA"<<
825 "meanTPCnclF="<<meanTPCnclF <<
826 "rmsTPCnclF="<<rmsTPCnclF <<
827 "meanTPCChi2="<<meanTPCChi2 <<
828 "rmsTPCChi2="<<rmsTPCChi2 <<
829 "slopeATPCnclF="<< slopeATPCnclF<<
830 "slopeCTPCnclF="<< slopeCTPCnclF<<
831 "slopeATPCnclFErr="<< slopeATPCnclFErr<<
832 "slopeCTPCnclFErr="<< slopeCTPCnclFErr<<
833 "meanTPCncl="<<meanTPCncl <<
834 "rmsTPCncl="<< rmsTPCncl<<
835 "slopeATPCncl="<< slopeATPCncl<<
836 "slopeCTPCncl="<< slopeCTPCncl<<
837 "slopeATPCnclErr="<< slopeATPCnclErr<<
838 "slopeCTPCnclErr="<< slopeCTPCnclErr;
843 //_____________________________________________________________________________
844 Int_t AliTPCPerformanceSummary::AnalyzeDrift(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
847 // Analyse DCA Z imperferctions (drift velocity)
850 if (!pcstream) return 2;
854 static Double_t offsetdZA=0;
855 static Double_t slopedZA=0;
856 static Double_t offsetdZC=0;
857 static Double_t slopedZC=0;
858 static Double_t offsetdZAErr=0;
859 static Double_t slopedZAErr=0;
860 static Double_t offsetdZCErr=0;
861 static Double_t slopedZCErr=0;
862 static Double_t offsetdZAchi2=0;
863 static Double_t slopedZAchi2=0;
864 static Double_t offsetdZCchi2=0;
865 static Double_t slopedZCchi2=0;
870 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7")) {
871 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7"));
873 his3D->GetYaxis()->SetRangeUser(-1,1);
874 his3D->GetZaxis()->SetRangeUser(0.25,10);
877 if (his3D && !fgForceTHnSparse) {
878 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
880 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
884 static TF1 *fpol1 = new TF1("fpol1","pol1");
886 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
888 his1D = (TH1*) arrayFit.At(1);
889 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
890 offsetdZC=fpol1->GetParameter(0);
891 slopedZC=fpol1->GetParameter(1);
892 offsetdZCErr=fpol1->GetParError(0);
893 slopedZCErr=fpol1->GetParError(1);
894 offsetdZCchi2=fpol1->GetChisquare();
895 slopedZCchi2=fpol1->GetChisquare();
897 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
898 offsetdZA=fpol1->GetParameter(0);
899 slopedZA=fpol1->GetParameter(1);
900 offsetdZAErr=fpol1->GetParError(0);
901 slopedZAErr=fpol1->GetParError(1);
902 offsetdZAchi2=fpol1->GetChisquare();
903 slopedZAchi2=fpol1->GetChisquare();
905 printf("Drift velocity QA report\n");
906 printf("offsetdZA\t%f\n",offsetdZA);
907 printf("slopedZA\t%f\n",slopedZA);
908 printf("offsetdZC\t%f\n",offsetdZC);
909 printf("slopedZC\t%f\n",slopedZC);
911 // dump drift QA values
913 (*pcstream)<<"tpcQA"<<
914 "offsetdZA="<< offsetdZA<<
915 "slopedZA="<< slopedZA<<
916 "offsetdZC="<< offsetdZC<<
917 "slopedZC="<<slopedZC<<
919 "offsetdZAErr="<< offsetdZAErr<<
920 "slopedZAErr="<< slopedZAErr<<
921 "offsetdZCErr="<< offsetdZCErr<<
922 "slopedZCErr="<<slopedZCErr<<
924 "offsetdZAchi2="<< offsetdZAchi2<<
925 "slopedZAchi2="<< slopedZAchi2<<
926 "offsetdZCchi2="<< offsetdZCchi2<<
927 "slopedZCchi2="<<slopedZCchi2;
932 //_____________________________________________________________________________
933 Int_t AliTPCPerformanceSummary::AnalyzeDriftPos(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
936 // Analyse DCA Z imperferctions (drift velocity)
937 // for positive particles
939 if (!pcstream) return 64;
940 if (!pTPC) return 64;
943 static Double_t offsetdZAPos=0;
944 static Double_t slopedZAPos=0;
945 static Double_t offsetdZCPos=0;
946 static Double_t slopedZCPos=0;
947 static Double_t offsetdZAErrPos=0;
948 static Double_t slopedZAErrPos=0;
949 static Double_t offsetdZCErrPos=0;
950 static Double_t slopedZCErrPos=0;
951 static Double_t offsetdZAchi2Pos=0;
952 static Double_t slopedZAchi2Pos=0;
953 static Double_t offsetdZCchi2Pos=0;
954 static Double_t slopedZCchi2Pos=0;
959 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7")) {
960 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7"));
961 if(!his3D) return 64;
962 his3D->GetYaxis()->SetRangeUser(-1,1);
963 his3D->GetZaxis()->SetRangeUser(0.25,10);
966 if (his3D && !fgForceTHnSparse) {
967 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
969 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
971 if(!his2D) return 64;
973 static TF1 *fpol1 = new TF1("fpol1","pol1");
975 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
978 his1D = (TH1*) arrayFit.At(1);
979 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
980 offsetdZCPos=fpol1->GetParameter(0);
981 slopedZCPos=fpol1->GetParameter(1);
982 offsetdZCErrPos=fpol1->GetParError(0);
983 slopedZCErrPos=fpol1->GetParError(1);
984 offsetdZCchi2Pos=fpol1->GetChisquare();
985 slopedZCchi2Pos=fpol1->GetChisquare();
987 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
988 offsetdZAPos=fpol1->GetParameter(0);
989 slopedZAPos=fpol1->GetParameter(1);
990 offsetdZAErrPos=fpol1->GetParError(0);
991 slopedZAErrPos=fpol1->GetParError(1);
992 offsetdZAchi2Pos=fpol1->GetChisquare();
993 slopedZAchi2Pos=fpol1->GetChisquare();
995 printf("Drift velocity QA report\n");
996 printf("offsetdZAPos\t%f\n",offsetdZAPos);
997 printf("slopedZAPos\t%f\n",slopedZAPos);
998 printf("offsetdZCPos\t%f\n",offsetdZCPos);
999 printf("slopedZCPos\t%f\n",slopedZCPos);
1001 // dump drift QA values
1003 (*pcstream)<<"tpcQA"<<
1004 "offsetdZAPos="<< offsetdZAPos<<
1005 "slopedZAPos="<< slopedZAPos<<
1006 "offsetdZCPos="<< offsetdZCPos<<
1007 "slopedZCPos="<<slopedZCPos<<
1009 "offsetdZAErrPos="<< offsetdZAErrPos<<
1010 "slopedZAErrPos="<< slopedZAErrPos<<
1011 "offsetdZCErrPos="<< offsetdZCErrPos<<
1012 "slopedZCErrPos="<<slopedZCErrPos<<
1014 "offsetdZAchi2Pos="<< offsetdZAchi2Pos<<
1015 "slopedZAchi2Pos="<< slopedZAchi2Pos<<
1016 "offsetdZCchi2Pos="<< offsetdZCchi2Pos<<
1017 "slopedZCchi2Pos="<<slopedZCchi2Pos;
1022 //_____________________________________________________________________________
1023 Int_t AliTPCPerformanceSummary::AnalyzeDriftNeg(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
1026 // Analyse DCA Z imperferctions (drift velocity)
1027 // for negative particles
1029 if (!pcstream) return 128;
1030 if (!pTPC) return 128;
1033 static Double_t offsetdZANeg=0;
1034 static Double_t slopedZANeg=0;
1035 static Double_t offsetdZCNeg=0;
1036 static Double_t slopedZCNeg=0;
1037 static Double_t offsetdZAErrNeg=0;
1038 static Double_t slopedZAErrNeg=0;
1039 static Double_t offsetdZCErrNeg=0;
1040 static Double_t slopedZCErrNeg=0;
1041 static Double_t offsetdZAchi2Neg=0;
1042 static Double_t slopedZAchi2Neg=0;
1043 static Double_t offsetdZCchi2Neg=0;
1044 static Double_t slopedZCchi2Neg=0;
1050 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7")) {
1051 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7"));
1052 if(!his3D) return 128;
1053 his3D->GetYaxis()->SetRangeUser(-1,1);
1054 his3D->GetZaxis()->SetRangeUser(0.25,10);
1056 if (his3D && !fgForceTHnSparse) {
1057 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
1059 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
1061 if(!his2D) return 128;
1063 static TF1 *fpol1 = new TF1("fpol1","pol1");
1065 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
1068 his1D = (TH1*) arrayFit.At(1);
1069 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
1070 offsetdZCNeg=fpol1->GetParameter(0);
1071 slopedZCNeg=fpol1->GetParameter(1);
1072 offsetdZCErrNeg=fpol1->GetParError(0);
1073 slopedZCErrNeg=fpol1->GetParError(1);
1074 offsetdZCchi2Neg=fpol1->GetChisquare();
1075 slopedZCchi2Neg=fpol1->GetChisquare();
1077 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
1078 offsetdZANeg=fpol1->GetParameter(0);
1079 slopedZANeg=fpol1->GetParameter(1);
1080 offsetdZAErrNeg=fpol1->GetParError(0);
1081 slopedZAErrNeg=fpol1->GetParError(1);
1082 offsetdZAchi2Neg=fpol1->GetChisquare();
1083 slopedZAchi2Neg=fpol1->GetChisquare();
1085 printf("Drift velocity QA report\n");
1086 printf("offsetdZANeg\t%f\n",offsetdZANeg);
1087 printf("slopedZANeg\t%f\n",slopedZANeg);
1088 printf("offsetdZCNeg\t%f\n",offsetdZCNeg);
1089 printf("slopedZCNeg\t%f\n",slopedZCNeg);
1091 // dump drift QA values
1093 (*pcstream)<<"tpcQA"<<
1094 "offsetdZANeg="<< offsetdZANeg<<
1095 "slopedZANeg="<< slopedZANeg<<
1096 "offsetdZCNeg="<< offsetdZCNeg<<
1097 "slopedZCNeg="<<slopedZCNeg<<
1099 "offsetdZAErrNeg="<< offsetdZAErrNeg<<
1100 "slopedZAErrNeg="<< slopedZAErrNeg<<
1101 "offsetdZCErrNeg="<< offsetdZCErrNeg<<
1102 "slopedZCErrNeg="<<slopedZCErrNeg<<
1104 "offsetdZAchi2Neg="<< offsetdZAchi2Neg<<
1105 "slopedZAchi2Neg="<< slopedZAchi2Neg<<
1106 "offsetdZCchi2Neg="<< offsetdZCchi2Neg<<
1107 "slopedZCchi2Neg="<<slopedZCchi2Neg;
1112 //_____________________________________________________________________________
1113 Int_t AliTPCPerformanceSummary::AnalyzeGain(const AliPerformanceDEdx* pTPCgain, TTreeSRedirector* const pcstream)
1119 if (!pcstream) return 4;
1120 if (!pTPCgain) return 4;
1122 static TVectorD meanMIPvsSector(36);
1123 static TVectorD sector(36);
1124 static Float_t meanMIP = 0;
1125 static Float_t resolutionMIP = 0;
1126 static Float_t attachSlopeC = 0;
1127 static Float_t attachSlopeA = 0;
1130 //TH1 * hisProj1D=0;
1134 meanMIPvsSector.Zero();
1136 // select MIP particles
1138 pTPCgain->GetDeDxHisto()->GetAxis(7)->SetRangeUser(0.4,0.55);
1139 pTPCgain->GetDeDxHisto()->GetAxis(0)->SetRangeUser(35,60);
1140 pTPCgain->GetDeDxHisto()->GetAxis(6)->SetRangeUser(80,160);
1141 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-1,1);
1143 // MIP position and resolution
1145 TF1 gausFit("gausFit","gaus");
1147 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_0") && !fgForceTHnSparse) {
1148 his1D = dynamic_cast<TH1*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_0")->Clone());
1150 his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1152 if(!his1D) return 4;
1153 his1D->Fit(&gausFit,"QN","QN");
1155 meanMIP = gausFit.GetParameter(1);
1157 if (meanMIP!=0) resolutionMIP = gausFit.GetParameter(2)/meanMIP;
1158 //removedtotest// delete his1D;
1160 // MIP position vs. dip angle (attachment)
1162 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-3,0); // C side
1163 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_5") && !fgForceTHnSparse) {
1164 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_5")->Clone());
1166 his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
1168 if(!his2D) return 4;
1170 TF1 * fpol = new TF1("fpol","pol1");
1172 his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
1173 his1D = (TH1*) arrayFit.At(1);
1174 his1D->Fit(fpol,"QNROB=0.8","QNR",-1,0);
1175 attachSlopeC = fpol->GetParameter(1);
1176 //removedtotest// delete his2D;
1177 //removedtotest// delete his1D;
1179 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(0,3); // A side
1180 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_5") && !fgForceTHnSparse) {
1181 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_5")->Clone());
1183 his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
1185 if(!his2D) return 4;
1187 TF1 * fpolA = new TF1("fpolA","pol1");
1188 TObjArray arrayFitA;
1189 his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
1190 his1D = (TH1*) arrayFit.At(1);
1191 his1D->Fit(fpolA,"QNROB=0.8","QN",0,1);
1192 attachSlopeA = fpolA->GetParameter(1);
1193 //removedtotest// delete his2D;
1194 //removedtotest// delete his1D;
1196 // MIP position vs. sector
1198 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-3,0); // C side
1199 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_1") && !fgForceTHnSparse) {
1200 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_1")->Clone());
1202 his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
1204 if(!his2D) return 4;
1206 for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
1208 Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
1209 Float_t phiUp = -TMath::Pi() + (i+1)*(20./360.)*(2*TMath::Pi());
1210 //pTPCgain->GetDeDxHisto()->GetAxis(1)->SetRangeUser(phiLow,phiUp);
1211 his2D->GetXaxis()->SetRangeUser(phiLow,phiUp);
1212 //his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1213 his1D = his2D->ProjectionY();
1214 TF1 gausFunc("gausFunc","gaus");
1215 his1D->Fit(&gausFunc, "QN");
1216 meanMIPvsSector(i) = gausFunc.GetParameter(1);
1218 //removedtotest// delete his1D;
1220 //removedtotest// delete his2D;
1222 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(0,3); // A side
1223 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_1") && !fgForceTHnSparse) {
1224 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_1")->Clone());
1226 his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
1228 if(!his2D) return 4;
1230 for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
1232 Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
1233 Float_t phiUp = -TMath::Pi() + (i+1)*(20./360.)*(2*TMath::Pi());
1234 //pTPCgain->GetDeDxHisto()->GetAxis(1)->SetRangeUser(phiLow,phiUp);
1235 his2D->GetXaxis()->SetRangeUser(phiLow,phiUp);
1236 //his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1237 his1D = his2D->ProjectionY();
1238 TF1 gausFunc("gausFunc","gaus");
1239 his1D->Fit(&gausFunc, "QN");
1240 meanMIPvsSector(i+18) = gausFunc.GetParameter(1);
1242 //removedtotest// delete his1D;
1244 //removedtotest// delete his2D;
1246 printf("Gain QA report\n");
1247 printf("MIP mean\t%f\n",meanMIP);
1248 printf("MIP resolution\t%f\n",resolutionMIP);
1249 printf("MIPslopeA\t%f\n",attachSlopeA);
1250 printf("MIPslopeC\t%f\n",attachSlopeC);
1253 (*pcstream)<<"tpcQA"<<
1254 "MIPattachSlopeC="<<attachSlopeC<<
1255 "MIPattachSlopeA="<<attachSlopeA<<
1256 "resolutionMIP="<<resolutionMIP<<
1257 "meanMIPvsSector.="<<&meanMIPvsSector<<
1258 "sector.="<<§or<<
1259 "meanMIP="<<meanMIP;
1264 //_____________________________________________________________________________
1265 Int_t AliTPCPerformanceSummary::AnalyzeEvent(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
1268 // Analyse Primary Vertex Distribution and Multiplicities
1270 if (!pcstream) return 1;
1271 if (!pTPC) return 1;
1275 static Double_t meanVertX=0;
1276 static Double_t rmsVertX=0;
1277 static Double_t meanVertY=0;
1278 static Double_t rmsVertY=0;
1279 static Double_t meanVertZ=0;
1280 static Double_t rmsVertZ=0;
1281 static Double_t vertStatus=0;
1282 static Double_t meanMult=0;
1283 static Double_t rmsMult=0;
1284 static Double_t meanMultPos=0;
1285 static Double_t rmsMultPos=0;
1286 static Double_t meanMultNeg=0;
1287 static Double_t rmsMultNeg=0;
1288 static Double_t vertAll = 0;
1289 static Double_t vertOK = 0;
1292 if (pTPC->GetHistos()->FindObject("h_tpc_event_6") && !fgForceTHnSparse) {
1293 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_6")->Clone());
1295 his1D = pTPC->GetTPCEventHisto()->Projection(6);
1297 if(!his1D) return 1;
1299 vertAll = his1D->GetEntries();
1300 vertOK = his1D->GetBinContent(2);
1302 vertStatus = vertOK / vertAll;
1307 pTPC->GetTPCEventHisto()->GetAxis(6)->SetRange(2,2);
1309 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_0") && !fgForceTHnSparse) {
1310 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_0")->Clone());
1312 his1D = pTPC->GetTPCEventHisto()->Projection(0);
1314 if(!his1D) return 1;
1316 meanVertX = his1D->GetMean();
1317 rmsVertX = his1D->GetRMS();
1323 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_1") && !fgForceTHnSparse) {
1324 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_1")->Clone());
1326 his1D = pTPC->GetTPCEventHisto()->Projection(1);
1328 if(!his1D) return 1;
1330 meanVertY = his1D->GetMean();
1331 rmsVertY = his1D->GetRMS();
1335 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2") && !fgForceTHnSparse) {
1336 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2")->Clone());
1338 his1D = pTPC->GetTPCEventHisto()->Projection(2);
1339 } meanVertZ = his1D->GetMean();
1340 if(!his1D) return 1;
1342 rmsVertZ = his1D->GetRMS();
1346 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3") && !fgForceTHnSparse) {
1347 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3")->Clone());
1349 his1D = pTPC->GetTPCEventHisto()->Projection(3);
1351 if(!his1D) return 1;
1353 meanMult = his1D->GetMean();
1354 rmsMult = his1D->GetRMS();
1358 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_4") && !fgForceTHnSparse) {
1359 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_4")->Clone());
1361 his1D = pTPC->GetTPCEventHisto()->Projection(4);
1363 if(!his1D) return 1;
1365 meanMultPos = his1D->GetMean();
1366 rmsMultPos = his1D->GetRMS();
1369 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_5") && !fgForceTHnSparse) {
1370 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_5")->Clone());
1372 his1D = pTPC->GetTPCEventHisto()->Projection(5);
1374 if(!his1D) return 1;
1376 meanMultNeg = his1D->GetMean();
1377 rmsMultNeg = his1D->GetRMS();
1380 pTPC->GetTPCEventHisto()->GetAxis(6)->SetRange(1,2);
1382 (*pcstream)<<"tpcQA"<<
1383 "meanVertX="<<meanVertX<<
1384 "rmsVertX="<<rmsVertX<<
1385 "meanVertY="<<meanVertY<<
1386 "rmsVertY="<<rmsVertY<<
1387 "meanVertZ="<<meanVertZ<<
1388 "rmsVertZ="<<rmsVertZ<<
1389 "vertStatus="<<vertStatus<<
1390 "vertAll="<<vertAll<<
1392 "meanMult="<<meanMult<<
1393 "rmsMult="<<rmsMult<<
1394 "meanMultPos="<<meanMultPos<<
1395 "rmsMultPos="<<rmsMultPos<<
1396 "meanMultNeg="<<meanMultNeg<<
1397 "rmsMultNeg="<<rmsMultNeg;
1402 //_____________________________________________________________________________
1403 Int_t AliTPCPerformanceSummary::AnalyzePt(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
1406 // Analyse DCA R imperfections for positive particles
1409 if (!pcstream) return 256;
1410 if (!pTPC) return 256;
1413 static Double_t meanPtAPos = 0;
1414 static Double_t mediumPtAPos = 0;
1415 static Double_t highPtAPos = 0;
1416 static Double_t meanPtCPos = 0;
1417 static Double_t mediumPtCPos = 0;
1418 static Double_t highPtCPos = 0;
1420 static Double_t meanPtANeg = 0;
1421 static Double_t mediumPtANeg = 0;
1422 static Double_t highPtANeg = 0;
1423 static Double_t meanPtCNeg = 0;
1424 static Double_t mediumPtCNeg = 0;
1425 static Double_t highPtCNeg = 0;
1430 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
1432 his3D1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
1433 if(!his3D1) return 256;
1435 his3D1->GetYaxis()->SetRangeUser(0.1,0.8);
1437 his3D1->GetZaxis()->SetRangeUser(0.25,10);
1438 meanPtAPos = his3D1->GetMean(3);
1439 his3D1->GetZaxis()->SetRangeUser(2,5);
1440 mediumPtAPos = his3D1->GetMean(3);
1441 his3D1->GetZaxis()->SetRangeUser(5,10);
1442 highPtAPos = his3D1->GetMean(3);
1444 his3D1->GetYaxis()->SetRangeUser(-0.8,-0.1);
1446 his3D1->GetZaxis()->SetRangeUser(0.25,10);
1447 meanPtCPos = his3D1->GetMean(3);
1448 his3D1->GetZaxis()->SetRangeUser(2,5);
1449 mediumPtCPos = his3D1->GetMean(3);
1450 his3D1->GetZaxis()->SetRangeUser(5,10);
1451 highPtCPos = his3D1->GetMean(3);
1453 his3D1->GetYaxis()->SetRangeUser(-1,1);
1454 his3D1->GetZaxis()->SetRangeUser(0.25,10);
1458 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
1460 his3D2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
1461 if(!his3D2) return 256;
1463 his3D2->GetYaxis()->SetRangeUser(0.1,0.8);
1465 his3D2->GetZaxis()->SetRangeUser(0.25,10);
1466 meanPtANeg = his3D2->GetMean(3);
1467 his3D2->GetZaxis()->SetRangeUser(2,5);
1468 mediumPtANeg = his3D2->GetMean(3);
1469 his3D2->GetZaxis()->SetRangeUser(5,10);
1470 highPtANeg = his3D2->GetMean(3);
1472 his3D2->GetYaxis()->SetRangeUser(-0.8,-0.1);
1474 his3D2->GetZaxis()->SetRangeUser(0.25,10);
1475 meanPtCNeg = his3D2->GetMean(3);
1476 his3D2->GetZaxis()->SetRangeUser(2,5);
1477 mediumPtCNeg = his3D2->GetMean(3);
1478 his3D2->GetZaxis()->SetRangeUser(5,10);
1479 highPtCNeg = his3D2->GetMean(3);
1481 his3D2->GetYaxis()->SetRangeUser(-1,1);
1482 his3D2->GetZaxis()->SetRangeUser(0.25,10);
1489 (*pcstream)<<"tpcQA"<<
1490 "meanPtAPos="<< meanPtAPos<<
1491 "mediumPtAPos="<< mediumPtAPos<<
1492 "highPtAPos="<< highPtAPos<<
1494 "meanPtCPos="<< meanPtCPos<<
1495 "mediumPtCPos="<< mediumPtCPos<<
1496 "highPtCPos="<< highPtCPos<<
1498 "meanPtANeg="<< meanPtANeg<<
1499 "mediumPtANeg="<< mediumPtANeg<<
1500 "highPtANeg="<< highPtANeg<<
1502 "meanPtCNeg="<< meanPtCNeg<<
1503 "mediumPtCNeg="<< mediumPtCNeg<<
1504 "highPtCNeg="<< highPtCNeg;
1510 //_____________________________________________________________________________
1512 Int_t AliTPCPerformanceSummary::AnalyzeChargeOverPt(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream){
1514 // Analyse DCA R imperfections for positive particles
1517 if (!pcstream) return 512;
1518 if (!pTPC) return 512;
1521 static Double_t qOverPt = 0;
1522 static Double_t qOverPtA = 0;
1523 static Double_t qOverPtC = 0;
1529 TF1 *fp1 = new TF1("fp1","pol2",-1.0,1.0);
1530 TF1 *fp2 = new TF1("fp2","pol2",-1.0,1.0);
1531 TF1 *fp3 = new TF1("fp3","pol2",-1.0,1.0);
1533 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8")) {
1535 his2D = dynamic_cast<TH2*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8"));
1536 if(!his2D) return 512;
1538 his1D1 = his2D->ProjectionX();
1539 his1D1->Fit(fp1,"R");
1540 if(fp1->GetParameter(2)!=0){
1541 qOverPt = (-1.0)*(fp1->GetParameter(1)/(2.0*fp1->GetParameter(2)));
1546 his2D->GetYaxis()->SetRangeUser(0.1,0.8);
1547 his1D2 = his2D->ProjectionX();
1548 his1D2->Fit(fp2,"R");
1549 if(fp2->GetParameter(2)!=0)
1550 qOverPtA = (-1.0)*(fp2->GetParameter(1)/(2.0*fp2->GetParameter(2)));
1554 his2D->GetYaxis()->SetRangeUser(-0.8,-0.1);
1555 his1D3 = his2D->ProjectionX();
1556 his1D3->Fit(fp3,"R");
1557 if(fp3->GetParameter(2)!=0)
1558 qOverPtC = (-1.0)*(fp3->GetParameter(1)/(2.0*fp3->GetParameter(2)));
1562 his2D->GetYaxis()->SetRangeUser(-1.0,1.0);
1566 (*pcstream)<<"tpcQA"<<
1567 "qOverPt="<< qOverPt<<
1568 "qOverPtA="<< qOverPtA<<
1569 "qOverPtC="<< qOverPtC;
1574 void AliTPCPerformanceSummary::AnalyzeMatch(const AliPerformanceMatch* pMatch, TTreeSRedirector* const pcstream)
1576 if ((pMatch == 0) or (0 == pcstream)) { printf("this will not work anyway..."); }
1577 printf("funtion not implemented");