]>
Commit | Line | Data |
---|---|---|
a050b283 | 1 | /* |
2 | marian.ivanov@cern.ch | |
3 | // | |
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 | |
10 | // | |
11 | ||
12 | RegisterCorrection(); - Reserved id's 0 -999 | |
13 | // | |
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 | ||
20 | .x ~/rootlogon.C | |
21 | .L $ALICE_ROOT/TPC/CalibMacros/RegisterCorrection.C+ | |
22 | RegisterCorrection(); | |
23 | ||
24 | */ | |
25 | #if !defined(__CINT__) || defined(__MAKECINT__) | |
26 | #include "TFile.h" | |
27 | #include "TObjArray.h" | |
28 | #include "TTreeStream.h" | |
29 | #include "TMath.h" | |
30 | #include "TGraph.h" | |
31 | #include "TRandom.h" | |
32 | #include "TTree.h" | |
33 | #include "TF1.h" | |
34 | #include "TH2F.h" | |
35 | #include "TH3F.h" | |
36 | #include "TAxis.h" | |
37 | #include "TPad.h" | |
38 | #include "TCanvas.h" | |
39 | #include "TStyle.h" | |
40 | #include "AliTPCParamSR.h" | |
41 | #include "TDatabasePDG.h" | |
42 | #include "AliTPCCorrection.h" | |
43 | #include "AliTPCFCVoltError3D.h" | |
44 | #include "AliTPCROCVoltError3D.h" | |
45 | #include "AliTPCComposedCorrection.h" | |
46 | #include "AliTPCBoundaryVoltError.h" | |
47 | #include "AliTPCCalibGlobalMisalignment.h" | |
48 | #include "AliTPCExBBShape.h" | |
49 | #include "AliTPCExBTwist.h" | |
50 | #include "AliMagF.h" | |
51 | #include "AliCDBEntry.h" | |
52 | #include "AliTPCROC.h" | |
53 | #include <TStatToolkit.h> | |
54 | #include "TCut.h" | |
55 | #include "TGraphErrors.h" | |
56 | #include "AliTrackerBase.h" | |
57 | #include "TGeoGlobalMagField.h" | |
58 | #endif | |
59 | ||
60 | ||
61 | ||
62 | ||
63 | TFile *fCorrections=0; //file with corrections | |
64 | // | |
65 | //models E field distortion AliTPCFCVoltError3D | |
66 | // | |
67 | AliTPCFCVoltError3D *rotOFC =0; // fit models | |
68 | AliTPCFCVoltError3D *rodOFC1 =0; | |
69 | AliTPCFCVoltError3D *rodOFC2 =0; | |
70 | AliTPCFCVoltError3D *rotIFC =0; | |
71 | AliTPCFCVoltError3D *rodIFC1 =0; | |
72 | AliTPCFCVoltError3D *rodIFC2 =0; | |
73 | AliTPCFCVoltError3D *rodIFCShift=0; //common IFC shift | |
74 | AliTPCFCVoltError3D *rodOFCShift=0; //common OFC shift | |
75 | AliTPCFCVoltError3D *rodIFCSin=0; //common IFC shift -sinus | |
76 | AliTPCFCVoltError3D *rodOFCSin=0; //common OFC shift -sinus | |
77 | AliTPCFCVoltError3D *rodIFCCos=0; //common IFC shift -cos | |
78 | AliTPCFCVoltError3D *rodOFCCos=0; //common OFC shift -cos | |
79 | AliTPCBoundaryVoltError *boundaryVoltErrorA[8]; // boundary voltage error A side | |
80 | AliTPCBoundaryVoltError *boundaryVoltErrorC[8]; // boundary voltage error C side | |
81 | AliTPCExBBShape *exbShape = 0; | |
82 | AliTPCExBTwist *twistX = 0; | |
83 | AliTPCExBTwist *twistY = 0; | |
84 | // | |
85 | AliTPCCalibGlobalMisalignment *alignRot0=0; | |
86 | AliTPCCalibGlobalMisalignment *alignRot1=0; | |
87 | AliTPCCalibGlobalMisalignment *alignRot2=0; | |
88 | AliTPCCalibGlobalMisalignment *alignTrans0=0; | |
89 | AliTPCCalibGlobalMisalignment *alignTrans1=0; | |
90 | AliTPCCalibGlobalMisalignment *alignTrans2=0; | |
91 | ||
92 | ||
93 | ||
94 | // | |
95 | void RegisterAliTPCFCVoltError3D(); | |
96 | void RegisterAliTPCCalibGlobalMisalignment(); | |
97 | void RegisterAliTPCBoundaryVoltError(); | |
98 | void RegisterAliTPCExBShape(); | |
99 | void RegisterAliTPCExBTwist(); | |
100 | ||
101 | void RegisterCorrection(){ | |
102 | // | |
103 | // | |
104 | // | |
105 | // check the presence of corrections in file | |
106 | // | |
107 | fCorrections = new TFile("TPCCorrectionPrimitives.root"); | |
108 | AliTPCComposedCorrection *corrField3D = (AliTPCComposedCorrection*) fCorrections->Get("TPCFCVoltError3D"); | |
109 | // if not make new file | |
110 | if (!corrField3D) fCorrections = new TFile("TPCCorrectionPrimitives.root","update"); | |
111 | // | |
112 | // | |
113 | RegisterAliTPCCalibGlobalMisalignment(); | |
114 | RegisterAliTPCBoundaryVoltError(); | |
115 | RegisterAliTPCFCVoltError3D(); | |
116 | RegisterAliTPCExBShape(); | |
117 | RegisterAliTPCExBTwist(); | |
118 | if (fCorrections) fCorrections->Close(); | |
119 | // | |
120 | } | |
121 | ||
122 | ||
123 | ||
124 | void RegisterAliTPCFCVoltError3D(){ | |
125 | // | |
126 | // Load the models from the file | |
127 | // Or create it | |
128 | // Register functions with following IDs: | |
129 | // IMPORTANT: The nominal shift is in mm | |
130 | // | |
131 | // rotOFC - 0 | |
132 | // rodOFC1 - 1 | |
133 | // rodOFC2 - 2 | |
134 | // rotIFC - 3 | |
135 | // rodIFC1 - 4 | |
136 | // rodIFC2 - 5 | |
137 | // rodIFCShift - 6 | |
138 | // rodIFCSin - 7 | |
139 | // rodIFCCos - 8 | |
140 | // rodOFCShift - 9 | |
141 | // rodOFCSin - 10 | |
142 | // rodOFCCos - 11 | |
143 | // | |
144 | printf("RegisterAliTPCFCVoltError3D()"); | |
145 | Int_t volt = 40; // 40 V ~ 1mm | |
146 | AliTPCComposedCorrection *corrField3D = (AliTPCComposedCorrection*) fCorrections->Get("TPCFCVoltError3D"); | |
147 | if (corrField3D) { // load form file | |
148 | corrField3D->Print(); | |
149 | TCollection *iter = corrField3D->GetCorrections(); | |
150 | rotOFC = (AliTPCFCVoltError3D*)iter->FindObject("rotOFC"); | |
151 | rodOFC1 = (AliTPCFCVoltError3D*)iter->FindObject("rodOFC1"); | |
152 | rodOFC2 = (AliTPCFCVoltError3D*)iter->FindObject("rodOFC2"); | |
153 | rotIFC = (AliTPCFCVoltError3D*)iter->FindObject("rotIFC"); | |
154 | rodIFC1 = (AliTPCFCVoltError3D*)iter->FindObject("rodIFC1"); | |
155 | rodIFC2 = (AliTPCFCVoltError3D*)iter->FindObject("rodIFC2"); | |
156 | // | |
157 | rodIFCShift = (AliTPCFCVoltError3D*)iter->FindObject("rodIFCShift"); | |
158 | rodOFCShift = (AliTPCFCVoltError3D*)iter->FindObject("rodOFCShift"); | |
159 | rodIFCSin = (AliTPCFCVoltError3D*)iter->FindObject("rodIFCSin"); | |
160 | rodOFCSin = (AliTPCFCVoltError3D*)iter->FindObject("rodOFCSin"); | |
161 | rodIFCCos = (AliTPCFCVoltError3D*)iter->FindObject("rodIFCCos"); | |
162 | rodOFCCos = (AliTPCFCVoltError3D*)iter->FindObject("rodOFCCos"); | |
163 | } else { | |
164 | // OFC | |
165 | rotOFC = new AliTPCFCVoltError3D(); | |
166 | rotOFC->SetOmegaTauT1T2(0,1,1); | |
167 | rotOFC->SetRotatedClipVoltA(1,volt); | |
168 | rotOFC->SetRotatedClipVoltC(1,volt); | |
169 | // | |
170 | rodOFC1 = new AliTPCFCVoltError3D(); | |
171 | rodOFC1->SetOmegaTauT1T2(0,1,1); | |
172 | rodOFC1->SetRodVoltShiftA(18,volt); | |
173 | rodOFC1->SetRodVoltShiftC(18,volt); | |
174 | // | |
175 | rodOFC2 = new AliTPCFCVoltError3D(); | |
176 | rodOFC2->SetOmegaTauT1T2(0,1,1); | |
177 | rodOFC2->SetCopperRodShiftA(18,volt); | |
178 | rodOFC2->SetCopperRodShiftC(18,volt); | |
179 | // IFC | |
180 | rotIFC = new AliTPCFCVoltError3D(); | |
181 | rotIFC->SetOmegaTauT1T2(0,1,1); | |
182 | rotIFC->SetRotatedClipVoltA(0,volt); | |
183 | rotIFC->SetRotatedClipVoltC(0,volt); | |
184 | // | |
185 | rodIFC1 = new AliTPCFCVoltError3D(); | |
186 | rodIFC1->SetOmegaTauT1T2(0,1,1); | |
187 | rodIFC1->SetRodVoltShiftA(0,volt); | |
188 | rodIFC1->SetRodVoltShiftC(0,volt); | |
189 | // | |
190 | rodIFC2 = new AliTPCFCVoltError3D(); | |
191 | rodIFC2->SetOmegaTauT1T2(0,1,1); | |
192 | rodIFC2->SetCopperRodShiftA(0,volt); | |
193 | rodIFC2->SetCopperRodShiftC(0,volt); | |
194 | // | |
195 | rodIFCShift = new AliTPCFCVoltError3D(); | |
196 | rodIFCSin = new AliTPCFCVoltError3D(); | |
197 | rodIFCCos = new AliTPCFCVoltError3D(); | |
198 | rodOFCShift = new AliTPCFCVoltError3D(); | |
199 | rodOFCSin = new AliTPCFCVoltError3D(); | |
200 | rodOFCCos = new AliTPCFCVoltError3D(); | |
201 | for (Int_t isec=0; isec<18; isec++){ | |
202 | Double_t phi=TMath::Pi()*isec/9.; | |
203 | rodIFCShift->SetOmegaTauT1T2(0,1,1); | |
204 | rodIFCShift->SetRodVoltShiftA(isec,volt); | |
205 | rodIFCShift->SetRodVoltShiftC(isec,volt); | |
206 | rodIFCSin->SetOmegaTauT1T2(0,1,1); | |
207 | rodIFCSin->SetRodVoltShiftA(isec,volt*TMath::Sin(phi)); | |
208 | rodIFCSin->SetRodVoltShiftC(isec,volt*TMath::Sin(phi)); | |
209 | rodIFCCos->SetOmegaTauT1T2(0,1,1); | |
210 | rodIFCCos->SetRodVoltShiftA(isec,volt*TMath::Cos(phi)); | |
211 | rodIFCCos->SetRodVoltShiftC(isec,volt*TMath::Cos(phi)); | |
212 | // | |
213 | rodOFCShift->SetOmegaTauT1T2(0,1,1); | |
214 | rodOFCShift->SetRodVoltShiftA(18+isec,volt); | |
215 | rodOFCShift->SetRodVoltShiftC(18+isec,volt); | |
216 | rodOFCSin->SetOmegaTauT1T2(0,1,1); | |
217 | rodOFCSin->SetRodVoltShiftA(18+isec,volt*TMath::Sin(phi)); | |
218 | rodOFCSin->SetRodVoltShiftC(18+isec,volt*TMath::Sin(phi)); | |
219 | rodOFCCos->SetOmegaTauT1T2(0,1,1); | |
220 | rodOFCCos->SetRodVoltShiftA(18+isec,volt*TMath::Cos(phi)); | |
221 | rodOFCCos->SetRodVoltShiftC(18+isec,volt*TMath::Cos(phi)); | |
222 | } | |
223 | // | |
224 | // | |
225 | // Initialization of the lookup tables | |
226 | // | |
227 | printf(" ------- OFC rotated clip:\n"); rotOFC->InitFCVoltError3D(); | |
228 | printf(" ------- OFC rod & strip:\n"); rodOFC1->InitFCVoltError3D(); | |
229 | printf(" ------- OFC copper rod:\n"); rodOFC2->InitFCVoltError3D(); | |
230 | printf(" ------- IFC rotated clip:\n"); rotIFC->InitFCVoltError3D(); | |
231 | printf(" ------- IFC rod & strip:\n"); rodIFC1->InitFCVoltError3D(); | |
232 | printf(" ------- IFC copper rod:\n"); rodIFC2->InitFCVoltError3D(); | |
233 | ||
234 | printf(" ------- IFC rod & strip shift:\n"); rodIFCShift->InitFCVoltError3D(); | |
235 | printf(" ------- IFC rod & strip sin:\n"); rodIFCSin->InitFCVoltError3D(); | |
236 | printf(" ------- IFC rod & strip cos:\n"); rodIFCCos->InitFCVoltError3D(); | |
237 | printf(" ------- OFC rod & strip shift:\n"); rodOFCShift->InitFCVoltError3D(); | |
238 | printf(" ------- OFC rod & strip sin:\n"); rodOFCSin->InitFCVoltError3D(); | |
239 | printf(" ------- OFC rod & strip cos:\n"); rodOFCCos->InitFCVoltError3D(); | |
240 | ||
241 | // give names | |
242 | rotOFC->SetName("rotOFC");rotOFC->SetTitle("rotOFC"); | |
243 | rodOFC1->SetName("rodOFC1");rodOFC1->SetTitle("rodOFC1"); | |
244 | rodOFC2->SetName("rodOFC2");rodOFC2->SetTitle("rodOFC2"); | |
245 | rotIFC->SetName("rotIFC");rotIFC->SetTitle("rotIFC"); | |
246 | rodIFC1->SetName("rodIFC1");rodIFC1->SetTitle("rodIFC1"); | |
247 | rodIFC2->SetName("rodIFC2");rodIFC2->SetTitle("rodIFC2"); | |
248 | // | |
249 | rodIFCShift->SetName("rodIFCShift");rodIFCShift->SetTitle("rodIFCShift"); | |
250 | rodIFCSin->SetName("rodIFCSin");rodIFCSin->SetTitle("rodIFCSin"); | |
251 | rodIFCCos->SetName("rodIFCCos");rodIFCCos->SetTitle("rodIFCCos"); | |
252 | // | |
253 | rodOFCShift->SetName("rodOFCShift");rodOFCShift->SetTitle("rodOFCShift"); | |
254 | rodOFCSin->SetName("rodOFCSin");rodOFCSin->SetTitle("rodOFCSin"); | |
255 | rodOFCCos->SetName("rodOFCCos");rodOFCCos->SetTitle("rodOFCCos"); | |
256 | // | |
257 | // save in file | |
258 | corrField3D = new AliTPCComposedCorrection(); | |
259 | TObjArray *cs = new TObjArray(); | |
260 | cs->Add(rotIFC); cs->Add(rotOFC); | |
261 | cs->Add(rodIFC1); cs->Add(rodOFC1); | |
262 | cs->Add(rodIFC2); cs->Add(rodOFC2); | |
263 | cs->Add(rodIFCShift); cs->Add(rodIFCSin); cs->Add(rodIFCCos); | |
264 | cs->Add(rodOFCShift); cs->Add(rodOFCSin); cs->Add(rodOFCCos); | |
265 | // | |
266 | corrField3D->SetCorrections(cs); | |
267 | corrField3D->SetOmegaTauT1T2(0,1.,1.); | |
268 | corrField3D->Print(); | |
269 | fCorrections->cd(); | |
270 | corrField3D->Write("TPCFCVoltError3D"); | |
271 | } | |
272 | // | |
273 | AliTPCCorrection::AddVisualCorrection(rotOFC,0); | |
274 | AliTPCCorrection::AddVisualCorrection(rodOFC1,1); | |
275 | AliTPCCorrection::AddVisualCorrection(rodOFC2,2); | |
276 | AliTPCCorrection::AddVisualCorrection(rotIFC,3); | |
277 | AliTPCCorrection::AddVisualCorrection(rodIFC1,4); | |
278 | AliTPCCorrection::AddVisualCorrection(rodIFC2,5); | |
279 | // common corrections | |
280 | // | |
281 | AliTPCCorrection::AddVisualCorrection(rodIFCShift,6); | |
282 | AliTPCCorrection::AddVisualCorrection(rodIFCSin,7); | |
283 | AliTPCCorrection::AddVisualCorrection(rodIFCCos,8); | |
284 | // | |
285 | AliTPCCorrection::AddVisualCorrection(rodIFCShift,9); | |
286 | AliTPCCorrection::AddVisualCorrection(rodIFCSin,10); | |
287 | AliTPCCorrection::AddVisualCorrection(rodIFCCos,11); | |
288 | } | |
289 | ||
290 | ||
291 | void RegisterAliTPCCalibGlobalMisalignment(){ | |
292 | // | |
293 | // Register primitive alignment components. | |
294 | // Linear conbination of primitev forulas used for fit | |
295 | // The nominal delta 1 mm in shift and 1 mrad in rotation | |
296 | // Primitive formulas registeren in AliTPCCoreection::AddvisualCorrection | |
297 | // 20 - deltaX | |
298 | // 21 - deltaY | |
299 | // 22 - deltaZ | |
300 | // 23 - rot0 (phi) | |
301 | // 24 - rot1 (theta) | |
302 | // 25 - rot2 | |
303 | // | |
304 | printf("RegisterAliTPCCalibGlobalMisalignment()\n"); | |
305 | TGeoHMatrix matrixX; | |
306 | TGeoHMatrix matrixY; | |
307 | TGeoHMatrix matrixZ; | |
308 | TGeoRotation rot0; | |
309 | TGeoRotation rot1; | |
310 | TGeoRotation rot2; //transformation matrices | |
311 | TGeoRotation rot90; //transformation matrices | |
312 | matrixX.SetDx(0.1); matrixY.SetDy(0.1); matrixZ.SetDz(0.1); //1 mm translation | |
313 | rot0.SetAngles(0.001*TMath::RadToDeg(),0,0); | |
314 | rot1.SetAngles(0,0.001*TMath::RadToDeg(),0); | |
315 | rot2.SetAngles(0,0,0.001*TMath::RadToDeg()); | |
316 | //how to get rot02 ? | |
317 | rot90.SetAngles(0,90,0); | |
318 | rot2.MultiplyBy(&rot90,kTRUE); | |
319 | rot90.SetAngles(0,-90,0); | |
320 | rot2.MultiplyBy(&rot90,kFALSE); | |
321 | alignRot0 =new AliTPCCalibGlobalMisalignment; | |
322 | alignRot0->SetAlignGlobal(&rot0); | |
323 | alignRot0->SetName("alignRot0"); | |
324 | alignRot1=new AliTPCCalibGlobalMisalignment; | |
325 | alignRot1->SetAlignGlobal(&rot1); | |
326 | alignRot1->SetName("alignRot1"); | |
327 | alignRot2=new AliTPCCalibGlobalMisalignment; | |
328 | alignRot2->SetAlignGlobal(&rot2); | |
329 | alignRot2->SetName("alignRot2"); | |
330 | // | |
331 | alignTrans0 =new AliTPCCalibGlobalMisalignment; | |
332 | alignTrans0->SetAlignGlobal(&matrixX); | |
333 | alignTrans0->SetName("alignTrans0"); | |
334 | alignTrans1=new AliTPCCalibGlobalMisalignment; | |
335 | alignTrans1->SetAlignGlobal(&matrixY); | |
336 | alignTrans1->SetName("alignTrans1"); | |
337 | alignTrans2=new AliTPCCalibGlobalMisalignment; | |
338 | alignTrans2->SetAlignGlobal(&matrixZ); | |
339 | alignTrans2->SetName("alignTrans2"); | |
340 | // | |
341 | AliTPCCorrection::AddVisualCorrection(alignTrans0 ,200); | |
342 | AliTPCCorrection::AddVisualCorrection(alignTrans1 ,201); | |
343 | AliTPCCorrection::AddVisualCorrection(alignTrans2 ,202); | |
344 | AliTPCCorrection::AddVisualCorrection(alignRot0 ,203); | |
345 | AliTPCCorrection::AddVisualCorrection(alignRot1 ,204); | |
346 | AliTPCCorrection::AddVisualCorrection(alignRot2 ,205); | |
347 | // | |
348 | TObjArray arrAlign(6); | |
349 | arrAlign.AddAt(alignTrans0->Clone(),0); | |
350 | arrAlign.AddAt(alignTrans1->Clone(),1); | |
351 | arrAlign.AddAt(alignTrans2->Clone(),2); | |
352 | arrAlign.AddAt(alignRot0->Clone(),3); | |
353 | arrAlign.AddAt(alignRot1->Clone(),4); | |
354 | arrAlign.AddAt(alignRot2->Clone(),5); | |
355 | //combAlign.SetCorrections((TObjArray*)arrAlign.Clone()); | |
356 | } | |
357 | ||
358 | ||
359 | void RegisterAliTPCBoundaryVoltError(){ | |
360 | // | |
361 | // Register phi symetric E filed distortions | |
362 | // | |
363 | // | |
364 | printf("RegisterAliTPCBoundaryVoltError()\n"); | |
365 | AliTPCComposedCorrection *corrField2D = (AliTPCComposedCorrection*) fCorrections->Get("TPCFCVoltError2D"); | |
366 | // | |
367 | if (!corrField2D){ | |
368 | TObjArray *array=new TObjArray(16); | |
369 | Double_t val = 40.; // 1mm | |
370 | Float_t bound0[8] = { 0, 0,0,0,0,0,0,0}; | |
371 | Float_t boundAi[8] = { 0, 0,0,0,0,0,0,0}; | |
372 | Float_t boundCi[8] = { 0, 0,0,0,0,0,0,0}; | |
373 | for (Int_t ipar=0; ipar<8; ipar++){ | |
374 | // | |
375 | boundaryVoltErrorA[ipar] = new AliTPCBoundaryVoltError; | |
376 | boundaryVoltErrorC[ipar] = new AliTPCBoundaryVoltError; | |
377 | boundaryVoltErrorA[ipar]->SetName(Form("BoundaryVoltErrorAsidePar%d",ipar)); | |
378 | boundaryVoltErrorA[ipar]->SetTitle(Form("BoundaryVoltErrorAsidePar%d",ipar)); | |
379 | boundaryVoltErrorC[ipar]->SetName(Form("BoundaryVoltErrorCsidePar%d",ipar)); | |
380 | boundaryVoltErrorC[ipar]->SetTitle(Form("BoundaryVoltErrorCsidePar%d",ipar)); | |
381 | for (Int_t jpar=0; jpar<8; jpar++) if (ipar!=jpar){ | |
382 | boundAi[jpar]=0; | |
383 | boundCi[jpar]=0; | |
384 | } | |
385 | boundAi[ipar]=val; | |
386 | boundCi[ipar]=val; | |
387 | // | |
388 | boundaryVoltErrorA[ipar]->SetBoundariesA(boundAi); | |
389 | boundaryVoltErrorA[ipar]->SetBoundariesC(bound0); | |
390 | boundaryVoltErrorA[ipar]->InitBoundaryVoltErrorDistortion(); | |
391 | boundaryVoltErrorA[ipar]->SetOmegaTauT1T2(0.,1,1); | |
392 | // | |
393 | Float_t tempboundAi[8] = { 0, 0,0,0,0,0,-boundCi[6],-boundCi[7]}; | |
394 | boundaryVoltErrorC[ipar]->SetBoundariesA(tempboundAi); | |
395 | boundaryVoltErrorC[ipar]->SetBoundariesC(boundCi); | |
396 | ||
397 | boundaryVoltErrorC[ipar]->InitBoundaryVoltErrorDistortion(); | |
398 | boundaryVoltErrorC[ipar]->SetOmegaTauT1T2(0.,1,1); | |
399 | array->AddAt(boundaryVoltErrorA[ipar],ipar); | |
400 | array->AddAt(boundaryVoltErrorC[ipar],ipar+8); | |
401 | boundaryVoltErrorA[ipar]->Print(); | |
402 | boundaryVoltErrorC[ipar]->Print(); | |
403 | AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorA[ipar], 100+ipar); | |
404 | AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorC[ipar], 150+ipar); | |
405 | } | |
406 | corrField2D = new AliTPCComposedCorrection; | |
407 | corrField2D->SetCorrections(array); | |
408 | corrField2D->SetOmegaTauT1T2(0,1.,1.); | |
409 | corrField2D->Print(); | |
410 | fCorrections->cd(); | |
411 | corrField2D->SetName("TPCFCVoltError2D"); | |
412 | corrField2D->SetTitle("TPCFCVoltError2D"); | |
413 | corrField2D->Write("TPCFCVoltError2D"); | |
414 | }else{ | |
415 | TObjArray *array = (TObjArray*)corrField2D->GetCorrections(); | |
416 | for (Int_t ipar=0; ipar<8; ipar++){ | |
417 | boundaryVoltErrorA[ipar] = (AliTPCBoundaryVoltError*) array->At(ipar); | |
418 | boundaryVoltErrorC[ipar] = (AliTPCBoundaryVoltError*) array->At(ipar+8); | |
419 | if (boundaryVoltErrorA[ipar]) AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorA[ipar], 40+ipar); | |
420 | if (boundaryVoltErrorC[ipar]) AliTPCCorrection::AddVisualCorrection(boundaryVoltErrorC[ipar], 50+ipar); | |
421 | } | |
422 | } | |
423 | } | |
424 | ||
425 | ||
426 | ||
427 | void RegisterAliTPCExBShape(){ | |
428 | // | |
429 | // | |
430 | // | |
431 | AliMagF *magF = new AliMagF("mag","mag"); | |
432 | ||
433 | exbShape = new AliTPCExBBShape; | |
434 | exbShape->SetBField(magF); | |
435 | exbShape->SetName("TPCExBShape"); | |
436 | exbShape->SetTitle("TPCExBShape"); | |
437 | exbShape->SetOmegaTauT1T2(0,1.,1.); | |
438 | exbShape->Print(); | |
439 | AliTPCCorrection::AddVisualCorrection(exbShape,500); | |
440 | } | |
441 | ||
442 | ||
443 | void RegisterAliTPCExBTwist(){ | |
444 | // | |
445 | // | |
446 | // | |
447 | twistX = new AliTPCExBTwist; | |
448 | twistY = new AliTPCExBTwist; | |
449 | twistX->SetXTwist(0.001); // 1 mrad twist in x | |
450 | twistX->SetName("ExBTwistX"); | |
451 | twistX->SetTitle("ExBTwistX"); | |
452 | twistY->SetYTwist(0.001); // 1 mrad twist in y | |
453 | twistY->SetName("ExBTwistY"); | |
454 | twistY->SetTitle("ExBTwistY"); | |
455 | twistX->SetOmegaTauT1T2(0,1.,1.); | |
456 | twistY->SetOmegaTauT1T2(0,1.,1.); | |
457 | AliTPCCorrection::AddVisualCorrection(twistX,600); | |
458 | AliTPCCorrection::AddVisualCorrection(twistY,601); | |
459 | } | |
460 | ||
461 | ||
462 | AliTPCComposedCorrection * MakeComposedCorrectionExB(){ | |
463 | // | |
464 | // make composed corection for ExB scanning | |
465 | // | |
466 | RegisterCorrection(); | |
467 | // | |
468 | Double_t bzField=AliTrackerBase::GetBz(); | |
469 | // AliMagF* magF= (AliMagF*)(TGeoGlobalMagField::Instance()->GetField()); | |
470 | Double_t vdrift = 2.6; // [cm/us] // to be updated: per second (ideally) | |
471 | Double_t ezField = 400; // [V/cm] // to be updated: never (hopefully) | |
472 | Double_t wt = -10.0 * (bzField*10) * vdrift / ezField ; | |
473 | Double_t T1 = 1.0; | |
474 | Double_t T2 = 1.0; | |
475 | // | |
476 | TObjArray * corr = new TObjArray; | |
477 | corr->AddLast(twistX); | |
478 | corr->AddLast(twistY); | |
479 | for (Int_t i=0; i<8; i++){ | |
480 | corr->AddLast(boundaryVoltErrorA[i]); | |
481 | corr->AddLast(boundaryVoltErrorC[i]); | |
482 | } | |
483 | corr->AddLast(alignTrans0); | |
484 | corr->AddLast(alignTrans1); | |
485 | corr->AddLast(alignTrans2); | |
486 | corr->AddLast(alignRot0); | |
487 | corr->AddLast(alignRot1); | |
488 | corr->AddLast(alignRot2); | |
489 | ||
490 | AliTPCComposedCorrection *cc= new AliTPCComposedCorrection ; | |
491 | cc->SetCorrections((TObjArray*)(corr)); | |
492 | cc->SetOmegaTauT1T2(wt,T1,T2); | |
493 | cc->Init(); | |
494 | cc->Print("DA"); // Print used correction classes | |
495 | cc->SetName("ComposedExB"); | |
496 | TFile fexb("RegisterCorrectionExB.root","recreate"); | |
497 | cc->Write("ComposedExB"); | |
498 | fexb.Close(); | |
499 | return cc; | |
500 | } |