]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGPP/TPC/AliTPCPerformanceSummary.cxx
Restrict number of entries for merging of the THNSparse in the
[u/mrichter/AliRoot.git] / PWGPP / 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//_____________________________________________________________________________
9f5fbaba 51void AliTPCPerformanceSummary::WriteToTTreeSRedirector(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pTPCMatch,const AliPerformanceMatch* pTPCPull, const AliPerformanceMatch* pConstrain, 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);
ac617c68 126 AnalyzeQAPosNegDpT(pTPC,pcstream);
127 AnalyzeQADCAFitParameter(pTPC,pcstream);
10d5d625 128
814d192f 129 pTPC->GetTPCTrackHisto()->GetAxis(9)->SetRangeUser(-10,10);
130 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0,100);
f69eb048 131 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-10,10);
814d192f 132 }
f69eb048 133 AnalyzeGain(pTPCgain, pcstream);
134 AnalyzeMatch(pTPCMatch, pcstream);
1833a193 135 AnalyzePull(pTPCPull, pcstream);
9f5fbaba 136 AnalyzeConstrain(pConstrain, pcstream);
137
b832d719 138 (*pcstream)<<"tpcQA"<<"\n";
b832d719 139}
140
141//_____________________________________________________________________________
9f5fbaba 142void AliTPCPerformanceSummary::WriteToFile(const AliPerformanceTPC* pTPC, const AliPerformanceDEdx* pTPCgain, const AliPerformanceMatch* pMatch, const AliPerformanceMatch* pPull, const AliPerformanceMatch* pConstrain, const Char_t* outfile, Int_t run)
b832d719 143{
144 //
145 // Extracts performance parameters from pTPC and pTPCgain.
146 // Output is written to a TTree saved in outfile.
147 // The run number must be provided since it is not stored in
148 // AliPerformanceTPC or AliPerformanceDEdx.
149 //
150 // The function creates a TTreeSRedirector and calls the
151 // function WriteToTTreeSRedirector.
152 //
153
f69eb048 154 if (!outfile) return;
b832d719 155 TTreeSRedirector* pcstream = 0;
156 pcstream = new TTreeSRedirector(outfile);
f69eb048 157 if (!pcstream) return;
9f5fbaba 158 WriteToTTreeSRedirector(pTPC, pTPCgain, pMatch, pPull, pConstrain, pcstream, run);
f69eb048 159 if (pcstream) { delete pcstream; pcstream = 0; }
b832d719 160
161}
162
163//_____________________________________________________________________________
164Int_t AliTPCPerformanceSummary::MakeReport(const Char_t* infile, const Char_t* outfile, Int_t run)
165{
166 //
167 // Reads QA information (AliPerformanceTPC and AliPerformanceDEdx) from
168 // infile (this must be a rootfile) and writes the output to a TTree
169 // stored in outfile.
170 // The run number must be provided since it is not stored in
171 // AliPerformanceTPC or AliPerformanceDEdx.
172 //
173 // The input objects must be named "AliPerformanceTPC" and
174 // "AliPerformanceDEdxTPCInner" and stored in a TList which name must
175 // be one of the following: "TPC", "TPCQA", "TPC_PerformanceQA"
176 // or "TPC_PerformanceQA/TPC" (with directory)
177 //
178
179 if (!infile) return -1;
180 if (!outfile) return -1;
181 TFile *f =0;
182 f=TFile::Open(infile,"read");
183 if (!f) {
184 printf("File %s not available\n", infile);
185 return -1;
186 }
187 TList* list = 0;
188 list = dynamic_cast<TList*>(f->Get("TPC"));
189 if (!list) { list = dynamic_cast<TList*>(f->Get("TPCQA")); }
b832d719 190 if (!list) { list = dynamic_cast<TList*>(f->Get("TPC_PerformanceQA/TPCQA")); }
0cb93e70 191 if (!list) { list = dynamic_cast<TList*>(f->Get("TPC_PerformanceQA")); }
1833a193 192 if (!list) { list = dynamic_cast<TList*>(f->Get("ITSTPCMatch")); }
b832d719 193 if (!list) {
194 printf("QA %s not available\n", infile);
195 return -1;
196 }
197 AliPerformanceTPC* pTPC = 0;
198 AliPerformanceDEdx* pTPCgain = 0;
f69eb048 199 AliPerformanceMatch* pTPCmatch = 0;
1833a193 200 AliPerformanceMatch* pTPCPull = 0;
9f5fbaba 201 AliPerformanceMatch* pConstrain = 0;
202
f69eb048 203 if (list) { pTPC = dynamic_cast<AliPerformanceTPC*>(list->FindObject("AliPerformanceTPC")); }
204 if (list) { pTPCgain = dynamic_cast<AliPerformanceDEdx*>(list->FindObject("AliPerformanceDEdxTPCInner")); }
205 if (list) { pTPCmatch = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchTPCITS")); }
1833a193 206 if (list) { pTPCPull = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchITSTPC")); }
9f5fbaba 207 if (list) { pConstrain = dynamic_cast<AliPerformanceMatch*>(list->FindObject("AliPerformanceMatchTPCConstrain")); }
b832d719 208
209 Int_t returncode = 0;
9f5fbaba 210 WriteToFile(pTPC, pTPCgain, pTPCmatch , pTPCPull, pConstrain, outfile, run);
b832d719 211 if (f) { delete f; f=0; }
212 return returncode;
213}
214
215//_____________________________________________________________________________
216Int_t AliTPCPerformanceSummary::ProduceTrends(const Char_t* infilelist, const Char_t* outfile)
217{
218 //
219 // Produces trend graphs.
220 //
221 // Input: infilelist is a textfile with one rootfile per line.
222 // There should be one rootfile for each run, the rootfile must
223 // contain the output of the MakeReport function
224 // Output: the information for all runs is merged into a TTree
225 // that is saved in outfile along with the trend graphs.
226 // Trend graphs are stored as TCanvas objects to include axis labels etc.
227 //
228
229 if (!infilelist) return -1;
230 if (!outfile) return -1;
231
232 TChain* chain = new TChain("tpcQA");
26a35193 233 if(!chain) return -1;
234
b832d719 235 ifstream in;
236 in.open(infilelist);
237
238 TString currentFile;
239 while(in.good()) {
240 in >> currentFile;
241
242 if (!currentFile.Contains("root")) continue; // protection
243 chain->Add(currentFile.Data());
244 }
245 in.close();
246 //TTree *tree = chain;
247 TTree *tree = chain->CopyTree("1");
26a35193 248 if(!tree) return -1;
b832d719 249 if (chain) { delete chain; chain=0; }
250 //TGraph* graph = dynamic_cast<TGraph*>(tree->DrawClone("run:run"));
251 //TGraph *graph = (TGraph*)gPad->GetPrimitive("Graph");
252
253 TFile* out = new TFile(outfile,"RECREATE");
26a35193 254 if(!out) return -1;
255
b832d719 256 out->cd();
c6d45264 257 const Char_t* condition = "meanTPCncl>0";
b832d719 258 SaveGraph(tree,"meanTPCnclF","run",condition);
259 SaveGraph(tree,"rmsTPCnclF","run",condition);
260 SaveGraph(tree,"meanTPCChi2","run",condition);
261 SaveGraph(tree,"rmsTPCChi2","run",condition);
262 SaveGraph(tree,"slopeATPCnclF","run",condition);
263 SaveGraph(tree,"slopeCTPCnclF","run",condition);
264 SaveGraph(tree,"slopeATPCnclFErr","run",condition);
265 SaveGraph(tree,"slopeCTPCnclFErr","run",condition);
266 SaveGraph(tree,"meanTPCncl","run",condition);
267 SaveGraph(tree,"rmsTPCncl","run",condition);
268 SaveGraph(tree,"slopeATPCncl","run",condition);
269 SaveGraph(tree,"slopeCTPCncl","run",condition);
270 SaveGraph(tree,"slopeATPCnclErr","run",condition);
271 SaveGraph(tree,"slopeCTPCnclErr","run",condition);
272
273 SaveGraph(tree,"offsetdRA","run",condition);
274 SaveGraph(tree,"slopedRA","run",condition);
275 SaveGraph(tree,"offsetdRC","run",condition);
276 SaveGraph(tree,"slopedRC","run",condition);
277 SaveGraph(tree,"offsetdRAErr","run",condition);
278 SaveGraph(tree,"slopedRAErr","run",condition);
279 SaveGraph(tree,"offsetdRCErr","run",condition);
280 SaveGraph(tree,"slopedRCErr","run",condition);
281 SaveGraph(tree,"offsetdRAchi2","run",condition);
282 SaveGraph(tree,"slopedRAchi2","run",condition);
283 SaveGraph(tree,"offsetdRCchi2","run",condition);
284 SaveGraph(tree,"slopedRCchi2","run",condition);
285
286 SaveGraph(tree,"offsetdRAPos","run",condition);
287
288 SaveGraph(tree,"slopedRAPos","run",condition);
289 SaveGraph(tree,"offsetdRCPos","run",condition);
290 SaveGraph(tree,"slopedRCPos","run",condition);
291 SaveGraph(tree,"offsetdRAErrPos","run",condition);
292 SaveGraph(tree,"slopedRAErrPos","run",condition);
293 SaveGraph(tree,"offsetdRCErrPos","run",condition);
294 SaveGraph(tree,"slopedRCErrPos","run",condition);
295 SaveGraph(tree,"offsetdRAchi2Pos","run",condition);
296 SaveGraph(tree,"slopedRAchi2Pos","run",condition);
297 SaveGraph(tree,"offsetdRCchi2Pos","run",condition);
298 SaveGraph(tree,"slopedRCchi2Pos","run",condition);
299
300 SaveGraph(tree,"offsetdRANeg","run",condition);
301 SaveGraph(tree,"slopedRANeg","run",condition);
302 SaveGraph(tree,"offsetdRCNeg","run",condition);
303 SaveGraph(tree,"slopedRCNeg","run",condition);
304 SaveGraph(tree,"offsetdRAErrNeg","run",condition);
305 SaveGraph(tree,"slopedRAErrNeg","run",condition);
306 SaveGraph(tree,"offsetdRCErrNeg","run",condition);
307 SaveGraph(tree,"slopedRCErrNeg","run",condition);
308 SaveGraph(tree,"offsetdRAchi2Neg","run",condition);
309 SaveGraph(tree,"slopedRAchi2Neg","run",condition);
310 SaveGraph(tree,"offsetdRCchi2Neg","run",condition);
311 SaveGraph(tree,"slopedRCchi2Neg","run",condition);
312
313 SaveGraph(tree,"offsetdZAPos","run",condition);
314 SaveGraph(tree,"slopedZAPos","run",condition);
315 SaveGraph(tree,"offsetdZCPos","run",condition);
316 SaveGraph(tree,"slopedZCPos","run",condition);
317 SaveGraph(tree,"offsetdZAErrPos","run",condition);
318 SaveGraph(tree,"slopedZAErrPos","run",condition);
319 SaveGraph(tree,"offsetdZCErrPos","run",condition);
320 SaveGraph(tree,"slopedZCErrPos","run",condition);
321 SaveGraph(tree,"offsetdZAchi2Pos","run",condition);
322 SaveGraph(tree,"slopedZAchi2Pos","run",condition);
323 SaveGraph(tree,"offsetdZCchi2Pos","run",condition);
324 SaveGraph(tree,"slopedZCchi2Pos","run",condition);
325
326 SaveGraph(tree,"offsetdZANeg","run",condition);
327 SaveGraph(tree,"slopedZANeg","run",condition);
328 SaveGraph(tree,"offsetdZCNeg","run",condition);
329 SaveGraph(tree,"slopedZCNeg","run",condition);
330 SaveGraph(tree,"offsetdZAErrNeg","run",condition);
331 SaveGraph(tree,"slopedZAErrNeg","run",condition);
332 SaveGraph(tree,"offsetdZCErrNeg","run",condition);
333 SaveGraph(tree,"slopedZCErrNeg","run",condition);
334 SaveGraph(tree,"offsetdZAchi2Neg","run",condition);
335 SaveGraph(tree,"slopedZAchi2Neg","run",condition);
336 SaveGraph(tree,"offsetdZCchi2Neg","run",condition);
337 SaveGraph(tree,"slopedZCchi2Neg","run",condition);
338
339 SaveGraph(tree,"offsetdZA","run",condition);
340 SaveGraph(tree,"slopedZA","run",condition);
341 SaveGraph(tree,"offsetdZC","run",condition);
342 SaveGraph(tree,"slopedZC","run",condition);
343 SaveGraph(tree,"offsetdZAErr","run",condition);
344 SaveGraph(tree,"slopedZAErr","run",condition);
345 SaveGraph(tree,"offsetdZCErr","run",condition);
346 SaveGraph(tree,"slopedZCErr","run",condition);
347 SaveGraph(tree,"offsetdZAchi2","run",condition);
348 SaveGraph(tree,"slopedZAchi2","run",condition);
349 SaveGraph(tree,"offsetdZCchi2","run",condition);
350 SaveGraph(tree,"slopedZCchi2","run",condition);
351
352 SaveGraph(tree,"meanVertX","run",condition);
353 SaveGraph(tree,"rmsVertX","run",condition);
354 SaveGraph(tree,"meanVertY","run",condition);
355 SaveGraph(tree,"rmsVertY","run",condition);
356 SaveGraph(tree,"meanVertZ","run",condition);
357 SaveGraph(tree,"rmsVertZ","run",condition);
358 SaveGraph(tree,"vertStatus","run",condition);
359 SaveGraph(tree,"meanMult","run",condition);
360 SaveGraph(tree,"rmsMult","run",condition);
361 SaveGraph(tree,"meanMultPos","run",condition);
362 SaveGraph(tree,"rmsMultPos","run",condition);
363 SaveGraph(tree,"meanMultNeg","run",condition);
364 SaveGraph(tree,"rmsMultNeg","run",condition);
365 SaveGraph(tree,"vertAll","run",condition);
366 SaveGraph(tree,"vertOK","run",condition);
367
10d5d625 368
369 SaveGraph(tree,"meanPtAPos","run",condition);
370 SaveGraph(tree,"mediumPtAPos","run",condition);
371 SaveGraph(tree,"highPtAPos","run",condition);
372 SaveGraph(tree,"meanPtCPos","run",condition);
373 SaveGraph(tree,"mediumPtCPos","run",condition);
374 SaveGraph(tree,"highPtCPos","run",condition);
375 SaveGraph(tree,"meanPtANeg","run",condition);
376 SaveGraph(tree,"mediumPtANeg","run",condition);
377 SaveGraph(tree,"highPtANeg","run",condition);
378 SaveGraph(tree,"meanPtCNeg","run",condition);
379 SaveGraph(tree,"mediumPtCNeg","run",condition);
380 SaveGraph(tree,"highPtCNeg","run",condition);
381
382 SaveGraph(tree,"qOverPt","run",condition);
383 SaveGraph(tree,"qOverPtA","run",condition);
384 SaveGraph(tree,"qOverPtC","run",condition);
1833a193 385
9f5fbaba 386 SaveGraph(tree,"dcarAP0","run",condition);
387 SaveGraph(tree,"dcarAP1","run",condition);
388 SaveGraph(tree,"dcarCP0","run",condition);
389 SaveGraph(tree,"dcarCP1","run",condition);
390
1833a193 391 condition = "";
392 SaveGraph(tree,"tpcItsMatchA","run",condition);
393 SaveGraph(tree,"tpcItsMatchHighPtA","run",condition);
394 SaveGraph(tree,"tpcItsMatchC","run",condition);
395 SaveGraph(tree,"tpcItsMatchHighPtC","run",condition);
396
397 SaveGraph(tree,"phiPull","run",condition);
398 SaveGraph(tree,"phiPullHighPt","run",condition);
399 SaveGraph(tree,"ptPull","run",condition);
400 SaveGraph(tree,"ptPullHighPt","run",condition);
401 SaveGraph(tree,"yPull","run",condition);
402 SaveGraph(tree,"yPullHighPt","run",condition);
403 SaveGraph(tree,"zPull","run",condition);
404 SaveGraph(tree,"zPullHighPt","run",condition);
405 SaveGraph(tree,"lambdaPull","run",condition);
406 SaveGraph(tree,"lambdaPullHighPt","run",condition);
407
9f5fbaba 408 SaveGraph(tree,"tpcConstrainPhiA","run",condition);
409 SaveGraph(tree,"tpcConstrainPhiC","run",condition);
410
ac617c68 411 SaveGraph(tree,"deltaPt","run",condition);
412 SaveGraph(tree,"deltaPtchi2","run",condition);
413 SaveGraph(tree,"deltaPtA","run",condition);
414 SaveGraph(tree,"deltaPtchi2A","run",condition);
415 SaveGraph(tree,"deltaPtC","run",condition);
416 SaveGraph(tree,"deltaPtchi2C","run",condition);
417 SaveGraph(tree,"deltaPtA_Err","run",condition);
418 SaveGraph(tree,"deltaPtA_Err","run",condition);
419 SaveGraph(tree,"deltaPtC_Err","run",condition);
420
421 ////////////////////////////////////////////////////////////////////////////////////////////////////////
422 //save dca fit parameters
423 SaveGraph(tree,"dcar_posA_0","run",condition);
424 SaveGraph(tree,"dcar_posA_1","run",condition);
425 SaveGraph(tree,"dcar_posA_2","run",condition);
426 SaveGraph(tree,"dcar_posA_chi2","run",condition);
427 SaveGraph(tree,"dcar_posA_0_Err","run",condition);
428 SaveGraph(tree,"dcar_posA_1_Err","run",condition);
429 SaveGraph(tree,"dcar_posA_2_Err","run",condition);
430
431 SaveGraph(tree,"dcaz_posA_0","run",condition);
432 SaveGraph(tree,"dcaz_posA_1","run",condition);
433 SaveGraph(tree,"dcaz_posA_2","run",condition);
434 SaveGraph(tree,"dcaz_posA_chi2","run",condition);
435 SaveGraph(tree,"dcaz_posA_0_Err","run",condition);
436 SaveGraph(tree,"dcaz_posA_1_Err","run",condition);
437 SaveGraph(tree,"dcaz_posA_2_Err","run",condition);
438
439 SaveGraph(tree,"dcaz_posC_0","run",condition);
440 SaveGraph(tree,"dcaz_posC_1","run",condition);
441 SaveGraph(tree,"dcaz_posC_2","run",condition);
442 SaveGraph(tree,"dcaz_posC_chi2","run",condition);
443 SaveGraph(tree,"dcaz_posC_0_Err","run",condition);
444 SaveGraph(tree,"dcaz_posC_1_Err","run",condition);
445 SaveGraph(tree,"dcaz_posC_2_Err","run",condition);
446
447 SaveGraph(tree,"dcar_posC_0","run",condition);
448 SaveGraph(tree,"dcar_posC_1","run",condition);
449 SaveGraph(tree,"dcar_posC_2","run",condition);
450 SaveGraph(tree,"dcar_posC_chi2","run",condition);
451 SaveGraph(tree,"dcar_posC_0_Err","run",condition);
452 SaveGraph(tree,"dcar_posC_1_Err","run",condition);
453 SaveGraph(tree,"dcar_posC_2_Err","run",condition);
454
455 SaveGraph(tree,"dcar_negA_0","run",condition);
456 SaveGraph(tree,"dcar_negA_1","run",condition);
457 SaveGraph(tree,"dcar_negA_2","run",condition);
458 SaveGraph(tree,"dcar_negA_chi2","run",condition);
459 SaveGraph(tree,"dcar_negA_0_Err","run",condition);
460 SaveGraph(tree,"dcar_negA_1_Err","run",condition);
461 SaveGraph(tree,"dcar_negA_2_Err","run",condition);
462
463 SaveGraph(tree,"dcaz_negA_0","run",condition);
464 SaveGraph(tree,"dcaz_negA_1","run",condition);
465 SaveGraph(tree,"dcaz_negA_2","run",condition);
466 SaveGraph(tree,"dcaz_negA_chi2","run",condition);
467 SaveGraph(tree,"dcaz_negA_0_Err","run",condition);
468 SaveGraph(tree,"dcaz_negA_1_Err","run",condition);
469 SaveGraph(tree,"dcaz_negA_2_Err","run",condition);
470
471 SaveGraph(tree,"dcaz_negC_0","run",condition);
472 SaveGraph(tree,"dcaz_negC_1","run",condition);
473 SaveGraph(tree,"dcaz_negC_2","run",condition);
474 SaveGraph(tree,"dcaz_negC_chi2","run",condition);
475 SaveGraph(tree,"dcaz_negC_0_Err","run",condition);
476 SaveGraph(tree,"dcaz_negC_1_Err","run",condition);
477 SaveGraph(tree,"dcaz_negC_2_Err","run",condition);
478
479 SaveGraph(tree,"dcar_negC_0","run",condition);
480 SaveGraph(tree,"dcar_negC_1","run",condition);
481 SaveGraph(tree,"dcar_negC_2","run",condition);
482 SaveGraph(tree,"dcar_negC_chi2","run",condition);
483 SaveGraph(tree,"dcar_negC_0_Err","run",condition);
484 SaveGraph(tree,"dcar_negC_1_Err","run",condition);
485 SaveGraph(tree,"dcar_negC_2_Err","run",condition);
486
487
488
489 ////////////////////////////////////////////////////////////////////////////////////////////////////////
490
491
492tree->Write();
b832d719 493
494 out->Close();
495 if (tree) { delete tree; tree=0; }
496 if (out) { delete out; out=0; }
1833a193 497 return 0;
b832d719 498}
499
500//_____________________________________________________________________________
501Int_t AliTPCPerformanceSummary::SaveGraph(TTree* tree, const Char_t* y, const Char_t* x, const Char_t* condition)
502{
503 //
504 // Creates a Graph and writes the canvas to the current directory
505 // called by ProduceTrends function.
506 //
507
508 TString s(y);
509 s += ':';
510 s += x;
511 tree->Draw(s.Data(),condition,"goff");
512 TCanvas* c = new TCanvas(s.Data(),s.Data());
513 c->cd();
514 TPad* p = new TPad("pad0","pad0",0,0,1,1);
515 p->Draw();
516 p->cd();
517 if (tree->GetSelectedRows() > 0) {
518 TGraph* graph = new TGraph(tree->GetSelectedRows(), tree->GetV2(), tree->GetV1());
519 graph->Draw("AP");
520 graph->GetXaxis()->SetTitle(x);
521 graph->GetYaxis()->SetTitle(y);
522 c->Write(s.Data());
523 delete graph;
524 }
525 //graph->Write(s.Data());
526 delete c;
527
528return 0;
529}
530
531//_____________________________________________________________________________
70f4b25f 532Int_t AliTPCPerformanceSummary::AnalyzeDCARPhi(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 533{
534 //
535 // Analyse DCA R imperfections
536 //
537
538 if (!pcstream) return 8;
539 if (!pTPC) return 8;
540
541 // variables:
542 static Double_t offsetdRA=0;
543 static Double_t slopedRA=0;
544 static Double_t offsetdRC=0;
545 static Double_t slopedRC=0;
546 static Double_t offsetdRAErr=0;
547 static Double_t slopedRAErr=0;
548 static Double_t offsetdRCErr=0;
549 static Double_t slopedRCErr=0;
550 static Double_t offsetdRAchi2=0;
551 static Double_t slopedRAchi2=0;
552 static Double_t offsetdRCchi2=0;
553 static Double_t slopedRCchi2=0;
9f5fbaba 554 static Double_t dcarAP0 = 0;
555 static Double_t dcarAP1 = 0;
556 static Double_t dcarCP0 = 0;
557 static Double_t dcarCP1 = 0;
b832d719 558
559 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
0cb93e70 560
b832d719 561 TH1* his1D=0;
562 TH2* his2D=0;
0cb93e70 563 TH3* his3D=0;
564
28bb9d1f 565 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7")) {
566 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_3_5_7"));
26a35193 567 if(!his3D) return 8;
0cb93e70 568 his3D->GetYaxis()->SetRangeUser(-1,1);
569 his3D->GetZaxis()->SetRangeUser(0.25,10);
570 }
571
b832d719 572 static TF1 *fpol1 = new TF1("fpol1","pol1");
573 TObjArray arrayFit;
0cb93e70 574 if (his3D && !fgForceTHnSparse) {
575 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
576 } else {
577 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
578 }
26a35193 579 if(!his2D) return 8;
0cb93e70 580
581
b832d719 582 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
583 delete his2D;
584 his1D = (TH1*) arrayFit.At(1);
585 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
586 offsetdRC=fpol1->GetParameter(0);
587 slopedRC=fpol1->GetParameter(1);
588 offsetdRCchi2=fpol1->GetChisquare();
589 slopedRCchi2=fpol1->GetChisquare();
590 //
591 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
592 offsetdRA=fpol1->GetParameter(0);
593 slopedRA=fpol1->GetParameter(1);
594 offsetdRAErr=fpol1->GetParError(0);
595 slopedRAErr=fpol1->GetParError(1);
596 offsetdRAchi2=fpol1->GetChisquare();
597 slopedRAchi2=fpol1->GetChisquare();
598 //
599 printf("DCA R QA report\n");
600 printf("offsetdRA\t%f\n",offsetdRA);
601 printf("slopedRA\t%f\n",slopedRA);
602 printf("offsetdRC\t%f\n",offsetdRC);
603 printf("slopedRC\t%f\n",slopedRC);
9f5fbaba 604
605 //
606 //extraction of DCAr versus pt
607 //
608 TLinearFitter linearFit;
609 linearFit.SetFormula("pol1");
610 TObjArray arrayWidth;
611 TH1 *width;
612 Int_t nXbins;
613 Double_t x,y;
614 Int_t pn = 1;
615
616 if(!his3D)
617 return 8;
618 his3D->GetYaxis()->SetRangeUser(-1,1);
619
620 //get his2D in A Side
621 his3D->GetYaxis()->SetRangeUser(0,1);
622 his3D->GetZaxis()->SetRangeUser(0.35,8);
623 his2D = dynamic_cast<TH2*>(his3D->Project3D("xz"));
e01d9fa9 624 if (his2D)
625 his2D->FitSlicesY(0,0,-1,0,"QNR",&arrayWidth);
248ee6f9 626
9f5fbaba 627 width = dynamic_cast<TH1*>(arrayWidth.At(2));
248ee6f9 628 if (width)
629 {
e01d9fa9 630 nXbins = width->GetNbinsX();
9f5fbaba 631 for(Int_t i=2; i<nXbins; i++){
632 x = width->GetBinCenter(i);
633 if(x!=0)
634 x = 1.0/(x*x);
635 y = width->GetBinContent(i);
636 y = y*y;
637 linearFit.AddPoint(&x,y,1);
638 }
639 if(!linearFit.Eval()){
640
641 dcarAP0 = linearFit.GetParameter(0);
642 if(dcarAP0!=0)
643 pn = Int_t(TMath::Abs(dcarAP0)/dcarAP0);
644 dcarAP0 = pn*TMath::Sqrt(TMath::Abs(dcarAP0));
645
646 dcarAP1 = linearFit.GetParameter(1);
647 if(dcarAP1!=0)
648 pn = Int_t(TMath::Abs(dcarAP1)/dcarAP1);
649 dcarAP1 = pn*TMath::Sqrt(TMath::Abs(dcarAP1));
650 }
248ee6f9 651 }
9f5fbaba 652
653 linearFit.ClearPoints();
654
655 //get his2D in C Side
656 his3D->GetYaxis()->SetRangeUser(-1,-0.001);
657 his2D = dynamic_cast<TH2*>(his3D->Project3D("xz"));
e01d9fa9 658 if (his2D)
659 his2D->FitSlicesY(0,0,-1,0,"QNR",&arrayWidth);
248ee6f9 660 width = dynamic_cast<TH1*>(arrayWidth.At(2));
661 if (width)
662 {
e01d9fa9 663 nXbins = width->GetNbinsX();
9f5fbaba 664 for(Int_t i=2; i<nXbins; i++){
665 x = width->GetBinCenter(i);
666 if(x!=0)
667 x = 1.0/(x*x);
668 y = width->GetBinContent(i);
669 y = y*y;
670 linearFit.AddPoint(&x,y);
671 }
672 if(!linearFit.Eval()){
673 dcarCP0 = linearFit.GetParameter(0);
674 if(dcarCP0!=0)
675 pn = Int_t(TMath::Abs(dcarCP0)/dcarCP0);
676 dcarCP0 = pn*TMath::Sqrt(TMath::Abs(dcarCP0));
677
678 dcarCP1 = linearFit.GetParameter(1);
679 if(dcarCP1!=0)
680 pn = Int_t(TMath::Abs(dcarCP1)/dcarCP1);
681 dcarCP1 = pn*TMath::Sqrt(TMath::Abs(dcarCP1));
682 }
248ee6f9 683 }
9f5fbaba 684 his3D->GetYaxis()->SetRangeUser(-1,1);
685 his3D->GetZaxis()->SetRangeUser(0,20);
686
b832d719 687 //
688 // dump values
689 //
690 (*pcstream)<<"tpcQA"<<
691 "offsetdRA="<< offsetdRA<<
692 "slopedRA="<< slopedRA<<
693 "offsetdRC="<< offsetdRC<<
694 "slopedRC="<<slopedRC<<
695 //
696 "offsetdRAErr="<< offsetdRAErr<<
697 "slopedRAErr="<< slopedRAErr<<
698 "offsetdRCErr="<< offsetdRCErr<<
699 "slopedRCErr="<<slopedRCErr<<
700 //
701 "offsetdRAchi2="<< offsetdRAchi2<<
702 "slopedRAchi2="<< slopedRAchi2<<
703 "offsetdRCchi2="<< offsetdRCchi2<<
9f5fbaba 704 "slopedRCchi2="<<slopedRCchi2<<
705 //
706 "dcarAP0="<<dcarAP0<<
707 "dcarAP1="<<dcarAP1<<
708 "dcarCP0="<<dcarCP0<<
709 "dcarCP1="<<dcarCP1;
b832d719 710
711 return 0;
712}
713
714//_____________________________________________________________________________
70f4b25f 715Int_t AliTPCPerformanceSummary::AnalyzeDCARPhiPos(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 716{
717 //
718 // Analyse DCA R imperfections for positive particles
719 //
720
721 if (!pcstream) return 16;
722 if (!pTPC) return 16;
723
724 // variables:
725 static Double_t offsetdRAPos=0;
726 static Double_t slopedRAPos=0;
727 static Double_t offsetdRCPos=0;
728 static Double_t slopedRCPos=0;
729 static Double_t offsetdRAErrPos=0;
730 static Double_t slopedRAErrPos=0;
731 static Double_t offsetdRCErrPos=0;
732 static Double_t slopedRCErrPos=0;
733 static Double_t offsetdRAchi2Pos=0;
734 static Double_t slopedRAchi2Pos=0;
735 static Double_t offsetdRCchi2Pos=0;
736 static Double_t slopedRCchi2Pos=0;
737
738 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
739 TH1* his1D=0;
740 TH2* his2D=0;
0cb93e70 741 TH3* his3D=0;
742
28bb9d1f 743 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
744 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
26a35193 745 if(!his3D) return 16;
0cb93e70 746 his3D->GetYaxis()->SetRangeUser(-1,1);
747 his3D->GetZaxis()->SetRangeUser(0.25,10);
748 }
749
b832d719 750 static TF1 *fpol1 = new TF1("fpol1","pol1");
751 TObjArray arrayFit;
0cb93e70 752 if (his3D && !fgForceTHnSparse) {
753 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
754 } else {
5ca104e5 755 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(0,1.5);
0cb93e70 756 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
5ca104e5 757 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
0cb93e70 758 }
26a35193 759 if(!his2D) return 16;
0cb93e70 760
b832d719 761 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
0cb93e70 762 delete his2D;
b832d719 763 his1D = (TH1*) arrayFit.At(1);
764 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
765 offsetdRCPos=fpol1->GetParameter(0);
766 slopedRCPos=fpol1->GetParameter(1);
767 offsetdRCchi2Pos=fpol1->GetChisquare();
768 slopedRCchi2Pos=fpol1->GetChisquare();
769 //
770 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
771 offsetdRAPos=fpol1->GetParameter(0);
772 slopedRAPos=fpol1->GetParameter(1);
773 offsetdRAErrPos=fpol1->GetParError(0);
774 slopedRAErrPos=fpol1->GetParError(1);
775 offsetdRAchi2Pos=fpol1->GetChisquare();
776 slopedRAchi2Pos=fpol1->GetChisquare();
777 //
778 printf("DCA R QA Pos report\n");
779 printf("offsetdRAPos\t%f\n",offsetdRAPos);
780 printf("slopedRAPos\t%f\n",slopedRAPos);
781 printf("offsetdRCPos\t%f\n",offsetdRCPos);
782 printf("slopedRCPos\t%f\n",slopedRCPos);
783 //
784 // dump values
785 //
786 (*pcstream)<<"tpcQA"<<
787 "offsetdRAPos="<< offsetdRAPos<<
788 "slopedRAPos="<< slopedRAPos<<
789 "offsetdRCPos="<< offsetdRCPos<<
790 "slopedRCPos="<<slopedRCPos<<
791 //
792 "offsetdRAErrPos="<< offsetdRAErrPos<<
793 "slopedRAErrPos="<< slopedRAErrPos<<
794 "offsetdRCErrPos="<< offsetdRCErrPos<<
795 "slopedRCErrPos="<<slopedRCErrPos<<
796 //
797 "offsetdRAchi2Pos="<< offsetdRAchi2Pos<<
798 "slopedRAchi2Pos="<< slopedRAchi2Pos<<
799 "offsetdRCchi2Pos="<< offsetdRCchi2Pos<<
800 "slopedRCchi2Pos="<<slopedRCchi2Pos;
801
802 return 0;
803}
804
805//_____________________________________________________________________________
70f4b25f 806Int_t AliTPCPerformanceSummary::AnalyzeDCARPhiNeg(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 807{
808 //
809 // Analyse DCA R imperfections for negative particles
810 //
811 if (!pcstream) return 32;
812 if (!pTPC) return 32;
813
814 // variables:
815 static Double_t offsetdRANeg=0;
816 static Double_t slopedRANeg=0;
817 static Double_t offsetdRCNeg=0;
818 static Double_t slopedRCNeg=0;
819 static Double_t offsetdRAErrNeg=0;
820 static Double_t slopedRAErrNeg=0;
821 static Double_t offsetdRCErrNeg=0;
822 static Double_t slopedRCErrNeg=0;
823 static Double_t offsetdRAchi2Neg=0;
824 static Double_t slopedRAchi2Neg=0;
825 static Double_t offsetdRCchi2Neg=0;
826 static Double_t slopedRCchi2Neg=0;
827
828 //AliPerformanceTPC* pTPC = dynamic_cast<AliPerformanceTPC*>(pTPCObject);
829 TH1* his1D=0;
830 TH2* his2D=0;
0cb93e70 831 TH3* his3D=0;
832
28bb9d1f 833 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
834 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
26a35193 835 if(!his3D) return 32;
0cb93e70 836 his3D->GetYaxis()->SetRangeUser(-1,1);
837 his3D->GetZaxis()->SetRangeUser(0.25,10);
838 }
839
b832d719 840 static TF1 *fpol1 = new TF1("fpol1","pol1");
841 TObjArray arrayFit;
0cb93e70 842 if (his3D && !fgForceTHnSparse) {
843 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
844 } else {
5ca104e5 845 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,0);
0cb93e70 846 his2D = pTPC->GetTPCTrackHisto()->Projection(3,5);
5ca104e5 847 pTPC->GetTPCTrackHisto()->GetAxis(8)->SetRangeUser(-1.5,1.5);
0cb93e70 848 }
26a35193 849 if(!his2D) return 32;
850
b832d719 851 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
0cb93e70 852 delete his2D;
b832d719 853 his1D = (TH1*) arrayFit.At(1);
854 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
855 offsetdRCNeg=fpol1->GetParameter(0);
856 slopedRCNeg=fpol1->GetParameter(1);
857 offsetdRCchi2Neg=fpol1->GetChisquare();
858 slopedRCchi2Neg=fpol1->GetChisquare();
859 //
860 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
861 offsetdRANeg=fpol1->GetParameter(0);
862 slopedRANeg=fpol1->GetParameter(1);
863 offsetdRAErrNeg=fpol1->GetParError(0);
864 slopedRAErrNeg=fpol1->GetParError(1);
865 offsetdRAchi2Neg=fpol1->GetChisquare();
866 slopedRAchi2Neg=fpol1->GetChisquare();
867 //
868 printf("DCA R QA Neg report\n");
869 printf("offsetdRANeg\t%f\n",offsetdRANeg);
870 printf("slopedRANeg\t%f\n",slopedRANeg);
871 printf("offsetdRCNeg\t%f\n",offsetdRCNeg);
872 printf("slopedRCNeg\t%f\n",slopedRCNeg);
873 //
874 // dump drift QA values
875 //
876 (*pcstream)<<"tpcQA"<<
877 "offsetdRANeg="<< offsetdRANeg<<
878 "slopedRANeg="<< slopedRANeg<<
879 "offsetdRCNeg="<< offsetdRCNeg<<
880 "slopedRCNeg="<<slopedRCNeg<<
881 //
882 "offsetdRAErrNeg="<< offsetdRAErrNeg<<
883 "slopedRAErrNeg="<< slopedRAErrNeg<<
884 "offsetdRCErrNeg="<< offsetdRCErrNeg<<
885 "slopedRCErrNeg="<<slopedRCErrNeg<<
886 //
887 "offsetdRAchi2Neg="<< offsetdRAchi2Neg<<
888 "slopedRAchi2Neg="<< slopedRAchi2Neg<<
889 "offsetdRCchi2Neg="<< offsetdRCchi2Neg<<
890 "slopedRCchi2Neg="<<slopedRCchi2Neg;
891
892 return 0;
893}
894
895//_____________________________________________________________________________
70f4b25f 896Int_t AliTPCPerformanceSummary::AnalyzeNCL(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 897{
898 //
899 // Analyse number of TPC clusters
900 //
901
902 if (!pcstream) return 1;
903 if (!pTPC) return 1;
904
905 // variables:
906 static Double_t meanTPCnclF=0;
907 static Double_t rmsTPCnclF=0;
908 static Double_t meanTPCChi2=0;
909 static Double_t rmsTPCChi2=0;
910 static Double_t slopeATPCnclF=0;
911 static Double_t slopeCTPCnclF=0;
912 static Double_t slopeATPCnclFErr=0;
913 static Double_t slopeCTPCnclFErr=0;
914 static Double_t meanTPCncl=0;
915 static Double_t rmsTPCncl=0;
916 static Double_t slopeATPCncl=0;
917 static Double_t slopeCTPCncl=0;
918 static Double_t slopeATPCnclErr=0;
919 static Double_t slopeCTPCnclErr=0;
70f4b25f 920 //
b832d719 921 TH1* his1D=0;
70f4b25f 922 TH3* his3D0=0;
923 TH3* his3D1=0;
924 TH3* his3D2=0;
b832d719 925 TProfile* hprof=0;
926 static TF1 *fpol1 = new TF1("fpol1","pol1");
927 //
928 // all clusters
0cb93e70 929 // only events with rec. vertex
b832d719 930 // eta cut - +-1
0cb93e70 931 // pt cut - 0.250 GeV
b832d719 932 pTPC->GetTPCTrackHisto()->GetAxis(5)->SetRangeUser(-1.,1.);
933 pTPC->GetTPCTrackHisto()->GetAxis(7)->SetRangeUser(0.25,10);
0cb93e70 934
28bb9d1f 935 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7")) {
70f4b25f 936 his3D0 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_0_5_7"));
26a35193 937 if(!his3D0) return 1;
70f4b25f 938 his3D0->GetYaxis()->SetRangeUser(-1,1);
939 his3D0->GetZaxis()->SetRangeUser(0.25,10);
0cb93e70 940 }
28bb9d1f 941 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7")) {
70f4b25f 942 his3D1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_1_5_7"));
26a35193 943 if(!his3D1) return 1;
70f4b25f 944 his3D1->GetYaxis()->SetRangeUser(-1,1);
945 his3D1->GetZaxis()->SetRangeUser(0.25,10);
0cb93e70 946 }
28bb9d1f 947 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7")) {
70f4b25f 948 his3D2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_2_5_7"));
26a35193 949 if(!his3D2) return 1;
70f4b25f 950 his3D2->GetYaxis()->SetRangeUser(-1,1);
951 his3D2->GetZaxis()->SetRangeUser(0.25,10);
952 his3D2->GetXaxis()->SetRangeUser(0.4,1.1);
0cb93e70 953 }
954
955
70f4b25f 956 if (his3D0 && !fgForceTHnSparse) {
957 his1D = his3D0->Project3D("x");
0cb93e70 958 } else {
959 his1D = pTPC->GetTPCTrackHisto()->Projection(0);
960 }
961
b832d719 962 meanTPCncl= his1D->GetMean();
963 rmsTPCncl= his1D->GetRMS();
964 delete his1D;
0cb93e70 965
70f4b25f 966 if (his3D1 && !fgForceTHnSparse) {
967 his1D = his3D1->Project3D("x");
0cb93e70 968 } else {
969 his1D = pTPC->GetTPCTrackHisto()->Projection(1);
970 }
971
b832d719 972 meanTPCChi2= his1D->GetMean();
973 rmsTPCChi2= his1D->GetRMS();
974 delete his1D;
0cb93e70 975
70f4b25f 976 if (his3D0 && !fgForceTHnSparse) {
977 hprof = (dynamic_cast<TH2*>(his3D0->Project3D("xy")))->ProfileX();
0cb93e70 978 } else {
979 hprof = pTPC->GetTPCTrackHisto()->Projection(0,5)->ProfileX();
980 }
26a35193 981 if(!hprof) return 1;
0cb93e70 982
983 hprof->Fit(fpol1,"QNR","QNR",0.1,0.8);
b832d719 984 slopeATPCncl= fpol1->GetParameter(1);
985 slopeATPCnclErr= fpol1->GetParError(1);
0cb93e70 986 hprof->Fit(fpol1,"QNR","QNR",-0.8,-0.1);
b832d719 987 slopeCTPCncl= fpol1->GetParameter(1);
988 slopeCTPCnclErr= fpol1->GetParameter(1);
989 delete hprof;
0cb93e70 990
b832d719 991 //
992 // findable clusters
993 //
0cb93e70 994
70f4b25f 995 if (his3D2 && !fgForceTHnSparse) {
996 his1D = his3D2->Project3D("x");
0cb93e70 997 } else {
998 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0.4,1.1);
999 his1D = pTPC->GetTPCTrackHisto()->Projection(2);
1000 }
814d192f 1001
b832d719 1002 meanTPCnclF= his1D->GetMean();
1003 rmsTPCnclF= his1D->GetRMS();
1004 delete his1D;
0cb93e70 1005
70f4b25f 1006 if (his3D2 && !fgForceTHnSparse) {
1007 his1D = (dynamic_cast<TH2*>(his3D2->Project3D("xy")))->ProfileX();
0cb93e70 1008 } else {
1009 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0.4,1.1);
1010 his1D = pTPC->GetTPCTrackHisto()->Projection(2,5)->ProfileX();
1011 }
26a35193 1012 if(!his1D) return 1;
0cb93e70 1013
1014 his1D->Fit(fpol1,"QNR","QNR",0.1,0.8);
b832d719 1015 slopeATPCnclF= fpol1->GetParameter(1);
1016 slopeATPCnclFErr= fpol1->GetParError(1);
0cb93e70 1017 his1D->Fit(fpol1,"QNR","QNR",-0.8,-0.1);
b832d719 1018 slopeCTPCnclF= fpol1->GetParameter(1);
1019 slopeCTPCnclFErr= fpol1->GetParameter(1);
1020 delete his1D;
0cb93e70 1021
1022 pTPC->GetTPCTrackHisto()->GetAxis(2)->SetRangeUser(0,10);
1023
b832d719 1024 printf("Cluster QA report\n");
1025 printf("meanTPCnclF=\t%f\n",meanTPCnclF);
1026 printf("rmsTPCnclF=\t%f\n",rmsTPCnclF);
1027 printf("slopeATPCnclF=\t%f\n",slopeATPCnclF);
1028 printf("slopeCTPCnclF=\t%f\n",slopeCTPCnclF);
1029 printf("meanTPCncl=\t%f\n",meanTPCncl);
1030 printf("rmsTPCncl=\t%f\n",rmsTPCncl);
1031 printf("slopeATPCncl=\t%f\n",slopeATPCncl);
1032 printf("slopeCTPCncl=\t%f\n",slopeCTPCncl);
1033 printf("meanTPCChi2=\t%f\n",meanTPCChi2);
1034 printf("rmsTPCChi2=\t%f\n",rmsTPCChi2);
1035 //
1036 // dump results to the tree
1037 //
1038 (*pcstream)<<"tpcQA"<<
1039 "meanTPCnclF="<<meanTPCnclF <<
1040 "rmsTPCnclF="<<rmsTPCnclF <<
1041 "meanTPCChi2="<<meanTPCChi2 <<
1042 "rmsTPCChi2="<<rmsTPCChi2 <<
1043 "slopeATPCnclF="<< slopeATPCnclF<<
1044 "slopeCTPCnclF="<< slopeCTPCnclF<<
1045 "slopeATPCnclFErr="<< slopeATPCnclFErr<<
1046 "slopeCTPCnclFErr="<< slopeCTPCnclFErr<<
1047 "meanTPCncl="<<meanTPCncl <<
1048 "rmsTPCncl="<< rmsTPCncl<<
1049 "slopeATPCncl="<< slopeATPCncl<<
1050 "slopeCTPCncl="<< slopeCTPCncl<<
1051 "slopeATPCnclErr="<< slopeATPCnclErr<<
1052 "slopeCTPCnclErr="<< slopeCTPCnclErr;
1053
1054 return 0;
1055}
1056
1057//_____________________________________________________________________________
70f4b25f 1058Int_t AliTPCPerformanceSummary::AnalyzeDrift(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 1059{
1060 //
1061 // Analyse DCA Z imperferctions (drift velocity)
1062 //
1063
1064 if (!pcstream) return 2;
1065 if (!pTPC) return 2;
1066
1067 // variables:
1068 static Double_t offsetdZA=0;
1069 static Double_t slopedZA=0;
1070 static Double_t offsetdZC=0;
1071 static Double_t slopedZC=0;
1072 static Double_t offsetdZAErr=0;
1073 static Double_t slopedZAErr=0;
1074 static Double_t offsetdZCErr=0;
1075 static Double_t slopedZCErr=0;
1076 static Double_t offsetdZAchi2=0;
1077 static Double_t slopedZAchi2=0;
1078 static Double_t offsetdZCchi2=0;
1079 static Double_t slopedZCchi2=0;
1080 TH1* his1D=0;
1081 TH2* his2D=0;
0cb93e70 1082 TH3* his3D=0;
1083
28bb9d1f 1084 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7")) {
1085 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_4_5_7"));
26a35193 1086 if(!his3D) return 2;
0cb93e70 1087 his3D->GetYaxis()->SetRangeUser(-1,1);
1088 his3D->GetZaxis()->SetRangeUser(0.25,10);
26a35193 1089 }
1090
0cb93e70 1091 if (his3D && !fgForceTHnSparse) {
1092 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
1093 } else {
1094 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
1095 }
26a35193 1096 if(!his2D) return 2;
0cb93e70 1097
b832d719 1098 static TF1 *fpol1 = new TF1("fpol1","pol1");
1099 TObjArray arrayFit;
b832d719 1100 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
1101 delete his2D;
1102 his1D = (TH1*) arrayFit.At(1);
1103 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
1104 offsetdZC=fpol1->GetParameter(0);
1105 slopedZC=fpol1->GetParameter(1);
1106 offsetdZCErr=fpol1->GetParError(0);
1107 slopedZCErr=fpol1->GetParError(1);
1108 offsetdZCchi2=fpol1->GetChisquare();
1109 slopedZCchi2=fpol1->GetChisquare();
1110 //
1111 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
1112 offsetdZA=fpol1->GetParameter(0);
1113 slopedZA=fpol1->GetParameter(1);
1114 offsetdZAErr=fpol1->GetParError(0);
1115 slopedZAErr=fpol1->GetParError(1);
1116 offsetdZAchi2=fpol1->GetChisquare();
1117 slopedZAchi2=fpol1->GetChisquare();
1118 //
1119 printf("Drift velocity QA report\n");
1120 printf("offsetdZA\t%f\n",offsetdZA);
1121 printf("slopedZA\t%f\n",slopedZA);
1122 printf("offsetdZC\t%f\n",offsetdZC);
1123 printf("slopedZC\t%f\n",slopedZC);
1124 //
1125 // dump drift QA values
1126 //
1127 (*pcstream)<<"tpcQA"<<
1128 "offsetdZA="<< offsetdZA<<
1129 "slopedZA="<< slopedZA<<
1130 "offsetdZC="<< offsetdZC<<
1131 "slopedZC="<<slopedZC<<
1132 //
1133 "offsetdZAErr="<< offsetdZAErr<<
1134 "slopedZAErr="<< slopedZAErr<<
1135 "offsetdZCErr="<< offsetdZCErr<<
1136 "slopedZCErr="<<slopedZCErr<<
1137 //
1138 "offsetdZAchi2="<< offsetdZAchi2<<
1139 "slopedZAchi2="<< slopedZAchi2<<
1140 "offsetdZCchi2="<< offsetdZCchi2<<
1141 "slopedZCchi2="<<slopedZCchi2;
1142
1143 return 0;
1144}
1145
1146//_____________________________________________________________________________
70f4b25f 1147Int_t AliTPCPerformanceSummary::AnalyzeDriftPos(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 1148{
1149 //
1150 // Analyse DCA Z imperferctions (drift velocity)
1151 // for positive particles
1152 //
1153 if (!pcstream) return 64;
1154 if (!pTPC) return 64;
1155
1156 // variables:
1157 static Double_t offsetdZAPos=0;
1158 static Double_t slopedZAPos=0;
1159 static Double_t offsetdZCPos=0;
1160 static Double_t slopedZCPos=0;
1161 static Double_t offsetdZAErrPos=0;
1162 static Double_t slopedZAErrPos=0;
1163 static Double_t offsetdZCErrPos=0;
1164 static Double_t slopedZCErrPos=0;
1165 static Double_t offsetdZAchi2Pos=0;
1166 static Double_t slopedZAchi2Pos=0;
1167 static Double_t offsetdZCchi2Pos=0;
1168 static Double_t slopedZCchi2Pos=0;
1169 TH1* his1D=0;
1170 TH2* his2D=0;
0cb93e70 1171 TH3* his3D=0;
1172
28bb9d1f 1173 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7")) {
1174 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_7"));
26a35193 1175 if(!his3D) return 64;
0cb93e70 1176 his3D->GetYaxis()->SetRangeUser(-1,1);
1177 his3D->GetZaxis()->SetRangeUser(0.25,10);
26a35193 1178 }
1179
0cb93e70 1180 if (his3D && !fgForceTHnSparse) {
1181 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
1182 } else {
1183 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
1184 }
26a35193 1185 if(!his2D) return 64;
0cb93e70 1186
b832d719 1187 static TF1 *fpol1 = new TF1("fpol1","pol1");
1188 TObjArray arrayFit;
b832d719 1189 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
1190 delete his2D;
0cb93e70 1191
b832d719 1192 his1D = (TH1*) arrayFit.At(1);
1193 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
1194 offsetdZCPos=fpol1->GetParameter(0);
1195 slopedZCPos=fpol1->GetParameter(1);
1196 offsetdZCErrPos=fpol1->GetParError(0);
1197 slopedZCErrPos=fpol1->GetParError(1);
1198 offsetdZCchi2Pos=fpol1->GetChisquare();
1199 slopedZCchi2Pos=fpol1->GetChisquare();
1200 //
1201 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
1202 offsetdZAPos=fpol1->GetParameter(0);
1203 slopedZAPos=fpol1->GetParameter(1);
1204 offsetdZAErrPos=fpol1->GetParError(0);
1205 slopedZAErrPos=fpol1->GetParError(1);
1206 offsetdZAchi2Pos=fpol1->GetChisquare();
1207 slopedZAchi2Pos=fpol1->GetChisquare();
1208 //
1209 printf("Drift velocity QA report\n");
1210 printf("offsetdZAPos\t%f\n",offsetdZAPos);
1211 printf("slopedZAPos\t%f\n",slopedZAPos);
1212 printf("offsetdZCPos\t%f\n",offsetdZCPos);
1213 printf("slopedZCPos\t%f\n",slopedZCPos);
1214 //
1215 // dump drift QA values
1216 //
1217 (*pcstream)<<"tpcQA"<<
1218 "offsetdZAPos="<< offsetdZAPos<<
1219 "slopedZAPos="<< slopedZAPos<<
1220 "offsetdZCPos="<< offsetdZCPos<<
1221 "slopedZCPos="<<slopedZCPos<<
1222 //
1223 "offsetdZAErrPos="<< offsetdZAErrPos<<
1224 "slopedZAErrPos="<< slopedZAErrPos<<
1225 "offsetdZCErrPos="<< offsetdZCErrPos<<
1226 "slopedZCErrPos="<<slopedZCErrPos<<
1227 //
1228 "offsetdZAchi2Pos="<< offsetdZAchi2Pos<<
1229 "slopedZAchi2Pos="<< slopedZAchi2Pos<<
1230 "offsetdZCchi2Pos="<< offsetdZCchi2Pos<<
1231 "slopedZCchi2Pos="<<slopedZCchi2Pos;
1232
1233 return 0;
1234}
1235
1236//_____________________________________________________________________________
70f4b25f 1237Int_t AliTPCPerformanceSummary::AnalyzeDriftNeg(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 1238{
1239 //
1240 // Analyse DCA Z imperferctions (drift velocity)
1241 // for negative particles
1242 //
1243 if (!pcstream) return 128;
1244 if (!pTPC) return 128;
1245
1246 // variables:
1247 static Double_t offsetdZANeg=0;
1248 static Double_t slopedZANeg=0;
1249 static Double_t offsetdZCNeg=0;
1250 static Double_t slopedZCNeg=0;
1251 static Double_t offsetdZAErrNeg=0;
1252 static Double_t slopedZAErrNeg=0;
1253 static Double_t offsetdZCErrNeg=0;
1254 static Double_t slopedZCErrNeg=0;
1255 static Double_t offsetdZAchi2Neg=0;
1256 static Double_t slopedZAchi2Neg=0;
1257 static Double_t offsetdZCchi2Neg=0;
1258 static Double_t slopedZCchi2Neg=0;
1259 TH1* his1D=0;
1260 TH2* his2D=0;
0cb93e70 1261 TH3* his3D=0;
1262
0cb93e70 1263
28bb9d1f 1264 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7")) {
1265 his3D = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_7"));
26a35193 1266 if(!his3D) return 128;
0cb93e70 1267 his3D->GetYaxis()->SetRangeUser(-1,1);
1268 his3D->GetZaxis()->SetRangeUser(0.25,10);
1269 }
1270 if (his3D && !fgForceTHnSparse) {
1271 his2D = dynamic_cast<TH2*>(his3D->Project3D("xy"));
1272 } else {
1273 his2D = pTPC->GetTPCTrackHisto()->Projection(4,5);
1274 }
26a35193 1275 if(!his2D) return 128;
0cb93e70 1276
b832d719 1277 static TF1 *fpol1 = new TF1("fpol1","pol1");
1278 TObjArray arrayFit;
b832d719 1279 his2D->FitSlicesY(0,0,-1,10,"QNR",&arrayFit);
1280 delete his2D;
0cb93e70 1281
b832d719 1282 his1D = (TH1*) arrayFit.At(1);
1283 his1D->Fit(fpol1,"QNRROB=0.8","QNR",-0.8,-0.1);
1284 offsetdZCNeg=fpol1->GetParameter(0);
1285 slopedZCNeg=fpol1->GetParameter(1);
1286 offsetdZCErrNeg=fpol1->GetParError(0);
1287 slopedZCErrNeg=fpol1->GetParError(1);
1288 offsetdZCchi2Neg=fpol1->GetChisquare();
1289 slopedZCchi2Neg=fpol1->GetChisquare();
1290 //
1291 his1D->Fit(fpol1,"QNRROB=0.8","QNR",0.1,0.8);
1292 offsetdZANeg=fpol1->GetParameter(0);
1293 slopedZANeg=fpol1->GetParameter(1);
1294 offsetdZAErrNeg=fpol1->GetParError(0);
1295 slopedZAErrNeg=fpol1->GetParError(1);
1296 offsetdZAchi2Neg=fpol1->GetChisquare();
1297 slopedZAchi2Neg=fpol1->GetChisquare();
1298 //
1299 printf("Drift velocity QA report\n");
1300 printf("offsetdZANeg\t%f\n",offsetdZANeg);
1301 printf("slopedZANeg\t%f\n",slopedZANeg);
1302 printf("offsetdZCNeg\t%f\n",offsetdZCNeg);
1303 printf("slopedZCNeg\t%f\n",slopedZCNeg);
1304 //
1305 // dump drift QA values
1306 //
1307 (*pcstream)<<"tpcQA"<<
1308 "offsetdZANeg="<< offsetdZANeg<<
1309 "slopedZANeg="<< slopedZANeg<<
1310 "offsetdZCNeg="<< offsetdZCNeg<<
1311 "slopedZCNeg="<<slopedZCNeg<<
1312 //
1313 "offsetdZAErrNeg="<< offsetdZAErrNeg<<
1314 "slopedZAErrNeg="<< slopedZAErrNeg<<
1315 "offsetdZCErrNeg="<< offsetdZCErrNeg<<
1316 "slopedZCErrNeg="<<slopedZCErrNeg<<
1317 //
1318 "offsetdZAchi2Neg="<< offsetdZAchi2Neg<<
1319 "slopedZAchi2Neg="<< slopedZAchi2Neg<<
1320 "offsetdZCchi2Neg="<< offsetdZCchi2Neg<<
1321 "slopedZCchi2Neg="<<slopedZCchi2Neg;
1322
1323 return 0;
1324}
1325
1326//_____________________________________________________________________________
70f4b25f 1327Int_t AliTPCPerformanceSummary::AnalyzeGain(const AliPerformanceDEdx* pTPCgain, TTreeSRedirector* const pcstream)
b832d719 1328{
1329 //
1330 // Analyse Gain
1331 //
1332
1333 if (!pcstream) return 4;
1334 if (!pTPCgain) return 4;
1335
1336 static TVectorD meanMIPvsSector(36);
1337 static TVectorD sector(36);
1338 static Float_t meanMIP = 0;
1339 static Float_t resolutionMIP = 0;
1340 static Float_t attachSlopeC = 0;
1341 static Float_t attachSlopeA = 0;
1342
69878f59 1343 TH1 * his1D = 0;
814d192f 1344 //TH1 * hisProj1D=0;
1345 TH2* his2D=0;
1346
69878f59 1347
b832d719 1348 meanMIPvsSector.Zero();
1349 //
1350 // select MIP particles
1351 //
1352 pTPCgain->GetDeDxHisto()->GetAxis(7)->SetRangeUser(0.4,0.55);
1353 pTPCgain->GetDeDxHisto()->GetAxis(0)->SetRangeUser(35,60);
1354 pTPCgain->GetDeDxHisto()->GetAxis(6)->SetRangeUser(80,160);
1355 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-1,1);
1356 //
1357 // MIP position and resolution
814d192f 1358 //
b832d719 1359 TF1 gausFit("gausFit","gaus");
814d192f 1360
1361 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_0") && !fgForceTHnSparse) {
1362 his1D = dynamic_cast<TH1*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_0")->Clone());
1363 } else {
1364 his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1365 }
26a35193 1366 if(!his1D) return 4;
814d192f 1367 his1D->Fit(&gausFit,"QN","QN");
1368
b832d719 1369 meanMIP = gausFit.GetParameter(1);
1370 resolutionMIP = 0;
1371 if (meanMIP!=0) resolutionMIP = gausFit.GetParameter(2)/meanMIP;
814d192f 1372 //removedtotest// delete his1D;
b832d719 1373 //
1374 // MIP position vs. dip angle (attachment)
814d192f 1375 //
1376 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-3,0); // C side
1377 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_5") && !fgForceTHnSparse) {
1378 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_5")->Clone());
1379 } else {
1380 his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
1381 }
26a35193 1382 if(!his2D) return 4;
1383
b832d719 1384 TF1 * fpol = new TF1("fpol","pol1");
1385 TObjArray arrayFit;
814d192f 1386 his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
69878f59 1387 his1D = (TH1*) arrayFit.At(1);
b832d719 1388 his1D->Fit(fpol,"QNROB=0.8","QNR",-1,0);
1389 attachSlopeC = fpol->GetParameter(1);
814d192f 1390 //removedtotest// delete his2D;
1391 //removedtotest// delete his1D;
b832d719 1392 //
814d192f 1393 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(0,3); // A side
1394 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_5") && !fgForceTHnSparse) {
1395 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_5")->Clone());
1396 } else {
1397 his2D = pTPCgain->GetDeDxHisto()->Projection(0,5);
1398 }
26a35193 1399 if(!his2D) return 4;
1400
b832d719 1401 TF1 * fpolA = new TF1("fpolA","pol1");
1402 TObjArray arrayFitA;
814d192f 1403 his2D->FitSlicesY(0,0,-1,10,"QN",&arrayFit);
1404 his1D = (TH1*) arrayFit.At(1);
1405 his1D->Fit(fpolA,"QNROB=0.8","QN",0,1);
b832d719 1406 attachSlopeA = fpolA->GetParameter(1);
814d192f 1407 //removedtotest// delete his2D;
1408 //removedtotest// delete his1D;
b832d719 1409 //
1410 // MIP position vs. sector
1411 //
1412 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(-3,0); // C side
814d192f 1413 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_1") && !fgForceTHnSparse) {
1414 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_c_0_1")->Clone());
1415 } else {
1416 his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
1417 }
26a35193 1418 if(!his2D) return 4;
1419
b832d719 1420 for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
0285b6f5 1421 //TH1* his1D=0;
b832d719 1422 Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
1423 Float_t phiUp = -TMath::Pi() + (i+1)*(20./360.)*(2*TMath::Pi());
814d192f 1424 //pTPCgain->GetDeDxHisto()->GetAxis(1)->SetRangeUser(phiLow,phiUp);
1425 his2D->GetXaxis()->SetRangeUser(phiLow,phiUp);
1426 //his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1427 his1D = his2D->ProjectionY();
b832d719 1428 TF1 gausFunc("gausFunc","gaus");
1429 his1D->Fit(&gausFunc, "QN");
1430 meanMIPvsSector(i) = gausFunc.GetParameter(1);
1431 sector(i)=i;
814d192f 1432 //removedtotest// delete his1D;
b832d719 1433 }
814d192f 1434 //removedtotest// delete his2D;
b832d719 1435 //
1436 pTPCgain->GetDeDxHisto()->GetAxis(5)->SetRangeUser(0,3); // A side
814d192f 1437 if (pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_1") && !fgForceTHnSparse) {
1438 his2D = dynamic_cast<TH2*>(pTPCgain->GetHistos()->FindObject("h_tpc_dedx_mips_a_0_1")->Clone());
1439 } else {
1440 his2D = pTPCgain->GetDeDxHisto()->Projection(0,1);
1441 }
26a35193 1442 if(!his2D) return 4;
1443
b832d719 1444 for(Int_t i = 0; i < 18; i++) { // loop over sectors; correct mapping to be checked!
69878f59 1445 //TH1* his1D=0;
b832d719 1446 Float_t phiLow = -TMath::Pi() + i*(20./360.)*(2*TMath::Pi());
1447 Float_t phiUp = -TMath::Pi() + (i+1)*(20./360.)*(2*TMath::Pi());
814d192f 1448 //pTPCgain->GetDeDxHisto()->GetAxis(1)->SetRangeUser(phiLow,phiUp);
1449 his2D->GetXaxis()->SetRangeUser(phiLow,phiUp);
1450 //his1D = pTPCgain->GetDeDxHisto()->Projection(0);
1451 his1D = his2D->ProjectionY();
b832d719 1452 TF1 gausFunc("gausFunc","gaus");
1453 his1D->Fit(&gausFunc, "QN");
1454 meanMIPvsSector(i+18) = gausFunc.GetParameter(1);
1455 sector(i+18)=i+18;
814d192f 1456 //removedtotest// delete his1D;
b832d719 1457 }
814d192f 1458 //removedtotest// delete his2D;
b832d719 1459 //
1460 printf("Gain QA report\n");
1461 printf("MIP mean\t%f\n",meanMIP);
1462 printf("MIP resolution\t%f\n",resolutionMIP);
1463 printf("MIPslopeA\t%f\n",attachSlopeA);
1464 printf("MIPslopeC\t%f\n",attachSlopeC);
814d192f 1465 //
1466
b832d719 1467 (*pcstream)<<"tpcQA"<<
1468 "MIPattachSlopeC="<<attachSlopeC<<
1469 "MIPattachSlopeA="<<attachSlopeA<<
1470 "resolutionMIP="<<resolutionMIP<<
1471 "meanMIPvsSector.="<<&meanMIPvsSector<<
1472 "sector.="<<&sector<<
1473 "meanMIP="<<meanMIP;
1474
1475 return 0;
1476}
1477
1478//_____________________________________________________________________________
70f4b25f 1479Int_t AliTPCPerformanceSummary::AnalyzeEvent(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
b832d719 1480{
1481 //
1482 // Analyse Primary Vertex Distribution and Multiplicities
1483 //
1484 if (!pcstream) return 1;
1485 if (!pTPC) return 1;
1486 //
1487 //
1488 //
1489 static Double_t meanVertX=0;
1490 static Double_t rmsVertX=0;
1491 static Double_t meanVertY=0;
1492 static Double_t rmsVertY=0;
1493 static Double_t meanVertZ=0;
1494 static Double_t rmsVertZ=0;
1495 static Double_t vertStatus=0;
1496 static Double_t meanMult=0;
1497 static Double_t rmsMult=0;
1498 static Double_t meanMultPos=0;
1499 static Double_t rmsMultPos=0;
1500 static Double_t meanMultNeg=0;
1501 static Double_t rmsMultNeg=0;
1502 static Double_t vertAll = 0;
1503 static Double_t vertOK = 0;
1504
1505 TH1* his1D=0;
820afb27 1506 TH1* hc=0;
28bb9d1f 1507 if (pTPC->GetHistos()->FindObject("h_tpc_event_6") && !fgForceTHnSparse) {
1508 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_6")->Clone());
0cb93e70 1509 } else {
1510 his1D = pTPC->GetTPCEventHisto()->Projection(6);
1511 }
26a35193 1512 if(!his1D) return 1;
1513
b832d719 1514 vertAll = his1D->GetEntries();
0cb93e70 1515 vertOK = his1D->GetBinContent(2);
b832d719 1516 if (vertAll>=1) {
1517 vertStatus = vertOK / vertAll;
1518 }
0cb93e70 1519
1520 delete his1D;
1521
1522 pTPC->GetTPCEventHisto()->GetAxis(6)->SetRange(2,2);
1523
28bb9d1f 1524 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_0") && !fgForceTHnSparse) {
1525 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_0")->Clone());
0cb93e70 1526 } else {
1527 his1D = pTPC->GetTPCEventHisto()->Projection(0);
1528 }
26a35193 1529 if(!his1D) return 1;
1530
b832d719 1531 meanVertX = his1D->GetMean();
1532 rmsVertX = his1D->GetRMS();
1533 delete his1D;
1534
0cb93e70 1535
1536
1537
28bb9d1f 1538 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_1") && !fgForceTHnSparse) {
1539 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_1")->Clone());
0cb93e70 1540 } else {
1541 his1D = pTPC->GetTPCEventHisto()->Projection(1);
1542 }
26a35193 1543 if(!his1D) return 1;
1544
b832d719 1545 meanVertY = his1D->GetMean();
1546 rmsVertY = his1D->GetRMS();
1547 delete his1D;
1548
0cb93e70 1549
28bb9d1f 1550 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2") && !fgForceTHnSparse) {
820afb27 1551 hc = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2"));
1552 if(!hc) return 1;
1553 //his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_2")->Clone());
1554 his1D = (TH1*)hc->Clone();
0cb93e70 1555 } else {
1556 his1D = pTPC->GetTPCEventHisto()->Projection(2);
820afb27 1557 }
26a35193 1558 if(!his1D) return 1;
1559
820afb27 1560 meanVertZ = his1D->GetMean();
b832d719 1561 rmsVertZ = his1D->GetRMS();
1562 delete his1D;
1563
0cb93e70 1564
28bb9d1f 1565 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3") && !fgForceTHnSparse) {
820afb27 1566 hc = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3"));
1567 if(!hc) return 1;
1568 //his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_3")->Clone());
1569 his1D = (TH1*)hc->Clone();
0cb93e70 1570 } else {
1571 his1D = pTPC->GetTPCEventHisto()->Projection(3);
1572 }
26a35193 1573 if(!his1D) return 1;
1574
b832d719 1575 meanMult = his1D->GetMean();
1576 rmsMult = his1D->GetRMS();
1577 delete his1D;
1578
0cb93e70 1579
28bb9d1f 1580 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_4") && !fgForceTHnSparse) {
1581 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_4")->Clone());
0cb93e70 1582 } else {
1583 his1D = pTPC->GetTPCEventHisto()->Projection(4);
1584 }
26a35193 1585 if(!his1D) return 1;
1586
b832d719 1587 meanMultPos = his1D->GetMean();
1588 rmsMultPos = his1D->GetRMS();
1589 delete his1D;
1590
28bb9d1f 1591 if (pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_5") && !fgForceTHnSparse) {
1592 his1D = dynamic_cast<TH1*>(pTPC->GetHistos()->FindObject("h_tpc_event_recvertex_5")->Clone());
0cb93e70 1593 } else {
1594 his1D = pTPC->GetTPCEventHisto()->Projection(5);
1595 }
26a35193 1596 if(!his1D) return 1;
1597
b832d719 1598 meanMultNeg = his1D->GetMean();
1599 rmsMultNeg = his1D->GetRMS();
1600 delete his1D;
1601
0cb93e70 1602 pTPC->GetTPCEventHisto()->GetAxis(6)->SetRange(1,2);
b832d719 1603 //
1604 (*pcstream)<<"tpcQA"<<
1605 "meanVertX="<<meanVertX<<
1606 "rmsVertX="<<rmsVertX<<
1607 "meanVertY="<<meanVertY<<
1608 "rmsVertY="<<rmsVertY<<
1609 "meanVertZ="<<meanVertZ<<
1610 "rmsVertZ="<<rmsVertZ<<
1611 "vertStatus="<<vertStatus<<
1612 "vertAll="<<vertAll<<
1613 "vertOK="<<vertOK<<
1614 "meanMult="<<meanMult<<
1615 "rmsMult="<<rmsMult<<
1616 "meanMultPos="<<meanMultPos<<
1617 "rmsMultPos="<<rmsMultPos<<
1618 "meanMultNeg="<<meanMultNeg<<
1619 "rmsMultNeg="<<rmsMultNeg;
1620
1621 return 0;
1622}
f69eb048 1623
1624//_____________________________________________________________________________
70f4b25f 1625Int_t AliTPCPerformanceSummary::AnalyzePt(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
10d5d625 1626{
1627 //
1628 // Analyse DCA R imperfections for positive particles
1629 //
1630
1631 if (!pcstream) return 256;
1632 if (!pTPC) return 256;
1633
1634 // variables:
1635 static Double_t meanPtAPos = 0;
1636 static Double_t mediumPtAPos = 0;
1637 static Double_t highPtAPos = 0;
1638 static Double_t meanPtCPos = 0;
1639 static Double_t mediumPtCPos = 0;
1640 static Double_t highPtCPos = 0;
1641
1642 static Double_t meanPtANeg = 0;
1643 static Double_t mediumPtANeg = 0;
1644 static Double_t highPtANeg = 0;
1645 static Double_t meanPtCNeg = 0;
1646 static Double_t mediumPtCNeg = 0;
1647 static Double_t highPtCNeg = 0;
1648
70f4b25f 1649 TH3* his3D1=0;
1650 TH3* his3D2=0;
10d5d625 1651
1652 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7")) {
1653
70f4b25f 1654 his3D1 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_7"));
26a35193 1655 if(!his3D1) return 256;
10d5d625 1656
70f4b25f 1657 his3D1->GetYaxis()->SetRangeUser(0.1,0.8);
10d5d625 1658
70f4b25f 1659 his3D1->GetZaxis()->SetRangeUser(0.25,10);
1660 meanPtAPos = his3D1->GetMean(3);
1661 his3D1->GetZaxis()->SetRangeUser(2,5);
1662 mediumPtAPos = his3D1->GetMean(3);
1663 his3D1->GetZaxis()->SetRangeUser(5,10);
1664 highPtAPos = his3D1->GetMean(3);
10d5d625 1665
70f4b25f 1666 his3D1->GetYaxis()->SetRangeUser(-0.8,-0.1);
10d5d625 1667
70f4b25f 1668 his3D1->GetZaxis()->SetRangeUser(0.25,10);
1669 meanPtCPos = his3D1->GetMean(3);
1670 his3D1->GetZaxis()->SetRangeUser(2,5);
1671 mediumPtCPos = his3D1->GetMean(3);
1672 his3D1->GetZaxis()->SetRangeUser(5,10);
1673 highPtCPos = his3D1->GetMean(3);
10d5d625 1674
70f4b25f 1675 his3D1->GetYaxis()->SetRangeUser(-1,1);
1676 his3D1->GetZaxis()->SetRangeUser(0.25,10);
10d5d625 1677 }
1678
1679
1680 if (pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7")) {
1681
70f4b25f 1682 his3D2 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_7"));
26a35193 1683 if(!his3D2) return 256;
10d5d625 1684
70f4b25f 1685 his3D2->GetYaxis()->SetRangeUser(0.1,0.8);
1686
1687 his3D2->GetZaxis()->SetRangeUser(0.25,10);
1688 meanPtANeg = his3D2->GetMean(3);
1689 his3D2->GetZaxis()->SetRangeUser(2,5);
1690 mediumPtANeg = his3D2->GetMean(3);
1691 his3D2->GetZaxis()->SetRangeUser(5,10);
1692 highPtANeg = his3D2->GetMean(3);
10d5d625 1693
70f4b25f 1694 his3D2->GetYaxis()->SetRangeUser(-0.8,-0.1);
1695
1696 his3D2->GetZaxis()->SetRangeUser(0.25,10);
1697 meanPtCNeg = his3D2->GetMean(3);
1698 his3D2->GetZaxis()->SetRangeUser(2,5);
1699 mediumPtCNeg = his3D2->GetMean(3);
1700 his3D2->GetZaxis()->SetRangeUser(5,10);
1701 highPtCNeg = his3D2->GetMean(3);
10d5d625 1702
70f4b25f 1703 his3D2->GetYaxis()->SetRangeUser(-1,1);
1704 his3D2->GetZaxis()->SetRangeUser(0.25,10);
10d5d625 1705 }
1706
1707
1708
1709 // dump values
1710 //
1711 (*pcstream)<<"tpcQA"<<
1712 "meanPtAPos="<< meanPtAPos<<
1713 "mediumPtAPos="<< mediumPtAPos<<
1714 "highPtAPos="<< highPtAPos<<
1715 //
1716 "meanPtCPos="<< meanPtCPos<<
1717 "mediumPtCPos="<< mediumPtCPos<<
1718 "highPtCPos="<< highPtCPos<<
1719 //
1720 "meanPtANeg="<< meanPtANeg<<
1721 "mediumPtANeg="<< mediumPtANeg<<
1722 "highPtANeg="<< highPtANeg<<
1723 //
1724 "meanPtCNeg="<< meanPtCNeg<<
1725 "mediumPtCNeg="<< mediumPtCNeg<<
1726 "highPtCNeg="<< highPtCNeg;
1727
1728
1729 return 0;
1730}
1731
1732//_____________________________________________________________________________
1733
70f4b25f 1734Int_t AliTPCPerformanceSummary::AnalyzeChargeOverPt(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream){
10d5d625 1735 //
1736 // Analyse DCA R imperfections for positive particles
1737 //
1738
1739 if (!pcstream) return 512;
1740 if (!pTPC) return 512;
1741
1742 // variables:
1743 static Double_t qOverPt = 0;
1744 static Double_t qOverPtA = 0;
1745 static Double_t qOverPtC = 0;
1746
1747 TH2* his2D=0;
70f4b25f 1748 TH1* his1D1=0;
1749 TH1* his1D2=0;
1750 TH1* his1D3=0;
10d5d625 1751 TF1 *fp1 = new TF1("fp1","pol2",-1.0,1.0);
1752 TF1 *fp2 = new TF1("fp2","pol2",-1.0,1.0);
1753 TF1 *fp3 = new TF1("fp3","pol2",-1.0,1.0);
1754
1755 if (pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8")) {
1756
1757 his2D = dynamic_cast<TH2*>(pTPC->GetHistos()->FindObject("h_tpc_track_all_recvertex_5_8"));
26a35193 1758 if(!his2D) return 512;
10d5d625 1759
70f4b25f 1760 his1D1 = his2D->ProjectionX();
1761 his1D1->Fit(fp1,"R");
10d5d625 1762 if(fp1->GetParameter(2)!=0){
1763 qOverPt = (-1.0)*(fp1->GetParameter(1)/(2.0*fp1->GetParameter(2)));
1764 }
1765 delete fp1;
70f4b25f 1766 delete his1D1;
10d5d625 1767
1768 his2D->GetYaxis()->SetRangeUser(0.1,0.8);
70f4b25f 1769 his1D2 = his2D->ProjectionX();
1770 his1D2->Fit(fp2,"R");
10d5d625 1771 if(fp2->GetParameter(2)!=0)
1772 qOverPtA = (-1.0)*(fp2->GetParameter(1)/(2.0*fp2->GetParameter(2)));
1773 delete fp2;
70f4b25f 1774 delete his1D2;
10d5d625 1775
1776 his2D->GetYaxis()->SetRangeUser(-0.8,-0.1);
70f4b25f 1777 his1D3 = his2D->ProjectionX();
1778 his1D3->Fit(fp3,"R");
10d5d625 1779 if(fp3->GetParameter(2)!=0)
1780 qOverPtC = (-1.0)*(fp3->GetParameter(1)/(2.0*fp3->GetParameter(2)));
1781 delete fp3;
70f4b25f 1782 delete his1D3;
10d5d625 1783
1784 his2D->GetYaxis()->SetRangeUser(-1.0,1.0);
1785 }
1786
1787
1788 (*pcstream)<<"tpcQA"<<
1789 "qOverPt="<< qOverPt<<
1790 "qOverPtA="<< qOverPtA<<
1791 "qOverPtC="<< qOverPtC;
1792
1793 return 0;
1794}
1795
1833a193 1796Int_t AliTPCPerformanceSummary::AnalyzeMatch(const AliPerformanceMatch* pMatch, TTreeSRedirector* const pcstream)
f69eb048 1797{
1833a193 1798 /* if ((pMatch == 0) or (0 == pcstream)) { printf("this will not work anyway..."); }
1799 printf("funtion not implemented");*/
1800
1801 if (!pcstream) return 1024;
1802 if (!pMatch) return 1024;
1803 static Double_t tpcItsMatchA = 0;
1804 static Double_t tpcItsMatchHighPtA = 0;
1805 static Double_t tpcItsMatchC = 0;
1806 static Double_t tpcItsMatchHighPtC = 0;
1807
1808 TH2 *h2D = 0;
1809 TH2 *h2D1 = 0;
1810 if(pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_all_2_3") &&
1811 pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_tpc_2_3")){
1812 h2D = dynamic_cast<TH2*>(pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_all_2_3"));
1813 h2D1 = dynamic_cast<TH2*>(pMatch->GetHistos()->FindObject("h_tpc_match_trackingeff_tpc_2_3"));
8f5423ae 1814
1815 if(!h2D) return 4;
1816 if(!h2D1) return 4;
1833a193 1817
1818 h2D->GetXaxis()->SetRangeUser(0,1.5);
1819 h2D1->GetXaxis()->SetRangeUser(0,1.5);
1820
1821 Double_t entries,entries1;
1822 entries = h2D->GetEffectiveEntries();
1823 entries1 = h2D1->GetEffectiveEntries();
1824 if(entries > 0)
1825 tpcItsMatchA = entries1/entries;
1826
9f5fbaba 1827 h2D->GetYaxis()->SetRangeUser(4.01,20.);
1828 h2D1->GetYaxis()->SetRangeUser(4.01,20.);
1833a193 1829 entries = h2D->GetEffectiveEntries();
1830 entries1 = h2D1->GetEffectiveEntries();
1831 if(entries > 0)
9f5fbaba 1832 tpcItsMatchHighPtA = entries1/entries;
1833a193 1833
1834
9f5fbaba 1835 h2D->GetXaxis()->SetRangeUser(-1.5,-0.01);
1836 h2D1->GetXaxis()->SetRangeUser(-1.5,-0.01);
1833a193 1837 h2D->GetYaxis()->SetRangeUser(0.0,20.);
1838 h2D1->GetYaxis()->SetRangeUser(0.0,20.);
1839
1840 entries = h2D->GetEffectiveEntries();
1841 entries1 = h2D1->GetEffectiveEntries();
1842 if(entries > 0)
1843 tpcItsMatchC = entries1/entries;
1844
9f5fbaba 1845 h2D->GetYaxis()->SetRangeUser(4.01,20.);
1846 h2D1->GetYaxis()->SetRangeUser(4.01,20.);
1833a193 1847 entries = h2D->GetEffectiveEntries();
1848 entries1 = h2D1->GetEffectiveEntries();
1849 if(entries > 0)
1850 tpcItsMatchHighPtC = entries1/entries;
1851
1852 h2D->GetXaxis()->SetRangeUser(-1.5,1.5);
1853 h2D1->GetXaxis()->SetRangeUser(-1.5,1.5);
1854 h2D->GetYaxis()->SetRangeUser(0.0,20.);
1855 h2D1->GetYaxis()->SetRangeUser(0.0,20.);
1856 // delete h2D;
1857 // delete h2D1;
1858 }
1859
1860 (*pcstream)<<"tpcQA"<<
1861 "tpcItsMatchA="<< tpcItsMatchA<<
1862 "tpcItsMatchHighPtA="<< tpcItsMatchHighPtA<<
1863 "tpcItsMatchC="<< tpcItsMatchC<<
1864 "tpcItsMatchHighPtC="<< tpcItsMatchHighPtC;
1865
1866 return 0;
1867}
1868
1869Int_t AliTPCPerformanceSummary::AnalyzePull(const AliPerformanceMatch* pPull, TTreeSRedirector* const pcstream)
1870{
1871 /* if ((pPull == 0) or (0 == pcstream)) { printf("this will not work anyway..."); }
1872 printf("funtion not implemented");*/
1873
1874 if (!pcstream) return 2048;
1875 if (!pPull) return 2048;
1876 static Double_t phiPull = 0;
1877 static Double_t phiPullHighPt = 0;
1878 static Double_t ptPull = 0;
1879 static Double_t ptPullHighPt = 0;
1880 static Double_t yPull = 0;
1881 static Double_t yPullHighPt = 0;
1882 static Double_t zPull = 0;
1883 static Double_t zPullHighPt = 0;
1884 static Double_t lambdaPull = 0;
1885 static Double_t lambdaPullHighPt = 0;
1886
1887 TH2 *h2D1 = 0;
1888 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_2_7")){
1889 h2D1 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_2_7"));
8f5423ae 1890 if(!h2D1) return 4;
1833a193 1891 phiPull = h2D1->GetMean(2);
1892 h2D1->SetAxisRange(0.0,1.0/5.0,"X");
1893 phiPullHighPt = h2D1->GetMean(2);
1894 h2D1->SetAxisRange(0.0,10.0,"X");
1895 // delete h2D1;
1896 }
1897
1898 TH2 *h2D2 = 0;
1899 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_4_7")){
1900 h2D2 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_4_7"));
8f5423ae 1901 if(!h2D2) return 4;
1833a193 1902 ptPull = h2D2->GetMean(2);
1903
1904 h2D2->SetAxisRange(0.0,1.0/5.0,"X");
1905 ptPullHighPt = h2D2->GetMean(2);
1906 h2D2->SetAxisRange(0.0,10.0,"X");
1907 // delete h2D2;
1908 }
1909
1910 TH2 *h2D3 = 0;
1911 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_0_7")){
1912 h2D3 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_0_7"));
8f5423ae 1913 if(!h2D3) return 4;
1833a193 1914 yPull = h2D3->GetMean(2);
1915
1916 h2D3->SetAxisRange(0.0,1.0/5.0,"X");
1917 yPullHighPt = h2D3->GetMean(2);
1918 h2D3->SetAxisRange(0.0,10.0,"X");
1919 // delete h2D3;
1920 }
1921
1922 TH2 *h2D4 = 0;
1923 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_1_7")){
1924 h2D4 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_1_7"));
8f5423ae 1925 if(!h2D4) return 4;
1833a193 1926 zPull = h2D4->GetMean(2);
1927
1928 h2D4->SetAxisRange(0.0,1.0/5.0,"X");
1929 zPullHighPt = h2D4->GetMean(2);
1930 h2D4->SetAxisRange(0.0,10.0,"X");
1931 // delete h2D4;
1932 }
1933
1934 TH2 *h2D5 = 0;
1935 if(pPull->GetHistos()->FindObject("h_tpc_match_pull_3_7")){
1936 h2D5 = dynamic_cast<TH2*>(pPull->GetHistos()->FindObject("h_tpc_match_pull_3_7"));
8f5423ae 1937 if(!h2D5) return 4;
1833a193 1938 lambdaPull = h2D5->GetMean(2);
1939
1940 h2D5->SetAxisRange(0.0,1.0/5.0,"X");
1941 lambdaPullHighPt = h2D5->GetMean(2);
1942 h2D5->SetAxisRange(0.0,10.0,"X");
1943 // delete h2D5;
1944}
1945
1946 (*pcstream)<<"tpcQA"<<
1947 "phiPull="<< phiPull<<
1948 "phiPullHighPt="<< phiPullHighPt<<
1949 "ptPull="<< ptPull<<
1950 "ptPullHighPt="<< ptPullHighPt<<
1951 "yPull="<< yPull<<
1952 "yPullHighPt="<< yPullHighPt<<
1953 "zPull="<< zPull<<
1954 "zPullHighPt="<< zPullHighPt<<
1955 "lambdaPull="<< lambdaPull<<
1956 "lambdaPullHighPt="<< lambdaPullHighPt;
1957
1958 return 0;
f69eb048 1959}
9f5fbaba 1960Int_t AliTPCPerformanceSummary::AnalyzeConstrain(const AliPerformanceMatch* pConstrain, TTreeSRedirector* pcstream)
1961{
1962 if (!pcstream) return 5126;
1963 if (!pConstrain) return 5126;
1964
1965 TH3* his3D=0;
1966 static Double_t tpcConstrainPhiA = 0;
1967 static Double_t tpcConstrainPhiC = 0;
1968
1969 if (pConstrain->GetHistos()->FindObject("h_tpc_constrain_tpc_0_2_3")) {
1970
1971 his3D = dynamic_cast<TH3*>(pConstrain->GetHistos()->FindObject("h_tpc_constrain_tpc_0_2_3"));//phi pull:pt:eta
1972 if(!his3D) return 5126;
1973
1974 his3D->GetZaxis()->SetRangeUser(0.0,1.0);
1975 tpcConstrainPhiA = his3D->GetMean(1);
1976 his3D->GetZaxis()->SetRangeUser(-1.0,-0.001);
1977 tpcConstrainPhiC = his3D->GetMean(1);
1978 }
1979
1980 (*pcstream)<<"tpcQA"<<
1981 "tpcConstrainPhiA="<<tpcConstrainPhiA <<
1982 "tpcConstrainPhiC="<< tpcConstrainPhiC;
1983
1984 return 0;
1985}
ac617c68 1986
1987//_____________________________________________________________________________
1988 Int_t AliTPCPerformanceSummary::AnalyzeQAPosNegDpT(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
1989{
1990 //function which plot 1/Pt for negative and
1991 //positive particles
1992
1993 if (!pcstream) return 512;
1994 if (!pTPC) return 512;
1995
1996 TH3D* pos3=0;
1997 TH3D* neg3=0;
1998 TH1D* pos=0;
1999 TH1D* neg=0;
2000 TH1D* posC=0;
2001 TH1D* negC=0;
2002 TH1D* posA=0;
2003 TH1D* negA=0;
2004 static Double_t deltaPtC = 0;
2005 static Double_t deltaPtchi2C = 0;
2006 static Double_t slopeC = 0;
2007 static Double_t deltaPtA = 0;
2008 static Double_t deltaPtchi2A = 0;
2009 static Double_t slopeA = 0;
2010 static Double_t deltaPt = 0;
2011 static Double_t deltaPtchi2 = 0;
2012 static Double_t slope = 0;
2013 static Double_t deltaPt_Err = 0;
2014 static Double_t deltaPtA_Err = 0;
2015 static Double_t deltaPtC_Err = 0;
2016
2017
2018//C side
2019
2020 if(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_0_5_7"))
2021 {
2022 pos3 = dynamic_cast<TH3D*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_0_5_7"));
2023 if(!pos3) return 512;
2024
2025 pos = pos3->ProjectionZ("pos",71,-1,6,25);
2026 posC = pos3->ProjectionZ("posC",71,-1,6,15);
2027 posA = pos3->ProjectionZ("posA",71,-1,16,25);
2028 }
2029
2030 if(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_0_5_7")){
2031 neg3 = dynamic_cast<TH3D*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_0_5_7"));
2032 if(!neg3) return 512;
2033
2034 neg = neg3->ProjectionZ("neg",71,-1,6,25);
2035 negC = neg3->ProjectionZ("negC",71,-1,6,15);
2036 negA = neg3->ProjectionZ("negA",71,-1,16,25);
2037}
2038
2039
2040pos->Sumw2();
2041neg->Sumw2();
2042posA->Sumw2();
2043negA->Sumw2();
2044posC->Sumw2();
2045negC->Sumw2();
2046
2047pos->Scale(1.,"width");
2048neg->Scale(1.,"width");
2049posA->Scale(1.,"width");
2050negA->Scale(1.,"width");
2051posC->Scale(1.,"width");
2052negC->Scale(1.,"width");
2053
2054//both sides
2055
2056TF1 fpt("fpt","[1]*exp(-1/((1/x))*[0])",0.1,10);
2057TF1 fpt2("fpt2","[1]*exp(-1/((1/x))*[0])",0.1,10);
2058fpt.SetParameters(1,0.5);
2059fpt2.SetParameters(1,0.5);
2060pos->Fit(&fpt,"","",1,4); pos->Fit(&fpt,"","",1,4); pos->Fit(&fpt,"","",1,4);
2061neg->Fit(&fpt2,"","",1,4); neg->Fit(&fpt2,"","",1,4); neg->Fit(&fpt2,"","",1,4);
2062
2063slope = (fpt.GetParameter(0)+fpt2.GetParameter(0))/2.;
2064
2065TH1D* ratio = new TH1D(*pos);
2066ratio->Divide(neg);
2067
2068ratio->Draw();
2069TF1 fptRatio("fptratio","[2]*exp(-1/((1/x)+[1])*[0])/exp(-1/((1/x)-[1])*[0])",0.1,10);
2070fptRatio.SetParameters(0.5,0.006,1);
2071fptRatio.FixParameter(0,slope);
2072fptRatio.Draw();
2073ratio->Fit(&fptRatio,"","",1,4); ratio->Fit(&fptRatio,"","",1,4);
2074ratio->Fit(&fptRatio,"","",1,4);
2075
2076deltaPt = fptRatio.GetParameter(1);
2077deltaPtchi2 = fptRatio.GetChisquare();
2078
2079//get the errors
2080deltaPt_Err = fptRatio.GetParError(1);
2081
2082
2083//A side
2084
2085TF1 fptA("fptA","[1]*exp(-1/((1/x))*[0])",0.1,10);
2086TF1 fpt2A("fpt2A","[1]*exp(-1/((1/x))*[0])",0.1,10);
2087fptA.SetParameters(1,0.5);
2088fpt2A.SetParameters(1,0.5);
2089posA->Fit(&fptA,"","",1,4); posA->Fit(&fptA,"","",1,4); posA->Fit(&fptA,"","",1,4);
2090negA->Fit(&fpt2A,"","",1,4); negA->Fit(&fpt2A,"","",1,4); negA->Fit(&fpt2A,"","",1,4);
2091
2092slopeA = (fptA.GetParameter(0)+fpt2A.GetParameter(0))/2.;
2093
2094TH1D* ratioA = new TH1D(*posA);
2095ratioA->Divide(negA);
2096
2097ratioA->Draw();
2098TF1 fptRatioA("fptratioA","[2]*exp(-1/((1/x)+[1])*[0])/exp(-1/((1/x)-[1])*[0])",0.1,10);
2099fptRatioA.SetParameters(0.5,0.006,1);
2100fptRatioA.FixParameter(0,slopeA);
2101fptRatioA.Draw();
2102ratioA->Fit(&fptRatioA,"","",1,4); ratio->Fit(&fptRatioA,"","",1,4);
2103ratioA->Fit(&fptRatioA,"","",1,4);
2104
2105deltaPtA = fptRatioA.GetParameter(1);
2106deltaPtchi2A = fptRatioA.GetChisquare();
2107
2108//get the errors
2109deltaPtA_Err = fptRatioA.GetParError(1);
2110
2111 delete ratioA;
2112 delete pos;
2113 delete neg;
2114
2115
2116//C side
2117TF1 fptC("fptC","[1]*exp(-1/((1/x))*[0])",0.1,10);
2118TF1 fpt2C("fpt2C","[1]*exp(-1/((1/x))*[0])",0.1,10);
2119fptC.SetParameters(1,0.5);
2120fpt2C.SetParameters(1,0.5);
2121posC->Fit(&fptC,"","",1,4); posC->Fit(&fptC,"","",1,4); posC->Fit(&fptC,"","",1,4);
2122negC->Fit(&fpt2C,"","",1,4); negC->Fit(&fpt2C,"","",1,4); negC->Fit(&fpt2C,"","",1,4);
2123
2124slopeC = (fptC.GetParameter(0)+fpt2C.GetParameter(0))/2.;
2125
2126TH1D* ratioC = new TH1D(*posC);
2127ratioC->Divide(negC);
2128
2129ratioC->Draw();
2130TF1 fptRatioC("fptratioC","[2]*exp(-1/((1/x)+[1])*[0])/exp(-1/((1/x)-[1])*[0])",0.1,10);
2131fptRatioC.SetParameters(0.5,0.006,1);
2132fptRatioC.FixParameter(0,slopeC);
2133fptRatioC.Draw();
2134ratioC->Fit(&fptRatioC,"","",1,4); ratio->Fit(&fptRatioC,"","",1,4);
2135ratioC->Fit(&fptRatioC,"","",1,4);
2136
2137deltaPtC = fptRatioC.GetParameter(1);
2138deltaPtchi2C = fptRatioC.GetChisquare();
2139
2140//get the errors
2141deltaPtC_Err = fptRatioC.GetParError(1);
2142
2143
2144 delete posC;
2145 delete negC;
2146 delete ratioC;
2147
2148 (*pcstream)<<"tpcQA"<<
2149 "deltaPt="<< deltaPt<<
2150 "deltaPtchi2="<< deltaPtchi2<<
2151 "deltaPtA="<< deltaPtA<<
2152 "deltaPtchi2A="<< deltaPtchi2A<<
2153 "deltaPtC="<< deltaPtC<<
2154 "deltaPtchi2C="<< deltaPtchi2C<<
2155 "deltaPt_Err="<< deltaPt_Err<<
2156 "deltaPtA_Err="<< deltaPtA_Err<<
2157 "deltaPtC_Err="<< deltaPtC_Err;
2158
2159 return 0;
2160}
2161
2162//_____________________________________________________________________________
2163 Int_t AliTPCPerformanceSummary::AnalyzeQADCAFitParameter(const AliPerformanceTPC* pTPC, TTreeSRedirector* const pcstream)
2164{
2165
2166 //
2167 //function which retrieve DCA fit parameters
2168 //
2169
2170 if (!pcstream) return 16;
2171 if (!pTPC) return 16;
2172
2173 TH3* dcar_pos3=0;
2174 TH3* dcaz_pos3=0;
2175 TH3* dcar_neg3=0;
2176 TH3* dcaz_neg3=0;
2177
2178 static Double_t dcar_posA_0=0;
2179 static Double_t dcar_posA_1=0;
2180 static Double_t dcar_posA_2=0;
2181 static Double_t dcar_posA_chi2=0;
2182 static Double_t dcar_posA_0_Err=0;
2183 static Double_t dcar_posA_1_Err=0;
2184 static Double_t dcar_posA_2_Err=0;
2185
2186 static Double_t dcar_posC_0=0;
2187 static Double_t dcar_posC_1=0;
2188 static Double_t dcar_posC_2=0;
2189 static Double_t dcar_posC_chi2=0;
2190 static Double_t dcar_posC_0_Err=0;
2191 static Double_t dcar_posC_1_Err=0;
2192 static Double_t dcar_posC_2_Err=0;
2193
2194 static Double_t dcaz_posA_0=0;
2195 static Double_t dcaz_posA_1=0;
2196 static Double_t dcaz_posA_2=0;
2197 static Double_t dcaz_posA_chi2=0;
2198 static Double_t dcaz_posA_0_Err=0;
2199 static Double_t dcaz_posA_1_Err=0;
2200 static Double_t dcaz_posA_2_Err=0;
2201
2202 static Double_t dcaz_posC_0=0;
2203 static Double_t dcaz_posC_1=0;
2204 static Double_t dcaz_posC_2=0;
2205 static Double_t dcaz_posC_chi2=0;
2206 static Double_t dcaz_posC_0_Err=0;
2207 static Double_t dcaz_posC_1_Err=0;
2208 static Double_t dcaz_posC_2_Err=0;
2209
2210 static Double_t dcar_negA_0=0;
2211 static Double_t dcar_negA_1=0;
2212 static Double_t dcar_negA_2=0;
2213 static Double_t dcar_negA_chi2=0;
2214 static Double_t dcar_negA_0_Err=0;
2215 static Double_t dcar_negA_1_Err=0;
2216 static Double_t dcar_negA_2_Err=0;
2217
2218 static Double_t dcar_negC_0=0;
2219 static Double_t dcar_negC_1=0;
2220 static Double_t dcar_negC_2=0;
2221 static Double_t dcar_negC_chi2=0;
2222 static Double_t dcar_negC_0_Err=0;
2223 static Double_t dcar_negC_1_Err=0;
2224 static Double_t dcar_negC_2_Err=0;
2225
2226 static Double_t dcaz_negA_0=0;
2227 static Double_t dcaz_negA_1=0;
2228 static Double_t dcaz_negA_2=0;
2229 static Double_t dcaz_negA_chi2=0;
2230 static Double_t dcaz_negA_0_Err=0;
2231 static Double_t dcaz_negA_1_Err=0;
2232 static Double_t dcaz_negA_2_Err=0;
2233
2234 static Double_t dcaz_negC_0=0;
2235 static Double_t dcaz_negC_1=0;
2236 static Double_t dcaz_negC_2=0;
2237 static Double_t dcaz_negC_chi2=0;
2238 static Double_t dcaz_negC_0_Err=0;
2239 static Double_t dcaz_negC_1_Err=0;
2240 static Double_t dcaz_negC_2_Err=0;
2241
2242 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_6")) {
2243 dcar_pos3 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_6"));
2244 }
2245
2246 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_6")) {
2247 dcaz_pos3 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_4_5_6"));
2248 }
2249
2250 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_6")) {
2251 dcar_neg3 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_3_5_6"));
2252 }
2253
2254 if (pTPC->GetHistos()->FindObject("h_tpc_track_pos_recvertex_3_5_6")) {
2255 dcaz_neg3 = dynamic_cast<TH3*>(pTPC->GetHistos()->FindObject("h_tpc_track_neg_recvertex_4_5_6"));
2256 }
2257
2258 TF1 fit("fit","[0]+[1]*cos(x)+[2]*sin(x)",0,7);
2259
2260 dcar_pos3->GetYaxis()->SetRangeUser(0,0.99);
2261 TH1* dcar_posA = (dynamic_cast<TH2*>(dcar_pos3->Project3D("xz_1")))->ProfileX();
2262 dcar_posA->Fit(&fit,"NQ");
2263 dcar_posA_0 = fit.GetParameter(0);
2264 dcar_posA_1 = fit.GetParameter(1);
2265 dcar_posA_2 = fit.GetParameter(2);
2266 dcar_posA_chi2 = fit.GetChisquare();
2267 dcar_posA_0_Err = fit.GetParError(0);
2268 dcar_posA_1_Err = fit.GetParError(1);
2269 dcar_posA_2_Err = fit.GetParError(2);
2270
2271 dcar_pos3->GetYaxis()->SetRangeUser(-1.0,-0.01);
2272 TH1* dcar_posC = (dynamic_cast<TH2*>(dcar_pos3->Project3D("xz_2")))->ProfileX();
2273 dcar_posC->Fit(&fit,"NQ");
2274 dcar_posC_0 = fit.GetParameter(0);
2275 dcar_posC_1 = fit.GetParameter(1);
2276 dcar_posC_2 = fit.GetParameter(2);
2277 dcar_posC_chi2 = fit.GetChisquare();
2278 dcar_posC_0_Err = fit.GetParError(0);
2279 dcar_posC_1_Err = fit.GetParError(1);
2280 dcar_posC_2_Err = fit.GetParError(2);
2281
2282 dcaz_pos3->GetYaxis()->SetRangeUser(0,0.99);
2283 TH1* dcaz_posA = (dynamic_cast<TH2*>(dcaz_pos3->Project3D("xz_3")))->ProfileX();
2284 dcaz_posA->Fit(&fit,"NQ");
2285 dcaz_posA_0 = fit.GetParameter(0);
2286 dcaz_posA_1 = fit.GetParameter(1);
2287 dcaz_posA_2 = fit.GetParameter(2);
2288 dcaz_posA_chi2 = fit.GetChisquare();
2289 dcaz_posA_0_Err = fit.GetParError(0);
2290 dcaz_posA_1_Err = fit.GetParError(1);
2291 dcaz_posA_2_Err = fit.GetParError(2);
2292
2293 dcaz_pos3->GetYaxis()->SetRangeUser(-1.0,-0.01);
2294 TH1* dcaz_posC = (dynamic_cast<TH2*>(dcaz_pos3->Project3D("xz_4")))->ProfileX();
2295 dcaz_posC->Fit(&fit,"NQ");
2296 dcaz_posC_0 = fit.GetParameter(0);
2297 dcaz_posC_1 = fit.GetParameter(1);
2298 dcaz_posC_2 = fit.GetParameter(2);
2299 dcaz_posC_chi2 = fit.GetChisquare();
2300 dcaz_posC_0_Err = fit.GetParError(0);
2301 dcaz_posC_1_Err = fit.GetParError(1);
2302 dcaz_posC_2_Err = fit.GetParError(2);
2303
2304
2305
2306 dcar_neg3->GetYaxis()->SetRangeUser(0,0.99);
2307 TH1* dcar_negA = (dynamic_cast<TH2*>(dcar_neg3->Project3D("xz_1")))->ProfileX();
2308 dcar_negA->Fit(&fit,"NQ");
2309 dcar_negA_0 = fit.GetParameter(0);
2310 dcar_negA_1 = fit.GetParameter(1);
2311 dcar_negA_2 = fit.GetParameter(2);
2312 dcar_negA_chi2 = fit.GetChisquare();
2313 dcar_negA_0_Err = fit.GetParError(0);
2314 dcar_negA_1_Err = fit.GetParError(1);
2315 dcar_negA_2_Err = fit.GetParError(2);
2316
2317 dcar_neg3->GetYaxis()->SetRangeUser(-1.0,-0.01);
2318 TH1* dcar_negC = (dynamic_cast<TH2*>(dcar_neg3->Project3D("xz_2")))->ProfileX();
2319 dcar_negC->Fit(&fit,"NQ");
2320 dcar_negC_0 = fit.GetParameter(0);
2321 dcar_negC_1 = fit.GetParameter(1);
2322 dcar_negC_2 = fit.GetParameter(2);
2323 dcar_negC_chi2 = fit.GetChisquare();
2324 dcar_negC_0_Err = fit.GetParError(0);
2325 dcar_negC_1_Err = fit.GetParError(1);
2326 dcar_negC_2_Err = fit.GetParError(2);
2327
2328 dcaz_neg3->GetYaxis()->SetRangeUser(0,0.99);
2329 TH1* dcaz_negA = (dynamic_cast<TH2*>(dcaz_neg3->Project3D("xz_3")))->ProfileX();
2330 dcaz_negA->Fit(&fit,"NQ");
2331 dcaz_negA_0 = fit.GetParameter(0);
2332 dcaz_negA_1 = fit.GetParameter(1);
2333 dcaz_negA_2 = fit.GetParameter(2);
2334 dcaz_negA_chi2 = fit.GetChisquare();
2335 dcaz_negA_0_Err = fit.GetParError(0);
2336 dcaz_negA_1_Err = fit.GetParError(1);
2337 dcaz_negA_2_Err = fit.GetParError(2);
2338
2339 dcaz_neg3->GetYaxis()->SetRangeUser(-1.0,-0.01);
2340 TH1* dcaz_negC = (dynamic_cast<TH2*>(dcaz_neg3->Project3D("xz_4")))->ProfileX();
2341 dcaz_negC->Fit(&fit,"NQ");
2342 dcaz_negC_0 = fit.GetParameter(0);
2343 dcaz_negC_1 = fit.GetParameter(1);
2344 dcaz_negC_2 = fit.GetParameter(2);
2345 dcaz_negC_chi2 = fit.GetChisquare();
2346 dcaz_negC_0_Err = fit.GetParError(0);
2347 dcaz_negC_1_Err = fit.GetParError(1);
2348 dcaz_negC_2_Err = fit.GetParError(2);
2349
2350
2351// store results (shift in dca) in ttree
2352
2353 (*pcstream)<<"tpcQA"<<
2354 "dcar_posA_0="<< dcar_posA_0<<
2355 "dcar_posA_1="<< dcar_posA_1<<
2356 "dcar_posA_2="<< dcar_posA_2<<
2357 "dcar_posA_chi2="<< dcar_posA_chi2<<
2358 "dcar_posA_0_Err="<< dcar_posA_0_Err<<
2359 "dcar_posA_1_Err="<< dcar_posA_1_Err<<
2360 "dcar_posA_2_Err="<< dcar_posA_2_Err;
2361
2362 (*pcstream)<<"tpcQA"<<
2363 "dcaz_posA_0="<< dcaz_posA_0<<
2364 "dcaz_posA_1="<< dcaz_posA_1<<
2365 "dcaz_posA_2="<< dcaz_posA_2<<
2366 "dcaz_posA_chi2="<< dcaz_posA_chi2<<
2367 "dcaz_posA_0_Err="<< dcaz_posA_0_Err<<
2368 "dcaz_posA_1_Err="<< dcaz_posA_1_Err<<
2369 "dcaz_posA_2_Err="<< dcaz_posA_2_Err;
2370
2371 (*pcstream)<<"tpcQA"<<
2372 "dcaz_posC_0="<< dcaz_posC_0<<
2373 "dcaz_posC_1="<< dcaz_posC_1<<
2374 "dcaz_posC_2="<< dcaz_posC_2<<
2375 "dcaz_posC_chi2="<< dcaz_posC_chi2<<
2376 "dcaz_posC_0_Err="<< dcaz_posC_0_Err<<
2377 "dcaz_posC_1_Err="<< dcaz_posC_1_Err<<
2378 "dcaz_posC_2_Err="<< dcaz_posC_2_Err;
2379
2380 (*pcstream)<<"tpcQA"<<
2381 "dcar_posC_0="<< dcar_posC_0<<
2382 "dcar_posC_1="<< dcar_posC_1<<
2383 "dcar_posC_2="<< dcar_posC_2<<
2384 "dcar_posC_chi2="<< dcar_posC_chi2<<
2385 "dcar_posC_0_Err="<< dcar_posC_0_Err<<
2386 "dcar_posC_1_Err="<< dcar_posC_1_Err<<
2387 "dcar_posC_2_Err="<< dcar_posC_2_Err;
2388
2389
2390 (*pcstream)<<"tpcQA"<<
2391 "dcar_negA_0="<< dcar_negA_0<<
2392 "dcar_negA_1="<< dcar_negA_1<<
2393 "dcar_negA_2="<< dcar_negA_2<<
2394 "dcar_negA_chi2="<< dcar_negA_chi2<<
2395 "dcar_negA_0_Err="<< dcar_negA_0_Err<<
2396 "dcar_negA_1_Err="<< dcar_negA_1_Err<<
2397 "dcar_negA_2_Err="<< dcar_negA_2_Err;
2398
2399 (*pcstream)<<"tpcQA"<<
2400 "dcaz_negA_0="<< dcaz_negA_0<<
2401 "dcaz_negA_1="<< dcaz_negA_1<<
2402 "dcaz_negA_2="<< dcaz_negA_2<<
2403 "dcaz_negA_chi2="<< dcaz_negA_chi2<<
2404 "dcaz_negA_0_Err="<< dcaz_negA_0_Err<<
2405 "dcaz_negA_1_Err="<< dcaz_negA_1_Err<<
2406 "dcaz_negA_2_Err="<< dcaz_negA_2_Err;
2407
2408 (*pcstream)<<"tpcQA"<<
2409 "dcaz_negC_0="<< dcaz_negC_0<<
2410 "dcaz_negC_1="<< dcaz_negC_1<<
2411 "dcaz_negC_2="<< dcaz_negC_2<<
2412 "dcaz_negC_chi2="<< dcaz_negC_chi2<<
2413 "dcaz_negC_0_Err="<< dcaz_negC_0_Err<<
2414 "dcaz_negC_1_Err="<< dcaz_negC_1_Err<<
2415 "dcaz_negC_2_Err="<< dcaz_negC_2_Err;
2416
2417 (*pcstream)<<"tpcQA"<<
2418 "dcar_negC_0="<< dcar_negC_0<<
2419 "dcar_negC_1="<< dcar_negC_1<<
2420 "dcar_negC_2="<< dcar_negC_2<<
2421 "dcar_negC_chi2="<< dcar_negC_chi2<<
2422 "dcar_negC_0_Err="<< dcar_negC_0_Err<<
2423 "dcar_negC_1_Err="<< dcar_negC_1_Err<<
2424 "dcar_negC_2_Err="<< dcar_negC_2_Err;
2425
2426 return 0;
2427}