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* 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");
224 if (!currentFile.Contains("root")) continue; // protection
225 chain->Add(currentFile.Data());
228 //TTree *tree = chain;
229 TTree *tree = chain->CopyTree("1");
230 if (chain) { delete chain; chain=0; }
231 //TGraph* graph = dynamic_cast<TGraph*>(tree->DrawClone("run:run"));
232 //TGraph *graph = (TGraph*)gPad->GetPrimitive("Graph");
234 TFile* out = new TFile(outfile,"RECREATE");
236 const Char_t* condition = "meanTPCncl>0";
237 SaveGraph(tree,"meanTPCnclF","run",condition);
238 SaveGraph(tree,"rmsTPCnclF","run",condition);
239 SaveGraph(tree,"meanTPCChi2","run",condition);
240 SaveGraph(tree,"rmsTPCChi2","run",condition);
241 SaveGraph(tree,"slopeATPCnclF","run",condition);
242 SaveGraph(tree,"slopeCTPCnclF","run",condition);
243 SaveGraph(tree,"slopeATPCnclFErr","run",condition);
244 SaveGraph(tree,"slopeCTPCnclFErr","run",condition);
245 SaveGraph(tree,"meanTPCncl","run",condition);
246 SaveGraph(tree,"rmsTPCncl","run",condition);
247 SaveGraph(tree,"slopeATPCncl","run",condition);
248 SaveGraph(tree,"slopeCTPCncl","run",condition);
249 SaveGraph(tree,"slopeATPCnclErr","run",condition);
250 SaveGraph(tree,"slopeCTPCnclErr","run",condition);
252 SaveGraph(tree,"offsetdRA","run",condition);
253 SaveGraph(tree,"slopedRA","run",condition);
254 SaveGraph(tree,"offsetdRC","run",condition);
255 SaveGraph(tree,"slopedRC","run",condition);
256 SaveGraph(tree,"offsetdRAErr","run",condition);
257 SaveGraph(tree,"slopedRAErr","run",condition);
258 SaveGraph(tree,"offsetdRCErr","run",condition);
259 SaveGraph(tree,"slopedRCErr","run",condition);
260 SaveGraph(tree,"offsetdRAchi2","run",condition);
261 SaveGraph(tree,"slopedRAchi2","run",condition);
262 SaveGraph(tree,"offsetdRCchi2","run",condition);
263 SaveGraph(tree,"slopedRCchi2","run",condition);
265 SaveGraph(tree,"offsetdRAPos","run",condition);
267 SaveGraph(tree,"slopedRAPos","run",condition);
268 SaveGraph(tree,"offsetdRCPos","run",condition);
269 SaveGraph(tree,"slopedRCPos","run",condition);
270 SaveGraph(tree,"offsetdRAErrPos","run",condition);
271 SaveGraph(tree,"slopedRAErrPos","run",condition);
272 SaveGraph(tree,"offsetdRCErrPos","run",condition);
273 SaveGraph(tree,"slopedRCErrPos","run",condition);
274 SaveGraph(tree,"offsetdRAchi2Pos","run",condition);
275 SaveGraph(tree,"slopedRAchi2Pos","run",condition);
276 SaveGraph(tree,"offsetdRCchi2Pos","run",condition);
277 SaveGraph(tree,"slopedRCchi2Pos","run",condition);
279 SaveGraph(tree,"offsetdRANeg","run",condition);
280 SaveGraph(tree,"slopedRANeg","run",condition);
281 SaveGraph(tree,"offsetdRCNeg","run",condition);
282 SaveGraph(tree,"slopedRCNeg","run",condition);
283 SaveGraph(tree,"offsetdRAErrNeg","run",condition);
284 SaveGraph(tree,"slopedRAErrNeg","run",condition);
285 SaveGraph(tree,"offsetdRCErrNeg","run",condition);
286 SaveGraph(tree,"slopedRCErrNeg","run",condition);
287 SaveGraph(tree,"offsetdRAchi2Neg","run",condition);
288 SaveGraph(tree,"slopedRAchi2Neg","run",condition);
289 SaveGraph(tree,"offsetdRCchi2Neg","run",condition);
290 SaveGraph(tree,"slopedRCchi2Neg","run",condition);
292 SaveGraph(tree,"offsetdZAPos","run",condition);
293 SaveGraph(tree,"slopedZAPos","run",condition);
294 SaveGraph(tree,"offsetdZCPos","run",condition);
295 SaveGraph(tree,"slopedZCPos","run",condition);
296 SaveGraph(tree,"offsetdZAErrPos","run",condition);
297 SaveGraph(tree,"slopedZAErrPos","run",condition);
298 SaveGraph(tree,"offsetdZCErrPos","run",condition);
299 SaveGraph(tree,"slopedZCErrPos","run",condition);
300 SaveGraph(tree,"offsetdZAchi2Pos","run",condition);
301 SaveGraph(tree,"slopedZAchi2Pos","run",condition);
302 SaveGraph(tree,"offsetdZCchi2Pos","run",condition);
303 SaveGraph(tree,"slopedZCchi2Pos","run",condition);
305 SaveGraph(tree,"offsetdZANeg","run",condition);
306 SaveGraph(tree,"slopedZANeg","run",condition);
307 SaveGraph(tree,"offsetdZCNeg","run",condition);
308 SaveGraph(tree,"slopedZCNeg","run",condition);
309 SaveGraph(tree,"offsetdZAErrNeg","run",condition);
310 SaveGraph(tree,"slopedZAErrNeg","run",condition);
311 SaveGraph(tree,"offsetdZCErrNeg","run",condition);
312 SaveGraph(tree,"slopedZCErrNeg","run",condition);
313 SaveGraph(tree,"offsetdZAchi2Neg","run",condition);
314 SaveGraph(tree,"slopedZAchi2Neg","run",condition);
315 SaveGraph(tree,"offsetdZCchi2Neg","run",condition);
316 SaveGraph(tree,"slopedZCchi2Neg","run",condition);
318 SaveGraph(tree,"offsetdZA","run",condition);
319 SaveGraph(tree,"slopedZA","run",condition);
320 SaveGraph(tree,"offsetdZC","run",condition);
321 SaveGraph(tree,"slopedZC","run",condition);
322 SaveGraph(tree,"offsetdZAErr","run",condition);
323 SaveGraph(tree,"slopedZAErr","run",condition);
324 SaveGraph(tree,"offsetdZCErr","run",condition);
325 SaveGraph(tree,"slopedZCErr","run",condition);
326 SaveGraph(tree,"offsetdZAchi2","run",condition);
327 SaveGraph(tree,"slopedZAchi2","run",condition);
328 SaveGraph(tree,"offsetdZCchi2","run",condition);
329 SaveGraph(tree,"slopedZCchi2","run",condition);
331 SaveGraph(tree,"meanVertX","run",condition);
332 SaveGraph(tree,"rmsVertX","run",condition);
333 SaveGraph(tree,"meanVertY","run",condition);
334 SaveGraph(tree,"rmsVertY","run",condition);
335 SaveGraph(tree,"meanVertZ","run",condition);
336 SaveGraph(tree,"rmsVertZ","run",condition);
337 SaveGraph(tree,"vertStatus","run",condition);
338 SaveGraph(tree,"meanMult","run",condition);
339 SaveGraph(tree,"rmsMult","run",condition);
340 SaveGraph(tree,"meanMultPos","run",condition);
341 SaveGraph(tree,"rmsMultPos","run",condition);
342 SaveGraph(tree,"meanMultNeg","run",condition);
343 SaveGraph(tree,"rmsMultNeg","run",condition);
344 SaveGraph(tree,"vertAll","run",condition);
345 SaveGraph(tree,"vertOK","run",condition);
348 SaveGraph(tree,"meanPtAPos","run",condition);
349 SaveGraph(tree,"mediumPtAPos","run",condition);
350 SaveGraph(tree,"highPtAPos","run",condition);
351 SaveGraph(tree,"meanPtCPos","run",condition);
352 SaveGraph(tree,"mediumPtCPos","run",condition);
353 SaveGraph(tree,"highPtCPos","run",condition);
354 SaveGraph(tree,"meanPtANeg","run",condition);
355 SaveGraph(tree,"mediumPtANeg","run",condition);
356 SaveGraph(tree,"highPtANeg","run",condition);
357 SaveGraph(tree,"meanPtCNeg","run",condition);
358 SaveGraph(tree,"mediumPtCNeg","run",condition);
359 SaveGraph(tree,"highPtCNeg","run",condition);
361 SaveGraph(tree,"qOverPt","run",condition);
362 SaveGraph(tree,"qOverPtA","run",condition);
363 SaveGraph(tree,"qOverPtC","run",condition);
368 if (tree) { delete tree; tree=0; }
369 if (out) { delete out; out=0; }
373 //_____________________________________________________________________________
374 Int_t AliTPCPerformanceSummary::SaveGraph(TTree* tree, const Char_t* y, const Char_t* x, const Char_t* condition)
377 // Creates a Graph and writes the canvas to the current directory
378 // called by ProduceTrends function.
384 tree->Draw(s.Data(),condition,"goff");
385 TCanvas* c = new TCanvas(s.Data(),s.Data());
387 TPad* p = new TPad("pad0","pad0",0,0,1,1);
390 if (tree->GetSelectedRows() > 0) {
391 TGraph* graph = new TGraph(tree->GetSelectedRows(), tree->GetV2(), tree->GetV1());
393 graph->GetXaxis()->SetTitle(x);
394 graph->GetYaxis()->SetTitle(y);
398 //graph->Write(s.Data());
404 //_____________________________________________________________________________
405 Int_t AliTPCPerformanceSummary::AnalyzeDCARPhi(const AliPerformanceTPC* pTPC, TTreeSRedirector* pcstream)
408 // Analyse DCA R imperfections
411 if (!pcstream) return 8;
415 static Double_t offsetdRA=0;
416 static Double_t slopedRA=0;
417 static Double_t offsetdRC=0;
418 static Double_t slopedRC=0;
419 static Double_t offsetdRAErr=0;
420 static Double_t slopedRAErr=0;
421 static Double_t offsetdRCErr=0;
422 static Double_t slopedRCErr=0;
423 static Double_t offsetdRAchi2=0;
424 static Double_t slopedRAchi2=0;
425 static Double_t offsetdRCchi2=0;
426 static Double_t slopedRCchi2=0;
428 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
434 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7")) {
435 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7"));
436 his3D->GetYaxis()->SetRangeUser(-1,1);
437 his3D->GetZaxis()->SetRangeUser(0.25,10);
440 static TF1 *fpol1 = new TF1("fpol1","pol1");
442 if (his3D && !fgForceTHnSparse) {
443 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
445 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
450 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
452 his1D = (TH1*) arrayFit.At(1);
453 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
454 offsetdRC=fpol1->GetParameter(0);
455 slopedRC=fpol1->GetParameter(1);
456 offsetdRCchi2=fpol1->GetChisquare();
457 slopedRCchi2=fpol1->GetChisquare();
459 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
460 offsetdRA=fpol1->GetParameter(0);
461 slopedRA=fpol1->GetParameter(1);
462 offsetdRAErr=fpol1->GetParError(0);
463 slopedRAErr=fpol1->GetParError(1);
464 offsetdRAchi2=fpol1->GetChisquare();
465 slopedRAchi2=fpol1->GetChisquare();
467 printf("DCA R QA report\n");
468 printf("offsetdRA\t%f\n",offsetdRA);
469 printf("slopedRA\t%f\n",slopedRA);
470 printf("offsetdRC\t%f\n",offsetdRC);
471 printf("slopedRC\t%f\n",slopedRC);
475 (*pcstream)<<"tpcQA"<<
476 "offsetdRA="<< offsetdRA<<
477 "slopedRA="<< slopedRA<<
478 "offsetdRC="<< offsetdRC<<
479 "slopedRC="<<slopedRC<<
481 "offsetdRAErr="<< offsetdRAErr<<
482 "slopedRAErr="<< slopedRAErr<<
483 "offsetdRCErr="<< offsetdRCErr<<
484 "slopedRCErr="<<slopedRCErr<<
486 "offsetdRAchi2="<< offsetdRAchi2<<
487 "slopedRAchi2="<< slopedRAchi2<<
488 "offsetdRCchi2="<< offsetdRCchi2<<
489 "slopedRCchi2="<<slopedRCchi2;
494 //_____________________________________________________________________________
495 Int_t AliTPCPerformanceSummary::AnalyzeDCARPhiPos(const AliPerformanceTPC* pTPC, TTreeSRedirector* pcstream)
498 // Analyse DCA R imperfections for positive particles
501 if (!pcstream) return 16;
502 if (!pTPC) return 16;
505 static Double_t offsetdRAPos=0;
506 static Double_t slopedRAPos=0;
507 static Double_t offsetdRCPos=0;
508 static Double_t slopedRCPos=0;
509 static Double_t offsetdRAErrPos=0;
510 static Double_t slopedRAErrPos=0;
511 static Double_t offsetdRCErrPos=0;
512 static Double_t slopedRCErrPos=0;
513 static Double_t offsetdRAchi2Pos=0;
514 static Double_t slopedRAchi2Pos=0;
515 static Double_t offsetdRCchi2Pos=0;
516 static Double_t slopedRCchi2Pos=0;
518 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
523 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
524 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
525 his3D->GetYaxis()->SetRangeUser(-1,1);
526 his3D->GetZaxis()->SetRangeUser(0.25,10);
529 static TF1 *fpol1 = new TF1("fpol1","pol1");
531 if (his3D && !fgForceTHnSparse) {
532 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
534 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(0,1.5);
535 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
536 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
539 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
541 his1D = (TH1*) arrayFit.At(1);
542 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
543 offsetdRCPos=fpol1->GetParameter(0);
544 slopedRCPos=fpol1->GetParameter(1);
545 offsetdRCchi2Pos=fpol1->GetChisquare();
546 slopedRCchi2Pos=fpol1->GetChisquare();
548 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
549 offsetdRAPos=fpol1->GetParameter(0);
550 slopedRAPos=fpol1->GetParameter(1);
551 offsetdRAErrPos=fpol1->GetParError(0);
552 slopedRAErrPos=fpol1->GetParError(1);
553 offsetdRAchi2Pos=fpol1->GetChisquare();
554 slopedRAchi2Pos=fpol1->GetChisquare();
556 printf("DCA R QA Pos report\n");
557 printf("offsetdRAPos\t%f\n",offsetdRAPos);
558 printf("slopedRAPos\t%f\n",slopedRAPos);
559 printf("offsetdRCPos\t%f\n",offsetdRCPos);
560 printf("slopedRCPos\t%f\n",slopedRCPos);
564 (*pcstream)<<"tpcQA"<<
565 "offsetdRAPos="<< offsetdRAPos<<
566 "slopedRAPos="<< slopedRAPos<<
567 "offsetdRCPos="<< offsetdRCPos<<
568 "slopedRCPos="<<slopedRCPos<<
570 "offsetdRAErrPos="<< offsetdRAErrPos<<
571 "slopedRAErrPos="<< slopedRAErrPos<<
572 "offsetdRCErrPos="<< offsetdRCErrPos<<
573 "slopedRCErrPos="<<slopedRCErrPos<<
575 "offsetdRAchi2Pos="<< offsetdRAchi2Pos<<
576 "slopedRAchi2Pos="<< slopedRAchi2Pos<<
577 "offsetdRCchi2Pos="<< offsetdRCchi2Pos<<
578 "slopedRCchi2Pos="<<slopedRCchi2Pos;
583 //_____________________________________________________________________________
584 Int_t AliTPCPerformanceSummary::AnalyzeDCARPhiNeg(const AliPerformanceTPC* pTPC, TTreeSRedirector* pcstream)
587 // Analyse DCA R imperfections for negative particles
589 if (!pcstream) return 32;
590 if (!pTPC) return 32;
593 static Double_t offsetdRANeg=0;
594 static Double_t slopedRANeg=0;
595 static Double_t offsetdRCNeg=0;
596 static Double_t slopedRCNeg=0;
597 static Double_t offsetdRAErrNeg=0;
598 static Double_t slopedRAErrNeg=0;
599 static Double_t offsetdRCErrNeg=0;
600 static Double_t slopedRCErrNeg=0;
601 static Double_t offsetdRAchi2Neg=0;
602 static Double_t slopedRAchi2Neg=0;
603 static Double_t offsetdRCchi2Neg=0;
604 static Double_t slopedRCchi2Neg=0;
606 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
611 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
612 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
613 his3D->GetYaxis()->SetRangeUser(-1,1);
614 his3D->GetZaxis()->SetRangeUser(0.25,10);
617 static TF1 *fpol1 = new TF1("fpol1","pol1");
619 if (his3D && !fgForceTHnSparse) {
620 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
622 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,0);
623 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
624 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
626 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
628 his1D = (TH1*) arrayFit.At(1);
629 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
630 offsetdRCNeg=fpol1->GetParameter(0);
631 slopedRCNeg=fpol1->GetParameter(1);
632 offsetdRCchi2Neg=fpol1->GetChisquare();
633 slopedRCchi2Neg=fpol1->GetChisquare();
635 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
636 offsetdRANeg=fpol1->GetParameter(0);
637 slopedRANeg=fpol1->GetParameter(1);
638 offsetdRAErrNeg=fpol1->GetParError(0);
639 slopedRAErrNeg=fpol1->GetParError(1);
640 offsetdRAchi2Neg=fpol1->GetChisquare();
641 slopedRAchi2Neg=fpol1->GetChisquare();
643 printf("DCA R QA Neg report\n");
644 printf("offsetdRANeg\t%f\n",offsetdRANeg);
645 printf("slopedRANeg\t%f\n",slopedRANeg);
646 printf("offsetdRCNeg\t%f\n",offsetdRCNeg);
647 printf("slopedRCNeg\t%f\n",slopedRCNeg);
649 // dump drift QA values
651 (*pcstream)<<"tpcQA"<<
652 "offsetdRANeg="<< offsetdRANeg<<
653 "slopedRANeg="<< slopedRANeg<<
654 "offsetdRCNeg="<< offsetdRCNeg<<
655 "slopedRCNeg="<<slopedRCNeg<<
657 "offsetdRAErrNeg="<< offsetdRAErrNeg<<
658 "slopedRAErrNeg="<< slopedRAErrNeg<<
659 "offsetdRCErrNeg="<< offsetdRCErrNeg<<
660 "slopedRCErrNeg="<<slopedRCErrNeg<<
662 "offsetdRAchi2Neg="<< offsetdRAchi2Neg<<
663 "slopedRAchi2Neg="<< slopedRAchi2Neg<<
664 "offsetdRCchi2Neg="<< offsetdRCchi2Neg<<
665 "slopedRCchi2Neg="<<slopedRCchi2Neg;
670 //_____________________________________________________________________________
671 Int_t AliTPCPerformanceSummary::AnalyzeNCL(const AliPerformanceTPC* pTPC, TTreeSRedirector* pcstream)
674 // Analyse number of TPC clusters
677 if (!pcstream) return 1;
681 static Double_t meanTPCnclF=0;
682 static Double_t rmsTPCnclF=0;
683 static Double_t meanTPCChi2=0;
684 static Double_t rmsTPCChi2=0;
685 static Double_t slopeATPCnclF=0;
686 static Double_t slopeCTPCnclF=0;
687 static Double_t slopeATPCnclFErr=0;
688 static Double_t slopeCTPCnclFErr=0;
689 static Double_t meanTPCncl=0;
690 static Double_t rmsTPCncl=0;
691 static Double_t slopeATPCncl=0;
692 static Double_t slopeCTPCncl=0;
693 static Double_t slopeATPCnclErr=0;
694 static Double_t slopeCTPCnclErr=0;
701 static TF1 *fpol1 = new TF1("fpol1","pol1");
704 // only events with rec. vertex
706 // pt cut - 0.250 GeV
707 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-1.,1.);
708 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0.25,10);
710 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7")) {
711 his3D_0 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7"));
712 his3D_0->GetYaxis()->SetRangeUser(-1,1);
713 his3D_0->GetZaxis()->SetRangeUser(0.25,10);
715 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7")) {
716 his3D_1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7"));
717 his3D_1->GetYaxis()->SetRangeUser(-1,1);
718 his3D_1->GetZaxis()->SetRangeUser(0.25,10);
720 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7")) {
721 his3D_2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7"));
722 his3D_2->GetYaxis()->SetRangeUser(-1,1);
723 his3D_2->GetZaxis()->SetRangeUser(0.25,10);
724 his3D_2->GetXaxis()->SetRangeUser(0.4,1.1);
728 if (his3D_0 && !fgForceTHnSparse) {
729 his1D = his3D_0->Project3D("x");
731 his1D = pTPC->GetTPCTrackHisto()->Projection(0);
734 meanTPCncl= his1D->GetMean();
735 rmsTPCncl= his1D->GetRMS();
738 if (his3D_1 && !fgForceTHnSparse) {
739 his1D = his3D_1->Project3D("x");
741 his1D = pTPC->GetTPCTrackHisto()->Projection(1);
744 meanTPCChi2= his1D->GetMean();
745 rmsTPCChi2= his1D->GetRMS();
748 if (his3D_0 && !fgForceTHnSparse) {
749 hprof = (dynamic_cast<TH2*>(his3D_0->Project3D("xy")))->ProfileX();
751 hprof = pTPC->GetTPCTrackHisto()->Projection(0,5)->ProfileX();
754 hprof->Fit(fpol1,"QNR","QNR",0.1,0.8);
755 slopeATPCncl= fpol1->GetParameter(1);
756 slopeATPCnclErr= fpol1->GetParError(1);
757 hprof->Fit(fpol1,"QNR","QNR",-0.8,-0.1);
758 slopeCTPCncl= fpol1->GetParameter(1);
759 slopeCTPCnclErr= fpol1->GetParameter(1);
766 if (his3D_2 && !fgForceTHnSparse) {
767 his1D = his3D_2->Project3D("x");
769 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0.4,1.1);
770 his1D = pTPC->GetTPCTrackHisto()->Projection(2);
773 meanTPCnclF= his1D->GetMean();
774 rmsTPCnclF= his1D->GetRMS();
777 if (his3D_2 && !fgForceTHnSparse) {
778 his1D = (dynamic_cast<TH2*>(his3D_2->Project3D("xy")))->ProfileX();
780 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0.4,1.1);
781 his1D = pTPC->GetTPCTrackHisto()->Projection(2,5)->ProfileX();
784 his1D->Fit(fpol1,"QNR","QNR",0.1,0.8);
785 slopeATPCnclF= fpol1->GetParameter(1);
786 slopeATPCnclFErr= fpol1->GetParError(1);
787 his1D->Fit(fpol1,"QNR","QNR",-0.8,-0.1);
788 slopeCTPCnclF= fpol1->GetParameter(1);
789 slopeCTPCnclFErr= fpol1->GetParameter(1);
792 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0,10);
794 printf("Cluster QA report\n");
795 printf("meanTPCnclF=\t%f\n",meanTPCnclF);
796 printf("rmsTPCnclF=\t%f\n",rmsTPCnclF);
797 printf("slopeATPCnclF=\t%f\n",slopeATPCnclF);
798 printf("slopeCTPCnclF=\t%f\n",slopeCTPCnclF);
799 printf("meanTPCncl=\t%f\n",meanTPCncl);
800 printf("rmsTPCncl=\t%f\n",rmsTPCncl);
801 printf("slopeATPCncl=\t%f\n",slopeATPCncl);
802 printf("slopeCTPCncl=\t%f\n",slopeCTPCncl);
803 printf("meanTPCChi2=\t%f\n",meanTPCChi2);
804 printf("rmsTPCChi2=\t%f\n",rmsTPCChi2);
806 // dump results to the tree
808 (*pcstream)<<"tpcQA"<<
809 "meanTPCnclF="<<meanTPCnclF <<
810 "rmsTPCnclF="<<rmsTPCnclF <<
811 "meanTPCChi2="<<meanTPCChi2 <<
812 "rmsTPCChi2="<<rmsTPCChi2 <<
813 "slopeATPCnclF="<< slopeATPCnclF<<
814 "slopeCTPCnclF="<< slopeCTPCnclF<<
815 "slopeATPCnclFErr="<< slopeATPCnclFErr<<
816 "slopeCTPCnclFErr="<< slopeCTPCnclFErr<<
817 "meanTPCncl="<<meanTPCncl <<
818 "rmsTPCncl="<< rmsTPCncl<<
819 "slopeATPCncl="<< slopeATPCncl<<
820 "slopeCTPCncl="<< slopeCTPCncl<<
821 "slopeATPCnclErr="<< slopeATPCnclErr<<
822 "slopeCTPCnclErr="<< slopeCTPCnclErr;
827 //_____________________________________________________________________________
828 Int_t AliTPCPerformanceSummary::AnalyzeDrift(const AliPerformanceTPC* pTPC, TTreeSRedirector* pcstream)
831 // Analyse DCA Z imperferctions (drift velocity)
834 if (!pcstream) return 2;
838 static Double_t offsetdZA=0;
839 static Double_t slopedZA=0;
840 static Double_t offsetdZC=0;
841 static Double_t slopedZC=0;
842 static Double_t offsetdZAErr=0;
843 static Double_t slopedZAErr=0;
844 static Double_t offsetdZCErr=0;
845 static Double_t slopedZCErr=0;
846 static Double_t offsetdZAchi2=0;
847 static Double_t slopedZAchi2=0;
848 static Double_t offsetdZCchi2=0;
849 static Double_t slopedZCchi2=0;
854 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7")) {
855 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7"));
856 his3D->GetYaxis()->SetRangeUser(-1,1);
857 his3D->GetZaxis()->SetRangeUser(0.25,10);
859 if (his3D && !fgForceTHnSparse) {
860 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
862 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
865 static TF1 *fpol1 = new TF1("fpol1","pol1");
867 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
869 his1D = (TH1*) arrayFit.At(1);
870 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
871 offsetdZC=fpol1->GetParameter(0);
872 slopedZC=fpol1->GetParameter(1);
873 offsetdZCErr=fpol1->GetParError(0);
874 slopedZCErr=fpol1->GetParError(1);
875 offsetdZCchi2=fpol1->GetChisquare();
876 slopedZCchi2=fpol1->GetChisquare();
878 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
879 offsetdZA=fpol1->GetParameter(0);
880 slopedZA=fpol1->GetParameter(1);
881 offsetdZAErr=fpol1->GetParError(0);
882 slopedZAErr=fpol1->GetParError(1);
883 offsetdZAchi2=fpol1->GetChisquare();
884 slopedZAchi2=fpol1->GetChisquare();
886 printf("Drift velocity QA report\n");
887 printf("offsetdZA\t%f\n",offsetdZA);
888 printf("slopedZA\t%f\n",slopedZA);
889 printf("offsetdZC\t%f\n",offsetdZC);
890 printf("slopedZC\t%f\n",slopedZC);
892 // dump drift QA values
894 (*pcstream)<<"tpcQA"<<
895 "offsetdZA="<< offsetdZA<<
896 "slopedZA="<< slopedZA<<
897 "offsetdZC="<< offsetdZC<<
898 "slopedZC="<<slopedZC<<
900 "offsetdZAErr="<< offsetdZAErr<<
901 "slopedZAErr="<< slopedZAErr<<
902 "offsetdZCErr="<< offsetdZCErr<<
903 "slopedZCErr="<<slopedZCErr<<
905 "offsetdZAchi2="<< offsetdZAchi2<<
906 "slopedZAchi2="<< slopedZAchi2<<
907 "offsetdZCchi2="<< offsetdZCchi2<<
908 "slopedZCchi2="<<slopedZCchi2;
913 //_____________________________________________________________________________
914 Int_t AliTPCPerformanceSummary::AnalyzeDriftPos(const AliPerformanceTPC* pTPC, TTreeSRedirector* pcstream)
917 // Analyse DCA Z imperferctions (drift velocity)
918 // for positive particles
920 if (!pcstream) return 64;
921 if (!pTPC) return 64;
924 static Double_t offsetdZAPos=0;
925 static Double_t slopedZAPos=0;
926 static Double_t offsetdZCPos=0;
927 static Double_t slopedZCPos=0;
928 static Double_t offsetdZAErrPos=0;
929 static Double_t slopedZAErrPos=0;
930 static Double_t offsetdZCErrPos=0;
931 static Double_t slopedZCErrPos=0;
932 static Double_t offsetdZAchi2Pos=0;
933 static Double_t slopedZAchi2Pos=0;
934 static Double_t offsetdZCchi2Pos=0;
935 static Double_t slopedZCchi2Pos=0;
940 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7")) {
941 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7"));
942 his3D->GetYaxis()->SetRangeUser(-1,1);
943 his3D->GetZaxis()->SetRangeUser(0.25,10);
945 if (his3D && !fgForceTHnSparse) {
946 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
948 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
951 static TF1 *fpol1 = new TF1("fpol1","pol1");
953 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
956 his1D = (TH1*) arrayFit.At(1);
957 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
958 offsetdZCPos=fpol1->GetParameter(0);
959 slopedZCPos=fpol1->GetParameter(1);
960 offsetdZCErrPos=fpol1->GetParError(0);
961 slopedZCErrPos=fpol1->GetParError(1);
962 offsetdZCchi2Pos=fpol1->GetChisquare();
963 slopedZCchi2Pos=fpol1->GetChisquare();
965 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
966 offsetdZAPos=fpol1->GetParameter(0);
967 slopedZAPos=fpol1->GetParameter(1);
968 offsetdZAErrPos=fpol1->GetParError(0);
969 slopedZAErrPos=fpol1->GetParError(1);
970 offsetdZAchi2Pos=fpol1->GetChisquare();
971 slopedZAchi2Pos=fpol1->GetChisquare();
973 printf("Drift velocity QA report\n");
974 printf("offsetdZAPos\t%f\n",offsetdZAPos);
975 printf("slopedZAPos\t%f\n",slopedZAPos);
976 printf("offsetdZCPos\t%f\n",offsetdZCPos);
977 printf("slopedZCPos\t%f\n",slopedZCPos);
979 // dump drift QA values
981 (*pcstream)<<"tpcQA"<<
982 "offsetdZAPos="<< offsetdZAPos<<
983 "slopedZAPos="<< slopedZAPos<<
984 "offsetdZCPos="<< offsetdZCPos<<
985 "slopedZCPos="<<slopedZCPos<<
987 "offsetdZAErrPos="<< offsetdZAErrPos<<
988 "slopedZAErrPos="<< slopedZAErrPos<<
989 "offsetdZCErrPos="<< offsetdZCErrPos<<
990 "slopedZCErrPos="<<slopedZCErrPos<<
992 "offsetdZAchi2Pos="<< offsetdZAchi2Pos<<
993 "slopedZAchi2Pos="<< slopedZAchi2Pos<<
994 "offsetdZCchi2Pos="<< offsetdZCchi2Pos<<
995 "slopedZCchi2Pos="<<slopedZCchi2Pos;
1000 //_____________________________________________________________________________
1001 Int_t AliTPCPerformanceSummary::AnalyzeDriftNeg(const AliPerformanceTPC* pTPC, TTreeSRedirector* pcstream)
1004 // Analyse DCA Z imperferctions (drift velocity)
1005 // for negative particles
1007 if (!pcstream) return 128;
1008 if (!pTPC) return 128;
1011 static Double_t offsetdZANeg=0;
1012 static Double_t slopedZANeg=0;
1013 static Double_t offsetdZCNeg=0;
1014 static Double_t slopedZCNeg=0;
1015 static Double_t offsetdZAErrNeg=0;
1016 static Double_t slopedZAErrNeg=0;
1017 static Double_t offsetdZCErrNeg=0;
1018 static Double_t slopedZCErrNeg=0;
1019 static Double_t offsetdZAchi2Neg=0;
1020 static Double_t slopedZAchi2Neg=0;
1021 static Double_t offsetdZCchi2Neg=0;
1022 static Double_t slopedZCchi2Neg=0;
1028 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7")) {
1029 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7"));
1030 his3D->GetYaxis()->SetRangeUser(-1,1);
1031 his3D->GetZaxis()->SetRangeUser(0.25,10);
1033 if (his3D && !fgForceTHnSparse) {
1034 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
1036 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
1039 static TF1 *fpol1 = new TF1("fpol1","pol1");
1041 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
1044 his1D = (TH1*) arrayFit.At(1);
1045 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
1046 offsetdZCNeg=fpol1->GetParameter(0);
1047 slopedZCNeg=fpol1->GetParameter(1);
1048 offsetdZCErrNeg=fpol1->GetParError(0);
1049 slopedZCErrNeg=fpol1->GetParError(1);
1050 offsetdZCchi2Neg=fpol1->GetChisquare();
1051 slopedZCchi2Neg=fpol1->GetChisquare();
1053 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
1054 offsetdZANeg=fpol1->GetParameter(0);
1055 slopedZANeg=fpol1->GetParameter(1);
1056 offsetdZAErrNeg=fpol1->GetParError(0);
1057 slopedZAErrNeg=fpol1->GetParError(1);
1058 offsetdZAchi2Neg=fpol1->GetChisquare();
1059 slopedZAchi2Neg=fpol1->GetChisquare();
1061 printf("Drift velocity QA report\n");
1062 printf("offsetdZANeg\t%f\n",offsetdZANeg);
1063 printf("slopedZANeg\t%f\n",slopedZANeg);
1064 printf("offsetdZCNeg\t%f\n",offsetdZCNeg);
1065 printf("slopedZCNeg\t%f\n",slopedZCNeg);
1067 // dump drift QA values
1069 (*pcstream)<<"tpcQA"<<
1070 "offsetdZANeg="<< offsetdZANeg<<
1071 "slopedZANeg="<< slopedZANeg<<
1072 "offsetdZCNeg="<< offsetdZCNeg<<
1073 "slopedZCNeg="<<slopedZCNeg<<
1075 "offsetdZAErrNeg="<< offsetdZAErrNeg<<
1076 "slopedZAErrNeg="<< slopedZAErrNeg<<
1077 "offsetdZCErrNeg="<< offsetdZCErrNeg<<
1078 "slopedZCErrNeg="<<slopedZCErrNeg<<
1080 "offsetdZAchi2Neg="<< offsetdZAchi2Neg<<
1081 "slopedZAchi2Neg="<< slopedZAchi2Neg<<
1082 "offsetdZCchi2Neg="<< offsetdZCchi2Neg<<
1083 "slopedZCchi2Neg="<<slopedZCchi2Neg;
1088 //_____________________________________________________________________________
1089 Int_t AliTPCPerformanceSummary::AnalyzeGain(const AliPerformanceDEdx* pTPCgain, TTreeSRedirector* pcstream)
1095 if (!pcstream) return 4;
1096 if (!pTPCgain) return 4;
1098 static TVectorD meanMIPvsSector(36);
1099 static TVectorD sector(36);
1100 static Float_t meanMIP = 0;
1101 static Float_t resolutionMIP = 0;
1102 static Float_t attachSlopeC = 0;
1103 static Float_t attachSlopeA = 0;
1106 //TH1 * hisProj1D=0;
1110 meanMIPvsSector.Zero();
1112 // select MIP particles
1114 pTPCgain->GetDeDxHisto()->GetAxis(7)->SetRangeUser(0.4,0.55);
1115 pTPCgain->GetDeDxHisto()->GetAxis(0)->SetRangeUser(35,60);
1116 pTPCgain->GetDeDxHisto()->GetAxis(6)->SetRangeUser(80,160);
1117 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-1,1);
1119 // MIP position and resolution
1121 TF1 gausFit("gausFit","gaus");
1123 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_0") && !fgForceTHnSparse) {
1124 his1D = dynamic_cast<TH1*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_0")->Clone());
1126 his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1128 his1D->Fit(&gausFit,"QN","QN");
1130 meanMIP = gausFit.GetParameter(1);
1132 if (meanMIP!=0) resolutionMIP = gausFit.GetParameter(2)/meanMIP;
1133 //removedtotest// delete his1D;
1135 // MIP position vs. dip angle (attachment)
1137 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-3,0); // C side
1138 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_5") && !fgForceTHnSparse) {
1139 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_5")->Clone());
1141 his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
1143 TF1 * fpol = new TF1("fpol","pol1");
1145 his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
1146 his1D = (TH1*) arrayFit.At(1);
1147 his1D->Fit(fpol,"QNROB=0.8","QNR",-1,0);
1148 attachSlopeC = fpol->GetParameter(1);
1149 //removedtotest// delete his2D;
1150 //removedtotest// delete his1D;
1152 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(0,3); // A side
1153 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_5") && !fgForceTHnSparse) {
1154 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_5")->Clone());
1156 his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
1158 TF1 * fpolA = new TF1("fpolA","pol1");
1159 TObjArray arrayFitA;
1160 his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
1161 his1D = (TH1*) arrayFit.At(1);
1162 his1D->Fit(fpolA,"QNROB=0.8","QN",0,1);
1163 attachSlopeA = fpolA->GetParameter(1);
1164 //removedtotest// delete his2D;
1165 //removedtotest// delete his1D;
1167 // MIP position vs. sector
1169 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-3,0); // C side
1170 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_1") && !fgForceTHnSparse) {
1171 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_1")->Clone());
1173 his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
1175 for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
1177 Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
1178 Float_t phiUp = -TMath::Pi() + (i+1)*(20./360.)*(2*TMath::Pi());
1179 //pTPCgain->GetDeDxHisto()->GetAxis(1)->SetRangeUser(phiLow,phiUp);
1180 his2D->GetXaxis()->SetRangeUser(phiLow,phiUp);
1181 //his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1182 his1D = his2D->ProjectionY();
1183 TF1 gausFunc("gausFunc","gaus");
1184 his1D->Fit(&gausFunc, "QN");
1185 meanMIPvsSector(i) = gausFunc.GetParameter(1);
1187 //removedtotest// delete his1D;
1189 //removedtotest// delete his2D;
1191 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(0,3); // A side
1192 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_1") && !fgForceTHnSparse) {
1193 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_1")->Clone());
1195 his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
1197 for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
1199 Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
1200 Float_t phiUp = -TMath::Pi() + (i+1)*(20./360.)*(2*TMath::Pi());
1201 //pTPCgain->GetDeDxHisto()->GetAxis(1)->SetRangeUser(phiLow,phiUp);
1202 his2D->GetXaxis()->SetRangeUser(phiLow,phiUp);
1203 //his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1204 his1D = his2D->ProjectionY();
1205 TF1 gausFunc("gausFunc","gaus");
1206 his1D->Fit(&gausFunc, "QN");
1207 meanMIPvsSector(i+18) = gausFunc.GetParameter(1);
1209 //removedtotest// delete his1D;
1211 //removedtotest// delete his2D;
1213 printf("Gain QA report\n");
1214 printf("MIP mean\t%f\n",meanMIP);
1215 printf("MIP resolution\t%f\n",resolutionMIP);
1216 printf("MIPslopeA\t%f\n",attachSlopeA);
1217 printf("MIPslopeC\t%f\n",attachSlopeC);
1220 (*pcstream)<<"tpcQA"<<
1221 "MIPattachSlopeC="<<attachSlopeC<<
1222 "MIPattachSlopeA="<<attachSlopeA<<
1223 "resolutionMIP="<<resolutionMIP<<
1224 "meanMIPvsSector.="<<&meanMIPvsSector<<
1225 "sector.="<<§or<<
1226 "meanMIP="<<meanMIP;
1231 //_____________________________________________________________________________
1232 Int_t AliTPCPerformanceSummary::AnalyzeEvent(const AliPerformanceTPC* pTPC, TTreeSRedirector* pcstream)
1235 // Analyse Primary Vertex Distribution and Multiplicities
1237 if (!pcstream) return 1;
1238 if (!pTPC) return 1;
1242 static Double_t meanVertX=0;
1243 static Double_t rmsVertX=0;
1244 static Double_t meanVertY=0;
1245 static Double_t rmsVertY=0;
1246 static Double_t meanVertZ=0;
1247 static Double_t rmsVertZ=0;
1248 static Double_t vertStatus=0;
1249 static Double_t meanMult=0;
1250 static Double_t rmsMult=0;
1251 static Double_t meanMultPos=0;
1252 static Double_t rmsMultPos=0;
1253 static Double_t meanMultNeg=0;
1254 static Double_t rmsMultNeg=0;
1255 static Double_t vertAll = 0;
1256 static Double_t vertOK = 0;
1259 if (pTPC->GetHistos()->FindObject("h_tpc_event_6") && !fgForceTHnSparse) {
1260 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_6")->Clone());
1262 his1D = pTPC->GetTPCEventHisto()->Projection(6);
1264 vertAll = his1D->GetEntries();
1265 vertOK = his1D->GetBinContent(2);
1267 vertStatus = vertOK / vertAll;
1272 pTPC->GetTPCEventHisto()->GetAxis(6)->SetRange(2,2);
1274 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_0") && !fgForceTHnSparse) {
1275 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_0")->Clone());
1277 his1D = pTPC->GetTPCEventHisto()->Projection(0);
1279 meanVertX = his1D->GetMean();
1280 rmsVertX = his1D->GetRMS();
1286 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_1") && !fgForceTHnSparse) {
1287 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_1")->Clone());
1289 his1D = pTPC->GetTPCEventHisto()->Projection(1);
1291 meanVertY = his1D->GetMean();
1292 rmsVertY = his1D->GetRMS();
1296 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2") && !fgForceTHnSparse) {
1297 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2")->Clone());
1299 his1D = pTPC->GetTPCEventHisto()->Projection(2);
1300 } meanVertZ = his1D->GetMean();
1301 rmsVertZ = his1D->GetRMS();
1305 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3") && !fgForceTHnSparse) {
1306 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3")->Clone());
1308 his1D = pTPC->GetTPCEventHisto()->Projection(3);
1310 meanMult = his1D->GetMean();
1311 rmsMult = his1D->GetRMS();
1315 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_4") && !fgForceTHnSparse) {
1316 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_4")->Clone());
1318 his1D = pTPC->GetTPCEventHisto()->Projection(4);
1320 meanMultPos = his1D->GetMean();
1321 rmsMultPos = his1D->GetRMS();
1324 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_5") && !fgForceTHnSparse) {
1325 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_5")->Clone());
1327 his1D = pTPC->GetTPCEventHisto()->Projection(5);
1329 meanMultNeg = his1D->GetMean();
1330 rmsMultNeg = his1D->GetRMS();
1333 pTPC->GetTPCEventHisto()->GetAxis(6)->SetRange(1,2);
1335 (*pcstream)<<"tpcQA"<<
1336 "meanVertX="<<meanVertX<<
1337 "rmsVertX="<<rmsVertX<<
1338 "meanVertY="<<meanVertY<<
1339 "rmsVertY="<<rmsVertY<<
1340 "meanVertZ="<<meanVertZ<<
1341 "rmsVertZ="<<rmsVertZ<<
1342 "vertStatus="<<vertStatus<<
1343 "vertAll="<<vertAll<<
1345 "meanMult="<<meanMult<<
1346 "rmsMult="<<rmsMult<<
1347 "meanMultPos="<<meanMultPos<<
1348 "rmsMultPos="<<rmsMultPos<<
1349 "meanMultNeg="<<meanMultNeg<<
1350 "rmsMultNeg="<<rmsMultNeg;
1355 //_____________________________________________________________________________
1356 Int_t AliTPCPerformanceSummary::AnalyzePt(const AliPerformanceTPC* pTPC, TTreeSRedirector* pcstream)
1359 // Analyse DCA R imperfections for positive particles
1362 if (!pcstream) return 256;
1363 if (!pTPC) return 256;
1366 static Double_t meanPtAPos = 0;
1367 static Double_t mediumPtAPos = 0;
1368 static Double_t highPtAPos = 0;
1369 static Double_t meanPtCPos = 0;
1370 static Double_t mediumPtCPos = 0;
1371 static Double_t highPtCPos = 0;
1373 static Double_t meanPtANeg = 0;
1374 static Double_t mediumPtANeg = 0;
1375 static Double_t highPtANeg = 0;
1376 static Double_t meanPtCNeg = 0;
1377 static Double_t mediumPtCNeg = 0;
1378 static Double_t highPtCNeg = 0;
1383 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
1385 his3D_1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
1387 his3D_1->GetYaxis()->SetRangeUser(0.1,0.8);
1389 his3D_1->GetZaxis()->SetRangeUser(0.25,10);
1390 meanPtAPos = his3D_1->GetMean(3);
1391 his3D_1->GetZaxis()->SetRangeUser(2,5);
1392 mediumPtAPos = his3D_1->GetMean(3);
1393 his3D_1->GetZaxis()->SetRangeUser(5,10);
1394 highPtAPos = his3D_1->GetMean(3);
1396 his3D_1->GetYaxis()->SetRangeUser(-0.8,-0.1);
1398 his3D_1->GetZaxis()->SetRangeUser(0.25,10);
1399 meanPtCPos = his3D_1->GetMean(3);
1400 his3D_1->GetZaxis()->SetRangeUser(2,5);
1401 mediumPtCPos = his3D_1->GetMean(3);
1402 his3D_1->GetZaxis()->SetRangeUser(5,10);
1403 highPtCPos = his3D_1->GetMean(3);
1405 his3D_1->GetYaxis()->SetRangeUser(-1,1);
1406 his3D_1->GetZaxis()->SetRangeUser(0.25,10);
1410 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
1412 his3D_2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
1414 his3D_2->GetYaxis()->SetRangeUser(0.1,0.8);
1416 his3D_2->GetZaxis()->SetRangeUser(0.25,10);
1417 meanPtANeg = his3D_2->GetMean(3);
1418 his3D_2->GetZaxis()->SetRangeUser(2,5);
1419 mediumPtANeg = his3D_2->GetMean(3);
1420 his3D_2->GetZaxis()->SetRangeUser(5,10);
1421 highPtANeg = his3D_2->GetMean(3);
1423 his3D_2->GetYaxis()->SetRangeUser(-0.8,-0.1);
1425 his3D_2->GetZaxis()->SetRangeUser(0.25,10);
1426 meanPtCNeg = his3D_2->GetMean(3);
1427 his3D_2->GetZaxis()->SetRangeUser(2,5);
1428 mediumPtCNeg = his3D_2->GetMean(3);
1429 his3D_2->GetZaxis()->SetRangeUser(5,10);
1430 highPtCNeg = his3D_2->GetMean(3);
1432 his3D_2->GetYaxis()->SetRangeUser(-1,1);
1433 his3D_2->GetZaxis()->SetRangeUser(0.25,10);
1440 (*pcstream)<<"tpcQA"<<
1441 "meanPtAPos="<< meanPtAPos<<
1442 "mediumPtAPos="<< mediumPtAPos<<
1443 "highPtAPos="<< highPtAPos<<
1445 "meanPtCPos="<< meanPtCPos<<
1446 "mediumPtCPos="<< mediumPtCPos<<
1447 "highPtCPos="<< highPtCPos<<
1449 "meanPtANeg="<< meanPtANeg<<
1450 "mediumPtANeg="<< mediumPtANeg<<
1451 "highPtANeg="<< highPtANeg<<
1453 "meanPtCNeg="<< meanPtCNeg<<
1454 "mediumPtCNeg="<< mediumPtCNeg<<
1455 "highPtCNeg="<< highPtCNeg;
1461 //_____________________________________________________________________________
1463 Int_t AliTPCPerformanceSummary::AnalyzeChargeOverPt(const AliPerformanceTPC* pTPC, TTreeSRedirector* pcstream){
1465 // Analyse DCA R imperfections for positive particles
1468 if (!pcstream) return 512;
1469 if (!pTPC) return 512;
1472 static Double_t qOverPt = 0;
1473 static Double_t qOverPtA = 0;
1474 static Double_t qOverPtC = 0;
1480 TF1 *fp1 = new TF1("fp1","pol2",-1.0,1.0);
1481 TF1 *fp2 = new TF1("fp2","pol2",-1.0,1.0);
1482 TF1 *fp3 = new TF1("fp3","pol2",-1.0,1.0);
1484 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8")) {
1486 his2D = dynamic_cast<TH2*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8"));
1488 his1D_1 = his2D->ProjectionX();
1489 his1D_1->Fit(fp1,"R");
1490 if(fp1->GetParameter(2)!=0){
1491 qOverPt = (-1.0)*(fp1->GetParameter(1)/(2.0*fp1->GetParameter(2)));
1496 his2D->GetYaxis()->SetRangeUser(0.1,0.8);
1497 his1D_2 = his2D->ProjectionX();
1498 his1D_2->Fit(fp2,"R");
1499 if(fp2->GetParameter(2)!=0)
1500 qOverPtA = (-1.0)*(fp2->GetParameter(1)/(2.0*fp2->GetParameter(2)));
1504 his2D->GetYaxis()->SetRangeUser(-0.8,-0.1);
1505 his1D_3 = his2D->ProjectionX();
1506 his1D_3->Fit(fp3,"R");
1507 if(fp3->GetParameter(2)!=0)
1508 qOverPtC = (-1.0)*(fp3->GetParameter(1)/(2.0*fp3->GetParameter(2)));
1512 his2D->GetYaxis()->SetRangeUser(-1.0,1.0);
1516 (*pcstream)<<"tpcQA"<<
1517 "qOverPt="<< qOverPt<<
1518 "qOverPtA="<< qOverPtA<<
1519 "qOverPtC="<< qOverPtC;
1524 void AliTPCPerformanceSummary::AnalyzeMatch(const AliPerformanceMatch* pMatch, TTreeSRedirector* pcstream)
1526 if ((pMatch == 0) or (0 == pcstream)) { printf("this will not work anyway..."); }
1527 printf("funtion not implemented");