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"
47 ClassImp(AliTPCPerformanceSummary)
49 Bool_t AliTPCPerformanceSummary::fgForceTHnSparse = kFALSE;
52 //_____________________________________________________________________________
53 void AliTPCPerformanceSummary::WriteToTTreeSRedirector(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pTPCMatch,const AliPerformanceMatch* pTPCPull, const AliPerformanceMatch* pConstrain, TTreeSRedirector* const pcstream, Int_t run)
56 // Extracts performance parameters from pTPC and pTPCgain.
57 // Output is written to pcstream.
58 // The run number must be provided since it is not stored in
59 // AliPerformanceTPC or AliPerformanceDEdx.
62 if (pTPCMatch) {run = pTPCMatch->GetRunNumber(); }
63 if (pTPCgain) {run = pTPCgain->GetRunNumber(); }
64 if (pTPC) { run = pTPC->GetRunNumber(); }
68 //AliTPCcalibDB *calibDB=0;
70 // AliTPCcalibDButil *dbutil =0;
76 //Float_t currentL3 =0;
77 //Int_t polarityL3 = 0;
80 //calibDB = AliTPCcalibDB::Instance();
82 // dbutil= new AliTPCcalibDButil;
84 //printf("Processing run %d ...\n",run);
86 //AliTPCcalibDB::Instance()->SetRun(run);
88 // dbutil->UpdateFromCalibDB();
89 // dbutil->SetReferenceRun(run);
90 // dbutil->UpdateRefDataFromOCDB();
92 //if (calibDB->GetGRP(run)){
93 //startTimeGRP = AliTPCcalibDB::GetGRP(run)->GetTimeStart();
94 //stopTimeGRP = AliTPCcalibDB::GetGRP(run)->GetTimeEnd();
95 //currentL3 = AliTPCcalibDB::GetL3Current(run);
96 //polarityL3 = AliTPCcalibDB::GetL3Polarity(run);
97 //bz = AliTPCcalibDB::GetBz(run);
100 //runType = AliTPCcalibDB::GetRunType(run).Data();
102 time = (startTimeGRP+stopTimeGRP)/2;
103 duration = (stopTimeGRP-startTimeGRP);
105 if (!pcstream) return;
106 (*pcstream)<<"tpcQA"<<
109 "startTimeGRP="<<startTimeGRP<<
110 "stopTimeGRP="<<stopTimeGRP<<
112 "runType.="<<&runType;
114 pTPC->GetTPCTrackHisto()->GetAxis(9)->SetRangeUser(0.5,1.5);
115 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0.25,10);
116 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-1,1);
117 AnalyzeNCL(pTPC, pcstream);
118 AnalyzeDrift(pTPC, pcstream);
119 AnalyzeDriftPos(pTPC, pcstream);
120 AnalyzeDriftNeg(pTPC, pcstream);
121 AnalyzeDCARPhi(pTPC, pcstream);
122 AnalyzeDCARPhiPos(pTPC, pcstream);
123 AnalyzeDCARPhiNeg(pTPC, pcstream);
124 AnalyzeEvent(pTPC, pcstream);
126 AnalyzePt(pTPC,pcstream);
127 AnalyzeChargeOverPt(pTPC,pcstream);
128 AnalyzeQAPosNegDpT(pTPC,pcstream);
129 AnalyzeQADCAFitParameter(pTPC,pcstream);
131 pTPC->GetTPCTrackHisto()->GetAxis(9)->SetRangeUser(-10,10);
132 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0,100);
133 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-10,10);
135 AnalyzeGain(pTPCgain, pcstream);
136 AnalyzeMatch(pTPCMatch, pcstream);
137 AnalyzePull(pTPCPull, pcstream);
138 AnalyzeConstrain(pConstrain, pcstream);
140 (*pcstream)<<"tpcQA"<<"\n";
143 //_____________________________________________________________________________
144 void AliTPCPerformanceSummary::WriteToFile(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pMatch, const AliPerformanceMatch* pPull, const AliPerformanceMatch* pConstrain, const Char_t* outfile, Int_t run)
147 // Extracts performance parameters from pTPC and pTPCgain.
148 // Output is written to a TTree saved in outfile.
149 // The run number must be provided since it is not stored in
150 // AliPerformanceTPC or AliPerformanceDEdx.
152 // The function creates a TTreeSRedirector and calls the
153 // function WriteToTTreeSRedirector.
156 if (!outfile) return;
157 TTreeSRedirector* pcstream = 0;
158 pcstream = new TTreeSRedirector(outfile);
159 if (!pcstream) return;
160 WriteToTTreeSRedirector(pTPC, pTPCgain, pMatch, pPull, pConstrain, pcstream, run);
161 if (pcstream) { delete pcstream; pcstream = 0; }
165 //_____________________________________________________________________________
166 Int_t AliTPCPerformanceSummary::MakeReport(const Char_t* infile, const Char_t* outfile, Int_t run)
169 // Reads QA information (AliPerformanceTPC and AliPerformanceDEdx) from
170 // infile (this must be a rootfile) and writes the output to a TTree
171 // stored in outfile.
172 // The run number must be provided since it is not stored in
173 // AliPerformanceTPC or AliPerformanceDEdx.
175 // The input objects must be named "AliPerformanceTPC" and
176 // "AliPerformanceDEdxTPCInner" and stored in a TList which name must
177 // be one of the following: "TPC", "TPCQA", "TPC_PerformanceQA"
178 // or "TPC_PerformanceQA/TPC" (with directory)
181 if (!infile) return -1;
182 if (!outfile) return -1;
184 f=TFile::Open(infile,"read");
186 printf("File %s not available\n", infile);
190 list = dynamic_cast<TList*>(f->Get("TPC"));
191 if (!list) { list = dynamic_cast<TList*>(f->Get("TPCQA")); }
192 if (!list) { list = dynamic_cast<TList*>(f->Get("TPC_PerformanceQA/TPCQA")); }
193 if (!list) { list = dynamic_cast<TList*>(f->Get("TPC_PerformanceQA")); }
194 if (!list) { list = dynamic_cast<TList*>(f->Get("ITSTPCMatch")); }
196 printf("QA %s not available\n", infile);
199 AliPerformanceTPC* pTPC = 0;
200 AliPerformanceDEdx* pTPCgain = 0;
201 AliPerformanceMatch* pTPCmatch = 0;
202 AliPerformanceMatch* pTPCPull = 0;
203 AliPerformanceMatch* pConstrain = 0;
205 if (list) { pTPC = dynamic_cast<AliPerformanceTPC*>(list->FindObject("AliPerformanceTPC")); }
206 if (list) { pTPCgain = dynamic_cast<AliPerformanceDEdx*>(list->FindObject("AliPerformanceDEdxTPCInner")); }
207 if (list) { pTPCmatch = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchTPCITS")); }
208 if (list) { pTPCPull = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchITSTPC")); }
209 if (list) { pConstrain = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchTPCConstrain")); }
211 Int_t returncode = 0;
212 WriteToFile(pTPC, pTPCgain, pTPCmatch , pTPCPull, pConstrain, outfile, run);
213 if (f) { delete f; f=0; }
217 //_____________________________________________________________________________
218 Int_t AliTPCPerformanceSummary::ProduceTrends(const Char_t* infilelist, const Char_t* outfile)
221 // Produces trend graphs.
223 // Input: infilelist is a textfile with one rootfile per line.
224 // There should be one rootfile for each run, the rootfile must
225 // contain the output of the MakeReport function
226 // Output: the information for all runs is merged into a TTree
227 // that is saved in outfile along with the trend graphs.
228 // Trend graphs are stored as TCanvas objects to include axis labels etc.
231 if (!infilelist) return -1;
232 if (!outfile) return -1;
234 TChain* chain = new TChain("tpcQA");
235 if(!chain) return -1;
244 if (!currentFile.Contains("root")) continue; // protection
245 chain->Add(currentFile.Data());
248 //TTree *tree = chain;
249 TTree *tree = chain->CopyTree("1");
251 if (chain) { delete chain; chain=0; }
252 //TGraph* graph = dynamic_cast<TGraph*>(tree->DrawClone("run:run"));
253 //TGraph *graph = (TGraph*)gPad->GetPrimitive("Graph");
255 TFile* out = new TFile(outfile,"RECREATE");
259 const Char_t* condition = "meanTPCncl>0";
260 SaveGraph(tree,"meanTPCnclF","run",condition);
261 SaveGraph(tree,"rmsTPCnclF","run",condition);
262 SaveGraph(tree,"meanTPCChi2","run",condition);
263 SaveGraph(tree,"rmsTPCChi2","run",condition);
264 SaveGraph(tree,"slopeATPCnclF","run",condition);
265 SaveGraph(tree,"slopeCTPCnclF","run",condition);
266 SaveGraph(tree,"slopeATPCnclFErr","run",condition);
267 SaveGraph(tree,"slopeCTPCnclFErr","run",condition);
268 SaveGraph(tree,"meanTPCncl","run",condition);
269 SaveGraph(tree,"rmsTPCncl","run",condition);
270 SaveGraph(tree,"slopeATPCncl","run",condition);
271 SaveGraph(tree,"slopeCTPCncl","run",condition);
272 SaveGraph(tree,"slopeATPCnclErr","run",condition);
273 SaveGraph(tree,"slopeCTPCnclErr","run",condition);
275 SaveGraph(tree,"offsetdRA","run",condition);
276 SaveGraph(tree,"slopedRA","run",condition);
277 SaveGraph(tree,"offsetdRC","run",condition);
278 SaveGraph(tree,"slopedRC","run",condition);
279 SaveGraph(tree,"offsetdRAErr","run",condition);
280 SaveGraph(tree,"slopedRAErr","run",condition);
281 SaveGraph(tree,"offsetdRCErr","run",condition);
282 SaveGraph(tree,"slopedRCErr","run",condition);
283 SaveGraph(tree,"offsetdRAchi2","run",condition);
284 SaveGraph(tree,"slopedRAchi2","run",condition);
285 SaveGraph(tree,"offsetdRCchi2","run",condition);
286 SaveGraph(tree,"slopedRCchi2","run",condition);
288 SaveGraph(tree,"offsetdRAPos","run",condition);
290 SaveGraph(tree,"slopedRAPos","run",condition);
291 SaveGraph(tree,"offsetdRCPos","run",condition);
292 SaveGraph(tree,"slopedRCPos","run",condition);
293 SaveGraph(tree,"offsetdRAErrPos","run",condition);
294 SaveGraph(tree,"slopedRAErrPos","run",condition);
295 SaveGraph(tree,"offsetdRCErrPos","run",condition);
296 SaveGraph(tree,"slopedRCErrPos","run",condition);
297 SaveGraph(tree,"offsetdRAchi2Pos","run",condition);
298 SaveGraph(tree,"slopedRAchi2Pos","run",condition);
299 SaveGraph(tree,"offsetdRCchi2Pos","run",condition);
300 SaveGraph(tree,"slopedRCchi2Pos","run",condition);
302 SaveGraph(tree,"offsetdRANeg","run",condition);
303 SaveGraph(tree,"slopedRANeg","run",condition);
304 SaveGraph(tree,"offsetdRCNeg","run",condition);
305 SaveGraph(tree,"slopedRCNeg","run",condition);
306 SaveGraph(tree,"offsetdRAErrNeg","run",condition);
307 SaveGraph(tree,"slopedRAErrNeg","run",condition);
308 SaveGraph(tree,"offsetdRCErrNeg","run",condition);
309 SaveGraph(tree,"slopedRCErrNeg","run",condition);
310 SaveGraph(tree,"offsetdRAchi2Neg","run",condition);
311 SaveGraph(tree,"slopedRAchi2Neg","run",condition);
312 SaveGraph(tree,"offsetdRCchi2Neg","run",condition);
313 SaveGraph(tree,"slopedRCchi2Neg","run",condition);
315 SaveGraph(tree,"offsetdZAPos","run",condition);
316 SaveGraph(tree,"slopedZAPos","run",condition);
317 SaveGraph(tree,"offsetdZCPos","run",condition);
318 SaveGraph(tree,"slopedZCPos","run",condition);
319 SaveGraph(tree,"offsetdZAErrPos","run",condition);
320 SaveGraph(tree,"slopedZAErrPos","run",condition);
321 SaveGraph(tree,"offsetdZCErrPos","run",condition);
322 SaveGraph(tree,"slopedZCErrPos","run",condition);
323 SaveGraph(tree,"offsetdZAchi2Pos","run",condition);
324 SaveGraph(tree,"slopedZAchi2Pos","run",condition);
325 SaveGraph(tree,"offsetdZCchi2Pos","run",condition);
326 SaveGraph(tree,"slopedZCchi2Pos","run",condition);
328 SaveGraph(tree,"offsetdZANeg","run",condition);
329 SaveGraph(tree,"slopedZANeg","run",condition);
330 SaveGraph(tree,"offsetdZCNeg","run",condition);
331 SaveGraph(tree,"slopedZCNeg","run",condition);
332 SaveGraph(tree,"offsetdZAErrNeg","run",condition);
333 SaveGraph(tree,"slopedZAErrNeg","run",condition);
334 SaveGraph(tree,"offsetdZCErrNeg","run",condition);
335 SaveGraph(tree,"slopedZCErrNeg","run",condition);
336 SaveGraph(tree,"offsetdZAchi2Neg","run",condition);
337 SaveGraph(tree,"slopedZAchi2Neg","run",condition);
338 SaveGraph(tree,"offsetdZCchi2Neg","run",condition);
339 SaveGraph(tree,"slopedZCchi2Neg","run",condition);
341 SaveGraph(tree,"offsetdZA","run",condition);
342 SaveGraph(tree,"slopedZA","run",condition);
343 SaveGraph(tree,"offsetdZC","run",condition);
344 SaveGraph(tree,"slopedZC","run",condition);
345 SaveGraph(tree,"offsetdZAErr","run",condition);
346 SaveGraph(tree,"slopedZAErr","run",condition);
347 SaveGraph(tree,"offsetdZCErr","run",condition);
348 SaveGraph(tree,"slopedZCErr","run",condition);
349 SaveGraph(tree,"offsetdZAchi2","run",condition);
350 SaveGraph(tree,"slopedZAchi2","run",condition);
351 SaveGraph(tree,"offsetdZCchi2","run",condition);
352 SaveGraph(tree,"slopedZCchi2","run",condition);
354 SaveGraph(tree,"meanVertX","run",condition);
355 SaveGraph(tree,"rmsVertX","run",condition);
356 SaveGraph(tree,"meanVertY","run",condition);
357 SaveGraph(tree,"rmsVertY","run",condition);
358 SaveGraph(tree,"meanVertZ","run",condition);
359 SaveGraph(tree,"rmsVertZ","run",condition);
360 SaveGraph(tree,"vertStatus","run",condition);
361 SaveGraph(tree,"meanMult","run",condition);
362 SaveGraph(tree,"rmsMult","run",condition);
363 SaveGraph(tree,"meanMultPos","run",condition);
364 SaveGraph(tree,"rmsMultPos","run",condition);
365 SaveGraph(tree,"meanMultNeg","run",condition);
366 SaveGraph(tree,"rmsMultNeg","run",condition);
367 SaveGraph(tree,"vertAll","run",condition);
368 SaveGraph(tree,"vertOK","run",condition);
371 SaveGraph(tree,"meanPtAPos","run",condition);
372 SaveGraph(tree,"mediumPtAPos","run",condition);
373 SaveGraph(tree,"highPtAPos","run",condition);
374 SaveGraph(tree,"meanPtCPos","run",condition);
375 SaveGraph(tree,"mediumPtCPos","run",condition);
376 SaveGraph(tree,"highPtCPos","run",condition);
377 SaveGraph(tree,"meanPtANeg","run",condition);
378 SaveGraph(tree,"mediumPtANeg","run",condition);
379 SaveGraph(tree,"highPtANeg","run",condition);
380 SaveGraph(tree,"meanPtCNeg","run",condition);
381 SaveGraph(tree,"mediumPtCNeg","run",condition);
382 SaveGraph(tree,"highPtCNeg","run",condition);
384 SaveGraph(tree,"qOverPt","run",condition);
385 SaveGraph(tree,"qOverPtA","run",condition);
386 SaveGraph(tree,"qOverPtC","run",condition);
388 SaveGraph(tree,"dcarAP0","run",condition);
389 SaveGraph(tree,"dcarAP1","run",condition);
390 SaveGraph(tree,"dcarCP0","run",condition);
391 SaveGraph(tree,"dcarCP1","run",condition);
394 SaveGraph(tree,"tpcItsMatchA","run",condition);
395 SaveGraph(tree,"tpcItsMatchHighPtA","run",condition);
396 SaveGraph(tree,"tpcItsMatchC","run",condition);
397 SaveGraph(tree,"tpcItsMatchHighPtC","run",condition);
399 SaveGraph(tree,"phiPull","run",condition);
400 SaveGraph(tree,"phiPullHighPt","run",condition);
401 SaveGraph(tree,"ptPull","run",condition);
402 SaveGraph(tree,"ptPullHighPt","run",condition);
403 SaveGraph(tree,"yPull","run",condition);
404 SaveGraph(tree,"yPullHighPt","run",condition);
405 SaveGraph(tree,"zPull","run",condition);
406 SaveGraph(tree,"zPullHighPt","run",condition);
407 SaveGraph(tree,"lambdaPull","run",condition);
408 SaveGraph(tree,"lambdaPullHighPt","run",condition);
410 SaveGraph(tree,"tpcConstrainPhiA","run",condition);
411 SaveGraph(tree,"tpcConstrainPhiC","run",condition);
413 SaveGraph(tree,"deltaPt","run",condition);
414 SaveGraph(tree,"deltaPtchi2","run",condition);
415 SaveGraph(tree,"deltaPtA","run",condition);
416 SaveGraph(tree,"deltaPtchi2A","run",condition);
417 SaveGraph(tree,"deltaPtC","run",condition);
418 SaveGraph(tree,"deltaPtchi2C","run",condition);
419 SaveGraph(tree,"deltaPtA_Err","run",condition);
420 SaveGraph(tree,"deltaPtA_Err","run",condition);
421 SaveGraph(tree,"deltaPtC_Err","run",condition);
423 ////////////////////////////////////////////////////////////////////////////////////////////////////////
424 //save dca fit parameters
425 SaveGraph(tree,"dcar_posA_0","run",condition);
426 SaveGraph(tree,"dcar_posA_1","run",condition);
427 SaveGraph(tree,"dcar_posA_2","run",condition);
428 SaveGraph(tree,"dcar_posA_chi2","run",condition);
429 SaveGraph(tree,"dcar_posA_0_Err","run",condition);
430 SaveGraph(tree,"dcar_posA_1_Err","run",condition);
431 SaveGraph(tree,"dcar_posA_2_Err","run",condition);
433 SaveGraph(tree,"dcaz_posA_0","run",condition);
434 SaveGraph(tree,"dcaz_posA_1","run",condition);
435 SaveGraph(tree,"dcaz_posA_2","run",condition);
436 SaveGraph(tree,"dcaz_posA_chi2","run",condition);
437 SaveGraph(tree,"dcaz_posA_0_Err","run",condition);
438 SaveGraph(tree,"dcaz_posA_1_Err","run",condition);
439 SaveGraph(tree,"dcaz_posA_2_Err","run",condition);
441 SaveGraph(tree,"dcaz_posC_0","run",condition);
442 SaveGraph(tree,"dcaz_posC_1","run",condition);
443 SaveGraph(tree,"dcaz_posC_2","run",condition);
444 SaveGraph(tree,"dcaz_posC_chi2","run",condition);
445 SaveGraph(tree,"dcaz_posC_0_Err","run",condition);
446 SaveGraph(tree,"dcaz_posC_1_Err","run",condition);
447 SaveGraph(tree,"dcaz_posC_2_Err","run",condition);
449 SaveGraph(tree,"dcar_posC_0","run",condition);
450 SaveGraph(tree,"dcar_posC_1","run",condition);
451 SaveGraph(tree,"dcar_posC_2","run",condition);
452 SaveGraph(tree,"dcar_posC_chi2","run",condition);
453 SaveGraph(tree,"dcar_posC_0_Err","run",condition);
454 SaveGraph(tree,"dcar_posC_1_Err","run",condition);
455 SaveGraph(tree,"dcar_posC_2_Err","run",condition);
457 SaveGraph(tree,"dcar_negA_0","run",condition);
458 SaveGraph(tree,"dcar_negA_1","run",condition);
459 SaveGraph(tree,"dcar_negA_2","run",condition);
460 SaveGraph(tree,"dcar_negA_chi2","run",condition);
461 SaveGraph(tree,"dcar_negA_0_Err","run",condition);
462 SaveGraph(tree,"dcar_negA_1_Err","run",condition);
463 SaveGraph(tree,"dcar_negA_2_Err","run",condition);
465 SaveGraph(tree,"dcaz_negA_0","run",condition);
466 SaveGraph(tree,"dcaz_negA_1","run",condition);
467 SaveGraph(tree,"dcaz_negA_2","run",condition);
468 SaveGraph(tree,"dcaz_negA_chi2","run",condition);
469 SaveGraph(tree,"dcaz_negA_0_Err","run",condition);
470 SaveGraph(tree,"dcaz_negA_1_Err","run",condition);
471 SaveGraph(tree,"dcaz_negA_2_Err","run",condition);
473 SaveGraph(tree,"dcaz_negC_0","run",condition);
474 SaveGraph(tree,"dcaz_negC_1","run",condition);
475 SaveGraph(tree,"dcaz_negC_2","run",condition);
476 SaveGraph(tree,"dcaz_negC_chi2","run",condition);
477 SaveGraph(tree,"dcaz_negC_0_Err","run",condition);
478 SaveGraph(tree,"dcaz_negC_1_Err","run",condition);
479 SaveGraph(tree,"dcaz_negC_2_Err","run",condition);
481 SaveGraph(tree,"dcar_negC_0","run",condition);
482 SaveGraph(tree,"dcar_negC_1","run",condition);
483 SaveGraph(tree,"dcar_negC_2","run",condition);
484 SaveGraph(tree,"dcar_negC_chi2","run",condition);
485 SaveGraph(tree,"dcar_negC_0_Err","run",condition);
486 SaveGraph(tree,"dcar_negC_1_Err","run",condition);
487 SaveGraph(tree,"dcar_negC_2_Err","run",condition);
491 ////////////////////////////////////////////////////////////////////////////////////////////////////////
497 if (tree) { delete tree; tree=0; }
498 if (out) { delete out; out=0; }
502 //_____________________________________________________________________________
503 Int_t AliTPCPerformanceSummary::SaveGraph(TTree* tree, const Char_t* y, const Char_t* x, const Char_t* condition)
506 // Creates a Graph and writes the canvas to the current directory
507 // called by ProduceTrends function.
513 tree->Draw(s.Data(),condition,"goff");
514 TCanvas* c = new TCanvas(s.Data(),s.Data());
516 TPad* p = new TPad("pad0","pad0",0,0,1,1);
519 if (tree->GetSelectedRows() > 0) {
520 TGraph* graph = new TGraph(tree->GetSelectedRows(), tree->GetV2(), tree->GetV1());
522 graph->GetXaxis()->SetTitle(x);
523 graph->GetYaxis()->SetTitle(y);
527 //graph->Write(s.Data());
533 //_____________________________________________________________________________
534 Int_t AliTPCPerformanceSummary::AnalyzeDCARPhi(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
537 // Analyse DCA R imperfections
540 if (!pcstream) return 8;
544 static Double_t offsetdRA=0;
545 static Double_t slopedRA=0;
546 static Double_t offsetdRC=0;
547 static Double_t slopedRC=0;
548 static Double_t offsetdRAErr=0;
549 static Double_t slopedRAErr=0;
550 static Double_t offsetdRCErr=0;
551 static Double_t slopedRCErr=0;
552 static Double_t offsetdRAchi2=0;
553 static Double_t slopedRAchi2=0;
554 static Double_t offsetdRCchi2=0;
555 static Double_t slopedRCchi2=0;
556 static Double_t dcarAP0 = 0;
557 static Double_t dcarAP1 = 0;
558 static Double_t dcarCP0 = 0;
559 static Double_t dcarCP1 = 0;
561 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
567 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7")) {
568 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7"));
570 his3D->GetYaxis()->SetRangeUser(-1,1);
571 his3D->GetZaxis()->SetRangeUser(0.25,10);
574 static TF1 *fpol1 = new TF1("fpol1","pol1");
576 if (his3D && !fgForceTHnSparse) {
577 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
579 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
584 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
586 his1D = (TH1*) arrayFit.At(1);
587 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
588 offsetdRC=fpol1->GetParameter(0);
589 slopedRC=fpol1->GetParameter(1);
590 offsetdRCchi2=fpol1->GetChisquare();
591 slopedRCchi2=fpol1->GetChisquare();
593 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
594 offsetdRA=fpol1->GetParameter(0);
595 slopedRA=fpol1->GetParameter(1);
596 offsetdRAErr=fpol1->GetParError(0);
597 slopedRAErr=fpol1->GetParError(1);
598 offsetdRAchi2=fpol1->GetChisquare();
599 slopedRAchi2=fpol1->GetChisquare();
601 printf("DCA R QA report\n");
602 printf("offsetdRA\t%f\n",offsetdRA);
603 printf("slopedRA\t%f\n",slopedRA);
604 printf("offsetdRC\t%f\n",offsetdRC);
605 printf("slopedRC\t%f\n",slopedRC);
608 //extraction of DCAr versus pt
610 TLinearFitter linearFit;
611 linearFit.SetFormula("pol1");
612 TObjArray arrayWidth;
620 his3D->GetYaxis()->SetRangeUser(-1,1);
622 //get his2D in A Side
623 his3D->GetYaxis()->SetRangeUser(0,1);
624 his3D->GetZaxis()->SetRangeUser(0.35,8);
625 his2D = dynamic_cast<TH2*>(his3D->Project3D("xz"));
627 his2D->FitSlicesY(0,0,-1,0,"QNR",&arrayWidth);
629 width = dynamic_cast<TH1*>(arrayWidth.At(2));
632 nXbins = width->GetNbinsX();
633 for(Int_t i=2; i<nXbins; i++){
634 x = width->GetBinCenter(i);
637 y = width->GetBinContent(i);
639 linearFit.AddPoint(&x,y,1);
641 if(!linearFit.Eval()){
643 dcarAP0 = linearFit.GetParameter(0);
645 pn = Int_t(TMath::Abs(dcarAP0)/dcarAP0);
646 dcarAP0 = pn*TMath::Sqrt(TMath::Abs(dcarAP0));
648 dcarAP1 = linearFit.GetParameter(1);
650 pn = Int_t(TMath::Abs(dcarAP1)/dcarAP1);
651 dcarAP1 = pn*TMath::Sqrt(TMath::Abs(dcarAP1));
655 linearFit.ClearPoints();
657 //get his2D in C Side
658 his3D->GetYaxis()->SetRangeUser(-1,-0.001);
659 his2D = dynamic_cast<TH2*>(his3D->Project3D("xz"));
661 his2D->FitSlicesY(0,0,-1,0,"QNR",&arrayWidth);
662 width = dynamic_cast<TH1*>(arrayWidth.At(2));
665 nXbins = width->GetNbinsX();
666 for(Int_t i=2; i<nXbins; i++){
667 x = width->GetBinCenter(i);
670 y = width->GetBinContent(i);
672 linearFit.AddPoint(&x,y);
674 if(!linearFit.Eval()){
675 dcarCP0 = linearFit.GetParameter(0);
677 pn = Int_t(TMath::Abs(dcarCP0)/dcarCP0);
678 dcarCP0 = pn*TMath::Sqrt(TMath::Abs(dcarCP0));
680 dcarCP1 = linearFit.GetParameter(1);
682 pn = Int_t(TMath::Abs(dcarCP1)/dcarCP1);
683 dcarCP1 = pn*TMath::Sqrt(TMath::Abs(dcarCP1));
686 his3D->GetYaxis()->SetRangeUser(-1,1);
687 his3D->GetZaxis()->SetRangeUser(0,20);
692 (*pcstream)<<"tpcQA"<<
693 "offsetdRA="<< offsetdRA<<
694 "slopedRA="<< slopedRA<<
695 "offsetdRC="<< offsetdRC<<
696 "slopedRC="<<slopedRC<<
698 "offsetdRAErr="<< offsetdRAErr<<
699 "slopedRAErr="<< slopedRAErr<<
700 "offsetdRCErr="<< offsetdRCErr<<
701 "slopedRCErr="<<slopedRCErr<<
703 "offsetdRAchi2="<< offsetdRAchi2<<
704 "slopedRAchi2="<< slopedRAchi2<<
705 "offsetdRCchi2="<< offsetdRCchi2<<
706 "slopedRCchi2="<<slopedRCchi2<<
708 "dcarAP0="<<dcarAP0<<
709 "dcarAP1="<<dcarAP1<<
710 "dcarCP0="<<dcarCP0<<
716 //_____________________________________________________________________________
717 Int_t AliTPCPerformanceSummary::AnalyzeDCARPhiPos(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
720 // Analyse DCA R imperfections for positive particles
723 if (!pcstream) return 16;
724 if (!pTPC) return 16;
727 static Double_t offsetdRAPos=0;
728 static Double_t slopedRAPos=0;
729 static Double_t offsetdRCPos=0;
730 static Double_t slopedRCPos=0;
731 static Double_t offsetdRAErrPos=0;
732 static Double_t slopedRAErrPos=0;
733 static Double_t offsetdRCErrPos=0;
734 static Double_t slopedRCErrPos=0;
735 static Double_t offsetdRAchi2Pos=0;
736 static Double_t slopedRAchi2Pos=0;
737 static Double_t offsetdRCchi2Pos=0;
738 static Double_t slopedRCchi2Pos=0;
740 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
745 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
746 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
747 if(!his3D) return 16;
748 his3D->GetYaxis()->SetRangeUser(-1,1);
749 his3D->GetZaxis()->SetRangeUser(0.25,10);
752 static TF1 *fpol1 = new TF1("fpol1","pol1");
754 if (his3D && !fgForceTHnSparse) {
755 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
757 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(0,1.5);
758 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
759 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
761 if(!his2D) return 16;
763 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
765 his1D = (TH1*) arrayFit.At(1);
766 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
767 offsetdRCPos=fpol1->GetParameter(0);
768 slopedRCPos=fpol1->GetParameter(1);
769 offsetdRCchi2Pos=fpol1->GetChisquare();
770 slopedRCchi2Pos=fpol1->GetChisquare();
772 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
773 offsetdRAPos=fpol1->GetParameter(0);
774 slopedRAPos=fpol1->GetParameter(1);
775 offsetdRAErrPos=fpol1->GetParError(0);
776 slopedRAErrPos=fpol1->GetParError(1);
777 offsetdRAchi2Pos=fpol1->GetChisquare();
778 slopedRAchi2Pos=fpol1->GetChisquare();
780 printf("DCA R QA Pos report\n");
781 printf("offsetdRAPos\t%f\n",offsetdRAPos);
782 printf("slopedRAPos\t%f\n",slopedRAPos);
783 printf("offsetdRCPos\t%f\n",offsetdRCPos);
784 printf("slopedRCPos\t%f\n",slopedRCPos);
788 (*pcstream)<<"tpcQA"<<
789 "offsetdRAPos="<< offsetdRAPos<<
790 "slopedRAPos="<< slopedRAPos<<
791 "offsetdRCPos="<< offsetdRCPos<<
792 "slopedRCPos="<<slopedRCPos<<
794 "offsetdRAErrPos="<< offsetdRAErrPos<<
795 "slopedRAErrPos="<< slopedRAErrPos<<
796 "offsetdRCErrPos="<< offsetdRCErrPos<<
797 "slopedRCErrPos="<<slopedRCErrPos<<
799 "offsetdRAchi2Pos="<< offsetdRAchi2Pos<<
800 "slopedRAchi2Pos="<< slopedRAchi2Pos<<
801 "offsetdRCchi2Pos="<< offsetdRCchi2Pos<<
802 "slopedRCchi2Pos="<<slopedRCchi2Pos;
807 //_____________________________________________________________________________
808 Int_t AliTPCPerformanceSummary::AnalyzeDCARPhiNeg(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
811 // Analyse DCA R imperfections for negative particles
813 if (!pcstream) return 32;
814 if (!pTPC) return 32;
817 static Double_t offsetdRANeg=0;
818 static Double_t slopedRANeg=0;
819 static Double_t offsetdRCNeg=0;
820 static Double_t slopedRCNeg=0;
821 static Double_t offsetdRAErrNeg=0;
822 static Double_t slopedRAErrNeg=0;
823 static Double_t offsetdRCErrNeg=0;
824 static Double_t slopedRCErrNeg=0;
825 static Double_t offsetdRAchi2Neg=0;
826 static Double_t slopedRAchi2Neg=0;
827 static Double_t offsetdRCchi2Neg=0;
828 static Double_t slopedRCchi2Neg=0;
830 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
835 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
836 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
837 if(!his3D) return 32;
838 his3D->GetYaxis()->SetRangeUser(-1,1);
839 his3D->GetZaxis()->SetRangeUser(0.25,10);
842 static TF1 *fpol1 = new TF1("fpol1","pol1");
844 if (his3D && !fgForceTHnSparse) {
845 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
847 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,0);
848 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
849 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
851 if(!his2D) return 32;
853 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
855 his1D = (TH1*) arrayFit.At(1);
856 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
857 offsetdRCNeg=fpol1->GetParameter(0);
858 slopedRCNeg=fpol1->GetParameter(1);
859 offsetdRCchi2Neg=fpol1->GetChisquare();
860 slopedRCchi2Neg=fpol1->GetChisquare();
862 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
863 offsetdRANeg=fpol1->GetParameter(0);
864 slopedRANeg=fpol1->GetParameter(1);
865 offsetdRAErrNeg=fpol1->GetParError(0);
866 slopedRAErrNeg=fpol1->GetParError(1);
867 offsetdRAchi2Neg=fpol1->GetChisquare();
868 slopedRAchi2Neg=fpol1->GetChisquare();
870 printf("DCA R QA Neg report\n");
871 printf("offsetdRANeg\t%f\n",offsetdRANeg);
872 printf("slopedRANeg\t%f\n",slopedRANeg);
873 printf("offsetdRCNeg\t%f\n",offsetdRCNeg);
874 printf("slopedRCNeg\t%f\n",slopedRCNeg);
876 // dump drift QA values
878 (*pcstream)<<"tpcQA"<<
879 "offsetdRANeg="<< offsetdRANeg<<
880 "slopedRANeg="<< slopedRANeg<<
881 "offsetdRCNeg="<< offsetdRCNeg<<
882 "slopedRCNeg="<<slopedRCNeg<<
884 "offsetdRAErrNeg="<< offsetdRAErrNeg<<
885 "slopedRAErrNeg="<< slopedRAErrNeg<<
886 "offsetdRCErrNeg="<< offsetdRCErrNeg<<
887 "slopedRCErrNeg="<<slopedRCErrNeg<<
889 "offsetdRAchi2Neg="<< offsetdRAchi2Neg<<
890 "slopedRAchi2Neg="<< slopedRAchi2Neg<<
891 "offsetdRCchi2Neg="<< offsetdRCchi2Neg<<
892 "slopedRCchi2Neg="<<slopedRCchi2Neg;
897 //_____________________________________________________________________________
898 Int_t AliTPCPerformanceSummary::AnalyzeNCL(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
901 // Analyse number of TPC clusters
904 if (!pcstream) return 1;
908 static Double_t meanTPCnclF=0;
909 static Double_t rmsTPCnclF=0;
910 static Double_t meanTPCChi2=0;
911 static Double_t rmsTPCChi2=0;
912 static Double_t slopeATPCnclF=0;
913 static Double_t slopeCTPCnclF=0;
914 static Double_t slopeATPCnclFErr=0;
915 static Double_t slopeCTPCnclFErr=0;
916 static Double_t meanTPCncl=0;
917 static Double_t rmsTPCncl=0;
918 static Double_t slopeATPCncl=0;
919 static Double_t slopeCTPCncl=0;
920 static Double_t slopeATPCnclErr=0;
921 static Double_t slopeCTPCnclErr=0;
928 static TF1 *fpol1 = new TF1("fpol1","pol1");
931 // only events with rec. vertex
933 // pt cut - 0.250 GeV
934 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-1.,1.);
935 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0.25,10);
937 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7")) {
938 his3D0 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7"));
939 if(!his3D0) return 1;
940 his3D0->GetYaxis()->SetRangeUser(-1,1);
941 his3D0->GetZaxis()->SetRangeUser(0.25,10);
943 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7")) {
944 his3D1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7"));
945 if(!his3D1) return 1;
946 his3D1->GetYaxis()->SetRangeUser(-1,1);
947 his3D1->GetZaxis()->SetRangeUser(0.25,10);
949 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7")) {
950 his3D2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7"));
951 if(!his3D2) return 1;
952 his3D2->GetYaxis()->SetRangeUser(-1,1);
953 his3D2->GetZaxis()->SetRangeUser(0.25,10);
954 his3D2->GetXaxis()->SetRangeUser(0.4,1.1);
958 if (his3D0 && !fgForceTHnSparse) {
959 his1D = his3D0->Project3D("x");
961 his1D = pTPC->GetTPCTrackHisto()->Projection(0);
964 meanTPCncl= his1D->GetMean();
965 rmsTPCncl= his1D->GetRMS();
968 if (his3D1 && !fgForceTHnSparse) {
969 his1D = his3D1->Project3D("x");
971 his1D = pTPC->GetTPCTrackHisto()->Projection(1);
974 meanTPCChi2= his1D->GetMean();
975 rmsTPCChi2= his1D->GetRMS();
978 if (his3D0 && !fgForceTHnSparse) {
979 hprof = (dynamic_cast<TH2*>(his3D0->Project3D("xy")))->ProfileX();
981 hprof = pTPC->GetTPCTrackHisto()->Projection(0,5)->ProfileX();
985 hprof->Fit(fpol1,"QNR","QNR",0.1,0.8);
986 slopeATPCncl= fpol1->GetParameter(1);
987 slopeATPCnclErr= fpol1->GetParError(1);
988 hprof->Fit(fpol1,"QNR","QNR",-0.8,-0.1);
989 slopeCTPCncl= fpol1->GetParameter(1);
990 slopeCTPCnclErr= fpol1->GetParameter(1);
997 if (his3D2 && !fgForceTHnSparse) {
998 his1D = his3D2->Project3D("x");
1000 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0.4,1.1);
1001 his1D = pTPC->GetTPCTrackHisto()->Projection(2);
1004 meanTPCnclF= his1D->GetMean();
1005 rmsTPCnclF= his1D->GetRMS();
1008 if (his3D2 && !fgForceTHnSparse) {
1009 his1D = (dynamic_cast<TH2*>(his3D2->Project3D("xy")))->ProfileX();
1011 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0.4,1.1);
1012 his1D = pTPC->GetTPCTrackHisto()->Projection(2,5)->ProfileX();
1014 if(!his1D) return 1;
1016 his1D->Fit(fpol1,"QNR","QNR",0.1,0.8);
1017 slopeATPCnclF= fpol1->GetParameter(1);
1018 slopeATPCnclFErr= fpol1->GetParError(1);
1019 his1D->Fit(fpol1,"QNR","QNR",-0.8,-0.1);
1020 slopeCTPCnclF= fpol1->GetParameter(1);
1021 slopeCTPCnclFErr= fpol1->GetParameter(1);
1024 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0,10);
1026 printf("Cluster QA report\n");
1027 printf("meanTPCnclF=\t%f\n",meanTPCnclF);
1028 printf("rmsTPCnclF=\t%f\n",rmsTPCnclF);
1029 printf("slopeATPCnclF=\t%f\n",slopeATPCnclF);
1030 printf("slopeCTPCnclF=\t%f\n",slopeCTPCnclF);
1031 printf("meanTPCncl=\t%f\n",meanTPCncl);
1032 printf("rmsTPCncl=\t%f\n",rmsTPCncl);
1033 printf("slopeATPCncl=\t%f\n",slopeATPCncl);
1034 printf("slopeCTPCncl=\t%f\n",slopeCTPCncl);
1035 printf("meanTPCChi2=\t%f\n",meanTPCChi2);
1036 printf("rmsTPCChi2=\t%f\n",rmsTPCChi2);
1038 // dump results to the tree
1040 (*pcstream)<<"tpcQA"<<
1041 "meanTPCnclF="<<meanTPCnclF <<
1042 "rmsTPCnclF="<<rmsTPCnclF <<
1043 "meanTPCChi2="<<meanTPCChi2 <<
1044 "rmsTPCChi2="<<rmsTPCChi2 <<
1045 "slopeATPCnclF="<< slopeATPCnclF<<
1046 "slopeCTPCnclF="<< slopeCTPCnclF<<
1047 "slopeATPCnclFErr="<< slopeATPCnclFErr<<
1048 "slopeCTPCnclFErr="<< slopeCTPCnclFErr<<
1049 "meanTPCncl="<<meanTPCncl <<
1050 "rmsTPCncl="<< rmsTPCncl<<
1051 "slopeATPCncl="<< slopeATPCncl<<
1052 "slopeCTPCncl="<< slopeCTPCncl<<
1053 "slopeATPCnclErr="<< slopeATPCnclErr<<
1054 "slopeCTPCnclErr="<< slopeCTPCnclErr;
1059 //_____________________________________________________________________________
1060 Int_t AliTPCPerformanceSummary::AnalyzeDrift(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
1063 // Analyse DCA Z imperferctions (drift velocity)
1066 if (!pcstream) return 2;
1067 if (!pTPC) return 2;
1070 static Double_t offsetdZA=0;
1071 static Double_t slopedZA=0;
1072 static Double_t offsetdZC=0;
1073 static Double_t slopedZC=0;
1074 static Double_t offsetdZAErr=0;
1075 static Double_t slopedZAErr=0;
1076 static Double_t offsetdZCErr=0;
1077 static Double_t slopedZCErr=0;
1078 static Double_t offsetdZAchi2=0;
1079 static Double_t slopedZAchi2=0;
1080 static Double_t offsetdZCchi2=0;
1081 static Double_t slopedZCchi2=0;
1086 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7")) {
1087 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7"));
1088 if(!his3D) return 2;
1089 his3D->GetYaxis()->SetRangeUser(-1,1);
1090 his3D->GetZaxis()->SetRangeUser(0.25,10);
1093 if (his3D && !fgForceTHnSparse) {
1094 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
1096 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
1098 if(!his2D) return 2;
1100 static TF1 *fpol1 = new TF1("fpol1","pol1");
1102 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
1104 his1D = (TH1*) arrayFit.At(1);
1105 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
1106 offsetdZC=fpol1->GetParameter(0);
1107 slopedZC=fpol1->GetParameter(1);
1108 offsetdZCErr=fpol1->GetParError(0);
1109 slopedZCErr=fpol1->GetParError(1);
1110 offsetdZCchi2=fpol1->GetChisquare();
1111 slopedZCchi2=fpol1->GetChisquare();
1113 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
1114 offsetdZA=fpol1->GetParameter(0);
1115 slopedZA=fpol1->GetParameter(1);
1116 offsetdZAErr=fpol1->GetParError(0);
1117 slopedZAErr=fpol1->GetParError(1);
1118 offsetdZAchi2=fpol1->GetChisquare();
1119 slopedZAchi2=fpol1->GetChisquare();
1121 printf("Drift velocity QA report\n");
1122 printf("offsetdZA\t%f\n",offsetdZA);
1123 printf("slopedZA\t%f\n",slopedZA);
1124 printf("offsetdZC\t%f\n",offsetdZC);
1125 printf("slopedZC\t%f\n",slopedZC);
1127 // dump drift QA values
1129 (*pcstream)<<"tpcQA"<<
1130 "offsetdZA="<< offsetdZA<<
1131 "slopedZA="<< slopedZA<<
1132 "offsetdZC="<< offsetdZC<<
1133 "slopedZC="<<slopedZC<<
1135 "offsetdZAErr="<< offsetdZAErr<<
1136 "slopedZAErr="<< slopedZAErr<<
1137 "offsetdZCErr="<< offsetdZCErr<<
1138 "slopedZCErr="<<slopedZCErr<<
1140 "offsetdZAchi2="<< offsetdZAchi2<<
1141 "slopedZAchi2="<< slopedZAchi2<<
1142 "offsetdZCchi2="<< offsetdZCchi2<<
1143 "slopedZCchi2="<<slopedZCchi2;
1148 //_____________________________________________________________________________
1149 Int_t AliTPCPerformanceSummary::AnalyzeDriftPos(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
1152 // Analyse DCA Z imperferctions (drift velocity)
1153 // for positive particles
1155 if (!pcstream) return 64;
1156 if (!pTPC) return 64;
1159 static Double_t offsetdZAPos=0;
1160 static Double_t slopedZAPos=0;
1161 static Double_t offsetdZCPos=0;
1162 static Double_t slopedZCPos=0;
1163 static Double_t offsetdZAErrPos=0;
1164 static Double_t slopedZAErrPos=0;
1165 static Double_t offsetdZCErrPos=0;
1166 static Double_t slopedZCErrPos=0;
1167 static Double_t offsetdZAchi2Pos=0;
1168 static Double_t slopedZAchi2Pos=0;
1169 static Double_t offsetdZCchi2Pos=0;
1170 static Double_t slopedZCchi2Pos=0;
1175 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7")) {
1176 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7"));
1177 if(!his3D) return 64;
1178 his3D->GetYaxis()->SetRangeUser(-1,1);
1179 his3D->GetZaxis()->SetRangeUser(0.25,10);
1182 if (his3D && !fgForceTHnSparse) {
1183 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
1185 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
1187 if(!his2D) return 64;
1189 static TF1 *fpol1 = new TF1("fpol1","pol1");
1191 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
1194 his1D = (TH1*) arrayFit.At(1);
1195 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
1196 offsetdZCPos=fpol1->GetParameter(0);
1197 slopedZCPos=fpol1->GetParameter(1);
1198 offsetdZCErrPos=fpol1->GetParError(0);
1199 slopedZCErrPos=fpol1->GetParError(1);
1200 offsetdZCchi2Pos=fpol1->GetChisquare();
1201 slopedZCchi2Pos=fpol1->GetChisquare();
1203 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
1204 offsetdZAPos=fpol1->GetParameter(0);
1205 slopedZAPos=fpol1->GetParameter(1);
1206 offsetdZAErrPos=fpol1->GetParError(0);
1207 slopedZAErrPos=fpol1->GetParError(1);
1208 offsetdZAchi2Pos=fpol1->GetChisquare();
1209 slopedZAchi2Pos=fpol1->GetChisquare();
1211 printf("Drift velocity QA report\n");
1212 printf("offsetdZAPos\t%f\n",offsetdZAPos);
1213 printf("slopedZAPos\t%f\n",slopedZAPos);
1214 printf("offsetdZCPos\t%f\n",offsetdZCPos);
1215 printf("slopedZCPos\t%f\n",slopedZCPos);
1217 // dump drift QA values
1219 (*pcstream)<<"tpcQA"<<
1220 "offsetdZAPos="<< offsetdZAPos<<
1221 "slopedZAPos="<< slopedZAPos<<
1222 "offsetdZCPos="<< offsetdZCPos<<
1223 "slopedZCPos="<<slopedZCPos<<
1225 "offsetdZAErrPos="<< offsetdZAErrPos<<
1226 "slopedZAErrPos="<< slopedZAErrPos<<
1227 "offsetdZCErrPos="<< offsetdZCErrPos<<
1228 "slopedZCErrPos="<<slopedZCErrPos<<
1230 "offsetdZAchi2Pos="<< offsetdZAchi2Pos<<
1231 "slopedZAchi2Pos="<< slopedZAchi2Pos<<
1232 "offsetdZCchi2Pos="<< offsetdZCchi2Pos<<
1233 "slopedZCchi2Pos="<<slopedZCchi2Pos;
1238 //_____________________________________________________________________________
1239 Int_t AliTPCPerformanceSummary::AnalyzeDriftNeg(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
1242 // Analyse DCA Z imperferctions (drift velocity)
1243 // for negative particles
1245 if (!pcstream) return 128;
1246 if (!pTPC) return 128;
1249 static Double_t offsetdZANeg=0;
1250 static Double_t slopedZANeg=0;
1251 static Double_t offsetdZCNeg=0;
1252 static Double_t slopedZCNeg=0;
1253 static Double_t offsetdZAErrNeg=0;
1254 static Double_t slopedZAErrNeg=0;
1255 static Double_t offsetdZCErrNeg=0;
1256 static Double_t slopedZCErrNeg=0;
1257 static Double_t offsetdZAchi2Neg=0;
1258 static Double_t slopedZAchi2Neg=0;
1259 static Double_t offsetdZCchi2Neg=0;
1260 static Double_t slopedZCchi2Neg=0;
1266 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7")) {
1267 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7"));
1268 if(!his3D) return 128;
1269 his3D->GetYaxis()->SetRangeUser(-1,1);
1270 his3D->GetZaxis()->SetRangeUser(0.25,10);
1272 if (his3D && !fgForceTHnSparse) {
1273 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
1275 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
1277 if(!his2D) return 128;
1279 static TF1 *fpol1 = new TF1("fpol1","pol1");
1281 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
1284 his1D = (TH1*) arrayFit.At(1);
1285 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
1286 offsetdZCNeg=fpol1->GetParameter(0);
1287 slopedZCNeg=fpol1->GetParameter(1);
1288 offsetdZCErrNeg=fpol1->GetParError(0);
1289 slopedZCErrNeg=fpol1->GetParError(1);
1290 offsetdZCchi2Neg=fpol1->GetChisquare();
1291 slopedZCchi2Neg=fpol1->GetChisquare();
1293 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
1294 offsetdZANeg=fpol1->GetParameter(0);
1295 slopedZANeg=fpol1->GetParameter(1);
1296 offsetdZAErrNeg=fpol1->GetParError(0);
1297 slopedZAErrNeg=fpol1->GetParError(1);
1298 offsetdZAchi2Neg=fpol1->GetChisquare();
1299 slopedZAchi2Neg=fpol1->GetChisquare();
1301 printf("Drift velocity QA report\n");
1302 printf("offsetdZANeg\t%f\n",offsetdZANeg);
1303 printf("slopedZANeg\t%f\n",slopedZANeg);
1304 printf("offsetdZCNeg\t%f\n",offsetdZCNeg);
1305 printf("slopedZCNeg\t%f\n",slopedZCNeg);
1307 // dump drift QA values
1309 (*pcstream)<<"tpcQA"<<
1310 "offsetdZANeg="<< offsetdZANeg<<
1311 "slopedZANeg="<< slopedZANeg<<
1312 "offsetdZCNeg="<< offsetdZCNeg<<
1313 "slopedZCNeg="<<slopedZCNeg<<
1315 "offsetdZAErrNeg="<< offsetdZAErrNeg<<
1316 "slopedZAErrNeg="<< slopedZAErrNeg<<
1317 "offsetdZCErrNeg="<< offsetdZCErrNeg<<
1318 "slopedZCErrNeg="<<slopedZCErrNeg<<
1320 "offsetdZAchi2Neg="<< offsetdZAchi2Neg<<
1321 "slopedZAchi2Neg="<< slopedZAchi2Neg<<
1322 "offsetdZCchi2Neg="<< offsetdZCchi2Neg<<
1323 "slopedZCchi2Neg="<<slopedZCchi2Neg;
1328 //_____________________________________________________________________________
1329 Int_t AliTPCPerformanceSummary::AnalyzeGain(const AliPerformanceDEdx* pTPCgain, TTreeSRedirector* const pcstream)
1335 if (!pcstream) return 4;
1336 if (!pTPCgain) return 4;
1338 static TVectorD meanMIPvsSector(36);
1339 static TVectorD sector(36);
1340 static Float_t meanMIP = 0;
1341 static Float_t resolutionMIP = 0;
1342 static Float_t attachSlopeC = 0;
1343 static Float_t attachSlopeA = 0;
1346 //TH1 * hisProj1D=0;
1350 meanMIPvsSector.Zero();
1352 // select MIP particles
1354 pTPCgain->GetDeDxHisto()->GetAxis(7)->SetRangeUser(0.4,0.55);
1355 pTPCgain->GetDeDxHisto()->GetAxis(0)->SetRangeUser(35,60);
1356 pTPCgain->GetDeDxHisto()->GetAxis(6)->SetRangeUser(80,160);
1357 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-1,1);
1359 // MIP position and resolution
1361 TF1 gausFit("gausFit","gaus");
1363 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_0") && !fgForceTHnSparse) {
1364 his1D = dynamic_cast<TH1*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_0")->Clone());
1366 his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1368 if(!his1D) return 4;
1369 his1D->Fit(&gausFit,"QN","QN");
1371 meanMIP = gausFit.GetParameter(1);
1373 if (meanMIP!=0) resolutionMIP = gausFit.GetParameter(2)/meanMIP;
1374 //removedtotest// delete his1D;
1376 // MIP position vs. dip angle (attachment)
1378 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-3,0); // C side
1379 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_5") && !fgForceTHnSparse) {
1380 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_5")->Clone());
1382 his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
1384 if(!his2D) return 4;
1386 TF1 * fpol = new TF1("fpol","pol1");
1388 his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
1389 his1D = (TH1*) arrayFit.At(1);
1390 his1D->Fit(fpol,"QNROB=0.8","QNR",-1,0);
1391 attachSlopeC = fpol->GetParameter(1);
1392 //removedtotest// delete his2D;
1393 //removedtotest// delete his1D;
1395 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(0,3); // A side
1396 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_5") && !fgForceTHnSparse) {
1397 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_5")->Clone());
1399 his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
1401 if(!his2D) return 4;
1403 TF1 * fpolA = new TF1("fpolA","pol1");
1404 TObjArray arrayFitA;
1405 his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
1406 his1D = (TH1*) arrayFit.At(1);
1407 his1D->Fit(fpolA,"QNROB=0.8","QN",0,1);
1408 attachSlopeA = fpolA->GetParameter(1);
1409 //removedtotest// delete his2D;
1410 //removedtotest// delete his1D;
1412 // MIP position vs. sector
1414 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-3,0); // C side
1415 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_1") && !fgForceTHnSparse) {
1416 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_1")->Clone());
1418 his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
1420 if(!his2D) return 4;
1422 for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
1424 Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
1425 Float_t phiUp = -TMath::Pi() + (i+1)*(20./360.)*(2*TMath::Pi());
1426 //pTPCgain->GetDeDxHisto()->GetAxis(1)->SetRangeUser(phiLow,phiUp);
1427 his2D->GetXaxis()->SetRangeUser(phiLow,phiUp);
1428 //his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1429 his1D = his2D->ProjectionY();
1430 TF1 gausFunc("gausFunc","gaus");
1431 his1D->Fit(&gausFunc, "QN");
1432 meanMIPvsSector(i) = gausFunc.GetParameter(1);
1434 //removedtotest// delete his1D;
1436 //removedtotest// delete his2D;
1438 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(0,3); // A side
1439 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_1") && !fgForceTHnSparse) {
1440 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_1")->Clone());
1442 his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
1444 if(!his2D) return 4;
1446 for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
1448 Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
1449 Float_t phiUp = -TMath::Pi() + (i+1)*(20./360.)*(2*TMath::Pi());
1450 //pTPCgain->GetDeDxHisto()->GetAxis(1)->SetRangeUser(phiLow,phiUp);
1451 his2D->GetXaxis()->SetRangeUser(phiLow,phiUp);
1452 //his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1453 his1D = his2D->ProjectionY();
1454 TF1 gausFunc("gausFunc","gaus");
1455 his1D->Fit(&gausFunc, "QN");
1456 meanMIPvsSector(i+18) = gausFunc.GetParameter(1);
1458 //removedtotest// delete his1D;
1460 //removedtotest// delete his2D;
1462 printf("Gain QA report\n");
1463 printf("MIP mean\t%f\n",meanMIP);
1464 printf("MIP resolution\t%f\n",resolutionMIP);
1465 printf("MIPslopeA\t%f\n",attachSlopeA);
1466 printf("MIPslopeC\t%f\n",attachSlopeC);
1469 (*pcstream)<<"tpcQA"<<
1470 "MIPattachSlopeC="<<attachSlopeC<<
1471 "MIPattachSlopeA="<<attachSlopeA<<
1472 "resolutionMIP="<<resolutionMIP<<
1473 "meanMIPvsSector.="<<&meanMIPvsSector<<
1474 "sector.="<<§or<<
1475 "meanMIP="<<meanMIP;
1480 //_____________________________________________________________________________
1481 Int_t AliTPCPerformanceSummary::AnalyzeEvent(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
1484 // Analyse Primary Vertex Distribution and Multiplicities
1486 if (!pcstream) return 1;
1487 if (!pTPC) return 1;
1491 static Double_t meanVertX=0;
1492 static Double_t rmsVertX=0;
1493 static Double_t meanVertY=0;
1494 static Double_t rmsVertY=0;
1495 static Double_t meanVertZ=0;
1496 static Double_t rmsVertZ=0;
1497 static Double_t vertStatus=0;
1498 static Double_t meanMult=0;
1499 static Double_t rmsMult=0;
1500 static Double_t meanMultPos=0;
1501 static Double_t rmsMultPos=0;
1502 static Double_t meanMultNeg=0;
1503 static Double_t rmsMultNeg=0;
1504 static Double_t vertAll = 0;
1505 static Double_t vertOK = 0;
1509 if (pTPC->GetHistos()->FindObject("h_tpc_event_6") && !fgForceTHnSparse) {
1510 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_6")->Clone());
1512 his1D = pTPC->GetTPCEventHisto()->Projection(6);
1514 if(!his1D) return 1;
1516 vertAll = his1D->GetEntries();
1517 vertOK = his1D->GetBinContent(2);
1519 vertStatus = vertOK / vertAll;
1524 pTPC->GetTPCEventHisto()->GetAxis(6)->SetRange(2,2);
1526 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_0") && !fgForceTHnSparse) {
1527 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_0")->Clone());
1529 his1D = pTPC->GetTPCEventHisto()->Projection(0);
1531 if(!his1D) return 1;
1533 meanVertX = his1D->GetMean();
1534 rmsVertX = his1D->GetRMS();
1540 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_1") && !fgForceTHnSparse) {
1541 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_1")->Clone());
1543 his1D = pTPC->GetTPCEventHisto()->Projection(1);
1545 if(!his1D) return 1;
1547 meanVertY = his1D->GetMean();
1548 rmsVertY = his1D->GetRMS();
1552 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2") && !fgForceTHnSparse) {
1553 hc = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2"));
1555 //his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2")->Clone());
1556 his1D = (TH1*)hc->Clone();
1558 his1D = pTPC->GetTPCEventHisto()->Projection(2);
1560 if(!his1D) return 1;
1562 meanVertZ = his1D->GetMean();
1563 rmsVertZ = his1D->GetRMS();
1567 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3") && !fgForceTHnSparse) {
1568 hc = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3"));
1570 //his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3")->Clone());
1571 his1D = (TH1*)hc->Clone();
1573 his1D = pTPC->GetTPCEventHisto()->Projection(3);
1575 if(!his1D) return 1;
1577 meanMult = his1D->GetMean();
1578 rmsMult = his1D->GetRMS();
1582 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_4") && !fgForceTHnSparse) {
1583 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_4")->Clone());
1585 his1D = pTPC->GetTPCEventHisto()->Projection(4);
1587 if(!his1D) return 1;
1589 meanMultPos = his1D->GetMean();
1590 rmsMultPos = his1D->GetRMS();
1593 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_5") && !fgForceTHnSparse) {
1594 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_5")->Clone());
1596 his1D = pTPC->GetTPCEventHisto()->Projection(5);
1598 if(!his1D) return 1;
1600 meanMultNeg = his1D->GetMean();
1601 rmsMultNeg = his1D->GetRMS();
1604 pTPC->GetTPCEventHisto()->GetAxis(6)->SetRange(1,2);
1606 (*pcstream)<<"tpcQA"<<
1607 "meanVertX="<<meanVertX<<
1608 "rmsVertX="<<rmsVertX<<
1609 "meanVertY="<<meanVertY<<
1610 "rmsVertY="<<rmsVertY<<
1611 "meanVertZ="<<meanVertZ<<
1612 "rmsVertZ="<<rmsVertZ<<
1613 "vertStatus="<<vertStatus<<
1614 "vertAll="<<vertAll<<
1616 "meanMult="<<meanMult<<
1617 "rmsMult="<<rmsMult<<
1618 "meanMultPos="<<meanMultPos<<
1619 "rmsMultPos="<<rmsMultPos<<
1620 "meanMultNeg="<<meanMultNeg<<
1621 "rmsMultNeg="<<rmsMultNeg;
1626 //_____________________________________________________________________________
1627 Int_t AliTPCPerformanceSummary::AnalyzePt(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
1630 // Analyse DCA R imperfections for positive particles
1633 if (!pcstream) return 256;
1634 if (!pTPC) return 256;
1637 static Double_t meanPtAPos = 0;
1638 static Double_t mediumPtAPos = 0;
1639 static Double_t highPtAPos = 0;
1640 static Double_t meanPtCPos = 0;
1641 static Double_t mediumPtCPos = 0;
1642 static Double_t highPtCPos = 0;
1644 static Double_t meanPtANeg = 0;
1645 static Double_t mediumPtANeg = 0;
1646 static Double_t highPtANeg = 0;
1647 static Double_t meanPtCNeg = 0;
1648 static Double_t mediumPtCNeg = 0;
1649 static Double_t highPtCNeg = 0;
1654 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
1656 his3D1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
1657 if(!his3D1) return 256;
1659 his3D1->GetYaxis()->SetRangeUser(0.1,0.8);
1661 his3D1->GetZaxis()->SetRangeUser(0.25,10);
1662 meanPtAPos = his3D1->GetMean(3);
1663 his3D1->GetZaxis()->SetRangeUser(2,5);
1664 mediumPtAPos = his3D1->GetMean(3);
1665 his3D1->GetZaxis()->SetRangeUser(5,10);
1666 highPtAPos = his3D1->GetMean(3);
1668 his3D1->GetYaxis()->SetRangeUser(-0.8,-0.1);
1670 his3D1->GetZaxis()->SetRangeUser(0.25,10);
1671 meanPtCPos = his3D1->GetMean(3);
1672 his3D1->GetZaxis()->SetRangeUser(2,5);
1673 mediumPtCPos = his3D1->GetMean(3);
1674 his3D1->GetZaxis()->SetRangeUser(5,10);
1675 highPtCPos = his3D1->GetMean(3);
1677 his3D1->GetYaxis()->SetRangeUser(-1,1);
1678 his3D1->GetZaxis()->SetRangeUser(0.25,10);
1682 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
1684 his3D2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
1685 if(!his3D2) return 256;
1687 his3D2->GetYaxis()->SetRangeUser(0.1,0.8);
1689 his3D2->GetZaxis()->SetRangeUser(0.25,10);
1690 meanPtANeg = his3D2->GetMean(3);
1691 his3D2->GetZaxis()->SetRangeUser(2,5);
1692 mediumPtANeg = his3D2->GetMean(3);
1693 his3D2->GetZaxis()->SetRangeUser(5,10);
1694 highPtANeg = his3D2->GetMean(3);
1696 his3D2->GetYaxis()->SetRangeUser(-0.8,-0.1);
1698 his3D2->GetZaxis()->SetRangeUser(0.25,10);
1699 meanPtCNeg = his3D2->GetMean(3);
1700 his3D2->GetZaxis()->SetRangeUser(2,5);
1701 mediumPtCNeg = his3D2->GetMean(3);
1702 his3D2->GetZaxis()->SetRangeUser(5,10);
1703 highPtCNeg = his3D2->GetMean(3);
1705 his3D2->GetYaxis()->SetRangeUser(-1,1);
1706 his3D2->GetZaxis()->SetRangeUser(0.25,10);
1713 (*pcstream)<<"tpcQA"<<
1714 "meanPtAPos="<< meanPtAPos<<
1715 "mediumPtAPos="<< mediumPtAPos<<
1716 "highPtAPos="<< highPtAPos<<
1718 "meanPtCPos="<< meanPtCPos<<
1719 "mediumPtCPos="<< mediumPtCPos<<
1720 "highPtCPos="<< highPtCPos<<
1722 "meanPtANeg="<< meanPtANeg<<
1723 "mediumPtANeg="<< mediumPtANeg<<
1724 "highPtANeg="<< highPtANeg<<
1726 "meanPtCNeg="<< meanPtCNeg<<
1727 "mediumPtCNeg="<< mediumPtCNeg<<
1728 "highPtCNeg="<< highPtCNeg;
1734 //_____________________________________________________________________________
1736 Int_t AliTPCPerformanceSummary::AnalyzeChargeOverPt(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream){
1738 // Analyse DCA R imperfections for positive particles
1741 if (!pcstream) return 512;
1742 if (!pTPC) return 512;
1745 static Double_t qOverPt = 0;
1746 static Double_t qOverPtA = 0;
1747 static Double_t qOverPtC = 0;
1753 TF1 *fp1 = new TF1("fp1","pol2",-1.0,1.0);
1754 TF1 *fp2 = new TF1("fp2","pol2",-1.0,1.0);
1755 TF1 *fp3 = new TF1("fp3","pol2",-1.0,1.0);
1757 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8")) {
1759 his2D = dynamic_cast<TH2*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8"));
1760 if(!his2D) return 512;
1762 his1D1 = his2D->ProjectionX();
1763 his1D1->Fit(fp1,"R");
1764 if(fp1->GetParameter(2)!=0){
1765 qOverPt = (-1.0)*(fp1->GetParameter(1)/(2.0*fp1->GetParameter(2)));
1770 his2D->GetYaxis()->SetRangeUser(0.1,0.8);
1771 his1D2 = his2D->ProjectionX();
1772 his1D2->Fit(fp2,"R");
1773 if(fp2->GetParameter(2)!=0)
1774 qOverPtA = (-1.0)*(fp2->GetParameter(1)/(2.0*fp2->GetParameter(2)));
1778 his2D->GetYaxis()->SetRangeUser(-0.8,-0.1);
1779 his1D3 = his2D->ProjectionX();
1780 his1D3->Fit(fp3,"R");
1781 if(fp3->GetParameter(2)!=0)
1782 qOverPtC = (-1.0)*(fp3->GetParameter(1)/(2.0*fp3->GetParameter(2)));
1786 his2D->GetYaxis()->SetRangeUser(-1.0,1.0);
1790 (*pcstream)<<"tpcQA"<<
1791 "qOverPt="<< qOverPt<<
1792 "qOverPtA="<< qOverPtA<<
1793 "qOverPtC="<< qOverPtC;
1798 Int_t AliTPCPerformanceSummary::AnalyzeMatch(const AliPerformanceMatch* pMatch, TTreeSRedirector* const pcstream)
1800 /* if ((pMatch == 0) or (0 == pcstream)) { printf("this will not work anyway..."); }
1801 printf("funtion not implemented");*/
1803 if (!pcstream) return 1024;
1804 if (!pMatch) return 1024;
1805 static Double_t tpcItsMatchA = 0;
1806 static Double_t tpcItsMatchHighPtA = 0;
1807 static Double_t tpcItsMatchC = 0;
1808 static Double_t tpcItsMatchHighPtC = 0;
1812 if(pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_all_2_3") &&
1813 pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_tpc_2_3")){
1814 h2D = dynamic_cast<TH2*>(pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_all_2_3"));
1815 h2D1 = dynamic_cast<TH2*>(pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_tpc_2_3"));
1820 h2D->GetXaxis()->SetRangeUser(0,1.5);
1821 h2D1->GetXaxis()->SetRangeUser(0,1.5);
1823 Double_t entries,entries1;
1824 entries = h2D->GetEffectiveEntries();
1825 entries1 = h2D1->GetEffectiveEntries();
1827 tpcItsMatchA = entries1/entries;
1829 h2D->GetYaxis()->SetRangeUser(4.01,20.);
1830 h2D1->GetYaxis()->SetRangeUser(4.01,20.);
1831 entries = h2D->GetEffectiveEntries();
1832 entries1 = h2D1->GetEffectiveEntries();
1834 tpcItsMatchHighPtA = entries1/entries;
1837 h2D->GetXaxis()->SetRangeUser(-1.5,-0.01);
1838 h2D1->GetXaxis()->SetRangeUser(-1.5,-0.01);
1839 h2D->GetYaxis()->SetRangeUser(0.0,20.);
1840 h2D1->GetYaxis()->SetRangeUser(0.0,20.);
1842 entries = h2D->GetEffectiveEntries();
1843 entries1 = h2D1->GetEffectiveEntries();
1845 tpcItsMatchC = entries1/entries;
1847 h2D->GetYaxis()->SetRangeUser(4.01,20.);
1848 h2D1->GetYaxis()->SetRangeUser(4.01,20.);
1849 entries = h2D->GetEffectiveEntries();
1850 entries1 = h2D1->GetEffectiveEntries();
1852 tpcItsMatchHighPtC = entries1/entries;
1854 h2D->GetXaxis()->SetRangeUser(-1.5,1.5);
1855 h2D1->GetXaxis()->SetRangeUser(-1.5,1.5);
1856 h2D->GetYaxis()->SetRangeUser(0.0,20.);
1857 h2D1->GetYaxis()->SetRangeUser(0.0,20.);
1862 (*pcstream)<<"tpcQA"<<
1863 "tpcItsMatchA="<< tpcItsMatchA<<
1864 "tpcItsMatchHighPtA="<< tpcItsMatchHighPtA<<
1865 "tpcItsMatchC="<< tpcItsMatchC<<
1866 "tpcItsMatchHighPtC="<< tpcItsMatchHighPtC;
1871 Int_t AliTPCPerformanceSummary::AnalyzePull(const AliPerformanceMatch* pPull, TTreeSRedirector* const pcstream)
1873 /* if ((pPull == 0) or (0 == pcstream)) { printf("this will not work anyway..."); }
1874 printf("funtion not implemented");*/
1876 if (!pcstream) return 2048;
1877 if (!pPull) return 2048;
1878 static Double_t phiPull = 0;
1879 static Double_t phiPullHighPt = 0;
1880 static Double_t ptPull = 0;
1881 static Double_t ptPullHighPt = 0;
1882 static Double_t yPull = 0;
1883 static Double_t yPullHighPt = 0;
1884 static Double_t zPull = 0;
1885 static Double_t zPullHighPt = 0;
1886 static Double_t lambdaPull = 0;
1887 static Double_t lambdaPullHighPt = 0;
1890 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_2_7")){
1891 h2D1 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_2_7"));
1893 phiPull = h2D1->GetMean(2);
1894 h2D1->SetAxisRange(0.0,1.0/5.0,"X");
1895 phiPullHighPt = h2D1->GetMean(2);
1896 h2D1->SetAxisRange(0.0,10.0,"X");
1901 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_4_7")){
1902 h2D2 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_4_7"));
1904 ptPull = h2D2->GetMean(2);
1906 h2D2->SetAxisRange(0.0,1.0/5.0,"X");
1907 ptPullHighPt = h2D2->GetMean(2);
1908 h2D2->SetAxisRange(0.0,10.0,"X");
1913 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_0_7")){
1914 h2D3 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_0_7"));
1916 yPull = h2D3->GetMean(2);
1918 h2D3->SetAxisRange(0.0,1.0/5.0,"X");
1919 yPullHighPt = h2D3->GetMean(2);
1920 h2D3->SetAxisRange(0.0,10.0,"X");
1925 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_1_7")){
1926 h2D4 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_1_7"));
1928 zPull = h2D4->GetMean(2);
1930 h2D4->SetAxisRange(0.0,1.0/5.0,"X");
1931 zPullHighPt = h2D4->GetMean(2);
1932 h2D4->SetAxisRange(0.0,10.0,"X");
1937 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_3_7")){
1938 h2D5 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_3_7"));
1940 lambdaPull = h2D5->GetMean(2);
1942 h2D5->SetAxisRange(0.0,1.0/5.0,"X");
1943 lambdaPullHighPt = h2D5->GetMean(2);
1944 h2D5->SetAxisRange(0.0,10.0,"X");
1948 (*pcstream)<<"tpcQA"<<
1949 "phiPull="<< phiPull<<
1950 "phiPullHighPt="<< phiPullHighPt<<
1951 "ptPull="<< ptPull<<
1952 "ptPullHighPt="<< ptPullHighPt<<
1954 "yPullHighPt="<< yPullHighPt<<
1956 "zPullHighPt="<< zPullHighPt<<
1957 "lambdaPull="<< lambdaPull<<
1958 "lambdaPullHighPt="<< lambdaPullHighPt;
1962 Int_t AliTPCPerformanceSummary::AnalyzeConstrain(const AliPerformanceMatch* pConstrain, TTreeSRedirector* pcstream)
1964 if (!pcstream) return 5126;
1965 if (!pConstrain) return 5126;
1968 static Double_t tpcConstrainPhiA = 0;
1969 static Double_t tpcConstrainPhiC = 0;
1971 if (pConstrain->GetHistos()->FindObject("h_tpc_constrain_tpc_0_2_3")) {
1973 his3D = dynamic_cast<TH3*>(pConstrain->GetHistos()->FindObject("h_tpc_constrain_tpc_0_2_3"));//phi pull:pt:eta
1974 if(!his3D) return 5126;
1976 his3D->GetZaxis()->SetRangeUser(0.0,1.0);
1977 tpcConstrainPhiA = his3D->GetMean(1);
1978 his3D->GetZaxis()->SetRangeUser(-1.0,-0.001);
1979 tpcConstrainPhiC = his3D->GetMean(1);
1982 (*pcstream)<<"tpcQA"<<
1983 "tpcConstrainPhiA="<<tpcConstrainPhiA <<
1984 "tpcConstrainPhiC="<< tpcConstrainPhiC;
1989 //_____________________________________________________________________________
1990 Int_t AliTPCPerformanceSummary::AnalyzeQAPosNegDpT(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
1992 //function which plot 1/Pt for negative and
1993 //positive particles
1995 if (!pcstream) return 512;
1996 if (!pTPC) return 512;
2006 static Double_t deltaPtC = 0;
2007 static Double_t deltaPtchi2C = 0;
2008 static Double_t slopeC = 0;
2009 static Double_t deltaPtA = 0;
2010 static Double_t deltaPtchi2A = 0;
2011 static Double_t slopeA = 0;
2012 static Double_t deltaPt = 0;
2013 static Double_t deltaPtchi2 = 0;
2014 static Double_t slope = 0;
2015 static Double_t deltaPt_Err = 0;
2016 static Double_t deltaPtA_Err = 0;
2017 static Double_t deltaPtC_Err = 0;
2022 if(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_0_5_7"))
2024 pos3 = dynamic_cast<TH3D*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_0_5_7"));
2025 if(!pos3) return 512;
2027 pos = pos3->ProjectionZ("pos",71,-1,6,25);
2028 posC = pos3->ProjectionZ("posC",71,-1,6,15);
2029 posA = pos3->ProjectionZ("posA",71,-1,16,25);
2032 if(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_0_5_7")){
2033 neg3 = dynamic_cast<TH3D*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_0_5_7"));
2034 if(!neg3) return 512;
2036 neg = neg3->ProjectionZ("neg",71,-1,6,25);
2037 negC = neg3->ProjectionZ("negC",71,-1,6,15);
2038 negA = neg3->ProjectionZ("negA",71,-1,16,25);
2049 pos->Scale(1.,"width");
2050 neg->Scale(1.,"width");
2051 posA->Scale(1.,"width");
2052 negA->Scale(1.,"width");
2053 posC->Scale(1.,"width");
2054 negC->Scale(1.,"width");
2058 TF1 fpt("fpt","[1]*exp(-1/((1/x))*[0])",0.1,10);
2059 TF1 fpt2("fpt2","[1]*exp(-1/((1/x))*[0])",0.1,10);
2060 fpt.SetParameters(1,0.5);
2061 fpt2.SetParameters(1,0.5);
2062 pos->Fit(&fpt,"","",1,4); pos->Fit(&fpt,"","",1,4); pos->Fit(&fpt,"","",1,4);
2063 neg->Fit(&fpt2,"","",1,4); neg->Fit(&fpt2,"","",1,4); neg->Fit(&fpt2,"","",1,4);
2065 slope = (fpt.GetParameter(0)+fpt2.GetParameter(0))/2.;
2067 TH1D* ratio = new TH1D(*pos);
2071 TF1 fptRatio("fptratio","[2]*exp(-1/((1/x)+[1])*[0])/exp(-1/((1/x)-[1])*[0])",0.1,10);
2072 fptRatio.SetParameters(0.5,0.006,1);
2073 fptRatio.FixParameter(0,slope);
2075 ratio->Fit(&fptRatio,"","",1,4); ratio->Fit(&fptRatio,"","",1,4);
2076 ratio->Fit(&fptRatio,"","",1,4);
2078 deltaPt = fptRatio.GetParameter(1);
2079 deltaPtchi2 = fptRatio.GetChisquare();
2082 deltaPt_Err = fptRatio.GetParError(1);
2087 TF1 fptA("fptA","[1]*exp(-1/((1/x))*[0])",0.1,10);
2088 TF1 fpt2A("fpt2A","[1]*exp(-1/((1/x))*[0])",0.1,10);
2089 fptA.SetParameters(1,0.5);
2090 fpt2A.SetParameters(1,0.5);
2091 posA->Fit(&fptA,"","",1,4); posA->Fit(&fptA,"","",1,4); posA->Fit(&fptA,"","",1,4);
2092 negA->Fit(&fpt2A,"","",1,4); negA->Fit(&fpt2A,"","",1,4); negA->Fit(&fpt2A,"","",1,4);
2094 slopeA = (fptA.GetParameter(0)+fpt2A.GetParameter(0))/2.;
2096 TH1D* ratioA = new TH1D(*posA);
2097 ratioA->Divide(negA);
2100 TF1 fptRatioA("fptratioA","[2]*exp(-1/((1/x)+[1])*[0])/exp(-1/((1/x)-[1])*[0])",0.1,10);
2101 fptRatioA.SetParameters(0.5,0.006,1);
2102 fptRatioA.FixParameter(0,slopeA);
2104 ratioA->Fit(&fptRatioA,"","",1,4); ratio->Fit(&fptRatioA,"","",1,4);
2105 ratioA->Fit(&fptRatioA,"","",1,4);
2107 deltaPtA = fptRatioA.GetParameter(1);
2108 deltaPtchi2A = fptRatioA.GetChisquare();
2111 deltaPtA_Err = fptRatioA.GetParError(1);
2119 TF1 fptC("fptC","[1]*exp(-1/((1/x))*[0])",0.1,10);
2120 TF1 fpt2C("fpt2C","[1]*exp(-1/((1/x))*[0])",0.1,10);
2121 fptC.SetParameters(1,0.5);
2122 fpt2C.SetParameters(1,0.5);
2123 posC->Fit(&fptC,"","",1,4); posC->Fit(&fptC,"","",1,4); posC->Fit(&fptC,"","",1,4);
2124 negC->Fit(&fpt2C,"","",1,4); negC->Fit(&fpt2C,"","",1,4); negC->Fit(&fpt2C,"","",1,4);
2126 slopeC = (fptC.GetParameter(0)+fpt2C.GetParameter(0))/2.;
2128 TH1D* ratioC = new TH1D(*posC);
2129 ratioC->Divide(negC);
2132 TF1 fptRatioC("fptratioC","[2]*exp(-1/((1/x)+[1])*[0])/exp(-1/((1/x)-[1])*[0])",0.1,10);
2133 fptRatioC.SetParameters(0.5,0.006,1);
2134 fptRatioC.FixParameter(0,slopeC);
2136 ratioC->Fit(&fptRatioC,"","",1,4); ratio->Fit(&fptRatioC,"","",1,4);
2137 ratioC->Fit(&fptRatioC,"","",1,4);
2139 deltaPtC = fptRatioC.GetParameter(1);
2140 deltaPtchi2C = fptRatioC.GetChisquare();
2143 deltaPtC_Err = fptRatioC.GetParError(1);
2150 (*pcstream)<<"tpcQA"<<
2151 "deltaPt="<< deltaPt<<
2152 "deltaPtchi2="<< deltaPtchi2<<
2153 "deltaPtA="<< deltaPtA<<
2154 "deltaPtchi2A="<< deltaPtchi2A<<
2155 "deltaPtC="<< deltaPtC<<
2156 "deltaPtchi2C="<< deltaPtchi2C<<
2157 "deltaPt_Err="<< deltaPt_Err<<
2158 "deltaPtA_Err="<< deltaPtA_Err<<
2159 "deltaPtC_Err="<< deltaPtC_Err;
2164 //_____________________________________________________________________________
2165 Int_t AliTPCPerformanceSummary::AnalyzeQADCAFitParameter(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
2169 //function which retrieve DCA fit parameters
2172 if (!pcstream) return 16;
2173 if (!pTPC) return 16;
2180 static Double_t dcar_posA_0=0;
2181 static Double_t dcar_posA_1=0;
2182 static Double_t dcar_posA_2=0;
2183 static Double_t dcar_posA_chi2=0;
2184 static Double_t dcar_posA_0_Err=0;
2185 static Double_t dcar_posA_1_Err=0;
2186 static Double_t dcar_posA_2_Err=0;
2188 static Double_t dcar_posC_0=0;
2189 static Double_t dcar_posC_1=0;
2190 static Double_t dcar_posC_2=0;
2191 static Double_t dcar_posC_chi2=0;
2192 static Double_t dcar_posC_0_Err=0;
2193 static Double_t dcar_posC_1_Err=0;
2194 static Double_t dcar_posC_2_Err=0;
2196 static Double_t dcaz_posA_0=0;
2197 static Double_t dcaz_posA_1=0;
2198 static Double_t dcaz_posA_2=0;
2199 static Double_t dcaz_posA_chi2=0;
2200 static Double_t dcaz_posA_0_Err=0;
2201 static Double_t dcaz_posA_1_Err=0;
2202 static Double_t dcaz_posA_2_Err=0;
2204 static Double_t dcaz_posC_0=0;
2205 static Double_t dcaz_posC_1=0;
2206 static Double_t dcaz_posC_2=0;
2207 static Double_t dcaz_posC_chi2=0;
2208 static Double_t dcaz_posC_0_Err=0;
2209 static Double_t dcaz_posC_1_Err=0;
2210 static Double_t dcaz_posC_2_Err=0;
2212 static Double_t dcar_negA_0=0;
2213 static Double_t dcar_negA_1=0;
2214 static Double_t dcar_negA_2=0;
2215 static Double_t dcar_negA_chi2=0;
2216 static Double_t dcar_negA_0_Err=0;
2217 static Double_t dcar_negA_1_Err=0;
2218 static Double_t dcar_negA_2_Err=0;
2220 static Double_t dcar_negC_0=0;
2221 static Double_t dcar_negC_1=0;
2222 static Double_t dcar_negC_2=0;
2223 static Double_t dcar_negC_chi2=0;
2224 static Double_t dcar_negC_0_Err=0;
2225 static Double_t dcar_negC_1_Err=0;
2226 static Double_t dcar_negC_2_Err=0;
2228 static Double_t dcaz_negA_0=0;
2229 static Double_t dcaz_negA_1=0;
2230 static Double_t dcaz_negA_2=0;
2231 static Double_t dcaz_negA_chi2=0;
2232 static Double_t dcaz_negA_0_Err=0;
2233 static Double_t dcaz_negA_1_Err=0;
2234 static Double_t dcaz_negA_2_Err=0;
2236 static Double_t dcaz_negC_0=0;
2237 static Double_t dcaz_negC_1=0;
2238 static Double_t dcaz_negC_2=0;
2239 static Double_t dcaz_negC_chi2=0;
2240 static Double_t dcaz_negC_0_Err=0;
2241 static Double_t dcaz_negC_1_Err=0;
2242 static Double_t dcaz_negC_2_Err=0;
2244 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_6")) {
2245 dcar_pos3 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_6"));
2248 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_6")) {
2249 dcaz_pos3 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_6"));
2252 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_6")) {
2253 dcar_neg3 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_6"));
2256 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_6")) {
2257 dcaz_neg3 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_6"));
2260 TF1 fit("fit","[0]+[1]*cos(x)+[2]*sin(x)",0,7);
2262 dcar_pos3->GetYaxis()->SetRangeUser(0,0.99);
2263 TH1* dcar_posA = (dynamic_cast<TH2*>(dcar_pos3->Project3D("xz_1")))->ProfileX();
2264 dcar_posA->Fit(&fit,"NQ");
2265 dcar_posA_0 = fit.GetParameter(0);
2266 dcar_posA_1 = fit.GetParameter(1);
2267 dcar_posA_2 = fit.GetParameter(2);
2268 dcar_posA_chi2 = fit.GetChisquare();
2269 dcar_posA_0_Err = fit.GetParError(0);
2270 dcar_posA_1_Err = fit.GetParError(1);
2271 dcar_posA_2_Err = fit.GetParError(2);
2273 dcar_pos3->GetYaxis()->SetRangeUser(-1.0,-0.01);
2274 TH1* dcar_posC = (dynamic_cast<TH2*>(dcar_pos3->Project3D("xz_2")))->ProfileX();
2275 dcar_posC->Fit(&fit,"NQ");
2276 dcar_posC_0 = fit.GetParameter(0);
2277 dcar_posC_1 = fit.GetParameter(1);
2278 dcar_posC_2 = fit.GetParameter(2);
2279 dcar_posC_chi2 = fit.GetChisquare();
2280 dcar_posC_0_Err = fit.GetParError(0);
2281 dcar_posC_1_Err = fit.GetParError(1);
2282 dcar_posC_2_Err = fit.GetParError(2);
2284 dcaz_pos3->GetYaxis()->SetRangeUser(0,0.99);
2285 TH1* dcaz_posA = (dynamic_cast<TH2*>(dcaz_pos3->Project3D("xz_3")))->ProfileX();
2286 dcaz_posA->Fit(&fit,"NQ");
2287 dcaz_posA_0 = fit.GetParameter(0);
2288 dcaz_posA_1 = fit.GetParameter(1);
2289 dcaz_posA_2 = fit.GetParameter(2);
2290 dcaz_posA_chi2 = fit.GetChisquare();
2291 dcaz_posA_0_Err = fit.GetParError(0);
2292 dcaz_posA_1_Err = fit.GetParError(1);
2293 dcaz_posA_2_Err = fit.GetParError(2);
2295 dcaz_pos3->GetYaxis()->SetRangeUser(-1.0,-0.01);
2296 TH1* dcaz_posC = (dynamic_cast<TH2*>(dcaz_pos3->Project3D("xz_4")))->ProfileX();
2297 dcaz_posC->Fit(&fit,"NQ");
2298 dcaz_posC_0 = fit.GetParameter(0);
2299 dcaz_posC_1 = fit.GetParameter(1);
2300 dcaz_posC_2 = fit.GetParameter(2);
2301 dcaz_posC_chi2 = fit.GetChisquare();
2302 dcaz_posC_0_Err = fit.GetParError(0);
2303 dcaz_posC_1_Err = fit.GetParError(1);
2304 dcaz_posC_2_Err = fit.GetParError(2);
2308 dcar_neg3->GetYaxis()->SetRangeUser(0,0.99);
2309 TH1* dcar_negA = (dynamic_cast<TH2*>(dcar_neg3->Project3D("xz_1")))->ProfileX();
2310 dcar_negA->Fit(&fit,"NQ");
2311 dcar_negA_0 = fit.GetParameter(0);
2312 dcar_negA_1 = fit.GetParameter(1);
2313 dcar_negA_2 = fit.GetParameter(2);
2314 dcar_negA_chi2 = fit.GetChisquare();
2315 dcar_negA_0_Err = fit.GetParError(0);
2316 dcar_negA_1_Err = fit.GetParError(1);
2317 dcar_negA_2_Err = fit.GetParError(2);
2319 dcar_neg3->GetYaxis()->SetRangeUser(-1.0,-0.01);
2320 TH1* dcar_negC = (dynamic_cast<TH2*>(dcar_neg3->Project3D("xz_2")))->ProfileX();
2321 dcar_negC->Fit(&fit,"NQ");
2322 dcar_negC_0 = fit.GetParameter(0);
2323 dcar_negC_1 = fit.GetParameter(1);
2324 dcar_negC_2 = fit.GetParameter(2);
2325 dcar_negC_chi2 = fit.GetChisquare();
2326 dcar_negC_0_Err = fit.GetParError(0);
2327 dcar_negC_1_Err = fit.GetParError(1);
2328 dcar_negC_2_Err = fit.GetParError(2);
2330 dcaz_neg3->GetYaxis()->SetRangeUser(0,0.99);
2331 TH1* dcaz_negA = (dynamic_cast<TH2*>(dcaz_neg3->Project3D("xz_3")))->ProfileX();
2332 dcaz_negA->Fit(&fit,"NQ");
2333 dcaz_negA_0 = fit.GetParameter(0);
2334 dcaz_negA_1 = fit.GetParameter(1);
2335 dcaz_negA_2 = fit.GetParameter(2);
2336 dcaz_negA_chi2 = fit.GetChisquare();
2337 dcaz_negA_0_Err = fit.GetParError(0);
2338 dcaz_negA_1_Err = fit.GetParError(1);
2339 dcaz_negA_2_Err = fit.GetParError(2);
2341 dcaz_neg3->GetYaxis()->SetRangeUser(-1.0,-0.01);
2342 TH1* dcaz_negC = (dynamic_cast<TH2*>(dcaz_neg3->Project3D("xz_4")))->ProfileX();
2343 dcaz_negC->Fit(&fit,"NQ");
2344 dcaz_negC_0 = fit.GetParameter(0);
2345 dcaz_negC_1 = fit.GetParameter(1);
2346 dcaz_negC_2 = fit.GetParameter(2);
2347 dcaz_negC_chi2 = fit.GetChisquare();
2348 dcaz_negC_0_Err = fit.GetParError(0);
2349 dcaz_negC_1_Err = fit.GetParError(1);
2350 dcaz_negC_2_Err = fit.GetParError(2);
2353 // store results (shift in dca) in ttree
2355 (*pcstream)<<"tpcQA"<<
2356 "dcar_posA_0="<< dcar_posA_0<<
2357 "dcar_posA_1="<< dcar_posA_1<<
2358 "dcar_posA_2="<< dcar_posA_2<<
2359 "dcar_posA_chi2="<< dcar_posA_chi2<<
2360 "dcar_posA_0_Err="<< dcar_posA_0_Err<<
2361 "dcar_posA_1_Err="<< dcar_posA_1_Err<<
2362 "dcar_posA_2_Err="<< dcar_posA_2_Err;
2364 (*pcstream)<<"tpcQA"<<
2365 "dcaz_posA_0="<< dcaz_posA_0<<
2366 "dcaz_posA_1="<< dcaz_posA_1<<
2367 "dcaz_posA_2="<< dcaz_posA_2<<
2368 "dcaz_posA_chi2="<< dcaz_posA_chi2<<
2369 "dcaz_posA_0_Err="<< dcaz_posA_0_Err<<
2370 "dcaz_posA_1_Err="<< dcaz_posA_1_Err<<
2371 "dcaz_posA_2_Err="<< dcaz_posA_2_Err;
2373 (*pcstream)<<"tpcQA"<<
2374 "dcaz_posC_0="<< dcaz_posC_0<<
2375 "dcaz_posC_1="<< dcaz_posC_1<<
2376 "dcaz_posC_2="<< dcaz_posC_2<<
2377 "dcaz_posC_chi2="<< dcaz_posC_chi2<<
2378 "dcaz_posC_0_Err="<< dcaz_posC_0_Err<<
2379 "dcaz_posC_1_Err="<< dcaz_posC_1_Err<<
2380 "dcaz_posC_2_Err="<< dcaz_posC_2_Err;
2382 (*pcstream)<<"tpcQA"<<
2383 "dcar_posC_0="<< dcar_posC_0<<
2384 "dcar_posC_1="<< dcar_posC_1<<
2385 "dcar_posC_2="<< dcar_posC_2<<
2386 "dcar_posC_chi2="<< dcar_posC_chi2<<
2387 "dcar_posC_0_Err="<< dcar_posC_0_Err<<
2388 "dcar_posC_1_Err="<< dcar_posC_1_Err<<
2389 "dcar_posC_2_Err="<< dcar_posC_2_Err;
2392 (*pcstream)<<"tpcQA"<<
2393 "dcar_negA_0="<< dcar_negA_0<<
2394 "dcar_negA_1="<< dcar_negA_1<<
2395 "dcar_negA_2="<< dcar_negA_2<<
2396 "dcar_negA_chi2="<< dcar_negA_chi2<<
2397 "dcar_negA_0_Err="<< dcar_negA_0_Err<<
2398 "dcar_negA_1_Err="<< dcar_negA_1_Err<<
2399 "dcar_negA_2_Err="<< dcar_negA_2_Err;
2401 (*pcstream)<<"tpcQA"<<
2402 "dcaz_negA_0="<< dcaz_negA_0<<
2403 "dcaz_negA_1="<< dcaz_negA_1<<
2404 "dcaz_negA_2="<< dcaz_negA_2<<
2405 "dcaz_negA_chi2="<< dcaz_negA_chi2<<
2406 "dcaz_negA_0_Err="<< dcaz_negA_0_Err<<
2407 "dcaz_negA_1_Err="<< dcaz_negA_1_Err<<
2408 "dcaz_negA_2_Err="<< dcaz_negA_2_Err;
2410 (*pcstream)<<"tpcQA"<<
2411 "dcaz_negC_0="<< dcaz_negC_0<<
2412 "dcaz_negC_1="<< dcaz_negC_1<<
2413 "dcaz_negC_2="<< dcaz_negC_2<<
2414 "dcaz_negC_chi2="<< dcaz_negC_chi2<<
2415 "dcaz_negC_0_Err="<< dcaz_negC_0_Err<<
2416 "dcaz_negC_1_Err="<< dcaz_negC_1_Err<<
2417 "dcaz_negC_2_Err="<< dcaz_negC_2_Err;
2419 (*pcstream)<<"tpcQA"<<
2420 "dcar_negC_0="<< dcar_negC_0<<
2421 "dcar_negC_1="<< dcar_negC_1<<
2422 "dcar_negC_2="<< dcar_negC_2<<
2423 "dcar_negC_chi2="<< dcar_negC_chi2<<
2424 "dcar_negC_0_Err="<< dcar_negC_0_Err<<
2425 "dcar_negC_1_Err="<< dcar_negC_1_Err<<
2426 "dcar_negC_2_Err="<< dcar_negC_2_Err;