17 #if !defined(__CINT__) || defined(__MAKECINT__)
18 #include "THnSparse.h"
28 #include "TProfile3D.h"
32 #include "TStatToolkit.h"
33 #include "TTreeStream.h"
34 #include "AliExternalTrackParam.h"
35 #include "AliESDfriend.h"
36 #include "AliTPCcalibTime.h"
44 #include "TPostScript.h"
46 #include "AliTrackerBase.h"
49 #include "TEntryList.h"
50 #include "AliCDBMetaData.h"
52 #include "AliCDBManager.h"
53 #include "AliCDBStorage.h"
57 const char*
chDetName[5]={
"ITS",
"TRD",
"Vertex",
"TOF",
"Laser"};
58 const char*
chParName[5]={
"rphi",
"z",
"snp",
"tan",
"1/pt"};
94 chain->SetAlias(
"isITS",
"(dtype==0||dtype==2)");
95 chain->SetAlias(
"isTRD",
"(dtype==1)");
96 chain->SetAlias(
"isLaser",
"(dtype==4)");
97 chain->SetAlias(
"r",
"sqrt(gx*gx+gy*gy)");
98 chain->SetAlias(
"r250",
"(sqrt(gx*gx+gy*gy)/250.)");
99 chain->SetAlias(
"weight",
"((dtype==4)*rms*10+rms)");
100 chain->SetAlias(
"side",
"(1+(theta>0)*2)");
101 chain->SetAlias(
"mdelta",
"(mean-R.mean-isLaser*((dRrec-R.dRrec)*tan(asin(snp))))");
102 chain->SetAlias(
"drift",
"(1-abs(gz/250))");
103 chain->SetAlias(
"r0",
"(r-160)/80");
104 chain->SetAlias(
"delta",
"(0*gx)");
111 gROOT->Macro(
"~/rootlogon.C");
113 gSystem->AddIncludePath(
"-I$ALICE_ROOT/STAT");
114 gSystem->AddIncludePath(
"-I$ALICE_ROOT/TPC");
115 gSystem->AddIncludePath(
"-I$ALICE_ROOT/TPC/macros");
116 gSystem->Load(
"libANALYSIS");
117 gSystem->Load(
"libTPCcalib");
122 TPostScript *ps =
new TPostScript(
"exbFit.eps", 112);
191 c=
DrawFitdY(
"dY-Physical+Effective Sign");
223 TH1::AddDirectory(0);
231 chain =
new TChain(
"fit",
"fit");
236 for (Int_t idet=0; idet<5; idet++){
237 for (Int_t ipar=0; ipar<5; ipar++){
238 f0=
TFile::Open(Form(
"../mergeField0/distortion%d_%d.root",idet,ipar));
239 fp=
TFile::Open(Form(
"../mergePlus/distortion%d_%d.root",idet,ipar));
240 fm=
TFile::Open(Form(
"../mergeMinus/distortion%d_%d.root",idet,ipar));
241 tree0 = (f0) ? (TTree*)f0->Get(
"fit"):0;
242 treeP = (
fp) ? (TTree*)fp->Get(
"fit"):0;
243 treeM = (fm) ? (TTree*)fm->Get(
"fit"):0;
245 if ( ipar==0 || ipar==2){
247 chain->Add(Form(
"../mergePlus/distortion%d_%d.root",idet,ipar));
248 chainRef->Add(Form(
"../mergeField0/distortion%d_%d.root",idet,ipar));
251 chain->Add(Form(
"../mergeMinus/distortion%d_%d.root",idet,ipar));
252 chainRef->Add(Form(
"../mergeField0/distortion%d_%d.root",idet,ipar));
255 if ( ipar==1 || ipar==3 || ipar==4){
257 chain->Add(Form(
"../mergePlus/distortion%d_%d.root",idet,ipar));
258 chainRef->Add(Form(
"../mergeMinus/distortion%d_%d.root",idet,ipar));
272 TCut
cutS=
"((rms>0&&R.rms>0&&entries>0&&R.entries>0))";
273 TCut cutType=
"((dtype==R.dtype)&&(ptype==R.ptype))";
274 TCut cutOut=
"(ptype==0)*abs(mdelta)<(0.3+rms)||(ptype==0&&abs(mdelta*85)<(0.3+rms*85))";
277 chain->Draw(
">>outList",cutS+cutType+cutOut+
"abs(snp)<0.5",
"entryList");
278 TEntryList *elistOut = (TEntryList*)gDirectory->Get(
"outList");
279 chain->SetEntryList(elistOut);
288 Int_t nrows = matrix.GetNrows();
289 TMatrixD *
mat =
new TMatrixD(nrows,nrows);
290 for (Int_t irow=0; irow<nrows; irow++)
291 for (Int_t icol=0; icol<nrows; icol++){
292 (*mat)(irow,icol)= matrix(irow,icol)/TMath::Sqrt(matrix(irow,irow)*matrix(icol,icol));
304 Int_t npointsMax=30000000;
312 fstring+=
"(tX1-R.tX1)++";
313 fstring+=
"(tY1-R.tY1)++";
314 fstring+=
"(sign(bz)*(tX1-R.tX1))++";
315 fstring+=
"(sign(bz)*(tY1-R.tY1))++";
318 fstring+=
"(isITS*shiftX)++";
319 fstring+=
"(isITS*shiftY)++";
320 fstring+=
"(isITS*sign(bz)*shiftX)++";
321 fstring+=
"(isITS*sign(bz)*shiftY)++";
324 fstring+=
"(isTRD*shiftX)++";
325 fstring+=
"(isTRD*shiftY)++";
326 fstring+=
"(isTRD*sign(bz)*shiftX)++";
327 fstring+=
"(isTRD*sign(bz)*shiftY)++";
332 TString fstringCustom=
"";
334 fstring+=
"(exbT1-exb11-(R.exbT1-R.exb11))++";
335 fstring+=
"(exbT2-exb11-(R.exbT2-R.exb11))++";
336 fstringCustom+=
"(eff0_0_0-R.eff0_0_0)++";
337 fstringCustom+=
"(eff1_0_0-R.eff1_0_0)++";
340 fstringCustom+=
"(eff0_0_1-R.eff0_0_1)++";
341 fstringCustom+=
"(eff1_0_1-R.eff1_0_1)++";
342 fstringCustom+=
"(eff0_0_2-R.eff0_0_2)++";
343 fstringCustom+=
"(eff1_0_2-R.eff1_0_2)++";
346 fstringCustom+=
"(eff0_1_0-R.eff0_1_0)++";
347 fstringCustom+=
"(eff1_1_0-R.eff1_1_0)++";
348 fstringCustom+=
"(eff0_1_1-R.eff0_1_1)++";
349 fstringCustom+=
"(eff1_1_1-R.eff1_1_1)++";
350 fstringCustom+=
"(eff0_1_2-R.eff0_1_2)++";
351 fstringCustom+=
"(eff1_1_2-R.eff1_1_2)++";
352 fstringCustom+=
"(eff0_2_0-R.eff0_2_0)++";
353 fstringCustom+=
"(eff1_2_0-R.eff1_2_0)++";
354 fstringCustom+=
"(eff0_2_1-R.eff0_2_1)++";
355 fstringCustom+=
"(eff1_2_1-R.eff1_2_1)++";
356 fstringCustom+=
"(eff0_2_2-R.eff0_2_2)++";
357 fstringCustom+=
"(eff1_2_2-R.eff1_2_2)++";
361 fstringCustom+=
"sign(bz)*(eff0_0_0-R.eff0_0_0)++";
362 fstringCustom+=
"sign(bz)*(eff1_0_0-R.eff1_0_0)++";
365 fstringCustom+=
"sign(bz)*(eff0_0_1-R.eff0_0_1)++";
366 fstringCustom+=
"sign(bz)*(eff1_0_1-R.eff1_0_1)++";
367 fstringCustom+=
"sign(bz)*(eff0_0_2-R.eff0_0_2)++";
368 fstringCustom+=
"sign(bz)*(eff1_0_2-R.eff1_0_2)++";
371 fstringCustom+=
"sign(bz)*(eff0_1_0-R.eff0_1_0)++";
372 fstringCustom+=
"sign(bz)*(eff1_1_0-R.eff1_1_0)++";
373 fstringCustom+=
"sign(bz)*(eff0_1_1-R.eff0_1_1)++";
374 fstringCustom+=
"sign(bz)*(eff1_1_1-R.eff1_1_1)++";
375 fstringCustom+=
"sign(bz)*(eff0_1_2-R.eff0_1_2)++";
376 fstringCustom+=
"sign(bz)*(eff1_1_2-R.eff1_1_2)++";
377 fstringCustom+=
"sign(bz)*(eff0_2_0-R.eff0_2_0)++";
378 fstringCustom+=
"sign(bz)*(eff1_2_0-R.eff1_2_0)++";
379 fstringCustom+=
"sign(bz)*(eff0_2_1-R.eff0_2_1)++";
380 fstringCustom+=
"sign(bz)*(eff1_2_1-R.eff1_2_1)++";
381 fstringCustom+=
"sign(bz)*(eff0_2_2-R.eff0_2_2)++";
382 fstringCustom+=
"sign(bz)*(eff1_2_2-R.eff1_2_2)++";
386 fstring+=fstringCustom;
388 TString *strDelta = TStatToolkit::FitPlane(
chain,
"mdelta:weight", fstring.Data(),
cut+
cutD+
cutCustom,
chi2,
npoints,param,covar,-1,0, npointsMax, kTRUE);
390 chain->SetAlias(
"delta",strDelta->Data());
391 strDelta->Tokenize(
"++")->Print();
403 for (Int_t ipar=0; ipar<5; ipar++){
404 for (Int_t idet=0; idet<5; idet++){
405 Double_t mean0,rms0,mean1,rms1;
406 Int_t entries =
chain->Draw(
"delta-mdelta>>rhis",
cut+Form(
"dtype==%d&&ptype==%d",idet,ipar),
"goff");
407 if (entries==0)
continue;
408 TH1 * his = (TH1*)(
chain->GetHistogram()->Clone());
409 mean1=his->GetMean();
413 entries =
chain->Draw(
"mdelta>>rhis",
cut+Form(
"dtype==%d&&ptype==%d",idet,ipar),
"goff");
414 if (entries==0)
continue;
415 his = (TH1*)(
chain->GetHistogram()->Clone());
417 mean0=his->GetMean();
420 printf(
"ptype==%s\tdtype==%s\tMean=%f -> %f\tRMS=%f -> %f\n",
chParName[ipar],
chDetName[idet], mean0,mean1,rms0,rms1);
433 TCanvas *canvas =
new TCanvas(name,name,800,800);
436 const char * grname[10]={
"A side (B=0.5T)",
"A side (B=-0.5T)",
"C side (B=0.5T)",
"C side (B=-0.5T)",0};
438 TGraph *graphsdyITS[10];
439 TGraph *graphsdyITSc[10];
440 entries=
chain->Draw(
"mdelta:phi",
cut+
"ptype==0&&dtype==0&&bz>0&&theta>0",
"goff");
441 graphsdyITS[0]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
442 entries=
chain->Draw(
"mdelta:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz<0&&theta>0",
"goff");
443 graphsdyITS[1]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
444 entries=
chain->Draw(
"mdelta:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz>0&&theta<0",
"goff");
445 graphsdyITS[2]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
446 entries=
chain->Draw(
"mdelta:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz<0&&theta<0",
"goff");
447 graphsdyITS[3]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
449 entries=
chain->Draw(
"mdelta-delta:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz>0&&theta>0",
"goff");
450 graphsdyITSc[0]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
451 entries=
chain->Draw(
"mdelta-delta:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz<0&&theta>0",
"goff");
452 graphsdyITSc[1]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
453 entries=
chain->Draw(
"mdelta-delta:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz>0&&theta<0",
"goff");
454 graphsdyITSc[2]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
455 entries=
chain->Draw(
"mdelta-delta:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz<0&&theta<0",
"goff");
456 graphsdyITSc[3]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
459 legend =
new TLegend(0.6,0.6,1.0,1.0,
"#Delta R#phi TPC-ITS");
460 for (Int_t i=0; i<4; i++){
461 graphsdyITS[i]->SetMaximum(0.5);
462 graphsdyITS[i]->SetMinimum(-0.5);
463 graphsdyITS[i]->SetMarkerColor(i+1);
464 graphsdyITS[i]->SetMarkerStyle(25+i);
466 graphsdyITS[i]->GetXaxis()->SetTitle(
"#phi");
467 graphsdyITS[i]->GetYaxis()->SetTitle(
"#Delta R#Phi (cm)");
468 if (i==0) graphsdyITS[i]->Draw(
"ap");
469 graphsdyITS[i]->Draw(
"p");
470 legend->AddEntry(graphsdyITS[i],grname[i]);
474 legend =
new TLegend(0.6,0.6,1.0,1.0,
"#Delta R#phi TPC-ITS corrected");
475 for (Int_t i=0; i<4; i++){
476 graphsdyITSc[i]->SetMaximum(0.5);
477 graphsdyITSc[i]->SetMinimum(-0.5);
478 graphsdyITSc[i]->SetMarkerColor(i+1);
479 graphsdyITSc[i]->SetMarkerStyle(25+i);
481 graphsdyITSc[i]->GetXaxis()->SetTitle(
"#phi");
482 graphsdyITSc[i]->GetYaxis()->SetTitle(
"#Delta R#Phi (cm)");
483 if (i==0) graphsdyITS[i]->Draw(
"ap");
484 graphsdyITSc[i]->Draw(
"p");
485 legend->AddEntry(graphsdyITSc[i],grname[i]);
495 TH1::AddDirectory(0);
496 TCut cutLaser=
cut+
"isLaser&&bz<0";
497 TCanvas *canvas=
new TCanvas(cname, cname,800,800);
503 {
for (Int_t icorr=0; icorr<2; icorr++){
504 for (Int_t iside=0; iside<2; iside++){
506 for (Int_t ib=0; ib<4; ib++){
508 if (iside==0) cutB=Form(
"(id==%d&&gz>0)",ib);
509 if (iside==1) cutB=Form(
"(id==%d&&gz<0)",ib);
511 if (icorr==0)
chain->Draw(
"10*mdelta:r",cutLaser+cutB,
"prof");
512 if (icorr==1)
chain->Draw(
"10*(mdelta-delta):r",cutLaser+cutB,
"prof");
513 his[icorr*8+iside*4+ib] = (TH1*)(
chain->GetHistogram()->Clone());
514 his[icorr*8+iside*4+ib]->SetName(Form(
"B%d%d%d",icorr,iside,ib));
515 his[icorr*8+iside*4+ib]->SetTitle(Form(
"Bundle %d",ib));
516 his[icorr*8+iside*4+ib]->SetMarkerColor(ib+1);
517 his[icorr*8+iside*4+ib]->SetMarkerStyle(ib+25);
518 his[icorr*8+iside*4+ib]->SetMarkerSize(0.4);
519 his[icorr*8+iside*4+ib]->SetMaximum(3);
520 his[icorr*8+iside*4+ib]->SetMinimum(-3);
521 his[icorr*8+iside*4+ib]->GetXaxis()->SetTitle(
"r (cm)");
522 his[icorr*8+iside*4+ib]->GetYaxis()->SetTitle(
"#Delta r#phi (mm)");
527 for (Int_t icorr=0; icorr<2; icorr++){
528 for (Int_t iside=0; iside<2; iside++){
529 canvas->cd(icorr*2+iside+1);
530 legend =
new TLegend(0.6,0.6,1.0,1.0,Form(
"#Delta R#phi Laser-%s",
chSideName[iside]));
531 for (Int_t ib=0; ib<4; ib++){
532 if (ib==0) his[icorr*2+iside*4+ib]->Draw();
533 his[icorr*8+iside*4+ib]->Draw(
"same");
534 legend->AddEntry(his[icorr*8+iside*4+ib]);
556 TCanvas *canvas =
new TCanvas(name,name,800,800);
559 const char * grname[10]={
"A side (B=0.5T)",
"A side (B=-0.5T)",
"C side (B=0.5T)",
"C side (B=-0.5T)",0};
561 TGraph *graphsdyVertex[10];
562 TGraph *graphsdyVertexc[10];
563 entries=
chain->Draw(
"mdelta:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz>0&&theta>0",
"goff");
564 graphsdyVertex[0]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
565 entries=
chain->Draw(
"mdelta:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz<0&&theta>0",
"goff");
566 graphsdyVertex[1]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
567 entries=
chain->Draw(
"mdelta:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz>0&&theta<0",
"goff");
568 graphsdyVertex[2]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
569 entries=
chain->Draw(
"mdelta:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz<0&&theta<0",
"goff");
570 graphsdyVertex[3]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
572 entries=
chain->Draw(
"mdelta-delta:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz>0&&theta>0",
"goff");
573 graphsdyVertexc[0]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
574 entries=
chain->Draw(
"mdelta-delta:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz<0&&theta>0",
"goff");
575 graphsdyVertexc[1]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
576 entries=
chain->Draw(
"mdelta-delta:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz>0&&theta<0",
"goff");
577 graphsdyVertexc[2]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
578 entries=
chain->Draw(
"mdelta-delta:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz<0&&theta<0",
"goff");
579 graphsdyVertexc[3]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
582 legend =
new TLegend(0.6,0.6,1.0,1.0,
"#Delta R#phi TPC-Vertex");
583 for (Int_t i=0; i<4; i++){
584 graphsdyVertex[i]->SetMaximum(1);
585 graphsdyVertex[i]->SetMinimum(-1);
586 graphsdyVertex[i]->SetMarkerColor(i+1);
587 graphsdyVertex[i]->SetMarkerStyle(25+i);
589 graphsdyVertex[i]->GetXaxis()->SetTitle(
"#phi");
590 graphsdyVertex[i]->GetYaxis()->SetTitle(
"#Delta R#Phi (cm)");
591 if (i==0) graphsdyVertex[i]->Draw(
"ap");
592 graphsdyVertex[i]->Draw(
"p");
593 legend->AddEntry(graphsdyVertex[i],grname[i]);
597 legend =
new TLegend(0.6,0.6,1.0,1.0,
"#Delta R#phi TPC-Vertex corrected");
598 for (Int_t i=0; i<4; i++){
599 graphsdyVertexc[i]->SetMaximum(1);
600 graphsdyVertexc[i]->SetMinimum(-1);
601 graphsdyVertexc[i]->SetMarkerColor(i+1);
602 graphsdyVertexc[i]->SetMarkerStyle(25+i);
604 graphsdyVertexc[i]->GetXaxis()->SetTitle(
"#phi");
605 graphsdyVertexc[i]->GetYaxis()->SetTitle(
"#Delta R#Phi (cm)");
606 if (i==0) graphsdyVertex[i]->Draw(
"ap");
607 graphsdyVertexc[i]->Draw(
"p");
608 legend->AddEntry(graphsdyVertexc[i],grname[i]);
622 TCanvas *canvas =
new TCanvas(
"Corrections",
"Corrections",800,800);
625 TGraph *graphsITS[10];
626 TGraph *graphsTRD[10];
627 TGraph *graphsVertex[10];
629 const char * grname[10]={
"X twist (1 mrad)",
"Y twist (1 mrad)",
"X shift (1 mm)",
"Y shift (1 mm)",
"drPhi (1 mm)"};
631 entries=
chain->Draw(
"tX1:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz>0",
"goff");
632 graphsITS[0]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
633 entries=
chain->Draw(
"tY1:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz>0",
"goff");
634 graphsITS[1]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
635 entries=
chain->Draw(
"shiftX:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz>0",
"goff");
636 graphsITS[2]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
637 entries=
chain->Draw(
"shiftY:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz>0",
"goff");
638 graphsITS[3]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
639 entries=
chain->Draw(
"drPhiA+drPhiC:phi",
cut+
cut+
"ptype==0&&dtype==0&&bz>0",
"goff");
640 graphsITS[4]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
642 entries=
chain->Draw(
"tX1:phi",
cut+
cut+
"ptype==0&&dtype==1&&bz>0",
"goff");
643 graphsTRD[0]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
644 entries=
chain->Draw(
"tY1:phi",
cut+
cut+
"ptype==0&&dtype==1&&bz>0",
"goff");
645 graphsTRD[1]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
646 entries=
chain->Draw(
"shiftX:phi",
cut+
cut+
"ptype==0&&dtype==1&&bz>0",
"goff");
647 graphsTRD[2]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
648 entries=
chain->Draw(
"shiftY:phi",
cut+
cut+
"ptype==0&&dtype==1&&bz>0",
"goff");
649 graphsTRD[3]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
650 entries=
chain->Draw(
"drPhiA+drPhiC:phi",
cut+
cut+
"ptype==0&&dtype==1&&bz>0",
"goff");
651 graphsTRD[4]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
653 entries=
chain->Draw(
"tX1:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz>0",
"goff");
654 graphsVertex[0]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
655 entries=
chain->Draw(
"tY1:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz>0",
"goff");
656 graphsVertex[1]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
657 entries=
chain->Draw(
"shiftX:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz>0",
"goff");
658 graphsVertex[2]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
659 entries=
chain->Draw(
"shiftY:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz>0",
"goff");
660 graphsVertex[3]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
661 entries=
chain->Draw(
"drPhiA+drPhiC:phi",
cut+
cut+
"ptype==0&&dtype==2&&bz>0",
"goff");
662 graphsVertex[4]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
666 legend =
new TLegend(0.6,0.6,1.0,1.0,
"#Delta R#Phi TPC-Vertex");
667 for (Int_t i=0; i<5; i++){
668 graphsVertex[i]->SetMaximum(0.2);
669 graphsVertex[i]->SetMinimum(-0.2);
670 graphsVertex[i]->SetMarkerColor(i+1);
671 graphsVertex[i]->SetMarkerStyle(25+i);
672 graphsVertex[i]->SetName(grname[i]);
673 graphsVertex[i]->GetXaxis()->SetTitle(
"#phi");
674 graphsVertex[i]->GetYaxis()->SetTitle(
"#DeltaR#Phi (cm)");
675 if (i==0) graphsVertex[i]->Draw(
"ap");
676 graphsVertex[i]->Draw(
"p");
677 legend->AddEntry(graphsITS[i],grname[i]);
682 legend =
new TLegend(0.6,0.6,1.0,1.0,
"#Delta R#Phi ITS-TPC");
683 for (Int_t i=0; i<5; i++){
684 graphsITS[i]->SetMaximum(0.2);
685 graphsITS[i]->SetMinimum(-0.2);
686 graphsITS[i]->SetMarkerColor(i+1);
687 graphsITS[i]->SetMarkerStyle(25+i);
688 graphsITS[i]->SetName(grname[i]);
689 graphsITS[i]->GetXaxis()->SetTitle(
"#phi");
690 graphsITS[i]->GetYaxis()->SetTitle(
"#Delta R#Phi (cm)");
691 if (i==0) graphsITS[i]->Draw(
"ap");
692 graphsITS[i]->Draw(
"p");
693 legend->AddEntry(graphsITS[i],grname[i]);
698 legend =
new TLegend(0.6,0.6,1.0,1.0,
"#Delta R#Phi TPC-TRD");
699 for (Int_t i=0; i<5; i++){
700 graphsTRD[i]->SetMaximum(0.2);
701 graphsTRD[i]->SetMinimum(-0.2);
702 graphsTRD[i]->SetMarkerColor(i+1);
703 graphsTRD[i]->SetMarkerStyle(25+i);
704 graphsTRD[i]->SetName(grname[i]);
705 graphsTRD[i]->GetXaxis()->SetTitle(
"#phi");
706 graphsTRD[i]->GetYaxis()->SetTitle(
"#DeltaR#Phi (cm)");
707 if (i==0) graphsTRD[i]->Draw(
"ap");
708 graphsTRD[i]->Draw(
"p");
709 legend->AddEntry(graphsITS[i],grname[i]);
719 TCanvas *canvas =
new TCanvas(
"Corrections dSnp",
"Corrections dSnp",800,800);
722 TGraph *graphsITS[10];
723 TGraph *graphsTRD[10];
724 TGraph *graphsVertex[10];
726 const char * grname[10]={
"X twist (1 mrad)",
"Y twist (1 mrad)",
"X shift (1 mm)",
"Y shift (1 mm)",0};
728 entries=
chain->Draw(
"1000*tX1:phi",
cut+
cut+
"ptype==2&&dtype==0&&bz>0",
"goff");
729 graphsITS[0]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
730 entries=
chain->Draw(
"1000*tY1:phi",
cut+
cut+
"ptype==2&&dtype==0&&bz>0",
"goff");
731 graphsITS[1]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
732 entries=
chain->Draw(
"1000*shiftX:phi",
cut+
cut+
"ptype==2&&dtype==0&&bz>0",
"goff");
733 graphsITS[2]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
734 entries=
chain->Draw(
"1000*shiftY:phi",
cut+
cut+
"ptype==2&&dtype==0&&bz>0",
"goff");
735 graphsITS[3]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
737 entries=
chain->Draw(
"1000*tX1:phi",
cut+
cut+
"ptype==2&&dtype==1&&bz>0",
"goff");
738 graphsTRD[0]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
739 entries=
chain->Draw(
"1000*tY1:phi",
cut+
cut+
"ptype==2&&dtype==1&&bz>0",
"goff");
740 graphsTRD[1]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
741 entries=
chain->Draw(
"1000*shiftX:phi",
cut+
cut+
"ptype==2&&dtype==1&&bz>0",
"goff");
742 graphsTRD[2]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
743 entries=
chain->Draw(
"1000*shiftY:phi",
cut+
cut+
"ptype==2&&dtype==1&&bz>0",
"goff");
744 graphsTRD[3]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
746 entries=
chain->Draw(
"1000*tX1:phi",
cut+
cut+
"ptype==2&&dtype==2&&bz>0",
"goff");
747 graphsVertex[0]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
748 entries=
chain->Draw(
"1000*tY1:phi",
cut+
cut+
"ptype==2&&dtype==2&&bz>0",
"goff");
749 graphsVertex[1]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
750 entries=
chain->Draw(
"1000*shiftX:phi",
cut+
cut+
"ptype==2&&dtype==2&&bz>0",
"goff");
751 graphsVertex[2]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
752 entries=
chain->Draw(
"1000*shiftY:phi",
cut+
cut+
"ptype==2&&dtype==2&&bz>0",
"goff");
753 graphsVertex[3]=
new TGraph(entries,
chain->GetV2(),
chain->GetV1());
757 legend =
new TLegend(0.6,0.6,1.0,1.0,
"#Delta sin(#phi) TPC-Vertex");
758 for (Int_t i=0; i<4; i++){
759 graphsVertex[i]->SetMaximum(2);
760 graphsVertex[i]->SetMinimum(2);
761 graphsVertex[i]->SetMarkerColor(i+1);
762 graphsVertex[i]->SetMarkerStyle(25+i);
763 graphsVertex[i]->SetName(grname[i]);
764 graphsVertex[i]->GetXaxis()->SetTitle(
"#phi");
765 graphsVertex[i]->GetYaxis()->SetTitle(
"#Deltasin(#phi) (mrad)");
766 if (i==0) graphsVertex[i]->Draw(
"ap");
767 graphsVertex[i]->Draw(
"p");
768 legend->AddEntry(graphsITS[i],grname[i]);
773 legend =
new TLegend(0.6,0.6,1.0,1.0,
"#Delta sin(#phi) ITS-TPC");
774 for (Int_t i=0; i<4; i++){
775 graphsITS[i]->SetMaximum(1);
776 graphsITS[i]->SetMinimum(-1);
777 graphsITS[i]->SetMarkerColor(i+1);
778 graphsITS[i]->SetMarkerStyle(25+i);
779 graphsITS[i]->SetName(grname[i]);
780 graphsITS[i]->GetXaxis()->SetTitle(
"#phi");
781 graphsITS[i]->GetYaxis()->SetTitle(
"#Delta sin(#phi) (mrad)");
782 if (i==0) graphsITS[i]->Draw(
"ap");
783 graphsITS[i]->Draw(
"p");
784 legend->AddEntry(graphsITS[i],grname[i]);
789 legend =
new TLegend(0.6,0.6,1.0,1.0,
"#Delta sin(#phi) TPC-TRD");
790 for (Int_t i=0; i<4; i++){
791 graphsTRD[i]->SetMaximum(1);
792 graphsTRD[i]->SetMinimum(-1);
793 graphsTRD[i]->SetMarkerColor(i+1);
794 graphsTRD[i]->SetMarkerStyle(25+i);
795 graphsTRD[i]->SetName(grname[i]);
796 graphsTRD[i]->GetXaxis()->SetTitle(
"#phi");
797 graphsTRD[i]->GetYaxis()->SetTitle(
"#Deltasin(#phi) (mrad)");
798 if (i==0) graphsTRD[i]->Draw(
"ap");
799 graphsTRD[i]->Draw(
"p");
800 legend->AddEntry(graphsITS[i],grname[i]);
810 TH1::AddDirectory(0);
811 TCanvas *canvas =
new TCanvas(name,name,800,800);
813 for (Int_t idet=0; idet<5; idet++){
814 chain->SetMarkerColor(4);
815 chain->SetMarkerStyle(25);
816 chain->SetMarkerSize(0.3);
817 chain->SetLineColor(2);
819 canvas->cd(idet*3+1);
820 chain->Draw(
"mdelta:delta",
cut+Form(
"ptype==0&&dtype==%d",idet),
"");
822 canvas->cd(idet*3+2);
823 chain->SetLineColor(2);
824 chain->Draw(
"mdelta-delta",
cut+Form(
"ptype==0&&dtype==%d",idet),
"");
825 chain->SetLineColor(1);
826 chain->Draw(
"mdelta",
cut+Form(
"ptype==0&&dtype==%d",idet),
"same");
828 canvas->cd(idet*3+3);
829 chain->SetMarkerColor(1);
830 chain->Draw(
"mdelta:phi",
cut+Form(
"ptype==0&&dtype==%d&&theta>0&&bz>0",idet),
"");
831 chain->SetMarkerColor(2);
832 chain->Draw(
"mdelta-delta:phi",
cut+Form(
"ptype==0&&dtype==%d&&theta>0&&bz>0",idet),
"same");
841 TH1::AddDirectory(0);
842 TCanvas *canvas =
new TCanvas(name,name,800,800);
844 {
for (Int_t idet=0; idet<5; idet++){
845 chain->SetMarkerColor(4);
846 chain->SetMarkerStyle(25);
847 chain->SetMarkerSize(0.3);
848 chain->SetLineColor(2);
850 canvas->cd(idet*3+1);
851 chain->Draw(
"1000*mdelta:1000*delta",
cut+Form(
"ptype==2&&dtype==%d",idet),
"");
853 canvas->cd(idet*3+2);
854 chain->SetLineColor(2);
855 chain->Draw(
"1000*(mdelta-delta)",
cut+Form(
"ptype==2&&dtype==%d",idet),
"");
856 chain->SetLineColor(1);
857 chain->Draw(
"1000*mdelta",
cut+Form(
"ptype==2&&dtype==%d",idet),
"same");
859 canvas->cd(idet*3+3);
860 chain->SetMarkerColor(1);
861 chain->Draw(
"1000*(mdelta):phi",
cut+Form(
"ptype==2&&dtype==%d&&theta>0&&bz>0",idet),
"");
862 chain->SetMarkerColor(2);
863 chain->Draw(
"1000*(mdelta-delta):phi",
cut+Form(
"ptype==2&&dtype==%d&&theta>0&&bz>0",idet),
"same");
875 TString
fit =
chain->GetAlias(
"delta");
877 Int_t nfun=array->GetEntries();
894 TMatrixD polA(100,4);
895 TMatrixD polC(100,4);
896 TMatrixD valA(100,1);
897 TMatrixD valC(100,1);
898 TMatrixD valAS(100,1);
899 TMatrixD valCS(100,1);
906 for (Int_t i=1; i<nfun;i++){
907 TObjString fitName=array->At(i)->GetName();
908 TObjString fitVal= &(fitName.String()[1+fitName.String().Last(
'(')]);
909 Double_t value= fitVal.String().Atof();
910 if (fitName.String().Contains(
"sign"))
continue;
911 if (fitName.String().Contains(
"tX1")){
914 if (fitName.String().Contains(
"tY1")){
918 if (fitName.String().Contains(
"shiftX")&&fitName.String().Contains(
"isITS")){
921 if (fitName.String().Contains(
"shiftY")&&fitName.String().Contains(
"isITS")){
925 if (fitName.String().Contains(
"eff")){
926 Int_t index=fitName.String().First(
"_")-1;
927 Int_t side=atoi(&(fitName.String()[index]));
928 Int_t px =atoi(&(fitName.String()[index+2]));
929 Int_t pd =atoi(&(fitName.String()[index+4]));
937 valA(counterA,0)=value*0.1;
945 valC(counterC,0)=value*0.1;
951 polA.ResizeTo(counterA,4);
952 polC.ResizeTo(counterC,4);
953 valA.ResizeTo(counterA,1);
954 valC.ResizeTo(counterC,1);
966 for (Int_t i=1; i<nfun;i++){
967 TObjString fitName=array->At(i)->GetName();
968 TObjString fitVal= &(fitName.String()[1+fitName.String().Last(
'(')]);
969 if (!fitName.String().Contains(
"sign"))
continue;
970 Double_t value= fitVal.String().Atof();
971 if (fitName.String().Contains(
"tX1")){
974 if (fitName.String().Contains(
"tY1")){
978 if (fitName.String().Contains(
"shiftX")&&fitName.String().Contains(
"isITS")){
981 if (fitName.String().Contains(
"shiftY")&&fitName.String().Contains(
"isITS")){
985 if (fitName.String().Contains(
"eff")){
986 Int_t index=fitName.String().First(
"_")-1;
987 Int_t side=atoi(&(fitName.String()[index]));
988 Int_t px =atoi(&(fitName.String()[index+2]));
989 Int_t pd =atoi(&(fitName.String()[index+4]));
994 polA(counterAS,1)=px;
995 polA(counterAS,2)=pd;
996 polA(counterAS,3)=pp;
997 valAS(counterAS,0)=value*0.1;
1001 polC(counterCS,0)=0;
1002 polC(counterCS,1)=px;
1003 polC(counterCS,2)=pd;
1004 polC(counterCS,3)=pp;
1005 valCS(counterCS,0)=value*0.1;
1011 polA.ResizeTo(counterA,4);
1012 polC.ResizeTo(counterC,4);
1013 valA.ResizeTo(counterA,1);
1014 valC.ResizeTo(counterC,1);
1050 eff0->
SetPolynoms((TMatrixD*)&polA,(TMatrixD*)&polC);
1057 corrP->AddLast(shiftITSP);
1058 corrP->AddLast(twistP);
1059 corrP->AddLast(effP);
1060 corrM->AddLast(shiftITSM);
1061 corrM->AddLast(twistM);
1062 corrM->AddLast(effM);
1063 corr0->AddLast(eff0);
1077 TFile
f(
"correctionsExB.root",
"update");
1080 printf(
"\nDump correction B=+0.5T:\n");
1082 printf(
"\nDump correction B=-0.5T:\n");
1085 comp0->Write(
"ExB-Field0");
1086 compP->Write(
"ExB-Bplus");
1087 compM->Write(
"ExB-Bminus");
1090 TCanvas *c =
new TCanvas(name,name,800,800);
1122 gROOT->Macro(Form(
"ConfigCalibTrain.C(%d)",refRun));
1123 gROOT->LoadMacro(
"AddTaskTPCCalib.C");
1124 gROOT->ProcessLine(Form(
"ConfigOCDB(%d);",refRun));
1127 TFile
f(
"correctionsExB.root");
1136 corrP0->SetName(
"Field0 correction");
1137 corrPP->SetName(
"FieldP correction");
1138 corrPM->SetName(
"FieldM correction");
1139 corrPE0->SetName(
"Field0 correction");
1140 corrPEP->SetName(
"FieldP correction");
1141 corrPEM->SetName(
"FieldM correction");
1154 corrPhysical.AddLast(corrP0); corrPhysical.AddLast(corrPP); corrPhysical.AddLast(corrPM);
1155 corrPhysicalEffective.AddLast(corrPE0); corrPhysicalEffective.AddLast(corrPEP); corrPhysicalEffective.AddLast(corrPEM);
1158 TString userName=gSystem->GetFromPipe(
"echo $USER");
1159 TString date=gSystem->GetFromPipe(
"date");
1160 TString ocdbStorage=
"local:////";
1161 ocdbStorage+=gSystem->GetFromPipe(
"pwd")+
"/OCDB";
1163 AliCDBMetaData *metaData=
new AliCDBMetaData();
1164 metaData->SetObjectClassName(
"TObjArray");
1165 metaData->SetResponsible(
"Marian Ivanov");
1166 metaData->SetBeamPeriod(1);
1167 metaData->SetAliRootVersion(
"05-25-01");
1168 metaData->SetComment(Form(
"Correction calibration. User: %s\n Data%s",userName.Data(),date.Data()));
1170 id1=
new AliCDBId(
"TPC/Calib/Correction", 0, AliCDBRunRange::Infinity());
1171 AliCDBStorage* gStorage = 0;
1173 gStorage=AliCDBManager::Instance()->GetStorage((ocdbStorage+
"Physical").Data());
1174 gStorage->Put(&corrPhysical, (*id1), metaData);
1175 gStorage = AliCDBManager::Instance()->GetStorage((ocdbStorage+
"PhysicalEffective").Data());
1176 gStorage->Put(&corrPhysicalEffective, (*id1), metaData);
static AliTPCcalibDB * Instance()
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
TCanvas * DrawFitdY(const char *name)
TFile * Open(const char *filename, Long64_t &nevents)
void SetPolynoms(const TMatrixD *polA, const TMatrixD *polC)
void MakeOCDBEntry(Int_t refRun)
void SetYShift(Float_t yShift)
Float_t GetXTwist() const
virtual void SetOmegaTauT1T2(Float_t omegaTau, Float_t t1, Float_t t2)
TFile f("CalibObjects.root")
virtual void SetOmegaTauT1T2(Float_t omegaTau, Float_t t1, Float_t t2)
void SetOmegaTauT1T2(Float_t omegaTau, Float_t t1, Float_t t2)
TFile fp("/data/calib/CalibTreePulser_run33834_Cside.root")
virtual void SetOmegaTauT1T2(Float_t omegaTau, Float_t t1, Float_t t2)
TH2F * CreateHistoDRPhiinXY(Float_t z=10., Int_t nx=100, Int_t nphi=100)
Correct for the rest of ExB effect which are not covered by physical models.
const char * chSideName[2]
Float_t GetXShift() const
void MakeFit(TCut cutCustom)
TH2F * CreateHistoDRPhiinZR(Float_t phi=0., Int_t nZ=100, Int_t nR=100)
const char * chParName[5]
void SetYTwist(Float_t yTwist)
AliTPCComposedCorrection class.
Float_t GetYTwist() const
void SetXTwist(Float_t xTwist)
void SetCorrections(const TCollection *corrections)
const char * chDetName[5]
TCollection * GetCorrections() const
AliTPCCorrection * GetTPCComposedCorrection() const
Float_t GetYShift() const
TCanvas * DrawFitVertex(const char *name)
TCanvas * DrawFitITS(const char *name)
void SetXShift(Float_t xShift)
TCanvas * DrawFitdSnp(const char *name)
TCanvas * MakeComposedCorrection(const char *name)
TCanvas * DrawFitLaser(const char *cname)
void SetCoeficients(const TMatrixD *valA, const TMatrixD *valC)
virtual void Print(Option_t *option="") const
TMatrixD * MakeCorrelation(TMatrixD &matrix)