4 Register primitive corrections: base functions for minimization:
5 Id numbers are assoctied 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
9 filename = TPCCorrectionPrimitives.root
12 RegisterCorrection(); - Reserved id's 0 -999
14 RegisterAliTPCFCVoltError3D(); - Reserved id's 0 -99
15 RegisterAliTPCBoundaryVoltError(); - Reserved id's 100-199
16 RegisterAliTPCCalibGlobalMisalignment(); - Reserved id's 200-499
17 RegisterAliTPCExBBShape(); - Reserved id's 500-600
18 RegisterAliTPCExBTwist(); - Reserved id's 600-700
19 RegisterAliTPCROCVoltError3D() - Reserved id's 700-800
20 RegisterAliTPCROCVoltError3DSector() - Reserved id's 800-900
22 .L $ALICE_ROOT/TPC/CalibMacros/RegisterCorrection.C+
26 #if !defined(__CINT__) || defined(__MAKECINT__)
28 #include "TObjArray.h"
29 #include "TTreeStream.h"
41 #include "AliTPCParamSR.h"
42 #include "TDatabasePDG.h"
43 #include "AliTPCCorrection.h"
44 #include "AliTPCFCVoltError3D.h"
45 #include "AliTPCROCVoltError3D.h"
46 #include "AliTPCComposedCorrection.h"
47 #include "AliTPCBoundaryVoltError.h"
48 #include "AliTPCCalibGlobalMisalignment.h"
49 #include "AliTPCExBBShape.h"
50 #include "AliTPCExBTwist.h"
52 #include "AliCDBEntry.h"
53 #include "AliTPCROC.h"
54 #include <TStatToolkit.h>
56 #include "TGraphErrors.h"
57 #include "AliTrackerBase.h"
58 #include "TGeoGlobalMagField.h"
65 TFile *fCorrections=0; //file with corrections
67 //models E field distortion AliTPCFCVoltError3D
69 AliTPCFCVoltError3D *rotOFC =0; // fit models
70 AliTPCFCVoltError3D *rodOFC1 =0;
71 AliTPCFCVoltError3D *rodOFC2 =0;
72 AliTPCFCVoltError3D *rotIFC =0;
73 AliTPCFCVoltError3D *rodIFC1 =0;
74 AliTPCFCVoltError3D *rodIFC2 =0;
75 AliTPCFCVoltError3D *rodIFCShift=0; //common IFC shift
76 AliTPCFCVoltError3D *rodOFCShift=0; //common OFC shift
77 AliTPCFCVoltError3D *rodIFCSin=0; //common IFC shift -sinus
78 AliTPCFCVoltError3D *rodOFCSin=0; //common OFC shift -sinus
79 AliTPCFCVoltError3D *rodIFCCos=0; //common IFC shift -cos
80 AliTPCFCVoltError3D *rodOFCCos=0; //common OFC shift -cos
82 AliTPCROCVoltError3D *rocRotgXA=0; // roc rotation A side - inclination in X
83 AliTPCROCVoltError3D *rocRotgYA=0; // roc rotation A side - inclination in Y
84 AliTPCROCVoltError3D *rocRotgXC=0; // roc rotation C side - inclination in X
85 AliTPCROCVoltError3D *rocRotgYC=0; // roc rotation C side - inclination in Y
86 AliTPCROCVoltError3D *rocDzIROCA=0; // roc shift A side - in Z
87 AliTPCROCVoltError3D *rocDzIROCC=0; // roc shift C side - in Z
88 AliTPCROCVoltError3D *rocRotIROCA=0; // roc rotation A side - in Z
89 AliTPCROCVoltError3D *rocRotIROCC=0; // roc rotation C side - in Z
91 AliTPCROCVoltError3D *rocShiftIROCA0=0; // IROC shift A0 side
92 AliTPCROCVoltError3D *rocRotIROCA0=0; // IROC rot A0 side
93 AliTPCROCVoltError3D *rocShiftOROCA0=0; // OROC shift A0 side
94 AliTPCROCVoltError3D *rocRotOROCA0=0; // OROC rot A0 side
95 AliTPCROCVoltError3D *rocShiftIROCC0=0; // IROC shift C0 side
96 AliTPCROCVoltError3D *rocRotIROCC0=0; // IROC rot C0 side
97 AliTPCROCVoltError3D *rocShiftOROCC0=0; // OROC shift C0 side
98 AliTPCROCVoltError3D *rocRotOROCC0=0; // OROC rot C0 side
102 AliTPCBoundaryVoltError *boundaryVoltErrorA[8]; // boundary voltage error A side
103 AliTPCBoundaryVoltError *boundaryVoltErrorC[8]; // boundary voltage error C side
104 AliTPCExBBShape *exbShape = 0; // nominal correctin
105 AliTPCExBBShape *exbShapeT1X = 0; // nominal +deltaT1=0.1
106 AliTPCExBBShape *exbShapeT2X = 0; // nominal +deltaT2=0.1
107 AliTPCExBTwist *twistX = 0;
108 AliTPCExBTwist *twistY = 0;
110 AliTPCCalibGlobalMisalignment *alignRot0=0;
111 AliTPCCalibGlobalMisalignment *alignRot1=0;
112 AliTPCCalibGlobalMisalignment *alignRot2=0;
113 AliTPCCalibGlobalMisalignment *alignTrans0=0;
114 AliTPCCalibGlobalMisalignment *alignTrans1=0;
115 AliTPCCalibGlobalMisalignment *alignTrans2=0;
120 void RegisterAliTPCFCVoltError3D();
121 void RegisterAliTPCCalibGlobalMisalignment();
122 void RegisterAliTPCBoundaryVoltError();
123 void RegisterAliTPCExBShape();
124 void RegisterAliTPCExBTwist();
125 void RegisterAliTPCROCVoltError3D();
126 void RegisterAliTPCROCVoltError3DSector();
129 void RegisterCorrection(Int_t type=0){
133 // check the presence of corrections in file
135 gROOT->Macro("ConfigCalibTrain.C(119037)");
138 if (type==1) return RegisterAliTPCROCVoltError3D();
139 if (type==2) return RegisterAliTPCROCVoltError3DSector();
140 fCorrections = new TFile("TPCCorrectionPrimitives.root");
141 AliTPCComposedCorrection *corrField3D = (AliTPCComposedCorrection*) fCorrections->Get("TPCFCVoltError3D");
142 // if not make new file
143 if (!corrField3D) fCorrections = new TFile("TPCCorrectionPrimitives.root","update");
145 RegisterAliTPCROCVoltError3D();
146 RegisterAliTPCROCVoltError3DSector();
148 RegisterAliTPCCalibGlobalMisalignment();
149 RegisterAliTPCBoundaryVoltError();
150 RegisterAliTPCFCVoltError3D();
151 RegisterAliTPCExBShape();
152 RegisterAliTPCExBTwist();
153 if (fCorrections) fCorrections->Close();
159 void RegisterAliTPCFCVoltError3D(){
161 // Load the models from the file
163 // Register functions with following IDs:
164 // IMPORTANT: The nominal shift is in mm
179 printf("RegisterAliTPCFCVoltError3D()");
180 Int_t volt = 40; // 40 V ~ 1mm
181 AliTPCComposedCorrection *corrField3D = (AliTPCComposedCorrection*) fCorrections->Get("TPCFCVoltError3D");
182 if (corrField3D) { // load form file
183 corrField3D->Print();
184 TCollection *iter = corrField3D->GetCorrections();
185 rotOFC = (AliTPCFCVoltError3D*)iter->FindObject("rotOFC");
186 rodOFC1 = (AliTPCFCVoltError3D*)iter->FindObject("rodOFC1");
187 rodOFC2 = (AliTPCFCVoltError3D*)iter->FindObject("rodOFC2");
188 rotIFC = (AliTPCFCVoltError3D*)iter->FindObject("rotIFC");
189 rodIFC1 = (AliTPCFCVoltError3D*)iter->FindObject("rodIFC1");
190 rodIFC2 = (AliTPCFCVoltError3D*)iter->FindObject("rodIFC2");
192 rodIFCShift = (AliTPCFCVoltError3D*)iter->FindObject("rodIFCShift");
193 rodOFCShift = (AliTPCFCVoltError3D*)iter->FindObject("rodOFCShift");
194 rodIFCSin = (AliTPCFCVoltError3D*)iter->FindObject("rodIFCSin");
195 rodOFCSin = (AliTPCFCVoltError3D*)iter->FindObject("rodOFCSin");
196 rodIFCCos = (AliTPCFCVoltError3D*)iter->FindObject("rodIFCCos");
197 rodOFCCos = (AliTPCFCVoltError3D*)iter->FindObject("rodOFCCos");
200 rotOFC = new AliTPCFCVoltError3D();
201 rotOFC->SetOmegaTauT1T2(0,1,1);
202 rotOFC->SetRotatedClipVoltA(1,volt);
203 rotOFC->SetRotatedClipVoltC(1,volt);
205 rodOFC1 = new AliTPCFCVoltError3D();
206 rodOFC1->SetOmegaTauT1T2(0,1,1);
207 rodOFC1->SetRodVoltShiftA(18,volt);
208 rodOFC1->SetRodVoltShiftC(18,volt);
210 rodOFC2 = new AliTPCFCVoltError3D();
211 rodOFC2->SetOmegaTauT1T2(0,1,1);
212 rodOFC2->SetCopperRodShiftA(18,volt);
213 rodOFC2->SetCopperRodShiftC(18,volt);
215 rotIFC = new AliTPCFCVoltError3D();
216 rotIFC->SetOmegaTauT1T2(0,1,1);
217 rotIFC->SetRotatedClipVoltA(0,volt);
218 rotIFC->SetRotatedClipVoltC(0,volt);
220 rodIFC1 = new AliTPCFCVoltError3D();
221 rodIFC1->SetOmegaTauT1T2(0,1,1);
222 rodIFC1->SetRodVoltShiftA(0,volt);
223 rodIFC1->SetRodVoltShiftC(0,volt);
225 rodIFC2 = new AliTPCFCVoltError3D();
226 rodIFC2->SetOmegaTauT1T2(0,1,1);
227 rodIFC2->SetCopperRodShiftA(0,volt);
228 rodIFC2->SetCopperRodShiftC(0,volt);
230 rodIFCShift = new AliTPCFCVoltError3D();
231 rodIFCSin = new AliTPCFCVoltError3D();
232 rodIFCCos = new AliTPCFCVoltError3D();
233 rodOFCShift = new AliTPCFCVoltError3D();
234 rodOFCSin = new AliTPCFCVoltError3D();
235 rodOFCCos = new AliTPCFCVoltError3D();
236 for (Int_t isec=0; isec<18; isec++){
237 Double_t phi=TMath::Pi()*isec/9.;
238 rodIFCShift->SetOmegaTauT1T2(0,1,1);
239 rodIFCShift->SetRodVoltShiftA(isec,volt);
240 rodIFCShift->SetRodVoltShiftC(isec,volt);
241 rodIFCSin->SetOmegaTauT1T2(0,1,1);
242 rodIFCSin->SetRodVoltShiftA(isec,volt*TMath::Sin(phi));
243 rodIFCSin->SetRodVoltShiftC(isec,volt*TMath::Sin(phi));
244 rodIFCCos->SetOmegaTauT1T2(0,1,1);
245 rodIFCCos->SetRodVoltShiftA(isec,volt*TMath::Cos(phi));
246 rodIFCCos->SetRodVoltShiftC(isec,volt*TMath::Cos(phi));
248 rodOFCShift->SetOmegaTauT1T2(0,1,1);
249 rodOFCShift->SetRodVoltShiftA(18+isec,volt);
250 rodOFCShift->SetRodVoltShiftC(18+isec,volt);
251 rodOFCSin->SetOmegaTauT1T2(0,1,1);
252 rodOFCSin->SetRodVoltShiftA(18+isec,volt*TMath::Sin(phi));
253 rodOFCSin->SetRodVoltShiftC(18+isec,volt*TMath::Sin(phi));
254 rodOFCCos->SetOmegaTauT1T2(0,1,1);
255 rodOFCCos->SetRodVoltShiftA(18+isec,volt*TMath::Cos(phi));
256 rodOFCCos->SetRodVoltShiftC(18+isec,volt*TMath::Cos(phi));
260 // Initialization of the lookup tables
262 printf(" ------- OFC rotated clip:\n"); rotOFC->InitFCVoltError3D();
263 printf(" ------- OFC rod & strip:\n"); rodOFC1->InitFCVoltError3D();
264 printf(" ------- OFC copper rod:\n"); rodOFC2->InitFCVoltError3D();
265 printf(" ------- IFC rotated clip:\n"); rotIFC->InitFCVoltError3D();
266 printf(" ------- IFC rod & strip:\n"); rodIFC1->InitFCVoltError3D();
267 printf(" ------- IFC copper rod:\n"); rodIFC2->InitFCVoltError3D();
269 printf(" ------- IFC rod & strip shift:\n"); rodIFCShift->InitFCVoltError3D();
270 printf(" ------- IFC rod & strip sin:\n"); rodIFCSin->InitFCVoltError3D();
271 printf(" ------- IFC rod & strip cos:\n"); rodIFCCos->InitFCVoltError3D();
272 printf(" ------- OFC rod & strip shift:\n"); rodOFCShift->InitFCVoltError3D();
273 printf(" ------- OFC rod & strip sin:\n"); rodOFCSin->InitFCVoltError3D();
274 printf(" ------- OFC rod & strip cos:\n"); rodOFCCos->InitFCVoltError3D();
277 rotOFC->SetName("rotOFC");rotOFC->SetTitle("rotOFC");
278 rodOFC1->SetName("rodOFC1");rodOFC1->SetTitle("rodOFC1");
279 rodOFC2->SetName("rodOFC2");rodOFC2->SetTitle("rodOFC2");
280 rotIFC->SetName("rotIFC");rotIFC->SetTitle("rotIFC");
281 rodIFC1->SetName("rodIFC1");rodIFC1->SetTitle("rodIFC1");
282 rodIFC2->SetName("rodIFC2");rodIFC2->SetTitle("rodIFC2");
284 rodIFCShift->SetName("rodIFCShift");rodIFCShift->SetTitle("rodIFCShift");
285 rodIFCSin->SetName("rodIFCSin");rodIFCSin->SetTitle("rodIFCSin");
286 rodIFCCos->SetName("rodIFCCos");rodIFCCos->SetTitle("rodIFCCos");
288 rodOFCShift->SetName("rodOFCShift");rodOFCShift->SetTitle("rodOFCShift");
289 rodOFCSin->SetName("rodOFCSin");rodOFCSin->SetTitle("rodOFCSin");
290 rodOFCCos->SetName("rodOFCCos");rodOFCCos->SetTitle("rodOFCCos");
293 corrField3D = new AliTPCComposedCorrection();
294 TObjArray *cs = new TObjArray();
295 cs->Add(rotIFC); cs->Add(rotOFC);
296 cs->Add(rodIFC1); cs->Add(rodOFC1);
297 cs->Add(rodIFC2); cs->Add(rodOFC2);
298 cs->Add(rodIFCShift); cs->Add(rodIFCSin); cs->Add(rodIFCCos);
299 cs->Add(rodOFCShift); cs->Add(rodOFCSin); cs->Add(rodOFCCos);
301 corrField3D->SetCorrections(cs);
302 corrField3D->SetOmegaTauT1T2(0,1.,1.);
303 corrField3D->Print();
305 corrField3D->Write("TPCFCVoltError3D");
308 AliTPCCorrection::AddVisualCorrection(rotOFC,0);
309 AliTPCCorrection::AddVisualCorrection(rodOFC1,1);
310 AliTPCCorrection::AddVisualCorrection(rodOFC2,2);
311 AliTPCCorrection::AddVisualCorrection(rotIFC,3);
312 AliTPCCorrection::AddVisualCorrection(rodIFC1,4);
313 AliTPCCorrection::AddVisualCorrection(rodIFC2,5);
314 // common corrections
316 AliTPCCorrection::AddVisualCorrection(rodIFCShift,6);
317 AliTPCCorrection::AddVisualCorrection(rodIFCSin,7);
318 AliTPCCorrection::AddVisualCorrection(rodIFCCos,8);
320 AliTPCCorrection::AddVisualCorrection(rodIFCShift,9);
321 AliTPCCorrection::AddVisualCorrection(rodIFCSin,10);
322 AliTPCCorrection::AddVisualCorrection(rodIFCCos,11);
326 void RegisterAliTPCCalibGlobalMisalignment(){
328 // Register primitive alignment components.
329 // Linear conbination of primitev forulas used for fit
330 // The nominal delta 1 mm in shift and 1 mrad in rotation
331 // Primitive formulas registeren in AliTPCCoreection::AddvisualCorrection
339 printf("RegisterAliTPCCalibGlobalMisalignment()\n");
345 TGeoRotation rot2; //transformation matrices
346 TGeoRotation rot90; //transformation matrices
347 matrixX.SetDx(0.1); matrixY.SetDy(0.1); matrixZ.SetDz(0.1); //1 mm translation
348 rot0.SetAngles(0.001*TMath::RadToDeg(),0,0);
349 rot1.SetAngles(0,0.001*TMath::RadToDeg(),0);
350 rot2.SetAngles(0,0,0.001*TMath::RadToDeg());
352 rot90.SetAngles(0,90,0);
353 rot2.MultiplyBy(&rot90,kTRUE);
354 rot90.SetAngles(0,-90,0);
355 rot2.MultiplyBy(&rot90,kFALSE);
356 alignRot0 =new AliTPCCalibGlobalMisalignment;
357 alignRot0->SetAlignGlobal(&rot0);
358 alignRot0->SetName("alignRot0");
359 alignRot1=new AliTPCCalibGlobalMisalignment;
360 alignRot1->SetAlignGlobal(&rot1);
361 alignRot1->SetName("alignRot1");
362 alignRot2=new AliTPCCalibGlobalMisalignment;
363 alignRot2->SetAlignGlobal(&rot2);
364 alignRot2->SetName("alignRot2");
366 alignTrans0 =new AliTPCCalibGlobalMisalignment;
367 alignTrans0->SetAlignGlobal(&matrixX);
368 alignTrans0->SetName("alignTrans0");
369 alignTrans1=new AliTPCCalibGlobalMisalignment;
370 alignTrans1->SetAlignGlobal(&matrixY);
371 alignTrans1->SetName("alignTrans1");
372 alignTrans2=new AliTPCCalibGlobalMisalignment;
373 alignTrans2->SetAlignGlobal(&matrixZ);
374 alignTrans2->SetName("alignTrans2");
376 AliTPCCorrection::AddVisualCorrection(alignTrans0 ,200);
377 AliTPCCorrection::AddVisualCorrection(alignTrans1 ,201);
378 AliTPCCorrection::AddVisualCorrection(alignTrans2 ,202);
379 AliTPCCorrection::AddVisualCorrection(alignRot0 ,203);
380 AliTPCCorrection::AddVisualCorrection(alignRot1 ,204);
381 AliTPCCorrection::AddVisualCorrection(alignRot2 ,205);
383 TObjArray arrAlign(6);
384 arrAlign.AddAt(alignTrans0->Clone(),0);
385 arrAlign.AddAt(alignTrans1->Clone(),1);
386 arrAlign.AddAt(alignTrans2->Clone(),2);
387 arrAlign.AddAt(alignRot0->Clone(),3);
388 arrAlign.AddAt(alignRot1->Clone(),4);
389 arrAlign.AddAt(alignRot2->Clone(),5);
390 //combAlign.SetCorrections((TObjArray*)arrAlign.Clone());
394 void RegisterAliTPCBoundaryVoltError(){
396 // Register phi symetric E filed distortions
397 // 100-108 - A side 0 Field
398 // 110-118 - C side 0 Field
399 // 120-128 - A side +0.5 Field
400 // 130-138 - C side +0.5 Field
401 // 140-148 - A side -0.5 Field
402 // 150-158 - C side -0.5 Field
404 Double_t vdrift = 2.64; // [cm/us] // to be updated: per second (ideally)
405 Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully)
408 Double_t wtP = -10.0 * (0.5*10) * vdrift / ezField ;
409 Double_t wtM = -10.0 * (0.5*10) * vdrift / -ezField ;
411 printf("RegisterAliTPCBoundaryVoltError()\n");
412 AliTPCComposedCorrection *corrField2D = (AliTPCComposedCorrection*) fCorrections->Get("TPCFCVoltError2D");
415 TObjArray *array=new TObjArray(16);
416 Double_t val = 40.; // 1mm
417 Float_t bound0[8] = { 0, 0,0,0,0,0,0,0};
418 Float_t boundAi[8] = { 0, 0,0,0,0,0,0,0};
419 Float_t boundCi[8] = { 0, 0,0,0,0,0,0,0};
420 for (Int_t ipar=0; ipar<8; ipar++){
422 boundaryVoltErrorA[ipar] = new AliTPCBoundaryVoltError;
423 boundaryVoltErrorC[ipar] = new AliTPCBoundaryVoltError;
424 boundaryVoltErrorA[ipar]->SetName(Form("BoundaryVoltErrorAsidePar%d",ipar));
425 boundaryVoltErrorA[ipar]->SetTitle(Form("BoundaryVoltErrorAsidePar%d",ipar));
426 boundaryVoltErrorC[ipar]->SetName(Form("BoundaryVoltErrorCsidePar%d",ipar));
427 boundaryVoltErrorC[ipar]->SetTitle(Form("BoundaryVoltErrorCsidePar%d",ipar));
428 for (Int_t jpar=0; jpar<8; jpar++) if (ipar!=jpar){
435 boundaryVoltErrorA[ipar]->SetBoundariesA(boundAi);
436 boundaryVoltErrorA[ipar]->SetBoundariesC(bound0);
437 boundaryVoltErrorA[ipar]->InitBoundaryVoltErrorDistortion();
438 boundaryVoltErrorA[ipar]->SetOmegaTauT1T2(0.,1,1);
440 Float_t tempboundAi[8] = { 0, 0,0,0,0,0,-boundCi[6],-boundCi[7]};
441 boundaryVoltErrorC[ipar]->SetBoundariesA(tempboundAi);
442 boundaryVoltErrorC[ipar]->SetBoundariesC(boundCi);
444 boundaryVoltErrorC[ipar]->InitBoundaryVoltErrorDistortion();
445 boundaryVoltErrorC[ipar]->SetOmegaTauT1T2(0.,1,1);
446 array->AddAt(boundaryVoltErrorA[ipar],ipar);
447 array->AddAt(boundaryVoltErrorC[ipar],ipar+8);
448 boundaryVoltErrorA[ipar]->Print();
449 boundaryVoltErrorC[ipar]->Print();
450 AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorA[ipar], 100+ipar);
451 AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorC[ipar], 150+ipar);
453 corrField2D = new AliTPCComposedCorrection;
454 corrField2D->SetCorrections(array);
455 corrField2D->SetOmegaTauT1T2(0,1.,1.);
456 corrField2D->Print();
458 corrField2D->SetName("TPCFCVoltError2D");
459 corrField2D->SetTitle("TPCFCVoltError2D");
460 corrField2D->Write("TPCFCVoltError2D");
462 TObjArray *array = (TObjArray*)corrField2D->GetCorrections();
463 for (Int_t ipar=0; ipar<8; ipar++){
464 boundaryVoltErrorA[ipar] = (AliTPCBoundaryVoltError*) array->At(ipar);
465 boundaryVoltErrorC[ipar] = (AliTPCBoundaryVoltError*) array->At(ipar+8);
469 // Register correction
470 for (Int_t ipar=0; ipar<8; ipar++){
471 AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorA[ipar], 100+ipar);
472 AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorC[ipar], 110+ipar);
474 // correction for +-0.5 T setting
475 AliTPCCorrection *corrField =0;
476 corrField=(AliTPCCorrection *)boundaryVoltErrorA[ipar]->Clone();
477 corrField->SetOmegaTauT1T2(wtP,T1,T2);
478 AliTPCCorrection::AddVisualCorrection(corrField,120+ipar);
480 corrField=(AliTPCCorrection *)boundaryVoltErrorC[ipar]->Clone();
481 corrField->SetOmegaTauT1T2(wtP,T1,T2);
482 AliTPCCorrection::AddVisualCorrection(corrField,130+ipar);
484 corrField=(AliTPCCorrection *)boundaryVoltErrorA[ipar]->Clone();
485 corrField->SetOmegaTauT1T2(wtM,T1,T2);
486 AliTPCCorrection::AddVisualCorrection(corrField,140+ipar);
488 corrField=(AliTPCCorrection *)boundaryVoltErrorC[ipar]->Clone();
489 corrField->SetOmegaTauT1T2(wtM,T1,T2);
490 AliTPCCorrection::AddVisualCorrection(corrField,150+ipar);
497 void RegisterAliTPCExBShape(){
501 AliMagF *magF = new AliMagF("mag","mag");
503 exbShape = new AliTPCExBBShape;
504 exbShape->SetBField(magF);
505 exbShape->SetName("TPCExBShape");
506 exbShape->SetTitle("TPCExBShape");
507 exbShape->SetOmegaTauT1T2(0,1.,1.);
509 AliTPCCorrection::AddVisualCorrection(exbShape,500);
510 exbShapeT1X = new AliTPCExBBShape;
511 exbShapeT1X->SetBField(magF);
512 exbShapeT1X->SetName("TPCExbShapeT1X");
513 exbShapeT1X->SetTitle("TPCExbShapeT1X");
514 exbShapeT1X->SetOmegaTauT1T2(0,1.2,1.);
515 exbShapeT1X->Print();
516 AliTPCCorrection::AddVisualCorrection(exbShapeT1X,501);
517 exbShapeT2X = new AliTPCExBBShape;
518 exbShapeT2X->SetBField(magF);
519 exbShapeT2X->SetName("TPCExbShapeT2X");
520 exbShapeT2X->SetTitle("TPCExbShapeT2X");
521 exbShapeT2X->SetOmegaTauT1T2(0,1.0,1.2);
522 exbShapeT2X->Print();
523 AliTPCCorrection::AddVisualCorrection(exbShapeT2X,502);
527 void RegisterAliTPCExBTwist(){
531 twistX = new AliTPCExBTwist;
532 twistY = new AliTPCExBTwist;
533 twistX->SetXTwist(0.001); // 1 mrad twist in x
534 twistX->SetName("ExBTwistX");
535 twistX->SetTitle("ExBTwistX");
536 twistY->SetYTwist(0.001); // 1 mrad twist in y
537 twistY->SetName("ExBTwistY");
538 twistY->SetTitle("ExBTwistY");
539 twistX->SetOmegaTauT1T2(0,1.,1.);
540 twistY->SetOmegaTauT1T2(0,1.,1.);
541 AliTPCCorrection::AddVisualCorrection(twistX,600);
542 AliTPCCorrection::AddVisualCorrection(twistY,601);
546 void RegisterAliTPCROCVoltError3D(){
548 // ROC rotation transformation
549 // 700 -709 - 0 field
550 // 710 -719 - +0.5 field
551 // 720 -729 - -0.5 field
552 Double_t vdrift = 2.64; // [cm/us] // to be updated: per second (ideally)
553 Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully)
556 Double_t wtP = -10.0 * (0.5*10) * vdrift / ezField ;
557 Double_t wtM = -10.0 * (0.5*10) * vdrift / -ezField ;
560 rocRotgXA=0; // roc rotation A side - inclination in X
561 rocRotgYA=0; // roc rotation A side - inclination in Y
562 rocRotgXC=0; // roc rotation C side - inclination in X
563 rocRotgYC=0; // roc rotation C side - inclination in Y
564 rocDzIROCA=0; // roc shift A side - in Z
565 rocDzIROCC=0; // roc shift C side - in Z
566 rocRotIROCA=0; // roc rot IROC A side - in Z
567 rocRotIROCC=0; // roc rot OROC C side - in Z
569 printf("RegisterAliTPCROCVoltError3D()");
570 Double_t kAngle=0.001;
572 AliTPCROC * rocInfo = AliTPCROC::Instance();
573 Double_t lxRef = (rocInfo->GetPadRowRadii(0,62)+rocInfo->GetPadRowRadii(36,0))/2;
575 TMatrixD matrix(72,3);
577 AliTPCComposedCorrection *corrField3D = 0;
578 TFile *fCorrectionsROC=0;
579 fCorrectionsROC = new TFile("TPCCorrectionPrimitivesROC.root");
580 corrField3D = ( AliTPCComposedCorrection *)fCorrectionsROC->Get("TPCROCVoltError3DRotationgXgY");
583 fCorrectionsROC = new TFile("TPCCorrectionPrimitivesROC.root","recreate");
585 if (corrField3D) { // load from file
586 corrField3D->Print();
587 TCollection *iter = corrField3D->GetCorrections();
589 rocRotgXA=(AliTPCROCVoltError3D*)iter->FindObject("rocRotgXA");
591 rocRotgYA=(AliTPCROCVoltError3D*)iter->FindObject("rocRotgYA");
593 rocRotgXC=(AliTPCROCVoltError3D*)iter->FindObject("rocRotgXC");
595 rocRotgYC=(AliTPCROCVoltError3D*)iter->FindObject("rocRotgYC");
597 rocDzIROCA=(AliTPCROCVoltError3D*)iter->FindObject("rocDzIROCA");
599 rocDzIROCC=(AliTPCROCVoltError3D*)iter->FindObject("rocDzIROCC");
601 rocRotIROCA=(AliTPCROCVoltError3D*)iter->FindObject("rocRotIROCA");
603 rocRotIROCC=(AliTPCROCVoltError3D*)iter->FindObject("rocRotIROCC");
606 corrField3D = new AliTPCComposedCorrection;
607 rocRotgXA=new AliTPCROCVoltError3D;
608 rocRotgYA=new AliTPCROCVoltError3D;
609 rocRotgXC=new AliTPCROCVoltError3D;
610 rocRotgYC=new AliTPCROCVoltError3D;
611 rocDzIROCA=new AliTPCROCVoltError3D;
612 rocDzIROCC=new AliTPCROCVoltError3D;
613 rocRotIROCA=new AliTPCROCVoltError3D;
614 rocRotIROCC=new AliTPCROCVoltError3D;
616 for (Int_t isec=0; isec<72; isec++){
617 Double_t secAlpha = TMath::DegToRad()*(10.+20.*(((Int_t)isec)%18));
618 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
620 matrix(isec,0) = kAngle*TMath::Cos(secAlpha)*lxRef;
621 matrix(isec,1) = kAngle*TMath::Cos(secAlpha);
622 matrix(isec,2) = -kAngle*TMath::Sin(secAlpha);
625 rocRotgXA->SetROCData(&matrix);
627 for (Int_t isec=0; isec<72; isec++){
628 Double_t secAlpha = TMath::DegToRad()*(10.+20.*(((Int_t)isec)%18));
629 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
631 matrix(isec,0) = kAngle*TMath::Sin(secAlpha)*lxRef;
632 matrix(isec,1) = kAngle*TMath::Sin(secAlpha);
633 matrix(isec,2) = kAngle*TMath::Cos(secAlpha);
636 rocRotgYA->SetROCData(&matrix);
638 for (Int_t isec=0; isec<72; isec++){
639 Double_t secAlpha = TMath::DegToRad()*(10.+20.*(((Int_t)isec)%18));
640 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
642 matrix(isec,0) = kAngle*TMath::Cos(secAlpha)*lxRef;
643 matrix(isec,1) = kAngle*TMath::Cos(secAlpha);
644 matrix(isec,2) = -kAngle*TMath::Sin(secAlpha);
647 rocRotgXC->SetROCData(&matrix);
649 for (Int_t isec=0; isec<72; isec++){
650 Double_t secAlpha = TMath::DegToRad()*(10.+20.*(((Int_t)isec)%18));
651 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
653 matrix(isec,0) = kAngle*TMath::Sin(secAlpha)*lxRef;
654 matrix(isec,1) = kAngle*TMath::Sin(secAlpha);
655 matrix(isec,2) = kAngle*TMath::Cos(secAlpha);
658 rocRotgYC->SetROCData(&matrix);
662 for (Int_t isec=0; isec<72; isec++){
663 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
665 matrix(isec,0) = 0.1; // 1 mm
670 rocDzIROCA->SetROCData(&matrix);
672 for (Int_t isec=0; isec<72; isec++){
673 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
674 if (isec>=18 && isec<36){
675 matrix(isec,0) = 0.1; // 1 mm
680 rocDzIROCC->SetROCData(&matrix);
683 for (Int_t isec=0; isec<72; isec++){
684 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
687 matrix(isec,1) = kAngle;
691 rocRotIROCA->SetROCData(&matrix);
693 for (Int_t isec=0; isec<72; isec++){
694 matrix(isec,0)=0; matrix(isec,1)=0; matrix(isec,2)=0;
695 if (isec>=18 && isec<36){
697 matrix(isec,1) = kAngle;
701 rocRotIROCC->SetROCData(&matrix);
705 rocRotgXA->SetElectronArrivalCorrection(kFALSE);
706 rocRotgYA->SetElectronArrivalCorrection(kFALSE);
707 rocRotgXC->SetElectronArrivalCorrection(kFALSE);
708 rocRotgYC->SetElectronArrivalCorrection(kFALSE);
709 rocDzIROCA->SetElectronArrivalCorrection(kFALSE);
710 rocDzIROCC->SetElectronArrivalCorrection(kFALSE);
711 rocRotIROCA->SetElectronArrivalCorrection(kFALSE);
712 rocRotIROCC->SetElectronArrivalCorrection(kFALSE);
714 /* // verification plots
715 rocRotgXA.CreateHistoOfZAlignment(0,500,500)->Draw("surf2");
716 rocRotgYA.CreateHistoOfZAlignment(0,500,500)->Draw("surf2");
717 rocRotgXC.CreateHistoOfZAlignment(1,500,500)->Draw("surf2");
718 rocRotgYC.CreateHistoOfZAlignment(1,500,500)->Draw("surf2");
722 rocRotgXA->SetName("rocRotgXA");rocRotgXA->SetTitle("rocRotgXA");
723 rocRotgYA->SetName("rocRotgYA");rocRotgYA->SetTitle("rocRotgYA");
724 rocRotgXC->SetName("rocRotgXC");rocRotgXC->SetTitle("rocRotgXC");
725 rocRotgYC->SetName("rocRotgYC");rocRotgYC->SetTitle("rocRotgYC");
726 rocDzIROCA->SetName("rocDzIROCA");rocDzIROCA->SetTitle("rocDzIROCA");
727 rocDzIROCC->SetName("rocDzIROCC");rocDzIROCC->SetTitle("rocDzIROCC");
728 rocRotIROCA->SetName("rocRotIROCA");rocRotIROCA->SetTitle("rocRotIROCA");
729 rocRotIROCC->SetName("rocRotIROCC");rocRotIROCC->SetTitle("rocRotIROCC");
732 TObjArray *cs = new TObjArray();
739 cs->Add(rocRotIROCA);
740 cs->Add(rocRotIROCC);
741 corrField3D->SetCorrections(cs);
742 corrField3D->SetOmegaTauT1T2(0,1.,1.);
743 corrField3D->Print();
744 fCorrectionsROC->cd();
746 corrField3D->Print("da");
747 fCorrectionsROC->cd();
748 corrField3D->Write("TPCROCVoltError3DRotationgXgY");
749 // rocRotgXA->Write();
750 // rocRotgYA->Write();
751 // rocRotgXC->Write();
752 // rocRotgYC->Write();
753 // rocDzIROCA->Write();
754 // rocDzIROCC->Write();
756 AliTPCCorrection::AddVisualCorrection(rocRotgXA,701);
757 AliTPCCorrection::AddVisualCorrection(rocRotgYA,702);
758 AliTPCCorrection::AddVisualCorrection(rocRotgXC,703);
759 AliTPCCorrection::AddVisualCorrection(rocRotgYC,704);
760 AliTPCCorrection::AddVisualCorrection(rocDzIROCA,705);
761 AliTPCCorrection::AddVisualCorrection(rocDzIROCC,706);
762 AliTPCCorrection::AddVisualCorrection(rocRotIROCA,707);
763 AliTPCCorrection::AddVisualCorrection(rocRotIROCC,708);
765 AliTPCCorrection *corrPlus =0;
767 corrPlus=(AliTPCCorrection *)rocRotgXA->Clone();
768 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
769 AliTPCCorrection::AddVisualCorrection(corrPlus,711);
771 corrPlus=(AliTPCCorrection *)rocRotgYA->Clone();
772 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
773 AliTPCCorrection::AddVisualCorrection(corrPlus,712);
775 corrPlus=(AliTPCCorrection *)rocRotgXC->Clone();
776 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
777 AliTPCCorrection::AddVisualCorrection(corrPlus,713);
779 corrPlus=(AliTPCCorrection *)rocRotgYC->Clone();
780 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
781 AliTPCCorrection::AddVisualCorrection(corrPlus,714);
783 corrPlus=(AliTPCCorrection *)rocDzIROCA->Clone();
784 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
785 AliTPCCorrection::AddVisualCorrection(corrPlus,715);
787 corrPlus=(AliTPCCorrection *)rocDzIROCC->Clone();
788 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
789 AliTPCCorrection::AddVisualCorrection(corrPlus,716);
791 corrPlus=(AliTPCCorrection *)rocRotIROCA->Clone();
792 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
793 AliTPCCorrection::AddVisualCorrection(corrPlus,717);
795 corrPlus=(AliTPCCorrection *)rocDzIROCC->Clone();
796 corrPlus->SetOmegaTauT1T2(wtP,T1,T2);
797 AliTPCCorrection::AddVisualCorrection(corrPlus,718);
800 AliTPCCorrection *corrMinus =0;
802 corrMinus=(AliTPCCorrection *)rocRotgXA->Clone();
803 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
804 AliTPCCorrection::AddVisualCorrection(corrMinus,721);
806 corrMinus=(AliTPCCorrection *)rocRotgYA->Clone();
807 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
808 AliTPCCorrection::AddVisualCorrection(corrMinus,722);
810 corrMinus=(AliTPCCorrection *)rocRotgXC->Clone();
811 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
812 AliTPCCorrection::AddVisualCorrection(corrMinus,723);
814 corrMinus=(AliTPCCorrection *)rocRotgYC->Clone();
815 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
816 AliTPCCorrection::AddVisualCorrection(corrMinus,724);
818 corrMinus=(AliTPCCorrection *)rocDzIROCA->Clone();
819 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
820 AliTPCCorrection::AddVisualCorrection(corrMinus,725);
822 corrMinus=(AliTPCCorrection *)rocDzIROCC->Clone();
823 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
824 AliTPCCorrection::AddVisualCorrection(corrMinus,726);
826 corrMinus=(AliTPCCorrection *)rocRotIROCA->Clone();
827 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
828 AliTPCCorrection::AddVisualCorrection(corrMinus,727);
830 corrMinus=(AliTPCCorrection *)rocDzIROCC->Clone();
831 corrMinus->SetOmegaTauT1T2(wtM,T1,T2);
832 AliTPCCorrection::AddVisualCorrection(corrMinus,728);
835 fCorrectionsROC->Close();
836 delete fCorrectionsROC;
840 void RegisterAliTPCROCVoltError3DSector(){
842 // ROC rotation and shift transformation
843 // 800-819 - 0.0 Field
844 // 820-839 - +0.5 Field
845 // 840-859 - +0.5 Field
847 rocShiftIROCA0=0; // IROC shift A0 side
848 rocRotIROCA0=0; // IROC rot A0 side
849 rocShiftOROCA0=0; // OROC shift A0 side
850 rocRotOROCA0=0; // OROC rot A0 side
851 rocShiftIROCC0=0; // IROC shift C0 side
852 rocRotIROCC0=0; // IROC rot C0 side
853 rocShiftOROCC0=0; // OROC shift C0 side
854 rocRotOROCC0=0; // OROC rot C0 side
855 Double_t vdrift = 2.64; // [cm/us] // to be updated: per second (ideally)
856 Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully)
860 // Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ;
864 printf("RegisterAliTPCROCVoltError3DSector()");
865 Double_t kAngle=0.001;
869 TMatrixD matrix(72,3);
871 AliTPCComposedCorrection *corrField3DSector = 0;
872 TFile *fCorrectionsROC=0;
873 fCorrectionsROC = new TFile("TPCCorrectionPrimitivesSector.root");
874 corrField3DSector = ( AliTPCComposedCorrection *)fCorrectionsROC->Get("TPCROCVoltError3DSector");
876 if (!corrField3DSector){
877 fCorrectionsROC = new TFile("TPCCorrectionPrimitivesSector.root","recreate");
879 if (corrField3DSector) { // load from file
880 corrField3DSector->Print();
881 TCollection *iter = corrField3DSector->GetCorrections();
883 rocShiftIROCA0=(AliTPCROCVoltError3D*)iter->FindObject("rocShiftIROCA0"); // IROC shift A0 side
884 rocRotIROCA0=(AliTPCROCVoltError3D*)iter->FindObject("rocRotIROCA0"); // IROC rot A0 side
885 rocShiftOROCA0=(AliTPCROCVoltError3D*)iter->FindObject("rocShiftOROCA0"); // OROC shift A0 side
886 rocRotOROCA0=(AliTPCROCVoltError3D*)iter->FindObject("rocRotOROCA0"); // OROC rot A0 side
887 rocShiftIROCC0=(AliTPCROCVoltError3D*)iter->FindObject("rocShiftIROCC0"); // IROC shift C0 side
888 rocRotIROCC0=(AliTPCROCVoltError3D*)iter->FindObject("rocRotIROCC0"); // IROC rot C0 side
889 rocShiftOROCC0=(AliTPCROCVoltError3D*)iter->FindObject("rocShiftOROCC0"); // OROC shift C0 side
890 rocRotOROCC0=(AliTPCROCVoltError3D*)iter->FindObject("rocRotOROCC0"); // OROC rot C0 side
893 corrField3DSector = new AliTPCComposedCorrection;
894 rocShiftIROCA0=new AliTPCROCVoltError3D; // IROC shift A0 side
895 rocRotIROCA0=new AliTPCROCVoltError3D; // IROC rot A0 side
896 rocShiftOROCA0=new AliTPCROCVoltError3D; // OROC shift A0 side
897 rocRotOROCA0=new AliTPCROCVoltError3D; // OROC rot A0 side
898 rocShiftIROCC0=new AliTPCROCVoltError3D; // IROC shift C0 side
899 rocRotIROCC0=new AliTPCROCVoltError3D; // IROC rot C0 side
900 rocShiftOROCC0=new AliTPCROCVoltError3D; // OROC shift C0 side
901 rocRotOROCC0=new AliTPCROCVoltError3D; // OROC rot C0 side
903 matrix.Zero(); matrix(0,0)=kDz;
904 rocShiftIROCA0->SetROCData(&matrix);
905 matrix.Zero(); matrix(0,1)=kAngle;
906 rocRotIROCA0->SetROCData(&matrix);
907 matrix.Zero(); matrix(36,0)=kDz;
908 rocShiftOROCA0->SetROCData(&matrix);
909 matrix.Zero(); matrix(36,1)=kAngle;
910 rocRotOROCA0->SetROCData(&matrix);
912 matrix.Zero(); matrix(18,0)=kDz;
913 rocShiftIROCC0->SetROCData(&matrix);
914 matrix.Zero(); matrix(18,1)=kAngle;
915 rocRotIROCC0->SetROCData(&matrix);
916 matrix.Zero(); matrix(36+18,0)=kDz;
917 rocShiftOROCC0->SetROCData(&matrix);
918 matrix.Zero(); matrix(36+18,1)=kAngle;
919 rocRotOROCC0->SetROCData(&matrix);
921 rocShiftIROCA0->SetElectronArrivalCorrection(kFALSE); // IROC shift A0 side
922 rocRotIROCA0->SetElectronArrivalCorrection(kFALSE); // IROC rot A0 side
923 rocShiftOROCA0->SetElectronArrivalCorrection(kFALSE); // OROC shift A0 side
924 rocRotOROCA0->SetElectronArrivalCorrection(kFALSE); // OROC rot A0 side
925 rocShiftIROCC0->SetElectronArrivalCorrection(kFALSE); // IROC shift C0 side
926 rocRotIROCC0->SetElectronArrivalCorrection(kFALSE); // IROC rot C0 side
927 rocShiftOROCC0->SetElectronArrivalCorrection(kFALSE); // OROC shift C0 side
928 rocRotOROCC0->SetElectronArrivalCorrection(kFALSE); // OROC rot C0 side
930 /* // verification plots
933 rocShiftIROCA0->SetName("rocShiftIROCA0");rocShiftIROCA0->SetTitle("rocShiftIROCA0");
934 rocRotIROCA0->SetName("rocRotIROCA0");rocRotIROCA0->SetTitle("rocRotIROCA0");
935 rocShiftOROCA0->SetName("rocShiftOROCA0"); rocShiftOROCA0->SetTitle("rocShiftOROCA0");
936 rocRotOROCA0->SetName("rocRotOROCA0");rocRotOROCA0->SetTitle("rocRotOROCA0");
938 rocShiftIROCC0->SetName("rocShiftIROCC0");rocShiftIROCC0->SetTitle("rocShiftIROCC0");
939 rocRotIROCC0->SetName("rocRotIROCC0");rocRotIROCC0->SetTitle("rocRotIROCC0");
940 rocShiftOROCC0->SetName("rocShiftOROCC0");rocShiftOROCC0->SetTitle("rocShiftOROCC0");
941 rocRotOROCC0->SetName("rocRotOROCC0");rocRotOROCC0->SetTitle("rocRotOROCC0");
944 TObjArray *cs = new TObjArray();
945 cs->Add(rocShiftIROCA0); // IROC shift A0 side
946 cs->Add(rocRotIROCA0); // IROC rot A0 side
947 cs->Add(rocShiftOROCA0); // OROC shift A0 side
948 cs->Add(rocRotOROCA0); // OROC rot A0 side
949 cs->Add(rocShiftIROCC0); // IROC shift C0 side
950 cs->Add(rocRotIROCC0); // IROC rot C0 side
951 cs->Add(rocShiftOROCC0); // OROC shift C0 side
952 cs->Add(rocRotOROCC0); // OROC rot C0 side
954 corrField3DSector->SetCorrections(cs);
955 corrField3DSector->SetOmegaTauT1T2(0,T1,T2);
956 corrField3DSector->Print();
959 fCorrectionsROC->cd();
960 corrField3DSector->Init();
961 corrField3DSector->Print("da");
962 fCorrectionsROC->cd();
963 corrField3DSector->Write("TPCROCVoltError3DSector");
965 AliTPCCorrection::AddVisualCorrection(rocShiftIROCA0,800); // IROC shift A0 side
966 AliTPCCorrection::AddVisualCorrection(rocRotIROCA0,801); // IROC rot A0 side
967 AliTPCCorrection::AddVisualCorrection(rocShiftOROCA0,802); // OROC shift A0 side
968 AliTPCCorrection::AddVisualCorrection(rocRotOROCA0,803); // OROC rot A0 side
969 AliTPCCorrection::AddVisualCorrection(rocShiftIROCC0,804); // IROC shift C0 side
970 AliTPCCorrection::AddVisualCorrection(rocRotIROCC0,805); // IROC rot C0 side
971 AliTPCCorrection::AddVisualCorrection(rocShiftOROCC0,806); // OROC shift C0 side
972 AliTPCCorrection::AddVisualCorrection(rocRotOROCC0,807); // OROC rot C0 side
974 // Register correction for plus setting
975 AliTPCCorrection *corr =0;
976 Double_t wtp = -10.0 * (0.5*10) * vdrift / ezField ;
977 Double_t wtm = -10.0 * (0.5*10) * vdrift / -ezField ;
979 corr=(AliTPCCorrection *)rocShiftIROCA0->Clone();
980 corr->SetOmegaTauT1T2(wtp,T1,T2);
981 AliTPCCorrection::AddVisualCorrection(corr,820); // IROC shift A0 side + Plus field
983 corr=(AliTPCCorrection *)rocRotIROCA0->Clone();
984 corr->SetOmegaTauT1T2(wtp,T1,T2);
985 AliTPCCorrection::AddVisualCorrection(corr,821); // IROC rot A0 side
987 corr=(AliTPCCorrection *)rocShiftOROCA0->Clone();
988 corr->SetOmegaTauT1T2(wtp,T1,T2);
989 AliTPCCorrection::AddVisualCorrection(corr,822); // OROC shift A0 side
991 corr=(AliTPCCorrection *)rocRotOROCA0->Clone();
992 corr->SetOmegaTauT1T2(wtp,T1,T2);
993 AliTPCCorrection::AddVisualCorrection(corr,823); // OROC rot A0 side
994 corr=(AliTPCCorrection *)rocShiftIROCC0->Clone();
995 corr->SetOmegaTauT1T2(wtp,T1,T2);
996 AliTPCCorrection::AddVisualCorrection(corr,824); // IROC shift C0 side + Plus field
998 corr=(AliTPCCorrection *)rocRotIROCC0->Clone();
999 corr->SetOmegaTauT1T2(wtp,T1,T2);
1000 AliTPCCorrection::AddVisualCorrection(corr,825); // IROC rot C0 side
1002 corr=(AliTPCCorrection *)rocShiftOROCC0->Clone();
1003 corr->SetOmegaTauT1T2(wtp,T1,T2);
1004 AliTPCCorrection::AddVisualCorrection(corr,826); // OROC shift C0 side
1006 corr=(AliTPCCorrection *)rocRotOROCC0->Clone();
1007 corr->SetOmegaTauT1T2(wtp,T1,T2);
1008 AliTPCCorrection::AddVisualCorrection(corr,827); // OROC rot C0 side
1010 corr=(AliTPCCorrection *)rocShiftIROCA0->Clone();
1011 corr->SetOmegaTauT1T2(wtm,T1,T2);
1012 AliTPCCorrection::AddVisualCorrection(corr,840); // IROC shift A0 side + Plus field
1014 corr=(AliTPCCorrection *)rocRotIROCA0->Clone();
1015 corr->SetOmegaTauT1T2(wtm,T1,T2);
1016 AliTPCCorrection::AddVisualCorrection(corr,841); // IROC rot A0 side
1018 corr=(AliTPCCorrection *)rocShiftOROCA0->Clone();
1019 corr->SetOmegaTauT1T2(wtm,T1,T2);
1020 AliTPCCorrection::AddVisualCorrection(corr,842); // OROC shift A0 side
1022 corr=(AliTPCCorrection *)rocRotOROCA0->Clone();
1023 corr->SetOmegaTauT1T2(wtm,T1,T2);
1024 AliTPCCorrection::AddVisualCorrection(corr,843); // OROC rot A0 side
1025 corr=(AliTPCCorrection *)rocShiftIROCC0->Clone();
1026 corr->SetOmegaTauT1T2(wtm,T1,T2);
1027 AliTPCCorrection::AddVisualCorrection(corr,844); // IROC shift C0 side + Plus field
1029 corr=(AliTPCCorrection *)rocRotIROCC0->Clone();
1030 corr->SetOmegaTauT1T2(wtm,T1,T2);
1031 AliTPCCorrection::AddVisualCorrection(corr,845); // IROC rot C0 side
1033 corr=(AliTPCCorrection *)rocShiftOROCC0->Clone();
1034 corr->SetOmegaTauT1T2(wtm,T1,T2);
1035 AliTPCCorrection::AddVisualCorrection(corr,846); // OROC shift C0 side
1037 corr=(AliTPCCorrection *)rocRotOROCC0->Clone();
1038 corr->SetOmegaTauT1T2(wtm,T1,T2);
1039 AliTPCCorrection::AddVisualCorrection(corr,847); // OROC rot C0 side
1041 fCorrectionsROC->Close();
1042 delete fCorrectionsROC;
1049 AliTPCComposedCorrection * MakeComposedCorrectionExB(){
1051 // make composed corection for ExB scanning
1053 RegisterCorrection();
1055 //Double_t bzField=AliTrackerBase::GetBz();
1056 // AliMagF* magF= (AliMagF*)(TGeoGlobalMagField::Instance()->GetField());
1057 //Double_t vdrift = 2.6; // [cm/us] // to be updated: per second (ideally)
1058 //Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully)
1059 // Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ;
1060 //Double_t T1 = 1.0;
1061 //Double_t T2 = 1.0;
1063 TObjArray * corr = new TObjArray;
1064 corr->AddLast(twistX);
1065 corr->AddLast(twistY);
1066 for (Int_t i=0; i<8; i++){
1067 corr->AddLast(boundaryVoltErrorA[i]);
1068 corr->AddLast(boundaryVoltErrorC[i]);
1070 corr->AddLast(alignTrans0);
1071 corr->AddLast(alignTrans1);
1072 corr->AddLast(alignTrans2);
1073 corr->AddLast(alignRot0);
1074 corr->AddLast(alignRot1);
1075 corr->AddLast(alignRot2);
1076 corr->AddLast(rocRotgXA);
1077 corr->AddLast(rocRotgYA);
1078 corr->AddLast(rocRotgXC);
1079 corr->AddLast(rocRotgYC);
1080 corr->AddLast(exbShape);
1081 corr->AddLast(exbShapeT1X);
1082 corr->AddLast(exbShapeT2X);
1083 corr->AddLast(rocRotgXA);
1084 corr->AddLast(rocRotgYA);
1085 corr->AddLast(rocRotgXC);
1086 corr->AddLast(rocRotgYC);
1087 corr->AddLast(rocDzIROCA);
1088 corr->AddLast(rocDzIROCC);
1089 AliTPCComposedCorrection *cc= new AliTPCComposedCorrection ;
1090 cc->SetCorrections((TObjArray*)(corr));
1091 //cc->SetOmegaTauT1T2(wt,T1,T2);
1092 //exbShapeT1X->SetOmegaTauT1T2(0,1.2,1.0);
1093 //exbShapeT2X->SetOmegaTauT1T2(0,1.0,1.2);
1095 cc->Print("DA"); // Print used correction classes
1096 cc->SetName("ComposedExB");
1097 TFile fexb("RegisterCorrectionExB.root","recreate");
1098 cc->Write("ComposedExB");