1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 ///////////////////////////////////////////////////////////////////////////////
19 // TPC cluster error, shape and charge parameterization as function
20 // of drift length, and inclination angle //
22 // Following notation is used in following
23 // Int_t dim 0 - y direction
26 // Int_t type 0 - short pads
29 // Float_t z - drift length
31 // Float_t angle - tangent of inclination angle at given dimension
33 // Implemented parameterization
36 // 1. Resolution as function of drift length and inclination angle
37 // 1.a) GetError0(Int_t dim, Int_t type, Float_t z, Float_t angle)
38 // Simple error parameterization as derived from analytical formula
39 // only linear term in drift length and angle^2
40 // The formula is valid only with precission +-5%
41 // Separate parameterization for differnt pad geometry
43 // Parabolic term correction - better precision
45 // 1.c) GetError1 - JUST FOR Study
46 // Similar to GetError1
47 // The angular and diffusion effect is scaling with pad length
48 // common parameterization for different pad length
50 // 2. Error parameterization using charge
53 // adding 1/Q component to diffusion and angluar part
56 // adding 1/Q component to diffusion and angluar part
57 // 2.c) GetErrorQParScaled - Just for study
58 // One parameterization for all pad shapes
59 // Smaller precission as previous one
62 // Example how to retrieve the paramterization:
64 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
65 AliCDBManager::Instance()->SetRun(0)
66 AliTPCClusterParam * param = AliTPCcalibDB::Instance()->GetClusterParam();
70 AliTPCClusterParam::SetInstance(param);
71 TF1 f1("f1","AliTPCClusterParam::SGetError0Par(1,0,x,0)",0,250);
74 // EXAMPLE hot to create parameterization
76 // Note resol is the resolution tree created by AliTPCcalibTracks
78 AliTPCClusterParam *param = new AliTPCClusterParam;
79 param->FitData(Resol);
80 AliTPCClusterParam::SetInstance(param);
86 ///////////////////////////////////////////////////////////////////////////////
87 #include "AliTPCClusterParam.h"
92 #include <TLinearFitter.h>
94 #include <TProfile2D.h>
96 #include <TObjArray.h>
98 ClassImp(AliTPCClusterParam)
101 AliTPCClusterParam* AliTPCClusterParam::fgInstance = 0;
105 Example usage fitting parameterization:
106 TFile fres("resol.root"); //tree with resolution and shape
107 TTree * treeRes =(TTree*)fres.Get("Resol");
109 AliTPCClusterParam param;
110 param.SetInstance(¶m);
111 param.FitResol(treeRes);
112 param.FitRMS(treeRes);
113 TFile fparam("TPCClusterParam.root","recreate");
114 param.Write("Param");
117 TFile fparam("TPCClusterParam.root");
118 AliTPCClusterParam *param2 = (AliTPCClusterParam *) fparam.Get("Param");
119 param2->SetInstance(param2);
120 param2->Test(treeRes);
123 treeRes->Draw("(Resol-AliTPCClusterParam::SGetError0(Dim,Pad,Zm,AngleM))/Resol","Dim==0&&QMean<0")
130 //_ singleton implementation __________________________________________________
131 AliTPCClusterParam* AliTPCClusterParam::Instance()
134 // Singleton implementation
135 // Returns an instance of this class, it is created if neccessary
137 if (fgInstance == 0){
138 fgInstance = new AliTPCClusterParam();
144 AliTPCClusterParam::AliTPCClusterParam():
150 // Default constructor
154 AliTPCClusterParam::AliTPCClusterParam(const AliTPCClusterParam& param):
162 memcpy(this, ¶m,sizeof(AliTPCClusterParam));
163 if (param.fQNorm) fQNorm = (TObjArray*) param.fQNorm->Clone();
166 AliTPCClusterParam & AliTPCClusterParam::operator=(const AliTPCClusterParam& param){
168 // Assignment operator
170 if (this != ¶m) {
171 memcpy(this, ¶m,sizeof(AliTPCClusterParam));
172 if (param.fQNorm) fQNorm = (TObjArray*) param.fQNorm->Clone();
178 AliTPCClusterParam::~AliTPCClusterParam(){
182 if (fQNorm) fQNorm->Delete();
187 void AliTPCClusterParam::FitResol0(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error){
189 // Fit z - angular dependence of resolution
191 // Int_t dim=0, type=0;
193 sprintf(varVal,"Resol:AngleM:Zm");
195 sprintf(varErr,"Sigma:AngleS:Zs");
197 sprintf(varCut,"Dim==%d&&Pad==%d&&QMean<0",dim,type);
199 Int_t entries = tree->Draw(varVal,varCut);
200 Float_t px[10000], py[10000], pz[10000];
201 Float_t ex[10000], ey[10000], ez[10000];
203 tree->Draw(varErr,varCut);
204 for (Int_t ipoint=0; ipoint<entries; ipoint++){
205 ex[ipoint]= tree->GetV3()[ipoint];
206 ey[ipoint]= tree->GetV2()[ipoint];
207 ez[ipoint]= tree->GetV1()[ipoint];
209 tree->Draw(varVal,varCut);
210 for (Int_t ipoint=0; ipoint<entries; ipoint++){
211 px[ipoint]= tree->GetV3()[ipoint];
212 py[ipoint]= tree->GetV2()[ipoint];
213 pz[ipoint]= tree->GetV1()[ipoint];
217 TLinearFitter fitter(3,"hyp2");
218 for (Int_t ipoint=0; ipoint<entries; ipoint++){
219 Float_t val = pz[ipoint]*pz[ipoint];
220 Float_t err = 2*pz[ipoint]*TMath::Sqrt(ez[ipoint]*ez[ipoint]+fRatio*fRatio*pz[ipoint]*pz[ipoint]);
223 x[1] = py[ipoint]*py[ipoint];
224 fitter.AddPoint(x,val,err);
228 fitter.GetParameters(param);
229 param0[0] = param[0];
230 param0[1] = param[1];
231 param0[2] = param[2];
232 Float_t chi2 = fitter.GetChisquare()/entries;
234 error[0] = (fitter.GetParError(0)*TMath::Sqrt(chi2));
235 error[1] = (fitter.GetParError(1)*TMath::Sqrt(chi2));
236 error[2] = (fitter.GetParError(2)*TMath::Sqrt(chi2));
240 void AliTPCClusterParam::FitResol0Par(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error){
242 // Fit z - angular dependence of resolution
244 // Int_t dim=0, type=0;
246 sprintf(varVal,"Resol:AngleM:Zm");
248 sprintf(varErr,"Sigma:AngleS:Zs");
250 sprintf(varCut,"Dim==%d&&Pad==%d&&QMean<0",dim,type);
252 Int_t entries = tree->Draw(varVal,varCut);
253 Float_t px[10000], py[10000], pz[10000];
254 Float_t ex[10000], ey[10000], ez[10000];
256 tree->Draw(varErr,varCut);
257 for (Int_t ipoint=0; ipoint<entries; ipoint++){
258 ex[ipoint]= tree->GetV3()[ipoint];
259 ey[ipoint]= tree->GetV2()[ipoint];
260 ez[ipoint]= tree->GetV1()[ipoint];
262 tree->Draw(varVal,varCut);
263 for (Int_t ipoint=0; ipoint<entries; ipoint++){
264 px[ipoint]= tree->GetV3()[ipoint];
265 py[ipoint]= tree->GetV2()[ipoint];
266 pz[ipoint]= tree->GetV1()[ipoint];
270 TLinearFitter fitter(6,"hyp5");
271 for (Int_t ipoint=0; ipoint<entries; ipoint++){
272 Float_t val = pz[ipoint]*pz[ipoint];
273 Float_t err = 2*pz[ipoint]*TMath::Sqrt(ez[ipoint]*ez[ipoint]+fRatio*fRatio*pz[ipoint]*pz[ipoint]);
276 x[1] = py[ipoint]*py[ipoint];
280 fitter.AddPoint(x,val,err);
284 fitter.GetParameters(param);
285 param0[0] = param[0];
286 param0[1] = param[1];
287 param0[2] = param[2];
288 param0[3] = param[3];
289 param0[4] = param[4];
290 param0[5] = param[5];
291 Float_t chi2 = fitter.GetChisquare()/entries;
293 error[0] = (fitter.GetParError(0)*TMath::Sqrt(chi2));
294 error[1] = (fitter.GetParError(1)*TMath::Sqrt(chi2));
295 error[2] = (fitter.GetParError(2)*TMath::Sqrt(chi2));
296 error[3] = (fitter.GetParError(3)*TMath::Sqrt(chi2));
297 error[4] = (fitter.GetParError(4)*TMath::Sqrt(chi2));
298 error[5] = (fitter.GetParError(5)*TMath::Sqrt(chi2));
305 void AliTPCClusterParam::FitResol1(TTree * tree, Int_t dim, Float_t *param0, Float_t *error){
307 // Fit z - angular dependence of resolution - pad length scaling
309 // Int_t dim=0, type=0;
311 sprintf(varVal,"Resol:AngleM*sqrt(Length):Zm/Length");
313 sprintf(varErr,"Sigma:AngleS:Zs");
315 sprintf(varCut,"Dim==%d&&QMean<0",dim);
317 Int_t entries = tree->Draw(varVal,varCut);
318 Float_t px[10000], py[10000], pz[10000];
319 Float_t ex[10000], ey[10000], ez[10000];
321 tree->Draw(varErr,varCut);
322 for (Int_t ipoint=0; ipoint<entries; ipoint++){
323 ex[ipoint]= tree->GetV3()[ipoint];
324 ey[ipoint]= tree->GetV2()[ipoint];
325 ez[ipoint]= tree->GetV1()[ipoint];
327 tree->Draw(varVal,varCut);
328 for (Int_t ipoint=0; ipoint<entries; ipoint++){
329 px[ipoint]= tree->GetV3()[ipoint];
330 py[ipoint]= tree->GetV2()[ipoint];
331 pz[ipoint]= tree->GetV1()[ipoint];
335 TLinearFitter fitter(3,"hyp2");
336 for (Int_t ipoint=0; ipoint<entries; ipoint++){
337 Float_t val = pz[ipoint]*pz[ipoint];
338 Float_t err = 2*pz[ipoint]*TMath::Sqrt(ez[ipoint]*ez[ipoint]+fRatio*fRatio*pz[ipoint]*pz[ipoint]);
341 x[1] = py[ipoint]*py[ipoint];
342 fitter.AddPoint(x,val,err);
346 fitter.GetParameters(param);
347 param0[0] = param[0];
348 param0[1] = param[1];
349 param0[2] = param[2];
350 Float_t chi2 = fitter.GetChisquare()/entries;
352 error[0] = (fitter.GetParError(0)*TMath::Sqrt(chi2));
353 error[1] = (fitter.GetParError(1)*TMath::Sqrt(chi2));
354 error[2] = (fitter.GetParError(2)*TMath::Sqrt(chi2));
357 void AliTPCClusterParam::FitResolQ(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error){
359 // Fit z - angular dependence of resolution - Q scaling
361 // Int_t dim=0, type=0;
363 sprintf(varVal,"Resol:AngleM/sqrt(QMean):Zm/QMean");
365 sprintf(varVal0,"Resol:AngleM:Zm");
368 sprintf(varErr,"Sigma:AngleS:Zs");
370 sprintf(varCut,"Dim==%d&&Pad==%d&&QMean>0",dim,type);
372 Int_t entries = tree->Draw(varVal,varCut);
373 Float_t px[20000], py[20000], pz[20000], pu[20000], pt[20000];
374 Float_t ex[20000], ey[20000], ez[20000];
376 tree->Draw(varErr,varCut);
377 for (Int_t ipoint=0; ipoint<entries; ipoint++){
378 ex[ipoint]= tree->GetV3()[ipoint];
379 ey[ipoint]= tree->GetV2()[ipoint];
380 ez[ipoint]= tree->GetV1()[ipoint];
382 tree->Draw(varVal,varCut);
383 for (Int_t ipoint=0; ipoint<entries; ipoint++){
384 px[ipoint]= tree->GetV3()[ipoint];
385 py[ipoint]= tree->GetV2()[ipoint];
386 pz[ipoint]= tree->GetV1()[ipoint];
388 tree->Draw(varVal0,varCut);
389 for (Int_t ipoint=0; ipoint<entries; ipoint++){
390 pu[ipoint]= tree->GetV3()[ipoint];
391 pt[ipoint]= tree->GetV2()[ipoint];
395 TLinearFitter fitter(5,"hyp4");
396 for (Int_t ipoint=0; ipoint<entries; ipoint++){
397 Float_t val = pz[ipoint]*pz[ipoint];
398 Float_t err = 2*pz[ipoint]*TMath::Sqrt(ez[ipoint]*ez[ipoint]+fRatio*fRatio*pz[ipoint]*pz[ipoint]);
401 x[1] = pt[ipoint]*pt[ipoint];
403 x[3] = py[ipoint]*py[ipoint];
404 fitter.AddPoint(x,val,err);
409 fitter.GetParameters(param);
410 param0[0] = param[0];
411 param0[1] = param[1];
412 param0[2] = param[2];
413 param0[3] = param[3];
414 param0[4] = param[4];
415 Float_t chi2 = fitter.GetChisquare()/entries;
417 error[0] = (fitter.GetParError(0)*TMath::Sqrt(chi2));
418 error[1] = (fitter.GetParError(1)*TMath::Sqrt(chi2));
419 error[2] = (fitter.GetParError(2)*TMath::Sqrt(chi2));
420 error[3] = (fitter.GetParError(3)*TMath::Sqrt(chi2));
421 error[4] = (fitter.GetParError(4)*TMath::Sqrt(chi2));
424 void AliTPCClusterParam::FitResolQPar(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error){
426 // Fit z - angular dependence of resolution - Q scaling - parabolic correction
428 // Int_t dim=0, type=0;
430 sprintf(varVal,"Resol:AngleM/sqrt(QMean):Zm/QMean");
432 sprintf(varVal0,"Resol:AngleM:Zm");
435 sprintf(varErr,"Sigma:AngleS:Zs");
437 sprintf(varCut,"Dim==%d&&Pad==%d&&QMean>0",dim,type);
439 Int_t entries = tree->Draw(varVal,varCut);
440 Float_t px[20000], py[20000], pz[20000], pu[20000], pt[20000];
441 Float_t ex[20000], ey[20000], ez[20000];
443 tree->Draw(varErr,varCut);
444 for (Int_t ipoint=0; ipoint<entries; ipoint++){
445 ex[ipoint]= tree->GetV3()[ipoint];
446 ey[ipoint]= tree->GetV2()[ipoint];
447 ez[ipoint]= tree->GetV1()[ipoint];
449 tree->Draw(varVal,varCut);
450 for (Int_t ipoint=0; ipoint<entries; ipoint++){
451 px[ipoint]= tree->GetV3()[ipoint];
452 py[ipoint]= tree->GetV2()[ipoint];
453 pz[ipoint]= tree->GetV1()[ipoint];
455 tree->Draw(varVal0,varCut);
456 for (Int_t ipoint=0; ipoint<entries; ipoint++){
457 pu[ipoint]= tree->GetV3()[ipoint];
458 pt[ipoint]= tree->GetV2()[ipoint];
462 TLinearFitter fitter(8,"hyp7");
463 for (Int_t ipoint=0; ipoint<entries; ipoint++){
464 Float_t val = pz[ipoint]*pz[ipoint];
465 Float_t err = 2*pz[ipoint]*TMath::Sqrt(ez[ipoint]*ez[ipoint]+fRatio*fRatio*pz[ipoint]*pz[ipoint]);
468 x[1] = pt[ipoint]*pt[ipoint];
473 x[6] = py[ipoint]*py[ipoint];
475 fitter.AddPoint(x,val,err);
480 fitter.GetParameters(param);
481 param0[0] = param[0];
482 param0[1] = param[1];
483 param0[2] = param[2];
484 param0[3] = param[3];
485 param0[4] = param[4];
486 param0[5] = param[5];
487 param0[6] = param[6];
488 param0[7] = param[7];
490 Float_t chi2 = fitter.GetChisquare()/entries;
492 error[0] = (fitter.GetParError(0)*TMath::Sqrt(chi2));
493 error[1] = (fitter.GetParError(1)*TMath::Sqrt(chi2));
494 error[2] = (fitter.GetParError(2)*TMath::Sqrt(chi2));
495 error[3] = (fitter.GetParError(3)*TMath::Sqrt(chi2));
496 error[4] = (fitter.GetParError(4)*TMath::Sqrt(chi2));
497 error[5] = (fitter.GetParError(5)*TMath::Sqrt(chi2));
498 error[6] = (fitter.GetParError(6)*TMath::Sqrt(chi2));
499 error[7] = (fitter.GetParError(7)*TMath::Sqrt(chi2));
504 void AliTPCClusterParam::FitRMS0(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error){
506 // Fit z - angular dependence of resolution
508 // Int_t dim=0, type=0;
510 sprintf(varVal,"RMSm:AngleM:Zm");
512 sprintf(varErr,"sqrt((1./(100.*sqrt(12.))^2)+RMSe0^2):AngleS:Zs");
514 sprintf(varCut,"Dim==%d&&Pad==%d&&QMean<0",dim,type);
516 Int_t entries = tree->Draw(varVal,varCut);
517 Float_t px[10000], py[10000], pz[10000];
518 Float_t ex[10000], ey[10000], ez[10000];
520 tree->Draw(varErr,varCut);
521 for (Int_t ipoint=0; ipoint<entries; ipoint++){
522 ex[ipoint]= tree->GetV3()[ipoint];
523 ey[ipoint]= tree->GetV2()[ipoint];
524 ez[ipoint]= tree->GetV1()[ipoint];
526 tree->Draw(varVal,varCut);
527 for (Int_t ipoint=0; ipoint<entries; ipoint++){
528 px[ipoint]= tree->GetV3()[ipoint];
529 py[ipoint]= tree->GetV2()[ipoint];
530 pz[ipoint]= tree->GetV1()[ipoint];
534 TLinearFitter fitter(3,"hyp2");
535 for (Int_t ipoint=0; ipoint<entries; ipoint++){
536 Float_t val = pz[ipoint]*pz[ipoint];
537 Float_t err = 2*pz[ipoint]*TMath::Sqrt(ez[ipoint]*ez[ipoint]+fRatio*fRatio*pz[ipoint]*pz[ipoint]);
540 x[1] = py[ipoint]*py[ipoint];
541 fitter.AddPoint(x,val,err);
545 fitter.GetParameters(param);
546 param0[0] = param[0];
547 param0[1] = param[1];
548 param0[2] = param[2];
549 Float_t chi2 = fitter.GetChisquare()/entries;
551 error[0] = (fitter.GetParError(0)*TMath::Sqrt(chi2));
552 error[1] = (fitter.GetParError(1)*TMath::Sqrt(chi2));
553 error[2] = (fitter.GetParError(2)*TMath::Sqrt(chi2));
556 void AliTPCClusterParam::FitRMS1(TTree * tree, Int_t dim, Float_t *param0, Float_t *error){
558 // Fit z - angular dependence of resolution - pad length scaling
560 // Int_t dim=0, type=0;
562 sprintf(varVal,"RMSm:AngleM*Length:Zm");
564 sprintf(varErr,"sqrt((1./(100.*sqrt(12.))^2)+RMSe0^2):AngleS:Pad");
566 sprintf(varCut,"Dim==%d&&QMean<0",dim);
568 Int_t entries = tree->Draw(varVal,varCut);
569 Float_t px[10000], py[10000], pz[10000];
570 Float_t type[10000], ey[10000], ez[10000];
572 tree->Draw(varErr,varCut);
573 for (Int_t ipoint=0; ipoint<entries; ipoint++){
574 type[ipoint] = tree->GetV3()[ipoint];
575 ey[ipoint] = tree->GetV2()[ipoint];
576 ez[ipoint] = tree->GetV1()[ipoint];
578 tree->Draw(varVal,varCut);
579 for (Int_t ipoint=0; ipoint<entries; ipoint++){
580 px[ipoint]= tree->GetV3()[ipoint];
581 py[ipoint]= tree->GetV2()[ipoint];
582 pz[ipoint]= tree->GetV1()[ipoint];
586 TLinearFitter fitter(4,"hyp3");
587 for (Int_t ipoint=0; ipoint<entries; ipoint++){
588 Float_t val = pz[ipoint]*pz[ipoint];
589 Float_t err = 2*pz[ipoint]*TMath::Sqrt(ez[ipoint]*ez[ipoint]+fRatio*fRatio*pz[ipoint]*pz[ipoint]);
591 x[0] = (type[ipoint]<0.5)? 0.:1.;
593 x[2] = py[ipoint]*py[ipoint];
594 fitter.AddPoint(x,val,err);
598 fitter.GetParameters(param);
599 param0[0] = param[0];
600 param0[1] = param[0]+param[1];
601 param0[2] = param[2];
602 param0[3] = param[3];
603 Float_t chi2 = fitter.GetChisquare()/entries;
605 error[0] = (fitter.GetParError(0)*TMath::Sqrt(chi2));
606 error[1] = (fitter.GetParError(1)*TMath::Sqrt(chi2));
607 error[2] = (fitter.GetParError(2)*TMath::Sqrt(chi2));
608 error[3] = (fitter.GetParError(3)*TMath::Sqrt(chi2));
611 void AliTPCClusterParam::FitRMSQ(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error){
613 // Fit z - angular dependence of resolution - Q scaling
615 // Int_t dim=0, type=0;
617 sprintf(varVal,"RMSm:AngleM/sqrt(QMean):Zm/QMean");
619 sprintf(varVal0,"RMSm:AngleM:Zm");
622 sprintf(varErr,"sqrt((1./(100.*sqrt(12.))^2)+RMSe0^2):AngleS:Zs");
624 sprintf(varCut,"Dim==%d&&Pad==%d&&QMean>0",dim,type);
626 Int_t entries = tree->Draw(varVal,varCut);
627 Float_t px[20000], py[20000], pz[20000], pu[20000], pt[20000];
628 Float_t ex[20000], ey[20000], ez[20000];
630 tree->Draw(varErr,varCut);
631 for (Int_t ipoint=0; ipoint<entries; ipoint++){
632 ex[ipoint]= tree->GetV3()[ipoint];
633 ey[ipoint]= tree->GetV2()[ipoint];
634 ez[ipoint]= tree->GetV1()[ipoint];
636 tree->Draw(varVal,varCut);
637 for (Int_t ipoint=0; ipoint<entries; ipoint++){
638 px[ipoint]= tree->GetV3()[ipoint];
639 py[ipoint]= tree->GetV2()[ipoint];
640 pz[ipoint]= tree->GetV1()[ipoint];
642 tree->Draw(varVal0,varCut);
643 for (Int_t ipoint=0; ipoint<entries; ipoint++){
644 pu[ipoint]= tree->GetV3()[ipoint];
645 pt[ipoint]= tree->GetV2()[ipoint];
649 TLinearFitter fitter(5,"hyp4");
650 for (Int_t ipoint=0; ipoint<entries; ipoint++){
651 Float_t val = pz[ipoint]*pz[ipoint];
652 Float_t err = 2*pz[ipoint]*TMath::Sqrt(ez[ipoint]*ez[ipoint]+fRatio*fRatio*pz[ipoint]*pz[ipoint]);
655 x[1] = pt[ipoint]*pt[ipoint];
657 x[3] = py[ipoint]*py[ipoint];
658 fitter.AddPoint(x,val,err);
663 fitter.GetParameters(param);
664 param0[0] = param[0];
665 param0[1] = param[1];
666 param0[2] = param[2];
667 param0[3] = param[3];
668 param0[4] = param[4];
669 Float_t chi2 = fitter.GetChisquare()/entries;
671 error[0] = (fitter.GetParError(0)*TMath::Sqrt(chi2));
672 error[1] = (fitter.GetParError(1)*TMath::Sqrt(chi2));
673 error[2] = (fitter.GetParError(2)*TMath::Sqrt(chi2));
674 error[3] = (fitter.GetParError(3)*TMath::Sqrt(chi2));
675 error[4] = (fitter.GetParError(4)*TMath::Sqrt(chi2));
679 void AliTPCClusterParam::FitRMSSigma(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t */*error*/){
681 // Fit z - angular dependence of resolution - Q scaling
683 // Int_t dim=0, type=0;
685 sprintf(varVal,"RMSs:RMSm");
688 sprintf(varCut,"Dim==%d&&Pad==%d&&QMean<0",dim,type);
690 Int_t entries = tree->Draw(varVal,varCut);
691 Float_t px[20000], py[20000];
693 tree->Draw(varVal,varCut);
694 for (Int_t ipoint=0; ipoint<entries; ipoint++){
695 px[ipoint]= tree->GetV2()[ipoint];
696 py[ipoint]= tree->GetV1()[ipoint];
698 TLinearFitter fitter(2,"pol1");
699 for (Int_t ipoint=0; ipoint<entries; ipoint++){
700 Float_t val = py[ipoint];
701 Float_t err = fRatio*px[ipoint];
704 if (err>0) fitter.AddPoint(x,val,err);
707 param0[0]= fitter.GetParameter(0);
708 param0[1]= fitter.GetParameter(1);
713 Float_t AliTPCClusterParam::GetError0(Int_t dim, Int_t type, Float_t z, Float_t angle){
718 value += fParamS0[dim][type][0];
719 value += fParamS0[dim][type][1]*z;
720 value += fParamS0[dim][type][2]*angle*angle;
721 value = TMath::Sqrt(TMath::Abs(value));
726 Float_t AliTPCClusterParam::GetError0Par(Int_t dim, Int_t type, Float_t z, Float_t angle){
731 value += fParamS0Par[dim][type][0];
732 value += fParamS0Par[dim][type][1]*z;
733 value += fParamS0Par[dim][type][2]*angle*angle;
734 value += fParamS0Par[dim][type][3]*z*z;
735 value += fParamS0Par[dim][type][4]*angle*angle*angle*angle;
736 value += fParamS0Par[dim][type][5]*z*angle*angle;
737 value = TMath::Sqrt(TMath::Abs(value));
743 Float_t AliTPCClusterParam::GetError1(Int_t dim, Int_t type, Float_t z, Float_t angle){
749 if (type==1) length=1;
750 if (type==2) length=1.5;
751 value += fParamS1[dim][0];
752 value += fParamS1[dim][1]*z/length;
753 value += fParamS1[dim][2]*angle*angle*length;
754 value = TMath::Sqrt(TMath::Abs(value));
758 Float_t AliTPCClusterParam::GetErrorQ(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
763 value += fParamSQ[dim][type][0];
764 value += fParamSQ[dim][type][1]*z;
765 value += fParamSQ[dim][type][2]*angle*angle;
766 value += fParamSQ[dim][type][3]*z/Qmean;
767 value += fParamSQ[dim][type][4]*angle*angle/Qmean;
768 value = TMath::Sqrt(TMath::Abs(value));
774 Float_t AliTPCClusterParam::GetErrorQPar(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
779 value += fParamSQPar[dim][type][0];
780 value += fParamSQPar[dim][type][1]*z;
781 value += fParamSQPar[dim][type][2]*angle*angle;
782 value += fParamSQPar[dim][type][3]*z*z;
783 value += fParamSQPar[dim][type][4]*angle*angle*angle*angle;
784 value += fParamSQPar[dim][type][5]*z*angle*angle;
785 value += fParamSQPar[dim][type][6]*z/Qmean;
786 value += fParamSQPar[dim][type][7]*angle*angle/Qmean;
787 value = TMath::Sqrt(TMath::Abs(value));
793 Float_t AliTPCClusterParam::GetErrorQParScaled(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
798 value += fParamSQPar[dim][type][0];
799 value += fParamSQPar[dim][type][1]*z;
800 value += fParamSQPar[dim][type][2]*angle*angle;
801 value += fParamSQPar[dim][type][3]*z*z;
802 value += fParamSQPar[dim][type][4]*angle*angle*angle*angle;
803 value += fParamSQPar[dim][type][5]*z*angle*angle;
804 value += fParamSQPar[dim][type][6]*z/Qmean;
805 value += fParamSQPar[dim][type][7]*angle*angle/Qmean;
806 Float_t valueMean = GetError0Par(dim,type,z,angle);
807 value -= 0.35*0.35*valueMean*valueMean;
808 value = TMath::Sqrt(TMath::Abs(value));
814 Float_t AliTPCClusterParam::GetRMS0(Int_t dim, Int_t type, Float_t z, Float_t angle){
816 // calculate mean RMS of cluster - z,angle - parameters for each pad and dimension separatelly
819 value += fParamRMS0[dim][type][0];
820 value += fParamRMS0[dim][type][1]*z;
821 value += fParamRMS0[dim][type][2]*angle*angle;
822 value = TMath::Sqrt(TMath::Abs(value));
826 Float_t AliTPCClusterParam::GetRMS1(Int_t dim, Int_t type, Float_t z, Float_t angle){
828 // calculate mean RMS of cluster - z,angle - pad length scalling
832 if (type==1) length=1;
833 if (type==2) length=1.5;
835 value += fParamRMS1[dim][0];
837 value += fParamRMS1[dim][1];
839 value += fParamRMS1[dim][2]*z;
840 value += fParamRMS1[dim][3]*angle*angle*length*length;
841 value = TMath::Sqrt(TMath::Abs(value));
845 Float_t AliTPCClusterParam::GetRMSQ(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
847 // calculate mean RMS of cluster - z,angle, Q dependence
850 value += fParamRMSQ[dim][type][0];
851 value += fParamRMSQ[dim][type][1]*z;
852 value += fParamRMSQ[dim][type][2]*angle*angle;
853 value += fParamRMSQ[dim][type][3]*z/Qmean;
854 value += fParamRMSQ[dim][type][4]*angle*angle/Qmean;
855 value = TMath::Sqrt(TMath::Abs(value));
859 Float_t AliTPCClusterParam::GetRMSSigma(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
861 // calculates RMS of signal shape fluctuation
863 Float_t mean = GetRMSQ(dim,type,z,angle,Qmean);
864 Float_t value = fRMSSigmaFit[dim][type][0];
865 value+= fRMSSigmaFit[dim][type][1]*mean;
869 Float_t AliTPCClusterParam::GetShapeFactor(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean, Float_t rmsL, Float_t rmsM){
871 // calculates vallue - sigma distortion contribution
875 Float_t rmsMeanQ = GetRMSQ(dim,type,z,angle,Qmean);
876 if (rmsL<rmsMeanQ) return value;
878 Float_t rmsSigma = GetRMSSigma(dim,type,z,angle,Qmean);
880 if ((rmsM-rmsMeanQ)>2.0*(rmsSigma+fErrorRMSSys[dim])){
881 //1.5 sigma cut on mean
882 value+= rmsL*rmsL+2*rmsM*rmsM-3*rmsMeanQ*rmsMeanQ;
884 if ((rmsL-rmsMeanQ)>3.*(rmsSigma+fErrorRMSSys[dim])){
885 //3 sigma cut on local
886 value+= rmsL*rmsL-rmsMeanQ*rmsMeanQ;
889 return TMath::Sqrt(TMath::Abs(value));
894 void AliTPCClusterParam::FitData(TTree * tree){
896 // make fits for error param and shape param
903 void AliTPCClusterParam::FitResol(TTree * tree){
906 for (Int_t idir=0;idir<2; idir++){
907 for (Int_t itype=0; itype<3; itype++){
911 FitResol0(tree, idir, itype,param0,error0);
912 printf("\nResol\t%d\t%d\tchi2=%f\n",idir,itype,param0[3]);
913 printf("%f\t%f\t%f\n", param0[0],param0[1],param0[2]);
914 printf("%f\t%f\t%f\n", error0[0],error0[1],error0[2]);
915 for (Int_t ipar=0;ipar<4; ipar++){
916 fParamS0[idir][itype][ipar] = param0[ipar];
917 fErrorS0[idir][itype][ipar] = param0[ipar];
919 // error param with parabolic correction
920 FitResol0Par(tree, idir, itype,param0,error0);
921 printf("\nResolPar\t%d\t%d\tchi2=%f\n",idir,itype,param0[6]);
922 printf("%f\t%f\t%f\t%f\t%f\t%f\n", param0[0],param0[1],param0[2],param0[3],param0[4],param0[5]);
923 printf("%f\t%f\t%f\t%f\t%f\t%f\n", error0[0],error0[1],error0[2],error0[3],error0[4],error0[5]);
924 for (Int_t ipar=0;ipar<7; ipar++){
925 fParamS0Par[idir][itype][ipar] = param0[ipar];
926 fErrorS0Par[idir][itype][ipar] = param0[ipar];
929 FitResolQ(tree, idir, itype,param0,error0);
930 printf("\nResolQ\t%d\t%d\tchi2=%f\n",idir,itype,param0[5]);
931 printf("%f\t%f\t%f\t%f\t%f\n", param0[0],param0[1],param0[2],param0[3],param0[4]);
932 printf("%f\t%f\t%f\t%f\t%f\n", error0[0],error0[1],error0[2],error0[3],error0[4]);
933 for (Int_t ipar=0;ipar<6; ipar++){
934 fParamSQ[idir][itype][ipar] = param0[ipar];
935 fErrorSQ[idir][itype][ipar] = param0[ipar];
938 FitResolQPar(tree, idir, itype,param0,error0);
939 printf("\nResolQ\t%d\t%d\tchi2=%f\n",idir,itype,param0[8]);
940 printf("%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\n", param0[0],param0[1],param0[2],param0[3],param0[4],param0[5],param0[6],param0[7]);
941 printf("%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\n", error0[0],error0[1],error0[2],error0[3],error0[4],error0[5],error0[6],error0[7]);
942 for (Int_t ipar=0;ipar<9; ipar++){
943 fParamSQPar[idir][itype][ipar] = param0[ipar];
944 fErrorSQPar[idir][itype][ipar] = param0[ipar];
949 printf("Resol z-scaled\n");
950 for (Int_t idir=0;idir<2; idir++){
953 FitResol1(tree, idir,param0,error0);
954 printf("\nResol\t%d\tchi2=%f\n",idir,param0[3]);
955 printf("%f\t%f\t%f\n", param0[0],param0[1],param0[2]);
956 printf("%f\t%f\t%f\n", error0[0],error0[1],error0[2]);
957 for (Int_t ipar=0;ipar<4; ipar++){
958 fParamS1[idir][ipar] = param0[ipar];
959 fErrorS1[idir][ipar] = param0[ipar];
963 for (Int_t idir=0;idir<2; idir++){
964 printf("\nDirection %d\n",idir);
965 printf("%d\t%f\t%f\t%f\n", -1,fParamS1[idir][0],fParamS1[idir][1],fParamS1[idir][2]);
966 for (Int_t itype=0; itype<3; itype++){
968 if (itype==1) length=1;
969 if (itype==2) length=1.5;
970 printf("%d\t%f\t%f\t%f\n", itype,fParamS0[idir][itype][0],fParamS0[idir][itype][1]*TMath::Sqrt(length),fParamS0[idir][itype][2]/TMath::Sqrt(length));
977 void AliTPCClusterParam::FitRMS(TTree * tree){
980 for (Int_t idir=0;idir<2; idir++){
981 for (Int_t itype=0; itype<3; itype++){
984 FitRMS0(tree, idir, itype,param0,error0);
985 printf("\nRMS\t%d\t%d\tchi2=%f\n",idir,itype,param0[3]);
986 printf("%f\t%f\t%f\n", param0[0],param0[1],param0[2]);
987 printf("%f\t%f\t%f\n", error0[0],error0[1],error0[2]);
988 for (Int_t ipar=0;ipar<4; ipar++){
989 fParamRMS0[idir][itype][ipar] = param0[ipar];
990 fErrorRMS0[idir][itype][ipar] = param0[ipar];
992 FitRMSQ(tree, idir, itype,param0,error0);
993 printf("\nRMSQ\t%d\t%d\tchi2=%f\n",idir,itype,param0[5]);
994 printf("%f\t%f\t%f\t%f\t%f\n", param0[0],param0[1],param0[2],param0[3],param0[4]);
995 printf("%f\t%f\t%f\t%f\t%f\n", error0[0],error0[1],error0[2],error0[3],error0[4]);
996 for (Int_t ipar=0;ipar<6; ipar++){
997 fParamRMSQ[idir][itype][ipar] = param0[ipar];
998 fErrorRMSQ[idir][itype][ipar] = param0[ipar];
1003 printf("RMS z-scaled\n");
1004 for (Int_t idir=0;idir<2; idir++){
1007 FitRMS1(tree, idir,param0,error0);
1008 printf("\nRMS\t%d\tchi2=%f\n",idir,param0[4]);
1009 printf("%f\t%f\t%f\t%f\n", param0[0],param0[1],param0[2], param0[3]);
1010 printf("%f\t%f\t%f\t%f\n", error0[0],error0[1],error0[2], error0[3]);
1011 for (Int_t ipar=0;ipar<5; ipar++){
1012 fParamRMS1[idir][ipar] = param0[ipar];
1013 fErrorRMS1[idir][ipar] = param0[ipar];
1017 for (Int_t idir=0;idir<2; idir++){
1018 printf("\nDirection %d\n",idir);
1019 printf("%d\t%f\t%f\t%f\t%f\n", -1,fParamRMS1[idir][0],fParamRMS1[idir][1],fParamRMS1[idir][2], fParamRMS1[idir][3]);
1020 for (Int_t itype=0; itype<3; itype++){
1021 Float_t length=0.75;
1022 if (itype==1) length=1;
1023 if (itype==2) length=1.5;
1024 if (itype==0) printf("%d\t%f\t\t\t%f\t%f\n", itype,fParamRMS0[idir][itype][0],fParamRMS0[idir][itype][1],fParamRMS0[idir][itype][2]/length);
1025 if (itype>0) printf("%d\t\t\t%f\t%f\t%f\n", itype,fParamRMS0[idir][itype][0],fParamRMS0[idir][itype][1],fParamRMS0[idir][itype][2]/length);
1031 printf("RMS fluctuation parameterization \n");
1032 for (Int_t idir=0;idir<2; idir++){
1033 for (Int_t itype=0; itype<3; itype++){
1036 FitRMSSigma(tree, idir,itype,param0,error0);
1037 printf("\t%d\t%d\t%f\t%f\n", idir, itype, param0[0],param0[1]);
1038 for (Int_t ipar=0;ipar<2; ipar++){
1039 fRMSSigmaFit[idir][itype][ipar] = param0[ipar];
1044 // store systematic error end RMS fluctuation parameterization
1046 TH1F hratio("hratio","hratio",100,-0.1,0.1);
1047 tree->Draw("(RMSm-AliTPCClusterParam::SGetRMSQ(Dim,Pad,Zm,AngleM,QMean))/RMSm>>hratio","Dim==0&&QMean>0");
1048 fErrorRMSSys[0] = hratio.GetRMS();
1049 tree->Draw("(RMSm-AliTPCClusterParam::SGetRMSQ(Dim,Pad,Zm,AngleM,QMean))/RMSm>>hratio","Dim==1&&QMean>0");
1050 fErrorRMSSys[1] = hratio.GetRMS();
1051 TH1F hratioR("hratioR","hratioR",100,0,0.2);
1052 tree->Draw("RMSs/RMSm>>hratioR","Dim==0&&QMean>0");
1053 fRMSSigmaRatio[0][0]=hratioR.GetMean();
1054 fRMSSigmaRatio[0][1]=hratioR.GetRMS();
1055 tree->Draw("RMSs/RMSm>>hratioR","Dim==1&&QMean>0");
1056 fRMSSigmaRatio[1][0]=hratioR.GetMean();
1057 fRMSSigmaRatio[1][1]=hratioR.GetRMS();
1060 void AliTPCClusterParam::Test(TTree * tree, const char *output){
1062 // Draw standard quality histograms to output file
1065 TFile f(output,"recreate");
1068 // 1D histograms - resolution
1070 for (Int_t idim=0; idim<2; idim++){
1071 for (Int_t ipad=0; ipad<3; ipad++){
1076 sprintf(hname1,"Delta0 Dir %d Pad %d",idim,ipad);
1077 sprintf(hcut1,"Dim==%d&&QMean<0&&Pad==%d",idim,ipad);
1078 sprintf(hexp1,"(Resol-AliTPCClusterParam::SGetError0(Dim,Pad,Zm,AngleM))/Resol>>%s",hname1);
1079 TH1F his1DRel0(hname1, hname1, 100,-0.2, 0.2);
1080 sprintf(hname1,"Dim==%d&&QMean<0&&Pad=%d",idim,ipad);
1081 tree->Draw(hexp1,hcut1,"");
1084 sprintf(hname1,"Delta0Par Dir %d Pad %d",idim,ipad);
1085 sprintf(hcut1,"Dim==%d&&QMean<0&&Pad==%d",idim,ipad);
1086 sprintf(hexp1,"(Resol-AliTPCClusterParam::SGetError0Par(Dim,Pad,Zm,AngleM))/Resol>>%s",hname1);
1087 TH1F his1DRel0Par(hname1, hname1, 100,-0.2, 0.2);
1088 sprintf(hname1,"Dim==%d&&QMean<0&&Pad=%d",idim,ipad);
1089 tree->Draw(hexp1,hcut1,"");
1090 his1DRel0Par.Write();
1095 // 2D histograms - resolution
1097 for (Int_t idim=0; idim<2; idim++){
1098 for (Int_t ipad=0; ipad<3; ipad++){
1103 sprintf(hname1,"2DDelta0 Dir %d Pad %d",idim,ipad);
1104 sprintf(hcut1,"Dim==%d&&QMean<0&&Pad==%d",idim,ipad);
1105 sprintf(hexp1,"(Resol-AliTPCClusterParam::SGetError0(Dim,Pad,Zm,AngleM))/Resol:AngleM:Zm>>%s",hname1);
1106 TProfile2D profDRel0(hname1, hname1, 6,0,250,6,0,1);
1107 sprintf(hname1,"Dim==%d&&QMean<0&&Pad=%d",idim,ipad);
1108 tree->Draw(hexp1,hcut1,"");
1111 sprintf(hname1,"2DDelta0Par Dir %d Pad %d",idim,ipad);
1112 sprintf(hcut1,"Dim==%d&&QMean<0&&Pad==%d",idim,ipad);
1113 sprintf(hexp1,"(Resol-AliTPCClusterParam::SGetError0Par(Dim,Pad,Zm,AngleM))/Resol:AngleM:Zm>>%s",hname1);
1114 TProfile2D profDRel0Par(hname1, hname1,6,0,250,6,0,1);
1115 sprintf(hname1,"Dim==%d&&QMean<0&&Pad=%d",idim,ipad);
1116 tree->Draw(hexp1,hcut1,"");
1117 profDRel0Par.Write();
1125 void AliTPCClusterParam::Print(Option_t* /*option*/) const{
1127 // Print param Information
1131 // Error parameterization
1133 printf("\nResolution Scaled factors\n");
1134 printf("Dir\tPad\tP0\t\tP1\t\tP2\t\tchi2\n");
1135 printf("Y\tall\t%f\t%f\t%f\t%f\n", TMath::Sqrt(TMath::Abs(fParamS1[0][0])),TMath::Sqrt(TMath::Abs(fParamS1[0][1])),
1136 TMath::Sqrt(TMath::Abs(fParamS1[0][2])),TMath::Sqrt(TMath::Abs(fParamS1[0][3])));
1137 for (Int_t ipad=0; ipad<3; ipad++){
1138 Float_t length=0.75;
1139 if (ipad==1) length=1;
1140 if (ipad==2) length=1.5;
1141 printf("\t%d\t%f\t%f\t%f\t%f\n", ipad,
1142 TMath::Sqrt(TMath::Abs(fParamS0[0][ipad][0])),
1143 TMath::Sqrt(TMath::Abs(fParamS0[0][ipad][1]*length)),
1144 TMath::Sqrt(TMath::Abs(fParamS0[0][ipad][2]/length)),
1145 TMath::Sqrt(TMath::Abs(fParamS0[0][ipad][3])));
1147 for (Int_t ipad=0; ipad<3; ipad++){
1148 Float_t length=0.75;
1149 if (ipad==1) length=1;
1150 if (ipad==2) length=1.5;
1151 printf("\t%dPar\t%f\t%f\t%f\t%f\n", ipad,
1152 TMath::Sqrt(TMath::Abs(fParamS0Par[0][ipad][0])),
1153 TMath::Sqrt(TMath::Abs(fParamS0Par[0][ipad][1]*length)),
1154 TMath::Sqrt(TMath::Abs(fParamS0Par[0][ipad][2]/length)),
1155 TMath::Sqrt(TMath::Abs(fParamS0Par[0][ipad][6])));
1157 printf("Z\tall\t%f\t%f\t%f\t%f\n", TMath::Sqrt(TMath::Abs(fParamS1[1][0])),TMath::Sqrt(fParamS1[1][1]),
1158 TMath::Sqrt(fParamS1[1][2]), TMath::Sqrt(fParamS1[1][3]));
1160 for (Int_t ipad=0; ipad<3; ipad++){
1161 Float_t length=0.75;
1162 if (ipad==1) length=1;
1163 if (ipad==2) length=1.5;
1164 printf("\t%d\t%f\t%f\t%f\t%f\n", ipad,
1165 TMath::Sqrt(TMath::Abs(fParamS0[1][ipad][0])),
1166 TMath::Sqrt(TMath::Abs(fParamS0[1][ipad][1]*length)),
1167 TMath::Sqrt(TMath::Abs(fParamS0[1][ipad][2]/length)),
1168 TMath::Sqrt(TMath::Abs(fParamS0[1][ipad][3])));
1170 for (Int_t ipad=0; ipad<3; ipad++){
1171 Float_t length=0.75;
1172 if (ipad==1) length=1;
1173 if (ipad==2) length=1.5;
1174 printf("\t%dPar\t%f\t%f\t%f\t%f\n", ipad,
1175 TMath::Sqrt(TMath::Abs(TMath::Abs(fParamS0Par[1][ipad][0]))),
1176 TMath::Sqrt(TMath::Abs(fParamS0Par[1][ipad][1]*length)),
1177 TMath::Sqrt(TMath::Abs(fParamS0Par[1][ipad][2]/length)),
1178 TMath::Sqrt(TMath::Abs(fParamS0Par[1][ipad][6])));
1185 printf("\nRMS Scaled factors\n");
1186 printf("Dir\tPad\tP00\t\tP01\t\tP1\t\tP2\t\tchi2\n");
1187 printf("Y\tall\t%f\t%f\t%f\t%f\t%f\n",
1188 TMath::Sqrt(TMath::Abs(fParamRMS1[0][0])),
1189 TMath::Sqrt(TMath::Abs(fParamRMS1[0][1])),
1190 TMath::Sqrt(TMath::Abs(fParamRMS1[0][2])),
1191 TMath::Sqrt(TMath::Abs(fParamRMS1[0][3])),
1192 TMath::Sqrt(TMath::Abs(fParamRMS1[0][4])));
1193 for (Int_t ipad=0; ipad<3; ipad++){
1194 Float_t length=0.75;
1195 if (ipad==1) length=1;
1196 if (ipad==2) length=1.5;
1198 printf("\t%d\t%f\t%f\t%f\t%f\t%f\n", ipad,
1199 TMath::Sqrt(TMath::Abs(fParamRMS0[0][ipad][0])),
1201 TMath::Sqrt(TMath::Abs(fParamRMS0[0][ipad][1])),
1202 TMath::Sqrt(TMath::Abs(fParamRMS0[0][ipad][2]/(length*length))),
1203 TMath::Sqrt(TMath::Abs(fParamRMS0[0][ipad][3])));
1205 printf("\t%d\t%f\t%f\t%f\t%f\t%f\n", ipad,
1207 TMath::Sqrt(TMath::Abs(fParamRMS0[0][ipad][0])),
1208 TMath::Sqrt(TMath::Abs(fParamRMS0[0][ipad][1])),
1209 TMath::Sqrt(TMath::Abs(fParamRMS0[0][ipad][2]/(length*length))),
1210 TMath::Sqrt(TMath::Abs(fParamRMS0[0][ipad][3])));
1214 printf("Z\tall\t%f\t%f\t%f\t%f\t%f\n",
1215 TMath::Sqrt(TMath::Abs(fParamRMS1[1][0])),
1216 TMath::Sqrt(TMath::Abs(fParamRMS1[1][1])),
1217 TMath::Sqrt(TMath::Abs(fParamRMS1[1][2])),
1218 TMath::Sqrt(TMath::Abs(fParamRMS1[1][3])),
1219 TMath::Sqrt(TMath::Abs(fParamRMS1[1][4])));
1220 for (Int_t ipad=0; ipad<3; ipad++){
1221 Float_t length=0.75;
1222 if (ipad==1) length=1;
1223 if (ipad==2) length=1.5;
1225 printf("\t%d\t%f\t%f\t%f\t%f\t%f\n", ipad,
1226 TMath::Sqrt(TMath::Abs(fParamRMS0[1][ipad][0])),
1228 TMath::Sqrt(TMath::Abs(fParamRMS0[1][ipad][1])),
1229 TMath::Sqrt(TMath::Abs(fParamRMS0[1][ipad][2]/(length*length))),
1230 TMath::Sqrt(TMath::Abs(fParamRMS0[1][ipad][3])));
1232 printf("\t%d\t%f\t%f\t%f\t%f\t%f\n", ipad,
1234 TMath::Sqrt(TMath::Abs(fParamRMS0[1][ipad][0])),
1235 TMath::Sqrt(TMath::Abs(fParamRMS0[1][ipad][1])),
1236 TMath::Sqrt(TMath::Abs(fParamRMS0[1][ipad][2]/(length*length))),
1237 TMath::Sqrt(TMath::Abs(fParamRMS0[1][ipad][3])));
1246 Float_t AliTPCClusterParam::Qnorm(Int_t ipad, Int_t itype, Float_t dr, Float_t ty, Float_t tz){
1247 // get Q normalization
1248 // type - 0 Qtot 1 Qmax
1249 // ipad - 0 (0.75 cm) ,1 (1 cm), 2 (1.5 cm)
1251 //expession formula - TString *strq0 = toolkit.FitPlane(chain,"dedxQ.fElements[2]","dr++ty++tz++dr*ty++dr*tz++ty*tz++ty^2++tz^2","IPad==0",chi2,npoints,param,covar,0,100000);
1253 if (fQNorm==0) return 0;
1254 TVectorD * norm = (TVectorD*)fQNorm->At(3*itype+ipad);
1255 if (!norm) return 0;
1256 TVectorD &no = *norm;
1257 Float_t res = no[0]+
1273 void AliTPCClusterParam::SetQnorm(Int_t ipad, Int_t itype, TVectorD * norm){
1275 // set normalization
1277 // type - 0 Qtot 1 Qmax
1278 // ipad - 0 (0.75 cm) ,1 (1 cm), 2 (1.5 cm)
1281 if (fQNorm==0) fQNorm = new TObjArray(6);
1282 fQNorm->AddAt(new TVectorD(*norm), itype*3+ipad);
1290 gSystem->Load("libSTAT.so")
1291 TStatToolkit toolkit;
1299 fstring+="(Zm/250.)++"
1300 fstring+="(Zm/250.)^2++"
1301 fstring+="(Zm/250.)^3++"
1303 fstring+="(AngleM)^2++"
1304 fstring+="(AngleM)^3++"
1305 fstring+="(Zm/250.)*AngleM++"
1306 fstring+="(Zm/250.)^2*AngleM++"
1307 fstring+="(Zm/250.)*AngleM^2++"
1309 TString *strRMSY0 = toolkit.FitPlane(treeRes,"RMSm^2",fstring->Data(), "Dim==0&&Pad==0&&QMean<0", chi2,npoints,fitParam,covMatrix);
1311 treeRes->SetAlias("RMSY0",strRMSY0->Data());