45 #if !defined(__CINT__) || defined(__MAKECINT__) 46 #include "THnSparse.h" 55 #include "TProfile3D.h" 63 #include "AliTPCcalibTime.h" 71 #include "TPostScript.h" 87 TCanvas *
DrawDistortionMaps(TTree * treedy, TTree * treedsnp, TTree* treed1Pt,
const char * name,
const char *title);
97 gSystem->AddIncludePath(
"-I$ALICE_ROOT/STAT");
98 gSystem->Load(
"libANALYSIS");
99 gSystem->Load(
"libTPCcalib");
108 TFile
f(
"TPCTimeObjects.root");
109 AliTPCcalibTime *
calibTime= (AliTPCcalibTime*)f.Get(
"calibTime");
111 TFile* f2 =
new TFile(
"CalibObjects.root");
112 calibTime= (AliTPCcalibTime*)f2->Get(
"calibTime");
114 TFile* f3 =
new TFile(
"../CalibObjects.root");
115 calibTime= (AliTPCcalibTime*)f3->Get(
"calibTime");
121 const char * hname[5]={
"dy",
"dz",
"dsnp",
"dtheta",
"d1pt"};
123 for (Int_t ihis=0; ihis<5;ihis++){
124 his = calibTime->GetResHistoTPCITS(ihis);
125 his->GetAxis(1)->SetRangeUser(-1.1,1.1);
126 his->GetAxis(2)->SetRange(0,1000000);
127 his->GetAxis(3)->SetRangeUser(-0.5,0.5);
130 his = calibTime->GetResHistoTPCvertex(ihis);
131 his->GetAxis(1)->SetRangeUser(-1.1,1.1);
132 his->GetAxis(2)->SetRange(0,1000000);
133 his->GetAxis(3)->SetRangeUser(-0.5,0.5);
136 his = calibTime->GetResHistoTPCTRD(ihis);
137 his->GetAxis(1)->SetRangeUser(-1.1,1.1);
138 his->GetAxis(2)->SetRange(0,1000000);
139 his->GetAxis(3)->SetRangeUser(-0.5,0.5);
141 his = calibTime->GetResHistoTPCTOF(ihis);
143 his->GetAxis(1)->SetRangeUser(-1.1,1.1);
144 his->GetAxis(2)->SetRange(0,1000000);
145 his->GetAxis(3)->SetRangeUser(-0.5,0.5);
151 gSystem->Exec(
"echo `pwd`/mean.root > distort.txt");
160 TCut
cut=
"entries>50&&rms>0";
163 TVectorD vecA[100],vecC[100], vecStatA[100],vecStatC[100];
166 TChain *chainITSdy = tool.
MakeChain(
"distort.txt",
"ITSdy",0,100000);
167 TChain *chainITSdsnp = tool.
MakeChain(
"distort.txt",
"ITSdsnp",0,100000);
168 TChain *chainTRDdy = tool.
MakeChain(
"distort.txt",
"TRDdy",0,100000);
169 TChain *chainTRDdsnp = tool.
MakeChain(
"distort.txt",
"TRDdsnp",0,100000);
170 TChain *chainVertexdy = tool.
MakeChain(
"distort.txt",
"Vertexdy",0,100000);
171 TChain *chainVertexdsnp = tool.
MakeChain(
"distort.txt",
"Vertexdsnp",0,100000);
173 (*pcstream)<<
"fits"<<
"run="<<run;
175 FitLookup(chainITSdy,
"yits-tpc",vecA[0],vecC[0],vecStatA[0],vecStatC[0],cut, picArray);
176 (*pcstream)<<
"fits"<<
"itsdyA.="<<&vecA[0]<<
"itsdyC.="<<&vecC[0];
177 (*pcstream)<<
"fits"<<
"itsdyAS.="<<&vecStatA[0]<<
"itsdyCS.="<<&vecStatC[0];
178 FitLookup(chainITSdsnp,
"snpits-tpc",vecA[1],vecC[1],vecStatA[1],vecStatC[1],cut, picArray);
179 (*pcstream)<<
"fits"<<
"itsdsnpA.="<<&vecA[1]<<
"itsdsnpC.="<<&vecC[1];
180 (*pcstream)<<
"fits"<<
"itsdsnpAS.="<<&vecStatA[1]<<
"itsdsnpCS.="<<&vecStatC[1];
182 FitLookup(chainTRDdy,
"ytrd-tpc",vecA[5],vecC[5],vecStatA[5],vecStatC[5],cut, picArray);
183 (*pcstream)<<
"fits"<<
"trddyA.="<<&vecA[5]<<
"trddyC="<<&vecC[5];
184 (*pcstream)<<
"fits"<<
"trddyAS.="<<&vecStatA[5]<<
"trddyCS.="<<&vecStatC[5];
185 FitLookup(chainTRDdsnp,
"snptrd-tpc",vecA[6],vecC[6],vecStatA[6],vecStatC[6],cut, picArray);
186 (*pcstream)<<
"fits"<<
"trddsnpA.="<<&vecA[6]<<
"trddsnpC.="<<&vecC[6];
187 (*pcstream)<<
"fits"<<
"trddsnpAS.="<<&vecStatA[6]<<
"trddsnpCS.="<<&vecStatC[6];
189 FitLookup(chainVertexdy,
"yvertex-tpc",vecA[10],vecC[10],vecStatA[10],vecStatC[10],cut, picArray);
190 (*pcstream)<<
"fits"<<
"vertexdyA.="<<&vecA[10]<<
"vertexdyC.="<<&vecC[10];
191 (*pcstream)<<
"fits"<<
"vertexdyAS.="<<&vecStatA[10]<<
"vertexdyCS.="<<&vecStatC[10];
192 FitLookup(chainVertexdsnp,
"snpvertex-tpc",vecA[11],vecC[11],vecStatA[11],vecStatC[11],cut, picArray);
193 (*pcstream)<<
"fits"<<
"vertexdsnpA.="<<&vecA[11]<<
"vertexdsnpC.="<<&vecC[11];
194 (*pcstream)<<
"fits"<<
"vertexdsnpAS.="<<&vecStatA[11]<<
"vertexdsnpCS.="<<&vecStatC[11];
196 (*pcstream)<<
"fits"<<
"\n";
199 for (Int_t i=0;i<picArray->GetEntries(); i++){
200 TObject * obj = picArray->At(i);
201 if (obj) obj->Write(obj->GetName());
206 chainITSdy->AddFriend(chainITSdy,
"ITSdy");
207 chainITSdy->AddFriend(chainITSdsnp,
"ITSdsnp");
208 chainITSdy->AddFriend(chainTRDdy,
"TRDdy");
209 chainITSdy->AddFriend(chainTRDdsnp,
"TRDdsnp");
210 chainITSdy->AddFriend(chainVertexdy,
"Vertexdy");
211 chainITSdy->AddFriend(chainVertexdsnp,
"Vertexdsnp");
212 TTree *
tree = chainITSdy->CloneTree();
213 tree->Write(
"distortionTree");
227 vecStatA.ResizeTo(6);
228 vecStatC.ResizeTo(6);
231 Int_t npointsMax=30000000;
245 fstring+=
"(cos(phi))++";
246 fstring+=
"(sin(phi))++";
248 fstring+=
"(theta)++";
249 fstring+=
"(theta*cos(phi))++";
250 fstring+=
"(theta*sin(phi))++";
253 fstring+=
"(snp*cos(phi))++";
254 fstring+=
"(snp*sin(phi))++";
257 strFitYA =
TStatToolkit::FitPlane(chainIn,
"mean", fstring.Data(),cut+
"theta>0",
chi2A,npointsA,paramA,covar,-1,0, npointsMax, kFALSE);
258 strFitYC =
TStatToolkit::FitPlane(chainIn,
"mean", fstring.Data(),cut+
"theta<0", chi2C,npointsC,paramC,covar,-1,0, npointsMax,kFALSE);
259 strFitYA->Tokenize(
"++")->Print();
260 strFitYC->Tokenize(
"++")->Print();
261 chainIn->SetAlias(
"dyA",strFitYA->Data());
262 chainIn->SetAlias(
"dyC",strFitYC->Data());
265 vecA.ResizeTo(paramA.GetNrows());
266 vecC.ResizeTo(paramC.GetNrows());
270 vecStatA[0]=npointsA;
271 vecStatA[1]=TMath::Sqrt(chi2A/npointsA);
272 chainIn->Draw(
"mean",cut+
"theta>0");
273 his=chainIn->GetHistogram();
274 his->SetName(Form(
"Orig #Delta%sA",prefix));
275 his->SetTitle(Form(
"Orig #Delta%sA",prefix));
276 picArray->AddLast(his->Clone());
277 vecStatA[2] = his->GetMean();
278 vecStatA[3] = his->GetRMS();
279 chainIn->Draw(
"mean-dyA",cut+
"theta>0");
280 his=chainIn->GetHistogram();
281 his->SetName(Form(
"Corr. #Delta%sA",prefix));
282 his->SetTitle(Form(
"Corr. #Delta%sA",prefix));
283 picArray->AddLast(his->Clone());
284 vecStatA[4] = his->GetMean();
285 vecStatA[5] = his->GetRMS();
288 vecStatC[0]=npointsC;
289 vecStatC[1]=TMath::Sqrt(chi2C/npointsC);
290 chainIn->Draw(
"mean",cut+
"theta<0");
291 his=chainIn->GetHistogram();
292 his->SetName(Form(
"Orig #Delta%sC",prefix));
293 his->SetTitle(Form(
"Orig #Delta%sC",prefix));
294 picArray->AddLast(his->Clone());
295 vecStatC[2] = his->GetMean();
296 vecStatC[3] = his->GetRMS();
297 chainIn->Draw(
"mean-dyC",cut+
"theta<0");
298 his=chainIn->GetHistogram();
299 his->SetName(Form(
"Corr. #Delta%sC",prefix));
300 his->SetTitle(Form(
"Corr. #Delta%sC",prefix));
301 picArray->AddLast(his->Clone());
302 vecStatC[4] = his->GetMean();
303 vecStatC[5] = his->GetRMS();
314 TFile fplus(
"meanBplus.root");
315 TFile fminus(
"meanBminus.root");
316 TTree * titsDyPlus= (TTree*)fplus.Get(
"ITSdy");
317 TTree * titsDyMinus= (TTree*)fminus.Get(
"ITSdy");
318 TTree * ttrdDyPlus= (TTree*)fplus.Get(
"TRDdy");
319 TTree * ttrdDyMinus= (TTree*)fminus.Get(
"TRDdy");
321 TTree * titsDsnpPlus= (TTree*)fplus.Get(
"ITSdsnp");
322 TTree * titsDsnpMinus= (TTree*)fminus.Get(
"ITSdsnp");
323 TTree * ttrdDsnpPlus= (TTree*)fplus.Get(
"TRDdsnp");
324 TTree * ttrdDsnpMinus= (TTree*)fminus.Get(
"TRDdsnp");
325 TTree * titsDthetaPlus= (TTree*)fplus.Get(
"ITSdtheta");
326 TTree * titsDthetaMinus= (TTree*)fminus.Get(
"ITSdtheta");
327 TTree * ttrdDthetaPlus= (TTree*)fplus.Get(
"TRDdtheta");
328 TTree * ttrdDthetaMinus= (TTree*)fminus.Get(
"TRDdtheta");
329 TCut
cut=
"rms>0&&entries>100&&abs(theta)<1&&abs(snp)<0.3";
332 titsDyPlus->AddFriend(titsDyMinus,
"TM.");
333 titsDyPlus->AddFriend(titsDsnpMinus,
"Tsnp.");
334 titsDyPlus->AddFriend(titsDthetaMinus,
"Ttheta.");
335 ttrdDyPlus->AddFriend(ttrdDyMinus,
"TM.");
336 titsDsnpPlus->AddFriend(titsDsnpMinus,
"TM.");
337 ttrdDsnpPlus->AddFriend(ttrdDsnpMinus,
"TM.");
343 TGraph * graphITSYC[3];
344 TGraph * graphITSYA[3];
345 TGraph * graphTRDYC[3];
346 TGraph * graphTRDYA[3];
349 entries=titsDyPlus->Draw(
"mean-TM..mean:phi",cut+
"theta<-0.1",
"goff");
350 graphITSYC[0] =
new TGraph(entries, titsDyPlus->GetV2(),titsDyPlus->GetV1());
351 titsDyMinus->Draw(
"mean:phi",cut+
"theta<-0.1",
"goff");
352 graphITSYC[2] =
new TGraph(entries, titsDyMinus->GetV2(),titsDyMinus->GetV1());
353 titsDyPlus->Draw(
"mean:phi",cut+
"theta<-0.1",
"goff");
354 graphITSYC[1] =
new TGraph(entries, titsDyPlus->GetV2(),titsDyPlus->GetV1());
356 entries=titsDyPlus->Draw(
"mean-TM..mean:phi",cut+
"theta>0.1",
"goff");
357 graphITSYA[0] =
new TGraph(entries, titsDyPlus->GetV2(),titsDyPlus->GetV1());
358 titsDyMinus->Draw(
"mean:phi",cut+
"theta>0.1",
"goff");
359 graphITSYA[2] =
new TGraph(entries, titsDyMinus->GetV2(),titsDyMinus->GetV1());
360 titsDyPlus->Draw(
"mean:phi",cut+
"theta>0.1",
"goff");
361 graphITSYA[1] =
new TGraph(entries, titsDyPlus->GetV2(),titsDyPlus->GetV1());
363 entries=ttrdDyPlus->Draw(
"mean-TM..mean:phi",cut+
"theta<-0.1&&TM..entries>100",
"goff");
364 graphTRDYC[0] =
new TGraph(entries, ttrdDyPlus->GetV2(),ttrdDyPlus->GetV1());
365 ttrdDyMinus->Draw(
"mean:phi",cut+
"theta<-0.1",
"goff");
366 graphTRDYC[2] =
new TGraph(entries, ttrdDyMinus->GetV2(),ttrdDyMinus->GetV1());
367 ttrdDyPlus->Draw(
"mean:phi",cut+
"theta<-0.1",
"goff");
368 graphTRDYC[1] =
new TGraph(entries, ttrdDyPlus->GetV2(),ttrdDyPlus->GetV1());
370 entries=ttrdDyPlus->Draw(
"mean-TM..mean:phi",cut+
"theta>0.1&&TM..entries>100",
"goff");
371 graphTRDYA[0] =
new TGraph(entries, ttrdDyPlus->GetV2(),ttrdDyPlus->GetV1());
372 ttrdDyMinus->Draw(
"mean:phi",cut+
"theta>0.1",
"goff");
373 graphTRDYA[2] =
new TGraph(entries, ttrdDyMinus->GetV2(),ttrdDyMinus->GetV1());
374 ttrdDyPlus->Draw(
"mean:phi",cut+
"theta>0.1",
"goff");
375 graphTRDYA[1] =
new TGraph(entries, ttrdDyPlus->GetV2(),ttrdDyPlus->GetV1());
380 {
for (Int_t i=0; i<3; i++){
381 graphITSYC[i]->SetMaximum(ymax+0.2); graphITSYC[i]->SetMinimum(ymin);
382 graphITSYC[i]->GetXaxis()->SetTitle(
"#phi"); graphITSYC[i]->GetYaxis()->SetTitle(
"#Delta r#phi (cm)");
383 graphITSYC[i]->SetMarkerColor(i+1); graphITSYC[i]->SetMarkerStyle(20+i);
384 graphITSYA[i]->SetMaximum(ymax+0.2); graphITSYA[i]->SetMinimum(ymin);
385 graphITSYA[i]->GetXaxis()->SetTitle(
"#phi"); graphITSYA[i]->GetYaxis()->SetTitle(
"#Delta r#phi (cm)");
386 graphITSYA[i]->SetMarkerColor(i+1); graphITSYA[i]->SetMarkerStyle(20+i);
387 graphTRDYC[i]->SetMaximum(ymax+0.2); graphTRDYC[i]->SetMinimum(ymin);
388 graphTRDYC[i]->GetXaxis()->SetTitle(
"#phi"); graphTRDYC[i]->GetYaxis()->SetTitle(
"#Delta r#phi (cm)");
389 graphTRDYC[i]->SetMarkerColor(i+1); graphTRDYC[i]->SetMarkerStyle(20+i);
390 graphTRDYA[i]->SetMaximum(ymax+0.2); graphTRDYA[i]->SetMinimum(ymin);
391 graphTRDYA[i]->GetXaxis()->SetTitle(
"#phi"); graphTRDYA[i]->GetYaxis()->SetTitle(
"#Delta r#phi (cm)");
392 graphTRDYA[i]->SetMarkerColor(i+1); graphTRDYA[i]->SetMarkerStyle(20+i);
396 TString cname=
"cdeltaY";
397 TString dirName=gSystem->GetFromPipe(
"dirname `pwd` | xargs basename ");
398 TString splus=gSystem->GetFromPipe(
"ls -al meanBplus.root | gawk '{print \"File: \"$8\" \"$6\" \"$7\" \";}'");
399 TString sminus=gSystem->GetFromPipe(
"ls -al meanBminus.root | gawk '{print \"File: \"$8\" \"$6\" \"$7\" \";}'");
401 TCanvas *cdeltaY =
new TCanvas(
"cdeltaY",
"cdeltaY",1300,800);
402 cdeltaY->Divide(2,2);
405 graphITSYC[0]->Draw(
"ap");
406 graphITSYC[1]->Draw(
"p");
407 graphITSYC[2]->Draw(
"p");
408 legend =
new TLegend(0.6,0.6,1.0,1.0,
"ITS-TPC C side #Delta r-#phi");
409 legend->AddEntry(
"",dirName.Data());
410 legend->AddEntry(
"",splus.Data());
411 legend->AddEntry(
"",sminus.Data());
412 legend->AddEntry(graphITSYC[0],
"B_{plus}-B_{minus}");
413 legend->AddEntry(graphITSYC[1],
"B_{plus}");
414 legend->AddEntry(graphITSYC[2],
"B_{minus}");
418 graphITSYA[0]->Draw(
"ap");
419 graphITSYA[1]->Draw(
"p");
420 graphITSYA[2]->Draw(
"p");
421 legend =
new TLegend(0.6,0.6,1.0,1.0,
"ITS-TPC A side #Delta r-#phi");
422 legend->AddEntry(graphITSYA[0],
"B_{plus}-B_{minus}");
423 legend->AddEntry(graphITSYA[1],
"B_{plus}");
424 legend->AddEntry(graphITSYA[2],
"B_{minus}");
429 graphTRDYC[0]->Draw(
"ap");
430 graphTRDYC[1]->Draw(
"p");
431 graphTRDYC[2]->Draw(
"p");
432 legend =
new TLegend(0.6,0.6,1.0,1.0,
"TRD-TPC C side #Delta r-#phi");
433 legend->AddEntry(graphTRDYC[0],
"B_{plus}-B_{minus}");
434 legend->AddEntry(graphTRDYC[1],
"B_{plus}");
435 legend->AddEntry(graphTRDYC[2],
"B_{minus}");
439 graphTRDYA[0]->Draw(
"ap");
440 graphTRDYA[1]->Draw(
"p");
441 graphTRDYA[2]->Draw(
"p");
442 legend =
new TLegend(0.6,0.6,1.0,1.0,
"TRD-TPC A side #Delta r-#phi");
443 legend->AddEntry(graphTRDYA[0],
"B_{plus}-B_{minus}");
444 legend->AddEntry(graphTRDYA[1],
"B_{plus}");
445 legend->AddEntry(graphTRDYA[2],
"B_{minus}");
447 cdeltaY->SaveAs(dirName+
"_deltaY.pdf");
464 const Int_t kskip=23;
466 TFile
f(
"mean.root");
468 tree = (TTree*)f.Get(
"ITSdy");
471 tree = (TTree*)f.Get(
"TRDdy");
474 tree = (TTree*)f.Get(
"Vertexdy");
477 tree = (TTree*)f.Get(
"TOFdy");
482 tree = (TTree*)f.Get(
"ITSdsnp");
485 tree = (TTree*)f.Get(
"TRDdsnp");
488 tree = (TTree*)f.Get(
"Vertexdsnp");
493 tree = (TTree*)f.Get(
"ITSd1pt");
497 tree = (TTree*)f.Get(
"TOFdz");
502 tree = (TTree*)f.Get(
"ITSdz");
505 tree = (TTree*)f.Get(
"Vertexdz");
510 tree = (TTree*)f.Get(
"ITSdtheta");
514 tree = (TTree*)f.Get(
"Vertexdtheta");
527 TCut
cutS=
"rms>0&&entries>100";
528 TCut
cut=cutS+
"(ptype==0||ptype==2||ptype==3||(ptype==4&&dtype==0))";
529 Int_t npointsMax=30000000;
535 chain->SetAlias(
"side",
"(1+(theta>0)*2)");
540 fstring+=
"ExBCon*cos(phi)++";
541 fstring+=
"ExBCon*sin(phi)++";
543 fstring+=
"ggA*cos(phi)++";
544 fstring+=
"ggA*sin(phi)++";
546 fstring+=
"ggC*cos(phi)++";
547 fstring+=
"ggC*sin(phi)++";
548 fstring+=
"(ptype==2)++";
549 fstring+=
"(ptype==3)++";
550 fstring+=
"(ptype==4)++";
551 fstring+=
"(ptype==4)*bz++";
553 TString *strDelta =
TStatToolkit::FitPlane(chain,
"mean:rms", fstring.Data(),cut+
"(Entry$%13==0)",
chi2,
npoints,param,covar,-1,0, npointsMax, kTRUE);
554 chain->SetAlias(
"delta",strDelta->Data());
555 strDelta->Tokenize(
"++")->Print();
567 TChain *chainPlus = tool.
MakeChain(
"distortionPlus.txt",
"fit",0,100000);
568 TChain *chainMinus = tool.
MakeChain(
"distortionMinus.txt",
"fit",0,100000);
569 TChain *
chain0 = tool.
MakeChain(
"distortionField0.txt",
"fit",0,100000);
571 chainPlus->AddFriend(chainMinus,
"M");
572 chainPlus->AddFriend(chain0,
"F0");
574 TCut
cut=
"rms>0&&M.rms>0&&entries>100&&dtype==0&&(ptype==0||ptype==2||ptype==4)";
575 chainPlus->SetAlias(
"deltaM",
"mean-M.mean");
576 Int_t npointsMax=30000000;
584 fstring+=
"(ptype==0)*cos(phi)++";
585 fstring+=
"(ptype==0)*sin(phi)++";
587 fstring+=
"(tX1-M.tX1)++";
588 fstring+=
"(tY1-M.tY1)++";
590 fstring+=
"(ExBConA-M.ExBConA)++";
591 fstring+=
"(ExBConC-M.ExBConC)++";
593 fstring+=
"(ggA-M.ggA)++";
594 fstring+=
"(ggC-M.ggC)++";
596 if (highFrequency) {
for (Int_t i=1; i<highFrequency; i++){
597 fstring+=Form(
"((ggA-M.ggA)*cos(%d*phi))++",i);
598 fstring+=Form(
"((ggA-M.ggA)*sin(%d*phi))++",i);
600 fstring+=Form(
"((ggC-M.ggC)*cos(%d*phi))++",i);
601 fstring+=Form(
"((ggC-M.ggC)*sin(%d*phi))++",i);
603 fstring+=Form(
"((ExBConA-M.ExBConA)*cos(%d*phi))++",i);
604 fstring+=Form(
"((ExBConA-M.ExBConA)*sin(%d*phi))++",i);
605 fstring+=Form(
"((ExBConC-M.ExBConC)*cos(%d*phi))++",i);
606 fstring+=Form(
"((ExBConC-M.ExBConC)*sin(%d*phi))++",i);
610 TString *strDelta =
TStatToolkit::FitPlane(chainPlus,
"deltaM:rms", fstring.Data(),cut+
"(Entry$%7==0)",
chi2,
npoints,param,covar,-1,0, npointsMax, kTRUE);
611 chainPlus->SetAlias(
"delta",strDelta->Data());
612 TObjArray *fitArray = strDelta->Tokenize(
"++");
618 TH1::AddDirectory(0);
619 TLatex *lfit=
new TLatex;
622 TCanvas * canvasdY=
new TCanvas(Form(
"deltaY%d",highFrequency),Form(
"deltaY%d",highFrequency),1200,800);
623 TCanvas * canvasdSnp=
new TCanvas(Form(
"deltaSnp%d",highFrequency),Form(
"deltaSnp%d",highFrequency),1200,800);
624 TCanvas * canvasd1pt=
new TCanvas(Form(
"delta1pt%d",highFrequency),Form(
"delta1pt%d",highFrequency),1200,800);
626 canvasdY->Divide(3,2);
627 chainPlus->SetMarkerStyle(25);
628 chainPlus->SetMarkerSize(0.5);
629 chainPlus->SetMarkerColor(1);
631 chainPlus->Draw(
"deltaM:delta",cut+
"theta>0&&abs(snp)<0.2&&ptype==0",
"");
633 chainPlus->SetMarkerColor(1);
634 chainPlus->Draw(
"deltaM-delta>>deltaCorr(50,-0.4,0.4)",cut+
"theta>0&&abs(snp)<0.2&&ptype==0",
"err");
635 chainPlus->SetMarkerColor(3);
636 chainPlus->Draw(
"deltaM",cut+
"theta>0&&abs(snp)<0.2&&ptype==0",
"errsame");
638 chainPlus->SetMarkerColor(1);
639 chainPlus->Draw(
"deltaM:phi",cut+
"theta>0&&abs(snp)<0.2&&ptype==0",
"");
640 chainPlus->SetMarkerColor(2);
641 chainPlus->Draw(
"deltaM-delta:phi",cut+
"theta>0&&abs(snp)<0.2&&ptype==0",
"same");
643 chainPlus->SetMarkerStyle(26);
644 chainPlus->SetMarkerColor(1);
645 chainPlus->Draw(
"deltaM:phi",cut+
"theta<0&&abs(snp)<0.2&&ptype==0",
"");
646 chainPlus->SetMarkerColor(4);
647 chainPlus->Draw(
"deltaM-delta:phi",cut+
"theta<0&&abs(snp)<0.2&&ptype==0",
"same");
651 canvasdSnp->Divide(3,2);
652 chainPlus->SetMarkerStyle(25);
653 chainPlus->SetMarkerSize(0.5);
654 chainPlus->SetMarkerColor(1);
656 chainPlus->Draw(
"1000*deltaM:1000*delta",cut+
"theta>0&&abs(snp)<0.2&&ptype==2",
"");
658 chainPlus->SetMarkerColor(1);
659 chainPlus->Draw(
"1000*(deltaM-delta)>>deltaCorr(50,-4.,4)",cut+
"theta>0&&abs(snp)<0.2&&ptype==2",
"err");
660 chainPlus->SetMarkerColor(3);
661 chainPlus->Draw(
"1000*deltaM",cut+
"theta>0&&abs(snp)<0.2&&ptype==2",
"errsame");
663 chainPlus->SetMarkerColor(1);
664 chainPlus->Draw(
"1000*(deltaM):phi",cut+
"theta>0&&abs(snp)<0.2&&ptype==2",
"");
665 chainPlus->SetMarkerColor(2);
666 chainPlus->Draw(
"1000*(deltaM-delta):phi",cut+
"theta>0&&abs(snp)<0.2&&ptype==2",
"same");
668 chainPlus->SetMarkerStyle(26);
669 chainPlus->SetMarkerColor(1);
670 chainPlus->Draw(
"1000*(deltaM):phi",cut+
"theta<0&&abs(snp)<0.2&&ptype==2",
"");
671 chainPlus->SetMarkerColor(4);
672 chainPlus->Draw(
"1000*(deltaM-delta):phi",cut+
"theta<0&&abs(snp)<0.2&&ptype==2",
"same");
676 canvasd1pt->Divide(3,2);
677 chainPlus->SetMarkerStyle(25);
678 chainPlus->SetMarkerSize(0.5);
679 chainPlus->SetMarkerColor(1);
681 chainPlus->Draw(
"deltaM:delta",cut+
"theta>0&&abs(snp)<0.2&&ptype==4",
"");
683 chainPlus->SetMarkerColor(1);
684 chainPlus->Draw(
"deltaM-delta>>deltaCorr(50,-0.15,0.15)",cut+
"theta>0&&abs(snp)<0.2&&ptype==4",
"err");
685 chainPlus->GetHistogram()->Fit(
"gaus");
686 chainPlus->SetMarkerColor(3);
687 chainPlus->Draw(
"deltaM",cut+
"theta>0&&abs(snp)<0.2&&ptype==4",
"errsame");
689 chainPlus->SetMarkerColor(1);
690 chainPlus->Draw(
"deltaM:phi",cut+
"theta>0&&abs(snp)<0.2&&ptype==4",
"");
691 chainPlus->SetMarkerColor(2);
692 chainPlus->Draw(
"deltaM-delta:phi",cut+
"theta>0&&abs(snp)<0.2&&ptype==4",
"same");
694 chainPlus->SetMarkerStyle(26);
695 chainPlus->SetMarkerColor(1);
696 chainPlus->Draw(
"deltaM:phi",cut+
"theta<0&&abs(snp)<0.2&&ptype==4",
"");
697 chainPlus->SetMarkerColor(4);
698 chainPlus->Draw(
"deltaM-delta:phi",cut+
"theta<0&&abs(snp)<0.2&&ptype==4",
"same");
700 {
for (Int_t ipad=0; ipad<3;ipad++){
701 if (ipad==0) canvasdY->cd(5);
702 if (ipad==1) canvasdSnp->cd(5);
703 if (ipad==2) canvasd1pt->cd(5);
704 lfit->SetTextAlign(12); lfit->SetTextSize(0.04);
705 {
for (Int_t i=1; i<fitArray->GetEntries(); i++){
706 lfit->DrawLatex(0.1,1-i/9.,fitArray->At(i)->GetName());
708 if (ipad==0) canvasdY->cd(4);
709 if (ipad==1) canvasdSnp->cd(4);
710 if (ipad==2) canvasd1pt->cd(4);
711 lfit->DrawLatex(0.1,0.9,
"Global fit - TPC ITS matching in r-#phi");
712 lfit->DrawLatex(0.1,0.8,
"Residual minimization:");
713 lfit->DrawLatex(0.1,0.7,
"r#phi_{0.5T}-r#phi_{-0.5T} (cm)");
714 lfit->DrawLatex(0.1,0.6,
"sin(r#phi)_{0.5T}-sin(r#phi)_{-0.5T} (mrad)");
715 lfit->DrawLatex(0.1,0.5,
"1/pt_{0.5T}-1/pt_{-0.5T} (1/GeV)");
719 TFile *fpic =
new TFile(Form(
"fitPictures%d.root",highFrequency),
"update");
724 canvasd1pt->SaveAs(Form(
"fitd1pt%d.pdf",highFrequency));
725 canvasdY->SaveAs(Form(
"fitdy%d.pdf",highFrequency));
726 canvasdSnp->SaveAs(Form(
"fitdsnp%d.pdf",highFrequency));
732 TTree *ITSdy=(TTree*)f.Get(
"ITSdy");
733 TTree *ITSdsnp=(TTree*)f.Get(
"ITSdsnp");
734 TTree *ITSd1pt=(TTree*)f.Get(
"ITSd1pt");
735 TTree *TRDdy=(TTree*)f.Get(
"TRDdy");
736 TTree *TRDdsnp=(TTree*)f.Get(
"TRDdsnp");
737 TTree *TRDd1pt=(TTree*)f.Get(
"TRDd1pt");
738 TTree *Vertexdy=(TTree*)f.Get(
"Vertexdy");
739 TTree *Vertexdsnp=(TTree*)f.Get(
"Vertexdsnp");
740 TTree *Vertexd1pt=(TTree*)f.Get(
"Vertexd1pt");
742 cits->SaveAs(
"matchingITS.pdf");
744 ctrd->SaveAs(
"matchingTRD.pdf");
745 TCanvas *cvertex =
DrawDistortionMaps(Vertexdy,Vertexdsnp,Vertexd1pt,
"Vertex",
"Vertex");
746 cvertex->SaveAs(
"matchingVertex.pdf");
749 TPostScript *ps =
new TPostScript(
"matching.ps", 112);
763 TCanvas *
DrawDistortionMaps(TTree * treedy, TTree * treedsnp, TTree* treed1pt,
const char * name,
const char *title){
766 TH1::AddDirectory(0);
767 TCanvas *cdist =
new TCanvas(name,name,1200,800);
773 treedy->Draw(
"10*mean",
"rms>0&&abs(snp)<0.25&&entries>100",
"");
774 his = (TH1*)treedy->GetHistogram()->Clone();
775 his->SetName(
"dY"); his->SetXTitle(
"#Delta_{r#phi} (cm)");
779 treedsnp->Draw(
"1000*mean",
"rms>0&&abs(snp)<0.25&&entries>200",
"");
780 his = (TH1*)treedsnp->GetHistogram()->Clone();
781 his->SetName(
"dsnp"); his->SetXTitle(
"#Delta_{sin(#phi)}");
785 treed1pt->Draw(
"mean",
"rms>0&&abs(snp)<0.15&&entries>400",
"");
786 his = (TH1*)treed1pt->GetHistogram()->Clone();
787 his->SetName(
"d1pt"); his->SetXTitle(
"#Delta_{1/pt} (1/GeV)");
790 treedy->SetMarkerSize(1);
791 treedsnp->SetMarkerSize(1);
792 treed1pt->SetMarkerSize(1);
793 {
for (Int_t type=0; type<3; type++){
795 TTree *
tree =treedy;
796 if (type==1) tree=treedsnp;
797 if (type==2) tree=treed1pt;
799 for (Double_t theta=-1; theta<=1; theta+=0.2){
800 if (TMath::Abs(theta)<0.11)
continue;
801 TCut
cut=Form(
"rms>0&&abs(snp)<0.25&&entries>20&&abs(theta-%f)<0.1",theta);
802 tree->SetMarkerStyle(20+counter);
803 Option_t *option=(counter==0)?
"":
"same";
804 if (theta>0) tree->SetMarkerColor(2);
805 if (theta<0) tree->SetMarkerColor(4);
806 if (type==0) tree->Draw(
"10*mean:phi>>his(45,-pi,pi)",cut,
"profgoff");
807 if (type==1) tree->Draw(
"1000*mean:phi>>his(45,-pi,pi)",cut,
"profgoff");
808 if (type==2) tree->Draw(
"mean:phi>>his(45,-pi,pi)",cut,
"profgoff");
809 his = (TH1*)tree->GetHistogram()->Clone();
810 his->SetName(Form(
"%d_%d",counter,type));
811 his->SetXTitle(
"#phi");
815 his->SetMaximum(0.06);
816 his->SetMinimum(-0.06);
836 AliMagF* magF= (
AliMagF*)(TGeoGlobalMagField::Instance()->GetField());
838 Double_t ezField = 400;
839 Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ;
848 twistX1->SetName(
"tX1");
852 twistY1->SetName(
"tY1");
856 ggErrorA->SetName(
"ggA");
860 ggErrorC->SetName(
"ggC");
865 shiftX->SetName(
"shiftX");
868 shiftY->SetName(
"shiftY");
872 exb11->SetName(
"exb11");
875 exbT1->SetName(
"exbT1");
878 exbT2->SetName(
"exbT2");
881 corr->AddLast(twistX1);
882 corr->AddLast(twistY1);
883 corr->AddLast(ggErrorA);
884 corr->AddLast(ggErrorC);
885 corr->AddLast(shiftX);
886 corr->AddLast(shiftY);
887 corr->AddLast(exb11);
888 corr->AddLast(exbT1);
889 corr->AddLast(exbT2);
914 {
for (Int_t iside=0; iside<=1; iside++){
915 {
for (Int_t ir=0; ir<3; ir++)
916 for (Int_t
id=0;
id<3;
id++) {
932 {
for (Int_t iside=0; iside<=1; iside++)
933 for (Int_t ir=0; ir<3; ir++)
934 for (Int_t
id=0;
id<3;
id++) {
938 eff->SetName(Form(
"eff%d_%d_%d",iside,ir,
id));
939 if (iside==0) valA(counter,0)=0.1;
940 if (iside==1) valC(counter,0)=0.1;
959 TFile
f(
"laserMean.root");
960 TTree*
tree =(TTree*)f.Get(
"Mean");
void MakeGlobalFitRelative(Int_t highFrequency=0)
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
void SetPolynoms(const TMatrixD *polA, const TMatrixD *polC)
void SetYShift(Float_t yShift)
void AddEffectiveCorrection(AliTPCComposedCorrection *comp)
AliTPCComposedCorrection * MakeComposedCorrection()
void SetOmegaTauT1T2(Float_t omegaTau, Float_t t1, Float_t t2)
Correct for the rest of ExB effect which are not covered by physical models.
TTreeSRedirector * pcstream
void SetDeltaVGGC(Double_t deltaVGGC)
virtual void SetOmegaTauT1T2(Float_t omegaTau, Float_t t1, Float_t t2)
void SetYTwist(Float_t yTwist)
void DrawDistortionMaps(const char *fname="mean.root")
AliTPCComposedCorrection class.
void SetXTwist(Float_t xTwist)
void SetCorrections(const TCollection *corrections)
static void MakeTrackDistortionTree(TTree *tinput, Int_t dtype, Int_t ptype, const TObjArray *corrArray, Int_t step=1, Int_t offset=0, Bool_t debug=0)
AliTPCcalibTime * calibTime
static void MakeLaserDistortionTree(TTree *tree, TObjArray *corrArray, Int_t itype)
TCollection * GetCorrections() const
void MakeLookup(Int_t run, Int_t mode)
void SetBField(const AliMagF *bField)
void SetXShift(Float_t xShift)
void SetDeltaVGGA(Double_t deltaVGGA)
static void MakeDistortionMap(THnSparse *his0, TTreeSRedirector *pcstream, const char *hname, Int_t run, Float_t refX, Int_t type, Int_t integ=1)
void FitLookup(TChain *chainIn, const char *prefix, TVectorD &vecA, TVectorD &vecC, TVectorD &vecStatA, TVectorD &vecStatD, TCut cut, TObjArray *picArray)
void DrawDistortionDy(TCut cutUser="", Double_t ymin=-0.6, Double_t ymax=0.6)
void SetCoeficients(const TMatrixD *valA, const TMatrixD *valC)
virtual void Print(Option_t *option="") const