4 Register primitive corrections: base functions for minimization:
5 Id numbers are associated to given primitive corrections.
6 See comments in the function headers.
7 Used only for residuals minimization not in the reconstruction.
8 File with all primitives expected to be in the current directory:
10 TPCCorrectionPrimitives.root - Alignment, Quadrants, 2D symentrid and rod misalingment
11 TPCCorrectionPrimitivesROC.root - ExB distortion due to the common ROC misalignment
12 TPCCorrectionPrimitivesSector.root - ExB distortion due to the one sector misalingment (sector 0)
13 TPCCorrectionPrimitivesFieldCage.root - ExB distortion due to the Field cage missalignment
16 RegisterCorrection(); - Reserved id's 0 -999
18 RegisterAliTPCFCVoltError3D(); - Reserved id's 0 -99
19 RegisterAliTPCBoundaryVoltError(); - Reserved id's 100-199
20 RegisterAliTPCCalibGlobalMisalignment(); - Reserved id's 200-499
21 RegisterAliTPCExBBShape(); - Reserved id's 500-600
22 RegisterAliTPCExBTwist(); - Reserved id's 600-700
23 RegisterAliTPCROCVoltError3D() - Reserved id's 700-800
24 RegisterAliTPCROCVoltError3DSector() - Reserved id's 800-900
26 .L $ALICE_ROOT/TPC/CalibMacros/RegisterCorrection.C+
34 .L $ALICE_ROOT/PWGPP/CalibMacros/CPass0/ConfigCalibTrain.C
35 ConfigCalibTrain(119037,"local:///cvmfs/alice.gsi.de/alice/data/2010/OCDB/")
37 .L $ALICE_ROOT/TPC/CalibMacros/RegisterCorrection.C+
38 RegisterCorrection(0);
40 //See example usage of correction primitive/derivatives in file
46 #if !defined(__CINT__) || defined(__MAKECINT__)
48 #include "TObjArray.h"
49 #include "TTreeStream.h"
61 #include "AliTPCParamSR.h"
62 #include "TDatabasePDG.h"
63 #include "AliTPCCorrection.h"
64 #include "AliTPCFCVoltError3D.h"
65 #include "AliTPCROCVoltError3D.h"
66 #include "AliTPCComposedCorrection.h"
67 #include "AliTPCBoundaryVoltError.h"
68 #include "AliTPCCalibGlobalMisalignment.h"
69 #include "AliTPCExBBShape.h"
70 #include "AliTPCExBTwist.h"
71 #include "AliTPCCorrectionDrift.h"
73 #include "AliCDBEntry.h"
74 #include "AliTPCROC.h"
75 #include <TStatToolkit.h>
77 #include "TGraphErrors.h"
78 #include "AliTrackerBase.h"
79 #include "TGeoGlobalMagField.h"
81 #include "TLinearFitter.h"
82 #include "TStopwatch.h"
83 #include "AliTPCCorrectionFit.h"
89 TFile *fCorrections=0; //file with corrections
91 //models E field distortion AliTPCFCVoltError3D
93 AliTPCFCVoltError3D *rotOFC =0; // fit models
94 AliTPCFCVoltError3D *rodOFC1 =0;
95 AliTPCFCVoltError3D *rodOFC2 =0;
96 AliTPCFCVoltError3D *rotIFC =0;
97 AliTPCFCVoltError3D *rodIFC1 =0;
98 AliTPCFCVoltError3D *rodIFC2 =0;
100 AliTPCFCVoltError3D *rodIFCShift=0; //common IFC shift
101 AliTPCFCVoltError3D *rodIFCSin=0; //common IFC shift -sinus
102 AliTPCFCVoltError3D *rodOFCSin=0; //common OFC shift -sinus
103 AliTPCFCVoltError3D *rodOFCShift=0; //common OFC shift
104 AliTPCFCVoltError3D *rodIFCCos=0; //common IFC shift -cos
105 AliTPCFCVoltError3D *rodOFCCos=0; //common OFC shift -cos
107 TObjArray *rodFCSideRadiusType=0; // field cage shift, A/C side, OFC/IFC, Fourier(const,sin,cos)
112 AliTPCROCVoltError3D *rocRotgXA=0; // roc rotation A side - inclination in X
113 AliTPCROCVoltError3D *rocRotgYA=0; // roc rotation A side - inclination in Y
114 AliTPCROCVoltError3D *rocRotgXC=0; // roc rotation C side - inclination in X
115 AliTPCROCVoltError3D *rocRotgYC=0; // roc rotation C side - inclination in Y
117 AliTPCROCVoltError3D *rocDzIROCA=0; // roc shift A side - in Z
118 AliTPCROCVoltError3D *rocDzIROCC=0; // roc shift C side - in Z
119 AliTPCROCVoltError3D *rocRotIROCA=0; // roc rotation A side - in Z
120 AliTPCROCVoltError3D *rocRotIROCC=0; // roc rotation C side - in Z
121 AliTPCROCVoltError3D *rocDzUDA=0; // roc shift Up-Down A side
122 AliTPCROCVoltError3D *rocDzUDC=0; // roc shift Up-Down C side
123 AliTPCROCVoltError3D *rocRotUDA=0; // roc rotation updown A side
124 AliTPCROCVoltError3D *rocRotUDC=0; // roc rotation updown C side
127 AliTPCROCVoltError3D *rocShiftIROCA0=0; // IROC shift A0 side
128 AliTPCROCVoltError3D *rocRotIROCA0=0; // IROC rot A0 side
129 AliTPCROCVoltError3D *rocShiftOROCA0=0; // OROC shift A0 side
130 AliTPCROCVoltError3D *rocRotOROCA0=0; // OROC rot A0 side
131 AliTPCROCVoltError3D *rocShiftIROCC0=0; // IROC shift C0 side
132 AliTPCROCVoltError3D *rocRotIROCC0=0; // IROC rot C0 side
133 AliTPCROCVoltError3D *rocShiftOROCC0=0; // OROC shift C0 side
134 AliTPCROCVoltError3D *rocRotOROCC0=0; // OROC rot C0 side
138 AliTPCBoundaryVoltError *boundaryVoltErrorA[8]; // boundary voltage error A side
139 AliTPCBoundaryVoltError *boundaryVoltErrorC[8]; // boundary voltage error C side
140 AliTPCExBBShape *exbShape = 0; // nominal correctin
141 AliTPCExBBShape *exbShapeT1X = 0; // nominal +deltaT1=0.1
142 AliTPCExBBShape *exbShapeT2X = 0; // nominal +deltaT2=0.1
143 AliTPCExBTwist *twistX = 0;
144 AliTPCExBTwist *twistY = 0;
146 AliTPCCalibGlobalMisalignment *alignRot0=0;
147 AliTPCCalibGlobalMisalignment *alignRot1=0;
148 AliTPCCalibGlobalMisalignment *alignRot2=0;
149 AliTPCCalibGlobalMisalignment *alignTrans0=0;
150 AliTPCCalibGlobalMisalignment *alignTrans1=0;
151 AliTPCCalibGlobalMisalignment *alignTrans2=0;
153 AliTPCCalibGlobalMisalignment *alignTrans0D[4]={0}; // delta alignemnt 4 quadrants
154 AliTPCCalibGlobalMisalignment *alignTrans1D[4]={0}; //
155 AliTPCCalibGlobalMisalignment *alignTrans2D[4]={0}; //
156 AliTPCCalibGlobalMisalignment *alignRot0D[4]={0};
157 AliTPCCalibGlobalMisalignment *alignRot1D[4]={0};
158 AliTPCCalibGlobalMisalignment *alignRot2D[4]={0};
163 AliTPCCorrectionDrift *calibDrift[7]={0};
167 void RegisterAliTPCFCVoltError3D();
168 void RegisterAliTPCCalibGlobalMisalignment();
169 void RegisterAliTPCBoundaryVoltError();
170 void RegisterAliTPCExBShape();
171 void RegisterAliTPCExBTwist();
172 void RegisterAliTPCROCVoltError3D();
173 void RegisterAliTPCROCVoltError3DSector();
174 void RegisterAliTPCCorrectionDrift();
175 void RegisterAliTPCFCVoltError3DRodFCSideRadiusType();
178 void RegisterCorrection(Int_t type=0){
182 // check the presence of corrections in file
184 //gROOT->Macro("ConfigCalibTrain.C(119037)");
187 if (type==1) return RegisterAliTPCROCVoltError3D(); // 3D distortion due misalignemnt of FC ....
188 if (type==2) return RegisterAliTPCROCVoltError3DSector(); // 3D distortion due misalingment of Sectors
189 if (type==4) return RegisterAliTPCFCVoltError3DRodFCSideRadiusType();
191 if (type==3) { // 2D distortions
192 fCorrections = TFile::Open("TPCCorrectionPrimitives.root","recreate");
193 RegisterAliTPCCalibGlobalMisalignment();
194 RegisterAliTPCBoundaryVoltError();
195 RegisterAliTPCFCVoltError3D();
196 RegisterAliTPCExBShape();
197 RegisterAliTPCExBTwist();
198 RegisterAliTPCCorrectionDrift();
199 fCorrections->Close();
203 fCorrections = TFile::Open("TPCCorrectionPrimitives.root");
204 AliTPCComposedCorrection *corrField3D = (AliTPCComposedCorrection*) fCorrections->Get("TPCFCVoltError3D");
205 // if not make new file
206 if (!corrField3D) fCorrections = TFile::Open("TPCCorrectionPrimitives.root","update");
208 RegisterAliTPCROCVoltError3D();
209 RegisterAliTPCROCVoltError3DSector();
210 RegisterAliTPCFCVoltError3DRodFCSideRadiusType();
212 RegisterAliTPCCalibGlobalMisalignment();
213 RegisterAliTPCBoundaryVoltError();
214 RegisterAliTPCFCVoltError3D();
215 RegisterAliTPCExBShape();
216 RegisterAliTPCExBTwist();
217 RegisterAliTPCCorrectionDrift();
218 if (fCorrections) fCorrections->Close();
224 void RegisterAliTPCFCVoltError3D(){
226 // Load the models from the file
228 // Register functions with following IDs:
229 // IMPORTANT: The nominal shift is in mm
244 printf("RegisterAliTPCFCVoltError3D()");
245 Int_t volt = 40; // 40 V ~ 1mm
246 AliTPCComposedCorrection *corrField3D = (AliTPCComposedCorrection*) fCorrections->Get("TPCFCVoltError3D");
247 if (corrField3D) { // load form file
248 corrField3D->Print();
249 TCollection *iter = corrField3D->GetCorrections();
250 rotOFC = (AliTPCFCVoltError3D*)iter->FindObject("rotOFC");
251 rodOFC1 = (AliTPCFCVoltError3D*)iter->FindObject("rodOFC1");
252 rodOFC2 = (AliTPCFCVoltError3D*)iter->FindObject("rodOFC2");
253 rotIFC = (AliTPCFCVoltError3D*)iter->FindObject("rotIFC");
254 rodIFC1 = (AliTPCFCVoltError3D*)iter->FindObject("rodIFC1");
255 rodIFC2 = (AliTPCFCVoltError3D*)iter->FindObject("rodIFC2");
257 rodIFCShift = (AliTPCFCVoltError3D*)iter->FindObject("rodIFCShift");
258 rodOFCShift = (AliTPCFCVoltError3D*)iter->FindObject("rodOFCShift");
259 rodIFCSin = (AliTPCFCVoltError3D*)iter->FindObject("rodIFCSin");
260 rodOFCSin = (AliTPCFCVoltError3D*)iter->FindObject("rodOFCSin");
261 rodIFCCos = (AliTPCFCVoltError3D*)iter->FindObject("rodIFCCos");
262 rodOFCCos = (AliTPCFCVoltError3D*)iter->FindObject("rodOFCCos");
265 rotOFC = new AliTPCFCVoltError3D();
266 rotOFC->SetOmegaTauT1T2(0,1,1);
267 rotOFC->SetRotatedClipVoltA(1,volt);
268 rotOFC->SetRotatedClipVoltC(1,volt);
270 rodOFC1 = new AliTPCFCVoltError3D();
271 rodOFC1->SetOmegaTauT1T2(0,1,1);
272 rodOFC1->SetRodVoltShiftA(18,volt);
273 rodOFC1->SetRodVoltShiftC(18,volt);
275 rodOFC2 = new AliTPCFCVoltError3D();
276 rodOFC2->SetOmegaTauT1T2(0,1,1);
277 rodOFC2->SetCopperRodShiftA(18,volt);
278 rodOFC2->SetCopperRodShiftC(18,volt);
280 rotIFC = new AliTPCFCVoltError3D();
281 rotIFC->SetOmegaTauT1T2(0,1,1);
282 rotIFC->SetRotatedClipVoltA(0,volt);
283 rotIFC->SetRotatedClipVoltC(0,volt);
285 rodIFC1 = new AliTPCFCVoltError3D();
286 rodIFC1->SetOmegaTauT1T2(0,1,1);
287 rodIFC1->SetRodVoltShiftA(0,volt);
288 rodIFC1->SetRodVoltShiftC(0,volt);
290 rodIFC2 = new AliTPCFCVoltError3D();
291 rodIFC2->SetOmegaTauT1T2(0,1,1);
292 rodIFC2->SetCopperRodShiftA(0,volt);
293 rodIFC2->SetCopperRodShiftC(0,volt);
295 rodIFCShift = new AliTPCFCVoltError3D();
296 rodIFCSin = new AliTPCFCVoltError3D();
297 rodIFCCos = new AliTPCFCVoltError3D();
298 rodOFCShift = new AliTPCFCVoltError3D();
299 rodOFCSin = new AliTPCFCVoltError3D();
300 rodOFCCos = new AliTPCFCVoltError3D();
301 for (Int_t isec=0; isec<18; isec++){
302 Double_t phi=TMath::Pi()*isec/9.;
303 rodIFCShift->SetOmegaTauT1T2(0,1,1);
304 rodIFCShift->SetRodVoltShiftA(isec,volt);
305 rodIFCShift->SetRodVoltShiftC(isec,volt);
306 rodIFCSin->SetOmegaTauT1T2(0,1,1);
307 rodIFCSin->SetRodVoltShiftA(isec,volt*TMath::Sin(phi));
308 rodIFCSin->SetRodVoltShiftC(isec,volt*TMath::Sin(phi));
309 rodIFCCos->SetOmegaTauT1T2(0,1,1);
310 rodIFCCos->SetRodVoltShiftA(isec,volt*TMath::Cos(phi));
311 rodIFCCos->SetRodVoltShiftC(isec,volt*TMath::Cos(phi));
313 rodOFCShift->SetOmegaTauT1T2(0,1,1);
314 rodOFCShift->SetRodVoltShiftA(18+isec,volt);
315 rodOFCShift->SetRodVoltShiftC(18+isec,volt);
316 rodOFCSin->SetOmegaTauT1T2(0,1,1);
317 rodOFCSin->SetRodVoltShiftA(18+isec,volt*TMath::Sin(phi));
318 rodOFCSin->SetRodVoltShiftC(18+isec,volt*TMath::Sin(phi));
319 rodOFCCos->SetOmegaTauT1T2(0,1,1);
320 rodOFCCos->SetRodVoltShiftA(18+isec,volt*TMath::Cos(phi));
321 rodOFCCos->SetRodVoltShiftC(18+isec,volt*TMath::Cos(phi));
325 // Initialization of the lookup tables
327 printf(" ------- OFC rotated clip:\n"); rotOFC->InitFCVoltError3D();
328 printf(" ------- OFC rod & strip:\n"); rodOFC1->InitFCVoltError3D();
329 printf(" ------- OFC copper rod:\n"); rodOFC2->InitFCVoltError3D();
330 printf(" ------- IFC rotated clip:\n"); rotIFC->InitFCVoltError3D();
331 printf(" ------- IFC rod & strip:\n"); rodIFC1->InitFCVoltError3D();
332 printf(" ------- IFC copper rod:\n"); rodIFC2->InitFCVoltError3D();
334 printf(" ------- IFC rod & strip shift:\n"); rodIFCShift->InitFCVoltError3D();
335 printf(" ------- IFC rod & strip sin:\n"); rodIFCSin->InitFCVoltError3D();
336 printf(" ------- IFC rod & strip cos:\n"); rodIFCCos->InitFCVoltError3D();
337 printf(" ------- OFC rod & strip shift:\n"); rodOFCShift->InitFCVoltError3D();
338 printf(" ------- OFC rod & strip sin:\n"); rodOFCSin->InitFCVoltError3D();
339 printf(" ------- OFC rod & strip cos:\n"); rodOFCCos->InitFCVoltError3D();
342 rotOFC->SetName("rotOFC");rotOFC->SetTitle("rotOFC");
343 rodOFC1->SetName("rodOFC1");rodOFC1->SetTitle("rodOFC1");
344 rodOFC2->SetName("rodOFC2");rodOFC2->SetTitle("rodOFC2");
345 rotIFC->SetName("rotIFC");rotIFC->SetTitle("rotIFC");
346 rodIFC1->SetName("rodIFC1");rodIFC1->SetTitle("rodIFC1");
347 rodIFC2->SetName("rodIFC2");rodIFC2->SetTitle("rodIFC2");
349 rodIFCShift->SetName("rodIFCShift");rodIFCShift->SetTitle("rodIFCShift");
350 rodIFCSin->SetName("rodIFCSin");rodIFCSin->SetTitle("rodIFCSin");
351 rodIFCCos->SetName("rodIFCCos");rodIFCCos->SetTitle("rodIFCCos");
353 rodOFCShift->SetName("rodOFCShift");rodOFCShift->SetTitle("rodOFCShift");
354 rodOFCSin->SetName("rodOFCSin");rodOFCSin->SetTitle("rodOFCSin");
355 rodOFCCos->SetName("rodOFCCos");rodOFCCos->SetTitle("rodOFCCos");
358 corrField3D = new AliTPCComposedCorrection();
359 TObjArray *cs = new TObjArray();
360 cs->Add(rotIFC); cs->Add(rotOFC);
361 cs->Add(rodIFC1); cs->Add(rodOFC1);
362 cs->Add(rodIFC2); cs->Add(rodOFC2);
363 cs->Add(rodIFCShift); cs->Add(rodIFCSin); cs->Add(rodIFCCos);
364 cs->Add(rodOFCShift); cs->Add(rodOFCSin); cs->Add(rodOFCCos);
366 corrField3D->SetCorrections(cs);
367 corrField3D->SetOmegaTauT1T2(0,1.,1.);
368 corrField3D->Print();
370 corrField3D->Write("TPCFCVoltError3D");
373 AliTPCCorrection::AddVisualCorrection(rotOFC,0);
374 AliTPCCorrection::AddVisualCorrection(rodOFC1,1);
375 AliTPCCorrection::AddVisualCorrection(rodOFC2,2);
376 AliTPCCorrection::AddVisualCorrection(rotIFC,3);
377 AliTPCCorrection::AddVisualCorrection(rodIFC1,4);
378 AliTPCCorrection::AddVisualCorrection(rodIFC2,5);
379 // common corrections
381 AliTPCCorrection::AddVisualCorrection(rodIFCShift,6);
382 AliTPCCorrection::AddVisualCorrection(rodIFCSin,7);
383 AliTPCCorrection::AddVisualCorrection(rodIFCCos,8);
385 AliTPCCorrection::AddVisualCorrection(rodOFCShift,9);
386 AliTPCCorrection::AddVisualCorrection(rodOFCSin,10);
387 AliTPCCorrection::AddVisualCorrection(rodOFCCos,11);
391 void RegisterAliTPCFCVoltError3DRodFCSideRadiusType(){
393 // Load the models from the file
395 // Register functions with following IDs:
396 // IMPORTANT: The nominal shift is in mm
398 // naming convention:
399 // rodFCSide%dRadius%dType%d
401 ::Info("RegisterAliTPCFCVoltError3DRodFCSideRadiusType()","Start");
402 Int_t volt = 40; // 40 V ~ 1mm
403 TFile * fCorrectionsRodFCSideRadiusType = TFile::Open("TPCCorrectionPrimitivesFieldCage.root","update");
404 if (!fCorrectionsRodFCSideRadiusType) fCorrectionsRodFCSideRadiusType = TFile::Open("TPCCorrectionPrimitivesFieldCage.root","recreate");
405 rodFCSideRadiusType= new TObjArray(100);
407 AliTPCComposedCorrection *corrFieldCage = (AliTPCComposedCorrection*) fCorrectionsRodFCSideRadiusType->Get("TPCRodFCSideRadiusType");
408 if (corrFieldCage) { // load from file
409 TCollection *corrections = corrFieldCage->GetCorrections();
410 for (Int_t itype=0; itype<3; itype++){
411 for (Int_t iside=0; iside<2; iside++){
412 for (Int_t ifc=0; ifc<2; ifc++){
413 Int_t id=4*itype+2*iside+ifc;
414 AliTPCFCVoltError3D *corr = (AliTPCFCVoltError3D *)corrections->FindObject(TString::Format("rodFCSide%dRadius%dType%d",iside,ifc,itype).Data());
415 rodFCSideRadiusType->AddLast(corr);
416 ::Info("Read AliTPCFCVoltError3DRodFCSideRadiusType", TString::Format("Init: rodFCSide%dRadius%dType%d\tId=%d",iside,ifc,itype,900+id).Data());
417 AliTPCCorrection::AddVisualCorrection(corr,900+id);
421 corrFieldCage->Print();
423 for (Int_t itype=0; itype<3; itype++){
424 for (Int_t iside=0; iside<2; iside++){
425 for (Int_t ifc=0; ifc<2; ifc++){
426 Int_t id=4*itype+2*iside+ifc;
427 AliTPCFCVoltError3D *corr = new AliTPCFCVoltError3D();
428 corr->SetName(TString::Format("rodFCSide%dRadius%dType%d",iside,ifc,itype).Data());
429 corr->SetTitle(TString::Format("rodFCSide%dRadius%dType%d",iside,ifc,itype).Data());
431 for (Int_t isec=0; isec<18; isec++){
432 Double_t phi=TMath::Pi()*isec/9.;
433 Int_t sectorOffset=(ifc==0) ? 0:18;
434 corr->SetOmegaTauT1T2(0,1,1);
435 Double_t sectorVoltage=0;
436 if (itype==0) sectorVoltage=volt;
437 if (itype==1) sectorVoltage=volt*TMath::Sin(phi);
438 if (itype==2) sectorVoltage=volt*TMath::Cos(phi);
440 corr->SetRodVoltShiftA(isec+sectorOffset,sectorVoltage);
443 corr->SetRodVoltShiftC(isec+sectorOffset,sectorVoltage);
446 rodFCSideRadiusType->AddLast(corr);
447 ::Info("Generate AliTPCFCVoltError3DRodFCSideRadiusType", TString::Format("Init: rodFCSide%dRadius%dType%d",iside,ifc,itype).Data());
448 corr->InitFCVoltError3D();
449 AliTPCCorrection::AddVisualCorrection(corr,900+id);
454 corrFieldCage = new AliTPCComposedCorrection();
455 corrFieldCage->SetCorrections(rodFCSideRadiusType);
456 corrFieldCage->SetOmegaTauT1T2(0,1.,1.);
458 corrFieldCage->Print();
459 fCorrectionsRodFCSideRadiusType->cd();
460 corrFieldCage->Write("TPCRodFCSideRadiusType");
462 fCorrectionsRodFCSideRadiusType->Close();
463 ::Info("RegisterAliTPCFCVoltError3DRodFCSideRadiusType()","End");
467 void RegisterAliTPCCalibGlobalMisalignment(){
469 // Register primitive alignment components.
470 // Linear conbination of primitev forulas used for fit
471 // The nominal delta 1 mm in shift and 1 mrad in rotation
472 // Primitive formulas registeren in AliTPCCoreection::AddvisualCorrection
480 printf("RegisterAliTPCCalibGlobalMisalignment()\n");
486 TGeoRotation rot2; //transformation matrices
487 TGeoRotation rot90; //transformation matrices
488 matrixX.SetDx(0.1); matrixY.SetDy(0.1); matrixZ.SetDz(0.1); //1 mm translation
489 rot0.SetAngles(0.001*TMath::RadToDeg(),0,0);
490 rot1.SetAngles(0,0.001*TMath::RadToDeg(),0);
491 rot2.SetAngles(0,0,0.001*TMath::RadToDeg());
493 rot90.SetAngles(0,90,0);
494 rot2.MultiplyBy(&rot90,kTRUE);
495 rot90.SetAngles(0,-90,0);
496 rot2.MultiplyBy(&rot90,kFALSE);
498 alignRot0 =new AliTPCCalibGlobalMisalignment;
499 alignRot0->SetAlignGlobal(&rot0);
500 alignRot0->SetName("alignRot0");
501 alignRot1=new AliTPCCalibGlobalMisalignment;
502 alignRot1->SetAlignGlobal(&rot1);
503 alignRot1->SetName("alignRot1");
504 alignRot2=new AliTPCCalibGlobalMisalignment;
505 alignRot2->SetAlignGlobal(&rot2);
506 alignRot2->SetName("alignRot2");
508 alignTrans0 =new AliTPCCalibGlobalMisalignment;
509 alignTrans0->SetAlignGlobal(&matrixX);
510 alignTrans0->SetName("alignTrans0");
511 alignTrans1=new AliTPCCalibGlobalMisalignment;
512 alignTrans1->SetAlignGlobal(&matrixY);
513 alignTrans1->SetName("alignTrans1");
514 alignTrans2=new AliTPCCalibGlobalMisalignment;
515 alignTrans2->SetAlignGlobal(&matrixZ);
516 alignTrans2->SetName("alignTrans2");
520 alignRot0D[0] =new AliTPCCalibGlobalMisalignment;
521 alignRot0D[0]->SetAlignGlobalDelta(&rot0);
522 alignRot0D[0]->SetName("alignRot0D");
523 alignRot1D[0]=new AliTPCCalibGlobalMisalignment;
524 alignRot1D[0]->SetAlignGlobalDelta(&rot1);
525 alignRot1D[0]->SetName("alignRot1D");
526 alignRot2D[0]=new AliTPCCalibGlobalMisalignment;
527 alignRot2D[0]->SetAlignGlobalDelta(&rot2);
528 alignRot2D[0]->SetName("alignRot2D");
530 alignTrans0D[0] =new AliTPCCalibGlobalMisalignment;
531 alignTrans0D[0]->SetAlignGlobalDelta(&matrixX);
532 alignTrans0D[0]->SetName("alignTrans0D");
533 alignTrans1D[0]=new AliTPCCalibGlobalMisalignment;
534 alignTrans1D[0]->SetAlignGlobalDelta(&matrixY);
535 alignTrans1D[0]->SetName("alignTrans1D");
536 alignTrans2D[0]=new AliTPCCalibGlobalMisalignment;
537 alignTrans2D[0]->SetAlignGlobalDelta(&matrixZ);
538 alignTrans2D[0]->SetName("alignTrans2D");
540 TObjArray * arrayDX = new TObjArray(72);
541 TObjArray * arrayDY = new TObjArray(72);
542 TObjArray * arrayDPhi = new TObjArray(72);
546 for (Int_t isec=0; isec<72; isec++){ //A side
547 TGeoHMatrix *matrixDX = new TGeoHMatrix;
548 TGeoHMatrix *matrixDY = new TGeoHMatrix;
549 TGeoRotation *matrixDPhi= new TGeoRotation;
550 arrayDX->AddAt(matrixDX,isec);
551 arrayDY->AddAt(matrixDY,isec);
552 arrayDPhi->AddAt(matrixDPhi,isec);
553 if (isec%36<18) matrixDX->SetDx(isec%18<9?0.1:-0.1);
554 if (isec%36<18) matrixDY->SetDy(isec%18<9?0.1:-0.1);
555 if (isec%36<18) matrixDPhi->SetAngles((isec%18<9?0.001:-0.001)*TMath::RadToDeg(),0,0);
557 alignTrans0D[1] =new AliTPCCalibGlobalMisalignment;
558 alignTrans0D[1]->SetName("alignTrans0UDA");
559 alignTrans0D[1]->SetAlignSectors((TObjArray *)(arrayDX->Clone()));
560 alignTrans1D[1] =new AliTPCCalibGlobalMisalignment;
561 alignTrans1D[1]->SetName("alignTrans1UDA");
562 alignTrans1D[1]->SetAlignSectors((TObjArray *)(arrayDY->Clone()));
563 alignRot0D[1] =new AliTPCCalibGlobalMisalignment;
564 alignRot0D[1]->SetName("alignRot0UDA");
565 alignRot0D[1]->SetAlignSectors((TObjArray *)(arrayDPhi->Clone()));
569 for (Int_t isec=0; isec<72; isec++){ //A side
570 TGeoHMatrix *matrixDX = new TGeoHMatrix;
571 TGeoHMatrix *matrixDY = new TGeoHMatrix;
572 TGeoRotation *matrixDPhi= new TGeoRotation;
573 arrayDX->AddAt(matrixDX,isec);
574 arrayDY->AddAt(matrixDY,isec);
575 arrayDPhi->AddAt(matrixDPhi,isec);
576 if (isec%36>=18) matrixDX->SetDx(isec%18<9?0.1:-0.1);
577 if (isec%36>=18) matrixDY->SetDy(isec%18<9?0.1:-0.1);
578 if (isec%36>=18) matrixDPhi->SetAngles((isec%18<9?0.001:-0.001)*TMath::RadToDeg(),0,0);
580 alignTrans0D[2] =new AliTPCCalibGlobalMisalignment;
581 alignTrans0D[2]->SetName("alignTrans0UDC");
582 alignTrans0D[2]->SetAlignSectors((TObjArray *)(arrayDX->Clone()));
583 alignTrans1D[2] =new AliTPCCalibGlobalMisalignment;
584 alignTrans1D[2]->SetName("alignTrans1UDC");
585 alignTrans1D[2]->SetAlignSectors((TObjArray *)(arrayDY->Clone()));
586 alignRot0D[2] =new AliTPCCalibGlobalMisalignment;
587 alignRot0D[2]->SetName("alignRot0UDC");
588 alignRot0D[2]->SetAlignSectors((TObjArray *)(arrayDPhi->Clone()));
593 AliTPCCorrection::AddVisualCorrection(alignTrans0 ,200);
594 AliTPCCorrection::AddVisualCorrection(alignTrans1 ,201);
595 AliTPCCorrection::AddVisualCorrection(alignTrans2 ,202);
596 AliTPCCorrection::AddVisualCorrection(alignRot0 ,203);
597 AliTPCCorrection::AddVisualCorrection(alignRot1 ,204);
598 AliTPCCorrection::AddVisualCorrection(alignRot2 ,205);
603 void RegisterAliTPCBoundaryVoltError(){
605 // Register phi symetric E filed distortions
606 // 100-108 - A side 0 Field
607 // 110-118 - C side 0 Field
608 // 120-128 - A side +0.5 Field
609 // 130-138 - C side +0.5 Field
610 // 140-148 - A side -0.5 Field
611 // 150-158 - C side -0.5 Field
613 Double_t vdrift = 2.64; // [cm/us] // to be updated: per second (ideally)
614 Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully)
617 Double_t wtP = -10.0 * (0.5*10) * vdrift / ezField ;
618 Double_t wtM = -10.0 * (0.5*10) * vdrift / -ezField ;
620 printf("RegisterAliTPCBoundaryVoltError()\n");
621 AliTPCComposedCorrection *corrField2D = (AliTPCComposedCorrection*) fCorrections->Get("TPCFCVoltError2D");
624 TObjArray *array=new TObjArray(16);
625 Double_t val = 40.; // 1mm
626 Float_t bound0[8] = { 0, 0,0,0,0,0,0,0};
627 Float_t boundAi[8] = { 0, 0,0,0,0,0,0,0};
628 Float_t boundCi[8] = { 0, 0,0,0,0,0,0,0};
629 for (Int_t ipar=0; ipar<8; ipar++){
631 boundaryVoltErrorA[ipar] = new AliTPCBoundaryVoltError;
632 boundaryVoltErrorC[ipar] = new AliTPCBoundaryVoltError;
633 boundaryVoltErrorA[ipar]->SetName(Form("BoundaryVoltErrorAsidePar%d",ipar));
634 boundaryVoltErrorA[ipar]->SetTitle(Form("BoundaryVoltErrorAsidePar%d",ipar));
635 boundaryVoltErrorC[ipar]->SetName(Form("BoundaryVoltErrorCsidePar%d",ipar));
636 boundaryVoltErrorC[ipar]->SetTitle(Form("BoundaryVoltErrorCsidePar%d",ipar));
637 for (Int_t jpar=0; jpar<8; jpar++) if (ipar!=jpar){
644 boundaryVoltErrorA[ipar]->SetBoundariesA(boundAi);
645 boundaryVoltErrorA[ipar]->SetBoundariesC(bound0);
646 boundaryVoltErrorA[ipar]->InitBoundaryVoltErrorDistortion();
647 boundaryVoltErrorA[ipar]->SetOmegaTauT1T2(0.,1,1);
649 Float_t tempboundAi[8] = { 0, 0,0,0,0,0,-boundCi[6],-boundCi[7]};
650 boundaryVoltErrorC[ipar]->SetBoundariesA(tempboundAi);
651 boundaryVoltErrorC[ipar]->SetBoundariesC(boundCi);
653 boundaryVoltErrorC[ipar]->InitBoundaryVoltErrorDistortion();
654 boundaryVoltErrorC[ipar]->SetOmegaTauT1T2(0.,1,1);
655 array->AddAt(boundaryVoltErrorA[ipar],ipar);
656 array->AddAt(boundaryVoltErrorC[ipar],ipar+8);
657 boundaryVoltErrorA[ipar]->Print();
658 boundaryVoltErrorC[ipar]->Print();
659 AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorA[ipar], 100+ipar);
660 AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorC[ipar], 150+ipar);
662 corrField2D = new AliTPCComposedCorrection;
663 corrField2D->SetCorrections(array);
664 corrField2D->SetOmegaTauT1T2(0,1.,1.);
665 corrField2D->Print();
667 corrField2D->SetName("TPCFCVoltError2D");
668 corrField2D->SetTitle("TPCFCVoltError2D");
669 corrField2D->Write("TPCFCVoltError2D");
671 TObjArray *array = (TObjArray*)corrField2D->GetCorrections();
672 for (Int_t ipar=0; ipar<8; ipar++){
673 boundaryVoltErrorA[ipar] = (AliTPCBoundaryVoltError*) array->At(ipar);
674 boundaryVoltErrorC[ipar] = (AliTPCBoundaryVoltError*) array->At(ipar+8);
678 // Register correction
679 for (Int_t ipar=0; ipar<8; ipar++){
680 AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorA[ipar], 100+ipar);
681 AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorC[ipar], 110+ipar);
683 // correction for +-0.5 T setting
684 AliTPCCorrection *corrField =0;
685 corrField=(AliTPCCorrection *)boundaryVoltErrorA[ipar]->Clone();
686 corrField->SetOmegaTauT1T2(wtP,T1,T2);
687 AliTPCCorrection::AddVisualCorrection(corrField,120+ipar);
689 corrField=(AliTPCCorrection *)boundaryVoltErrorC[ipar]->Clone();
690 corrField->SetOmegaTauT1T2(wtP,T1,T2);
691 AliTPCCorrection::AddVisualCorrection(corrField,130+ipar);
692 // correction for +-0.5 T setting
693 corrField=(AliTPCCorrection *)boundaryVoltErrorA[ipar]->Clone();
694 corrField->SetOmegaTauT1T2(wtM,T1,T2);
695 AliTPCCorrection::AddVisualCorrection(corrField,140+ipar);
697 corrField=(AliTPCCorrection *)boundaryVoltErrorC[ipar]->Clone();
698 corrField->SetOmegaTauT1T2(wtM,T1,T2);
699 AliTPCCorrection::AddVisualCorrection(corrField,150+ipar);
706 void RegisterAliTPCExBShape(){
710 AliMagF *magF = new AliMagF("mag","mag");
712 exbShape = new AliTPCExBBShape;
713 exbShape->SetBField(magF);
714 exbShape->SetName("TPCExBShape");
715 exbShape->SetTitle("TPCExBShape");
716 exbShape->SetOmegaTauT1T2(0,1.,1.);
718 AliTPCCorrection::AddVisualCorrection(exbShape,500);
719 exbShapeT1X = new AliTPCExBBShape;
720 exbShapeT1X->SetBField(magF);
721 exbShapeT1X->SetName("TPCExbShapeT1X");
722 exbShapeT1X->SetTitle("TPCExbShapeT1X");
723 exbShapeT1X->SetOmegaTauT1T2(0,1.2,1.);
724 exbShapeT1X->Print();
725 AliTPCCorrection::AddVisualCorrection(exbShapeT1X,501);
726 exbShapeT2X = new AliTPCExBBShape;
727 exbShapeT2X->SetBField(magF);
728 exbShapeT2X->SetName("TPCExbShapeT2X");
729 exbShapeT2X->SetTitle("TPCExbShapeT2X");
730 exbShapeT2X->SetOmegaTauT1T2(0,1.0,1.2);
731 exbShapeT2X->Print();
732 AliTPCCorrection::AddVisualCorrection(exbShapeT2X,502);
736 void RegisterAliTPCExBTwist(){
740 twistX = new AliTPCExBTwist;
741 twistY = new AliTPCExBTwist;
742 twistX->SetXTwist(0.001); // 1 mrad twist in x
743 twistX->SetName("ExBTwistX");
744 twistX->SetTitle("ExBTwistX");
745 twistY->SetYTwist(0.001); // 1 mrad twist in y
746 twistY->SetName("ExBTwistY");
747 twistY->SetTitle("ExBTwistY");
748 twistX->SetOmegaTauT1T2(0,1.,1.);
749 twistY->SetOmegaTauT1T2(0,1.,1.);
750 AliTPCCorrection::AddVisualCorrection(twistX,600);
751 AliTPCCorrection::AddVisualCorrection(twistY,601);
754 void RegisterAliTPCCorrectionDrift(){
756 // Drift distortion/correction
758 for (Int_t idrift=0; idrift<7; idrift++) {
759 calibDrift[idrift]=new AliTPCCorrectionDrift;
761 calibDrift[0]->SetName("driftT0");
762 calibDrift[0]->SetTitle("driftT0");
763 calibDrift[0]->fZ0Aside=0.1;
764 calibDrift[0]->fZ0Cside=0.1;
765 calibDrift[1]->SetName("driftScale0");
766 calibDrift[1]->SetTitle("driftScale0");
767 calibDrift[1]->fVScale0=0.001;
768 calibDrift[2]->SetName("driftScaleR");
769 calibDrift[2]->SetTitle("driftScaleR");
770 calibDrift[2]->fVScaleR=0.001;
771 calibDrift[3]->SetName("driftScaleX");
772 calibDrift[3]->SetTitle("driftScaleX");
773 calibDrift[3]->fVScaleX=0.001;
774 calibDrift[4]->SetName("driftScaleY");
775 calibDrift[4]->SetTitle("driftScaleY");
776 calibDrift[4]->fVScaleY=0.001;
778 calibDrift[5]->SetName("driftIROCDZ");
779 calibDrift[5]->SetTitle("driftIROCDZ");
780 calibDrift[5]->fIROCZ0=0.1; //delta Z for IROCORC
782 calibDrift[6]->SetName("driftOROCDT");
783 calibDrift[6]->SetTitle("driftOROCDT");
784 calibDrift[6]->fOROCDZ=0.001; //delta Z for IROCORC
790 void RegisterAliTPCROCVoltError3D(){
792 // ROC rotation transformation
793 // 700 -709 - 0 field
794 // 710 -719 - +0.5 field
795 // 720 -729 - -0.5 field
796 Double_t vdrift = 2.64; // [cm/us] // to be updated: per second (ideally)
797 Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully)
800 Double_t wtP = -10.0 * (0.5*10) * vdrift / ezField ;
801 Double_t wtM = -10.0 * (0.5*10) * vdrift / -ezField ;
804 rocRotgXA=0; // roc rotation A side - inclination in X
805 rocRotgYA=0; // roc rotation A side - inclination in Y
806 rocRotgXC=0; // roc rotation C side - inclination in X
807 rocRotgYC=0; // roc rotation C side - inclination in Y
808 rocDzIROCA=0; // roc shift A side - in Z
809 rocDzIROCC=0; // roc shift C side - in Z
811 rocDzUDA=0; // roc shift up-down - A side
812 rocDzUDC=0; // roc shift up-down - C side
814 rocRotIROCA=0; // roc rot IROC A side - in Z
815 rocRotIROCC=0; // roc rot OROC C side - in Z
816 rocRotUDA=0; // roc rot updown A side
817 rocRotUDC=0; // roc rot updown C side
819 printf("RegisterAliTPCROCVoltError3D()");
820 Double_t kAngle=0.001;
822 AliTPCROC * rocInfo = AliTPCROC::Instance();
823 Double_t lxRef = (rocInfo->GetPadRowRadii(0,62)+rocInfo->GetPadRowRadii(36,0))/2;
825 TMatrixD matrix(72,3);
827 AliTPCComposedCorrection *corrField3D = 0;
828 TFile *fCorrectionsROC=0;
829 fCorrectionsROC = TFile::Open("TPCCorrectionPrimitivesROC.root");
830 corrField3D = ( AliTPCComposedCorrection *)fCorrectionsROC->Get("TPCROCVoltError3DRotationgXgY");
833 fCorrectionsROC = TFile::Open("TPCCorrectionPrimitivesROC.root","recreate");
835 if (corrField3D) { // load from file
836 corrField3D->Print();
837 TCollection *iter = corrField3D->GetCorrections();
839 rocRotgXA=(AliTPCROCVoltError3D*)iter->FindObject("rocRotgXA");
841 rocRotgYA=(AliTPCROCVoltError3D*)iter->FindObject("rocRotgYA");
843 rocRotgXC=(AliTPCROCVoltError3D*)iter->FindObject("rocRotgXC");
845 rocRotgYC=(AliTPCROCVoltError3D*)iter->FindObject("rocRotgYC");
847 rocDzIROCA=(AliTPCROCVoltError3D*)iter->FindObject("rocDzIROCA");
849 rocDzIROCC=(AliTPCROCVoltError3D*)iter->FindObject("rocDzIROCC");
851 rocDzUDA=(AliTPCROCVoltError3D*)iter->FindObject("rocDzUDA");
853 rocDzUDC=(AliTPCROCVoltError3D*)iter->FindObject("rocDzUDC");
855 rocRotIROCA=(AliTPCROCVoltError3D*)iter->FindObject("rocRotIROCA");
857 rocRotIROCC=(AliTPCROCVoltError3D*)iter->FindObject("rocRotIROCC");
859 rocRotUDA=(AliTPCROCVoltError3D*)iter->FindObject("rocRotUDA");
861 rocRotUDC=(AliTPCROCVoltError3D*)iter->FindObject("rocRotUDC");
864 corrField3D = new AliTPCComposedCorrection;
865 rocRotgXA=new AliTPCROCVoltError3D;
866 rocRotgYA=new AliTPCROCVoltError3D;
867 rocRotgXC=new AliTPCROCVoltError3D;
868 rocRotgYC=new AliTPCROCVoltError3D;
869 rocDzIROCA=new AliTPCROCVoltError3D;
870 rocDzIROCC=new AliTPCROCVoltError3D;
871 rocDzUDA=new AliTPCROCVoltError3D;
872 rocDzUDC=new AliTPCROCVoltError3D;
873 rocRotIROCA=new AliTPCROCVoltError3D;
874 rocRotIROCC=new AliTPCROCVoltError3D;
875 rocRotUDA=new AliTPCROCVoltError3D;
876 rocRotUDC=new AliTPCROCVoltError3D;
878 for (Int_t isec=0; isec<72; isec++){
879 Double_t secAlpha = TMath::DegToRad()*(10.+20.*(((Int_t)isec)%18));
880 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
882 matrix(isec,0) = kAngle*TMath::Cos(secAlpha)*lxRef;
883 matrix(isec,1) = kAngle*TMath::Cos(secAlpha);
884 matrix(isec,2) = -kAngle*TMath::Sin(secAlpha);
887 rocRotgXA->SetROCData(&matrix);
889 for (Int_t isec=0; isec<72; isec++){
890 Double_t secAlpha = TMath::DegToRad()*(10.+20.*(((Int_t)isec)%18));
891 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
893 matrix(isec,0) = kAngle*TMath::Sin(secAlpha)*lxRef;
894 matrix(isec,1) = kAngle*TMath::Sin(secAlpha);
895 matrix(isec,2) = kAngle*TMath::Cos(secAlpha);
898 rocRotgYA->SetROCData(&matrix);
900 for (Int_t isec=0; isec<72; isec++){
901 Double_t secAlpha = TMath::DegToRad()*(10.+20.*(((Int_t)isec)%18));
902 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
904 matrix(isec,0) = kAngle*TMath::Cos(secAlpha)*lxRef;
905 matrix(isec,1) = kAngle*TMath::Cos(secAlpha);
906 matrix(isec,2) = -kAngle*TMath::Sin(secAlpha);
909 rocRotgXC->SetROCData(&matrix);
911 for (Int_t isec=0; isec<72; isec++){
912 Double_t secAlpha = TMath::DegToRad()*(10.+20.*(((Int_t)isec)%18));
913 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
915 matrix(isec,0) = kAngle*TMath::Sin(secAlpha)*lxRef;
916 matrix(isec,1) = kAngle*TMath::Sin(secAlpha);
917 matrix(isec,2) = kAngle*TMath::Cos(secAlpha);
920 rocRotgYC->SetROCData(&matrix);
924 for (Int_t isec=0; isec<72; isec++){
925 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
927 matrix(isec,0) = 0.1; // 1 mm
932 rocDzIROCA->SetROCData(&matrix);
934 for (Int_t isec=0; isec<72; isec++){
935 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
936 if (isec>=18 && isec<36){
937 matrix(isec,0) = 0.1; // 1 mm
942 rocDzIROCC->SetROCData(&matrix);
946 for (Int_t isec=0; isec<72; isec++){
947 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
949 matrix(isec,0) = (isec%18<9)? 0.05:-0.05; // 1 mm
954 rocDzUDA->SetROCData(&matrix);
956 for (Int_t isec=0; isec<72; isec++){
957 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
959 matrix(isec,0) = (isec%18<9)?0.05:-0.05; // 1 mm
964 rocDzUDC->SetROCData(&matrix);
967 for (Int_t isec=0; isec<72; isec++){
968 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
971 matrix(isec,1) = kAngle;
976 rocRotIROCA->SetROCData(&matrix);
978 for (Int_t isec=0; isec<72; isec++){
979 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
980 if (isec>=18 && isec<36){
982 matrix(isec,1) = kAngle;
986 rocRotIROCC->SetROCData(&matrix);
989 for (Int_t isec=0; isec<72; isec++){
990 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
993 matrix(isec,1) = (isec%18<9)?kAngle:-kAngle;
998 rocRotUDA->SetROCData(&matrix);
1000 for (Int_t isec=0; isec<72; isec++){
1001 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
1004 matrix(isec,1) = (isec%18<9)?kAngle:-kAngle;
1008 rocRotUDC->SetROCData(&matrix);
1012 rocRotgXA->SetElectronArrivalCorrection(kFALSE);
1013 rocRotgYA->SetElectronArrivalCorrection(kFALSE);
1014 rocRotgXC->SetElectronArrivalCorrection(kFALSE);
1015 rocRotgYC->SetElectronArrivalCorrection(kFALSE);
1016 rocDzIROCA->SetElectronArrivalCorrection(kFALSE);
1017 rocDzIROCC->SetElectronArrivalCorrection(kFALSE);
1018 rocDzUDA->SetElectronArrivalCorrection(kFALSE);
1019 rocDzUDC->SetElectronArrivalCorrection(kFALSE);
1020 rocRotIROCA->SetElectronArrivalCorrection(kFALSE);
1021 rocRotIROCC->SetElectronArrivalCorrection(kFALSE);
1022 rocRotUDA->SetElectronArrivalCorrection(kFALSE);
1023 rocRotUDC->SetElectronArrivalCorrection(kFALSE);
1025 /* // verification plots
1026 rocRotgXA.CreateHistoOfZAlignment(0,500,500)->Draw("surf2");
1027 rocRotgYA.CreateHistoOfZAlignment(0,500,500)->Draw("surf2");
1028 rocRotgXC.CreateHistoOfZAlignment(1,500,500)->Draw("surf2");
1029 rocRotgYC.CreateHistoOfZAlignment(1,500,500)->Draw("surf2");
1033 rocRotgXA->SetName("rocRotgXA");rocRotgXA->SetTitle("rocRotgXA");
1034 rocRotgYA->SetName("rocRotgYA");rocRotgYA->SetTitle("rocRotgYA");
1035 rocRotgXC->SetName("rocRotgXC");rocRotgXC->SetTitle("rocRotgXC");
1036 rocRotgYC->SetName("rocRotgYC");rocRotgYC->SetTitle("rocRotgYC");
1037 rocDzIROCA->SetName("rocDzIROCA");rocDzIROCA->SetTitle("rocDzIROCA");
1038 rocDzIROCC->SetName("rocDzIROCC");rocDzIROCC->SetTitle("rocDzIROCC");
1039 rocDzUDA->SetName("rocDzUDA");rocDzUDA->SetTitle("rocDzUDA");
1040 rocDzUDC->SetName("rocDzUDC");rocDzUDC->SetTitle("rocDzUDC");
1041 rocRotIROCA->SetName("rocRotIROCA");rocRotIROCA->SetTitle("rocRotIROCA");
1042 rocRotIROCC->SetName("rocRotIROCC");rocRotIROCC->SetTitle("rocRotIROCC");
1043 rocRotUDA->SetName("rocRotUDA");rocRotUDA->SetTitle("rocRotUDA");
1044 rocRotUDC->SetName("rocRotUDC");rocRotUDC->SetTitle("rocRotUDC");
1047 TObjArray *cs = new TObjArray();
1052 cs->Add(rocDzIROCA);
1053 cs->Add(rocDzIROCC);
1056 cs->Add(rocRotIROCA);
1057 cs->Add(rocRotIROCC);
1060 corrField3D->SetCorrections(cs);
1061 corrField3D->SetOmegaTauT1T2(0,1.,1.);
1062 corrField3D->Print();
1063 fCorrectionsROC->cd();
1064 corrField3D->Init();
1065 corrField3D->Print("da");
1066 fCorrectionsROC->cd();
1067 corrField3D->Write("TPCROCVoltError3DRotationgXgY");
1069 AliTPCCorrection::AddVisualCorrection(rocRotgXA,701);
1070 AliTPCCorrection::AddVisualCorrection(rocRotgYA,702);
1071 AliTPCCorrection::AddVisualCorrection(rocRotgXC,703);
1072 AliTPCCorrection::AddVisualCorrection(rocRotgYC,704);
1073 AliTPCCorrection::AddVisualCorrection(rocDzIROCA,705);
1074 AliTPCCorrection::AddVisualCorrection(rocDzIROCC,706);
1075 AliTPCCorrection::AddVisualCorrection(rocDzUDA,709);
1076 AliTPCCorrection::AddVisualCorrection(rocDzUDC,710);
1077 AliTPCCorrection::AddVisualCorrection(rocRotIROCA,707);
1078 AliTPCCorrection::AddVisualCorrection(rocRotIROCC,708);
1079 AliTPCCorrection::AddVisualCorrection(rocRotUDA,711);
1080 AliTPCCorrection::AddVisualCorrection(rocRotUDC,712);
1082 AliTPCCorrection *corrPlus =0;
1084 corrPlus=(AliTPCCorrection *)rocRotgXA->Clone();
1085 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
1086 AliTPCCorrection::AddVisualCorrection(corrPlus,711);
1088 corrPlus=(AliTPCCorrection *)rocRotgYA->Clone();
1089 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
1090 AliTPCCorrection::AddVisualCorrection(corrPlus,712);
1092 corrPlus=(AliTPCCorrection *)rocRotgXC->Clone();
1093 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
1094 AliTPCCorrection::AddVisualCorrection(corrPlus,713);
1096 corrPlus=(AliTPCCorrection *)rocRotgYC->Clone();
1097 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
1098 AliTPCCorrection::AddVisualCorrection(corrPlus,714);
1100 corrPlus=(AliTPCCorrection *)rocDzIROCA->Clone();
1101 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
1102 AliTPCCorrection::AddVisualCorrection(corrPlus,715);
1104 corrPlus=(AliTPCCorrection *)rocDzIROCC->Clone();
1105 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
1106 AliTPCCorrection::AddVisualCorrection(corrPlus,716);
1108 corrPlus=(AliTPCCorrection *)rocRotIROCA->Clone();
1109 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
1110 AliTPCCorrection::AddVisualCorrection(corrPlus,717);
1112 corrPlus=(AliTPCCorrection *)rocDzIROCC->Clone();
1113 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
1114 AliTPCCorrection::AddVisualCorrection(corrPlus,718);
1117 AliTPCCorrection *corrMinus =0;
1119 corrMinus=(AliTPCCorrection *)rocRotgXA->Clone();
1120 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
1121 AliTPCCorrection::AddVisualCorrection(corrMinus,721);
1123 corrMinus=(AliTPCCorrection *)rocRotgYA->Clone();
1124 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
1125 AliTPCCorrection::AddVisualCorrection(corrMinus,722);
1127 corrMinus=(AliTPCCorrection *)rocRotgXC->Clone();
1128 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
1129 AliTPCCorrection::AddVisualCorrection(corrMinus,723);
1131 corrMinus=(AliTPCCorrection *)rocRotgYC->Clone();
1132 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
1133 AliTPCCorrection::AddVisualCorrection(corrMinus,724);
1135 corrMinus=(AliTPCCorrection *)rocDzIROCA->Clone();
1136 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
1137 AliTPCCorrection::AddVisualCorrection(corrMinus,725);
1139 corrMinus=(AliTPCCorrection *)rocDzIROCC->Clone();
1140 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
1141 AliTPCCorrection::AddVisualCorrection(corrMinus,726);
1143 corrMinus=(AliTPCCorrection *)rocRotIROCA->Clone();
1144 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
1145 AliTPCCorrection::AddVisualCorrection(corrMinus,727);
1147 corrMinus=(AliTPCCorrection *)rocDzIROCC->Clone();
1148 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
1149 AliTPCCorrection::AddVisualCorrection(corrMinus,728);
1152 fCorrectionsROC->Close();
1153 delete fCorrectionsROC;
1157 void RegisterAliTPCROCVoltError3DSector(){
1159 // ROC rotation and shift transformation
1160 // 800-819 - 0.0 Field
1161 // 820-839 - +0.5 Field
1162 // 840-859 - +0.5 Field
1164 rocShiftIROCA0=0; // IROC shift A0 side
1165 rocRotIROCA0=0; // IROC rot A0 side
1166 rocShiftOROCA0=0; // OROC shift A0 side
1167 rocRotOROCA0=0; // OROC rot A0 side
1168 rocShiftIROCC0=0; // IROC shift C0 side
1169 rocRotIROCC0=0; // IROC rot C0 side
1170 rocShiftOROCC0=0; // OROC shift C0 side
1171 rocRotOROCC0=0; // OROC rot C0 side
1172 Double_t vdrift = 2.64; // [cm/us] // to be updated: per second (ideally)
1173 Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully)
1177 // Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ;
1181 printf("RegisterAliTPCROCVoltError3DSector()");
1182 Double_t kAngle=0.001;
1186 TMatrixD matrix(72,3);
1188 AliTPCComposedCorrection *corrField3DSector = 0;
1189 TFile *fCorrectionsROC=0;
1190 fCorrectionsROC = TFile::Open("TPCCorrectionPrimitivesSector.root");
1191 corrField3DSector = ( AliTPCComposedCorrection *)fCorrectionsROC->Get("TPCROCVoltError3DSector");
1193 if (!corrField3DSector){
1194 fCorrectionsROC = TFile::Open("TPCCorrectionPrimitivesSector.root","recreate");
1196 if (corrField3DSector) { // load from file
1197 corrField3DSector->Print();
1198 TCollection *iter = corrField3DSector->GetCorrections();
1200 rocShiftIROCA0=(AliTPCROCVoltError3D*)iter->FindObject("rocShiftIROCA0"); // IROC shift A0 side
1201 rocRotIROCA0=(AliTPCROCVoltError3D*)iter->FindObject("rocRotIROCA0"); // IROC rot A0 side
1202 rocShiftOROCA0=(AliTPCROCVoltError3D*)iter->FindObject("rocShiftOROCA0"); // OROC shift A0 side
1203 rocRotOROCA0=(AliTPCROCVoltError3D*)iter->FindObject("rocRotOROCA0"); // OROC rot A0 side
1204 rocShiftIROCC0=(AliTPCROCVoltError3D*)iter->FindObject("rocShiftIROCC0"); // IROC shift C0 side
1205 rocRotIROCC0=(AliTPCROCVoltError3D*)iter->FindObject("rocRotIROCC0"); // IROC rot C0 side
1206 rocShiftOROCC0=(AliTPCROCVoltError3D*)iter->FindObject("rocShiftOROCC0"); // OROC shift C0 side
1207 rocRotOROCC0=(AliTPCROCVoltError3D*)iter->FindObject("rocRotOROCC0"); // OROC rot C0 side
1210 corrField3DSector = new AliTPCComposedCorrection;
1211 rocShiftIROCA0=new AliTPCROCVoltError3D; // IROC shift A0 side
1212 rocRotIROCA0=new AliTPCROCVoltError3D; // IROC rot A0 side
1213 rocShiftOROCA0=new AliTPCROCVoltError3D; // OROC shift A0 side
1214 rocRotOROCA0=new AliTPCROCVoltError3D; // OROC rot A0 side
1215 rocShiftIROCC0=new AliTPCROCVoltError3D; // IROC shift C0 side
1216 rocRotIROCC0=new AliTPCROCVoltError3D; // IROC rot C0 side
1217 rocShiftOROCC0=new AliTPCROCVoltError3D; // OROC shift C0 side
1218 rocRotOROCC0=new AliTPCROCVoltError3D; // OROC rot C0 side
1220 matrix.Zero(); matrix(0,0)=kDz;
1221 rocShiftIROCA0->SetROCData(&matrix);
1222 matrix.Zero(); matrix(0,1)=kAngle;
1223 rocRotIROCA0->SetROCData(&matrix);
1224 matrix.Zero(); matrix(36,0)=kDz;
1225 rocShiftOROCA0->SetROCData(&matrix);
1226 matrix.Zero(); matrix(36,1)=kAngle;
1227 rocRotOROCA0->SetROCData(&matrix);
1229 matrix.Zero(); matrix(18,0)=kDz;
1230 rocShiftIROCC0->SetROCData(&matrix);
1231 matrix.Zero(); matrix(18,1)=kAngle;
1232 rocRotIROCC0->SetROCData(&matrix);
1233 matrix.Zero(); matrix(36+18,0)=kDz;
1234 rocShiftOROCC0->SetROCData(&matrix);
1235 matrix.Zero(); matrix(36+18,1)=kAngle;
1236 rocRotOROCC0->SetROCData(&matrix);
1238 rocShiftIROCA0->SetElectronArrivalCorrection(kFALSE); // IROC shift A0 side
1239 rocRotIROCA0->SetElectronArrivalCorrection(kFALSE); // IROC rot A0 side
1240 rocShiftOROCA0->SetElectronArrivalCorrection(kFALSE); // OROC shift A0 side
1241 rocRotOROCA0->SetElectronArrivalCorrection(kFALSE); // OROC rot A0 side
1242 rocShiftIROCC0->SetElectronArrivalCorrection(kFALSE); // IROC shift C0 side
1243 rocRotIROCC0->SetElectronArrivalCorrection(kFALSE); // IROC rot C0 side
1244 rocShiftOROCC0->SetElectronArrivalCorrection(kFALSE); // OROC shift C0 side
1245 rocRotOROCC0->SetElectronArrivalCorrection(kFALSE); // OROC rot C0 side
1247 /* // verification plots
1250 rocShiftIROCA0->SetName("rocShiftIROCA0");rocShiftIROCA0->SetTitle("rocShiftIROCA0");
1251 rocRotIROCA0->SetName("rocRotIROCA0");rocRotIROCA0->SetTitle("rocRotIROCA0");
1252 rocShiftOROCA0->SetName("rocShiftOROCA0"); rocShiftOROCA0->SetTitle("rocShiftOROCA0");
1253 rocRotOROCA0->SetName("rocRotOROCA0");rocRotOROCA0->SetTitle("rocRotOROCA0");
1255 rocShiftIROCC0->SetName("rocShiftIROCC0");rocShiftIROCC0->SetTitle("rocShiftIROCC0");
1256 rocRotIROCC0->SetName("rocRotIROCC0");rocRotIROCC0->SetTitle("rocRotIROCC0");
1257 rocShiftOROCC0->SetName("rocShiftOROCC0");rocShiftOROCC0->SetTitle("rocShiftOROCC0");
1258 rocRotOROCC0->SetName("rocRotOROCC0");rocRotOROCC0->SetTitle("rocRotOROCC0");
1261 TObjArray *cs = new TObjArray();
1262 cs->Add(rocShiftIROCA0); // IROC shift A0 side
1263 cs->Add(rocRotIROCA0); // IROC rot A0 side
1264 cs->Add(rocShiftOROCA0); // OROC shift A0 side
1265 cs->Add(rocRotOROCA0); // OROC rot A0 side
1266 cs->Add(rocShiftIROCC0); // IROC shift C0 side
1267 cs->Add(rocRotIROCC0); // IROC rot C0 side
1268 cs->Add(rocShiftOROCC0); // OROC shift C0 side
1269 cs->Add(rocRotOROCC0); // OROC rot C0 side
1271 corrField3DSector->SetCorrections(cs);
1272 corrField3DSector->SetOmegaTauT1T2(0,T1,T2);
1273 corrField3DSector->Print();
1276 fCorrectionsROC->cd();
1277 corrField3DSector->Init();
1278 corrField3DSector->Print("da");
1279 fCorrectionsROC->cd();
1280 corrField3DSector->Write("TPCROCVoltError3DSector");
1282 AliTPCCorrection::AddVisualCorrection(rocShiftIROCA0,800); // IROC shift A0 side
1283 AliTPCCorrection::AddVisualCorrection(rocRotIROCA0,801); // IROC rot A0 side
1284 AliTPCCorrection::AddVisualCorrection(rocShiftOROCA0,802); // OROC shift A0 side
1285 AliTPCCorrection::AddVisualCorrection(rocRotOROCA0,803); // OROC rot A0 side
1286 AliTPCCorrection::AddVisualCorrection(rocShiftIROCC0,804); // IROC shift C0 side
1287 AliTPCCorrection::AddVisualCorrection(rocRotIROCC0,805); // IROC rot C0 side
1288 AliTPCCorrection::AddVisualCorrection(rocShiftOROCC0,806); // OROC shift C0 side
1289 AliTPCCorrection::AddVisualCorrection(rocRotOROCC0,807); // OROC rot C0 side
1291 // Register correction for plus setting
1292 AliTPCCorrection *corr =0;
1293 Double_t wtp = -10.0 * (0.5*10) * vdrift / ezField ;
1294 Double_t wtm = -10.0 * (0.5*10) * vdrift / -ezField ;
1296 corr=(AliTPCCorrection *)rocShiftIROCA0->Clone();
1297 corr->SetOmegaTauT1T2(wtp,T1,T2);
1298 AliTPCCorrection::AddVisualCorrection(corr,820); // IROC shift A0 side + Plus field
1300 corr=(AliTPCCorrection *)rocRotIROCA0->Clone();
1301 corr->SetOmegaTauT1T2(wtp,T1,T2);
1302 AliTPCCorrection::AddVisualCorrection(corr,821); // IROC rot A0 side
1304 corr=(AliTPCCorrection *)rocShiftOROCA0->Clone();
1305 corr->SetOmegaTauT1T2(wtp,T1,T2);
1306 AliTPCCorrection::AddVisualCorrection(corr,822); // OROC shift A0 side
1308 corr=(AliTPCCorrection *)rocRotOROCA0->Clone();
1309 corr->SetOmegaTauT1T2(wtp,T1,T2);
1310 AliTPCCorrection::AddVisualCorrection(corr,823); // OROC rot A0 side
1311 corr=(AliTPCCorrection *)rocShiftIROCC0->Clone();
1312 corr->SetOmegaTauT1T2(wtp,T1,T2);
1313 AliTPCCorrection::AddVisualCorrection(corr,824); // IROC shift C0 side + Plus field
1315 corr=(AliTPCCorrection *)rocRotIROCC0->Clone();
1316 corr->SetOmegaTauT1T2(wtp,T1,T2);
1317 AliTPCCorrection::AddVisualCorrection(corr,825); // IROC rot C0 side
1319 corr=(AliTPCCorrection *)rocShiftOROCC0->Clone();
1320 corr->SetOmegaTauT1T2(wtp,T1,T2);
1321 AliTPCCorrection::AddVisualCorrection(corr,826); // OROC shift C0 side
1323 corr=(AliTPCCorrection *)rocRotOROCC0->Clone();
1324 corr->SetOmegaTauT1T2(wtp,T1,T2);
1325 AliTPCCorrection::AddVisualCorrection(corr,827); // OROC rot C0 side
1327 corr=(AliTPCCorrection *)rocShiftIROCA0->Clone();
1328 corr->SetOmegaTauT1T2(wtm,T1,T2);
1329 AliTPCCorrection::AddVisualCorrection(corr,840); // IROC shift A0 side + Plus field
1331 corr=(AliTPCCorrection *)rocRotIROCA0->Clone();
1332 corr->SetOmegaTauT1T2(wtm,T1,T2);
1333 AliTPCCorrection::AddVisualCorrection(corr,841); // IROC rot A0 side
1335 corr=(AliTPCCorrection *)rocShiftOROCA0->Clone();
1336 corr->SetOmegaTauT1T2(wtm,T1,T2);
1337 AliTPCCorrection::AddVisualCorrection(corr,842); // OROC shift A0 side
1339 corr=(AliTPCCorrection *)rocRotOROCA0->Clone();
1340 corr->SetOmegaTauT1T2(wtm,T1,T2);
1341 AliTPCCorrection::AddVisualCorrection(corr,843); // OROC rot A0 side
1342 corr=(AliTPCCorrection *)rocShiftIROCC0->Clone();
1343 corr->SetOmegaTauT1T2(wtm,T1,T2);
1344 AliTPCCorrection::AddVisualCorrection(corr,844); // IROC shift C0 side + Plus field
1346 corr=(AliTPCCorrection *)rocRotIROCC0->Clone();
1347 corr->SetOmegaTauT1T2(wtm,T1,T2);
1348 AliTPCCorrection::AddVisualCorrection(corr,845); // IROC rot C0 side
1350 corr=(AliTPCCorrection *)rocShiftOROCC0->Clone();
1351 corr->SetOmegaTauT1T2(wtm,T1,T2);
1352 AliTPCCorrection::AddVisualCorrection(corr,846); // OROC shift C0 side
1354 corr=(AliTPCCorrection *)rocRotOROCC0->Clone();
1355 corr->SetOmegaTauT1T2(wtm,T1,T2);
1356 AliTPCCorrection::AddVisualCorrection(corr,847); // OROC rot C0 side
1358 fCorrectionsROC->Close();
1359 delete fCorrectionsROC;
1366 AliTPCComposedCorrection * MakeComposedCorrectionExB(){
1368 // make composed corection for ExB scanning
1370 RegisterCorrection();
1373 TObjArray * corr = new TObjArray; // primitive corrections - for fitting
1374 TObjArray * testCorr = new TObjArray; // test corrections - to be used as benchmark for fitting
1376 corr->AddLast(twistX);
1377 corr->AddLast(twistY);
1378 corr->AddLast(exbShape);
1379 corr->AddLast(exbShapeT1X);
1380 corr->AddLast(exbShapeT2X);
1382 for (Int_t i=0; i<8; i++){
1383 corr->AddLast(boundaryVoltErrorA[i]);
1384 corr->AddLast(boundaryVoltErrorC[i]);
1389 corr->AddLast(rodIFCCos);
1390 corr->AddLast(rodIFCSin);
1391 corr->AddLast(rodOFCSin);
1392 corr->AddLast(rodOFCCos);
1394 corr->AddLast(alignTrans0);
1395 corr->AddLast(alignTrans1);
1396 corr->AddLast(alignTrans2);
1397 corr->AddLast(alignRot0);
1398 corr->AddLast(alignRot1);
1399 corr->AddLast(alignRot2);
1401 corr->AddLast(alignTrans0D[0]);
1402 corr->AddLast(alignTrans1D[0]);
1403 corr->AddLast(alignTrans2D[0]);
1404 corr->AddLast(alignRot0D[0]);
1405 corr->AddLast(alignRot1D[0]);
1406 corr->AddLast(alignRot2D[0]);
1407 corr->AddLast(alignTrans0D[1]);
1408 corr->AddLast(alignTrans1D[1]);
1409 corr->AddLast(alignRot0D[1]);
1410 corr->AddLast(alignTrans0D[2]);
1411 corr->AddLast(alignTrans1D[2]);
1412 corr->AddLast(alignRot0D[2]);
1414 // z alignment + E field distortion due z misalignment
1416 corr->AddLast(rocRotgXA); // A side C side
1417 corr->AddLast(rocRotgYA);
1418 corr->AddLast(rocRotgXC);
1419 corr->AddLast(rocRotgYC);
1420 corr->AddLast(rocDzIROCA);
1421 corr->AddLast(rocDzIROCC);
1422 corr->AddLast(rocRotIROCA);
1423 corr->AddLast(rocRotIROCC);
1424 corr->AddLast(rocDzUDA);
1425 corr->AddLast(rocDzUDC);
1426 corr->AddLast(rocRotUDA);
1427 corr->AddLast(rocRotUDC);
1430 corr->AddLast(calibDrift[0]);
1431 corr->AddLast(calibDrift[1]);
1432 corr->AddLast(calibDrift[2]);
1433 corr->AddLast(calibDrift[3]);
1434 corr->AddLast(calibDrift[4]);
1435 corr->AddLast(calibDrift[5]);
1436 corr->AddLast(calibDrift[6]);
1438 // setup test correction
1440 testCorr->AddLast(rodIFCCos);
1441 testCorr->AddLast(rodIFCSin);
1442 testCorr->AddLast(rodOFCSin);
1443 testCorr->AddLast(rodOFCCos);
1445 testCorr->AddLast(twistX);
1446 testCorr->AddLast(twistY);
1447 testCorr->AddLast(alignTrans0);
1448 testCorr->AddLast(alignTrans1);
1449 testCorr->AddLast(alignTrans2);
1450 testCorr->AddLast(alignRot0);
1451 testCorr->AddLast(alignRot1);
1452 testCorr->AddLast(alignRot2);
1453 testCorr->AddLast(rocRotgXA); // A side C side
1454 testCorr->AddLast(rocRotgYA);
1455 testCorr->AddLast(rocRotgXC);
1456 testCorr->AddLast(rocRotgYC);
1457 testCorr->AddLast(rocDzIROCA);
1458 testCorr->AddLast(rocDzIROCC);
1459 testCorr->AddLast(rocRotIROCA);
1460 testCorr->AddLast(rocRotIROCC);
1461 Int_t entries=testCorr->GetEntries();
1462 TVectorD weights(entries);
1463 for (Int_t i=0; i<entries; i++) weights[i]=1;
1465 AliTPCComposedCorrection *composedTest= new AliTPCComposedCorrection ;
1466 composedTest->SetName("FitSample");
1467 composedTest->SetTitle("FitSample");
1468 composedTest->SetCorrections(testCorr);
1469 composedTest->SetWeights(&weights);
1471 corr->AddLast(composedTest);
1472 AliTPCComposedCorrection *cc= new AliTPCComposedCorrection ;
1473 cc->SetCorrections((TObjArray*)(corr));
1475 cc->Print("DA"); // Print used correction classes
1476 cc->SetName("ComposedExB");
1477 TFile fexb("RegisterCorrectionExB.root","recreate");
1478 cc->Write("ComposedExB");
1484 AliTPCComposedCorrection * GetCorrectionFromFile(){
1486 // Getthe appropariate correction form the closest file
1488 TFile * fexb= TFile::Open("RegisterCorrectionExB.root");
1489 if (!fexb) fexb= TFile::Open("../RegisterCorrectionExB.root");
1490 if (!fexb) fexb= TFile::Open("../../RegisterCorrectionExB.root");
1491 if (!fexb) fexb= TFile::Open("../../../RegisterCorrectionExB.root");
1493 if (!fexb) return 0;
1494 TFile * fitter= TFile::Open("fitCorrection.root");
1496 if (!fitter) fitter= TFile::Open("../fitCorrection.root");
1497 if (!fitter) fitter= TFile::Open("../../fitCorrection.root");
1498 if (!fitter) fitter= TFile::Open("../../../fitCorrection.root");
1500 AliTPCComposedCorrection *cc= (AliTPCComposedCorrection*) fexb->Get("ComposedExB");
1502 printf("File or correction RegisterCorrectionExB.root doees not exist or corrupted\n\n\n");
1505 TObjArray * corr = (TObjArray*)(cc->GetCorrections());
1506 // TObjArray * corrLocal =new TObjArray;
1507 // TObjArray * corrGlobal =new TObjArray;
1510 if (fitter->GetKey("FitBoundary")) corr->AddLast(fitter->Get("FitBoundary"));
1511 if (fitter->GetKey("FitExBTwist")) corr->AddLast(fitter->Get("FitExBTwist"));
1512 if (fitter->GetKey("FitAlignGlobal")) corr->AddLast(fitter->Get("FitAlignGlobal"));
1513 if (fitter->GetKey("FitRodAlignGloba")) corr->AddLast(fitter->Get("FitRodAlignGlobal"));
1514 if (fitter->GetKey("FitRocAlignGlobal")) corr->AddLast(fitter->Get("FitRocAlignGlobal"));
1515 if (fitter->GetKey("FitRocAlignZ")) corr->AddLast(fitter->Get("FitRocAlignZ"));
1516 if (fitter->GetKey("FitAlignLocal")) corr->AddLast(fitter->Get("FitAlignLocal"));
1517 if (fitter->GetKey("FitAlignTPC")) corr->AddLast(fitter->Get("FitAlignTPC"));
1518 if (fitter->GetKey("FitAlignTOF")) corr->AddLast(fitter->Get("FitAlignTOF"));
1519 if (fitter->GetKey("FitAlignTRD")) corr->AddLast(fitter->Get("FitAlignTRD"));
1524 void TestParExample(){
1526 // dz shift example: AliTPCCorrection::AddVisualCorrection(rocDzIROCA,705);
1527 // => parabolic fit and helix fit agrees - once significant ammount of points used
1528 // 160 point - agreement ~2%;
1529 // 80 points - agreement ~5%
1530 AliTPCCorrection* corr = AliTPCCorrection::GetVisualCorrection(705);
1531 corr->SetOmegaTauT1T2(0.33,1,1);
1532 TF1 f705Par("f705","AliTPCCorrectionFit::EvalAtPar(0,0,85, x,0.1,705,0,80)",0,360);
1533 f705Par.SetLineColor(2);f705Par.SetNpx(500);
1534 TF1 f705Helix("f705Helix","AliTPCCorrectionFit::EvalAtHelix(0,0,85,x,0.1,705,0,80)",0,360);
1535 f705Helix.SetLineColor(4);f705Helix.SetNpx(500);
1537 f705Par.Draw("same");
1543 void TestFitSpeed(Int_t nEvals){
1545 // test speed of helix fit/ resp. parabolic fir
1548 ::Info("TestFitSpeed","Helix fit");
1549 for (Int_t i=0;i<nEvals; i++) AliTPCCorrectionFit::EvalAtPar(0,0,85,gRandom->Rndm(),0.1,705,0,80);
1552 ::Info("TestFitSpeed","Parabolicfit");
1553 for (Int_t i=0;i<nEvals; i++) AliTPCCorrectionFit::EvalAtPar(0,0,85,gRandom->Rndm(),0.1,705,0,80);
1556 For the test system CPU comsumption is the same:
1557 I-TestFitSpeed: Helix fit
1558 Real time 0:00:03, CP time 3.310
1559 I-TestFitSpeed: Parabolicfit
1560 Real time 0:00:03, CP time 3.280