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