62 {
64 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
65 MsgStream log(
msgSvc,
"MilleAlign");
66 log << MSG::INFO << "MilleAlign::initialize()" << endreq;
67
69 m_hlist = hlist;
70 m_cgemGeomSvc = cgemGeomSvc;
71 m_cgemFunSvc = cgemFunSvc;
72
73 for(int il=0; il<6; il++)
74 {
75 int ilgeo = int(il/2);
76 m_r[il]=(m_cgemGeomSvc->
getCgemLayer(ilgeo)->getMiddleROfGapD());
77 m_z[il]=(m_cgemGeomSvc->
getCgemLayer(ilgeo)->getLengthOfCgemLayer()/2.0);
78 Ste_ang[il]=(m_cgemGeomSvc->
getCgemLayer(ilgeo)->getAngleOfStereo()*TMath::Pi()/180.0);
79 }
80
81 int DataType = 1;
82
83 if(DataType==1)
84 {
85
86 sig_phi[0] = 0.13/m_r[0];
87 sig_phi[1] = 0.13/m_r[1];
88 sig_phi[2] = 0.13/m_r[2];
89 sig_phi[3] = 0.13/m_r[3];
90 sig_phi[4] = 0.13/m_r[4];
91 sig_phi[5] = 0.13/m_r[5];
92
93 sig_v[0] = 0.13;
94 sig_v[1] = 0.13;
95 sig_v[2] = 0.13;
96 sig_v[3] = 0.13;
97 sig_v[4] = 0.13;
98 sig_v[5] = 0.13;
99
100 }
101 else if(DataType==2)
102 {
103
104 sig_phi[0] = 0.03;
105 sig_phi[1] = 0.03;
106 sig_phi[2] = 0.03;
107 sig_phi[3] = 0.03;
108 sig_phi[4] = 0.03;
109 sig_phi[5] = 0.03;
110
111 sig_v[0] = 1.7;
112 sig_v[1] = 1.7;
113 sig_v[2] = 1.2;
114 sig_v[3] = 1.2;
115 sig_v[4] = 1.2;
116 sig_v[5] = 1.2;
117 }
118
119 for(int i=0; i<30; i++)
120 {
121 count[i] = 0 ;
122 }
123
124
125 cut_derLC_Phi[0][0] = -0.05;
126 cut_derLC_Phi[1][0] = 0.98;
127 cut_derLC_Phi[2][0] = -0.01;
128 cut_derLC_Phi[3][0] = -0.01;
129 cut_derLC_Phi[4][0] = -0.01;
130
131 cut_derLC_Phi[0][1] = 0.05;
132 cut_derLC_Phi[1][1] = 1.02;
133 cut_derLC_Phi[2][1] = 0.01;
134 cut_derLC_Phi[3][1] = 0.01;
135 cut_derLC_Phi[4][1] = 0.01;
136
137 cut_derLC_V[0][0] = -5.0;
138 cut_derLC_V[1][0] = 60.0;
139 cut_derLC_V[2][0] = -0.01;
140 cut_derLC_V[3][0] = 0.45;
141 cut_derLC_V[4][0] = -90.0;
142
143 cut_derLC_V[0][1] = 5.0;
144 cut_derLC_V[1][1] = 150;
145 cut_derLC_V[2][1] = 0.01;
146 cut_derLC_V[3][1] = 0.80;
147 cut_derLC_V[4][1] = 90.0;
148
149 cut_derGB_Phi[0][0] = -0.05;
150 cut_derGB_Phi[1][0] = -0.02;
151 cut_derGB_Phi[2][0] = -0.01;
152 cut_derGB_Phi[3][0] = -1.02;
153
154 cut_derGB_Phi[0][1] = 0.05;
155 cut_derGB_Phi[1][1] = 0.02;
156 cut_derGB_Phi[2][1] = 0.01;
157 cut_derGB_Phi[3][1] = -0.98;
158
159 cut_derGB_V[0][0] = -5.00;
160 cut_derGB_V[1][0] = -5.00;
161 cut_derGB_V[2][0] = -0.80;
162 cut_derGB_V[3][0] = -150;
163
164 cut_derGB_V[0][1] = 5.00;
165 cut_derGB_V[1][1] = 5.00;
166 cut_derGB_V[2][1] = -0.50;
167 cut_derGB_V[3][1] = -60;
168
169
170 m_hresAll_phi = new TH1F("Resi_All_Phi", "", 200, -2.0, 2.0);
171 m_hlist->Add(m_hresAll_phi);
172
173 m_hresAll_v = new TH1F("Resi_All_v", "", 100, -30.0, 30.0);
174 m_hlist->Add(m_hresAll_v);
175
176 m_hresAll_z = new TH1F("Resi_All_z", "", 100, -30.0, 30.0);
177 m_hlist->Add(m_hresAll_z);
178
179 char hname_phi[200];
180 char hname_v[200];
181 char hname_z[200];
182
184 sprintf(hname_phi, "Res_Phi_Layer%02d", lay);
185 m_hresLay_phi[lay] = new TH1F(hname_phi, "", 200, -2.0, 2.0);
186 m_hlist->Add(m_hresLay_phi[lay]);
187
188 sprintf(hname_v, "Res_V_Layer%02d", lay);
189 m_hresLay_v[lay] = new TH1F(hname_v, "", 100, -30.0, 30.0);
190 m_hlist->Add(m_hresLay_v[lay]);
191
192 sprintf(hname_z, "Res_Z_Layer%02d", lay);
193 m_hresLay_z[lay] = new TH1F(hname_z, "", 100, -30.0, 30.0);
194 m_hlist->Add(m_hresLay_z[lay]);
195 }
196
197
198 m_hddoca = new TH1F("delt_doca", "", 200, -1.0, 1.0);
199 m_hlist->Add(m_hddoca);
200
201 char hname[200];
203 sprintf(hname, "delt_docaLay%02d", lay);
204 m_hddocaLay[lay] = new TH1F(hname, "", 200, -1.0, 1.0);
205 m_hlist->Add(m_hddocaLay[lay]);
206 }
207
209 Plot_der = false;
210 debug = false;
211 re_3lay = false;
212 record_pos = true;
213 use_phi = true;
214 use_v = true;
215 mul_R = false;
216 mul_Ste_ang = false;
217
218 nTrack_tot = 0;
219
220
221
226
227 if(debug)cout<<"m_nlay, m_nloc, m_nglo_on_lay, m_npar = "<<m_nlay<<", "<<m_nloc<<", "<<m_nglo_on_lay<<", "<<m_npar<<endl;
228
231
232
233 for(
int i=0; i<
NLAYER; i++)
234 {
235
236 ini_alig_par[i][0] = m_geoalign->
getDx(i);
237 ini_alig_par[i][1] = m_geoalign->
getDy(i);
238 ini_alig_par[i][2] = m_geoalign->
getDz(i);
239 ini_alig_par[i][3] = m_geoalign->
getRx(i);
240 ini_alig_par[i][4] = m_geoalign->
getRy(i);
241 ini_alig_par[i][5] = m_geoalign->
getRz(i);
242
243 }
244
245
246 int i;
249 for (int j=i*m_nlay; j<(i+1)*m_nlay; j++)
250 {
252 }
253 }
254
256 m_pMilleAlign -> InitMille(&m_dofs[0], &m_sigm[0], m_nlay,m_nglo_on_lay, m_nloc,
258
259 m_derLC_Phi.resize(m_nloc);
260 m_derLC_V.resize(m_nloc);
261 m_derGB_Phi.resize(m_npar);
262 m_derGB_V.resize(m_npar);
263 m_derNonLin_Phi.resize(m_npar);
264 m_derNonLin_V.resize(m_npar);
265 m_par.resize(m_npar);
266 m_error.resize(m_npar);
267 m_pull.resize(m_npar);
268
269 log << MSG::INFO << "MilleAlign::initialize() finished!!" << endreq;
270
271
272 std::vector<double> constDY1;
273 std::vector<double> constDY2;
274 std::vector<double> constDY3;
275 std::vector<double> constDY4;
276 std::vector<double> constDY5;
277 std::vector<double> constDY6;
278
279 std::vector<double> constDX5;
280 std::vector<double> constDZ5;
281 std::vector<double> constRX5;
282 std::vector<double> constRY5;
283 std::vector<double> constRZ5;
284
285 std::vector<double> constDX6;
286 std::vector<double> constDZ6;
287 std::vector<double> constRX6;
288 std::vector<double> constRY6;
289 std::vector<double> constRZ6;
290
291 std::vector<double> constDX1;
292 std::vector<double> constDZ1;
293 std::vector<double> constRX1;
294 std::vector<double> constRY1;
295 std::vector<double> constRZ1;
296
297 std::vector<double> constDX2;
298 std::vector<double> constDZ2;
299 std::vector<double> constRX2;
300 std::vector<double> constRY2;
301 std::vector<double> constRZ2;
302
303 std::vector<double> constDX3DX4;
304 std::vector<double> constDZ3DZ4;
305 std::vector<double> constRX3RX4;
306 std::vector<double> constRY3RY4;
307 std::vector<double> constRZ3RZ4;
308
309 std::vector<double> constRX3;
310 std::vector<double> constRY3;
311 std::vector<double> constRX4;
312 std::vector<double> constRY4;
313
314
315 constDY1.resize(m_npar);
316 constDY2.resize(m_npar);
317 constDY3.resize(m_npar);
318 constDY4.resize(m_npar);
319 constDY5.resize(m_npar);
320 constDY6.resize(m_npar);
321
322
323 constDX5.resize(m_npar);
324 constDZ5.resize(m_npar);
325 constRX5.resize(m_npar);
326 constRY5.resize(m_npar);
327 constRZ5.resize(m_npar);
328
329 constDX6.resize(m_npar);
330 constDZ6.resize(m_npar);
331 constRX6.resize(m_npar);
332 constRY6.resize(m_npar);
333 constRZ6.resize(m_npar);
334
335
336 constDX1.resize(m_npar);
337 constDZ1.resize(m_npar);
338 constRX1.resize(m_npar);
339 constRY1.resize(m_npar);
340 constRZ1.resize(m_npar);
341
342 constDX2.resize(m_npar);
343 constDZ2.resize(m_npar);
344 constRX2.resize(m_npar);
345 constRY2.resize(m_npar);
346 constRZ2.resize(m_npar);
347
348 constDX3DX4.resize(m_npar);
349 constDZ3DZ4.resize(m_npar);
350 constRX3RX4.resize(m_npar);
351 constRY3RY4.resize(m_npar);
352 constRZ3RZ4.resize(m_npar);
353
354 constRX3.resize(m_npar);
355 constRY3.resize(m_npar);
356 constRX4.resize(m_npar);
357 constRY4.resize(m_npar);
358
359 for(i=0; i<m_npar; i++){
360
361 constDY1[i] = 0.0;
362 constDY2[i] = 0.0;
363 constDY3[i] = 0.0;
364 constDY4[i] = 0.0;
365 constDY5[i] = 0.0;
366 constDY6[i] = 0.0;
367
368 constDX5[i] = 0.0;
369 constDZ5[i] = 0.0;
370 constRX5[i] = 0.0;
371 constRY5[i] = 0.0;
372 constRZ5[i] = 0.0;
373
374 constDX6[i] = 0.0;
375 constDZ6[i] = 0.0;
376 constRX6[i] = 0.0;
377 constRY6[i] = 0.0;
378 constRZ6[i] = 0.0;
379
380 constDX1[i] = 0.0;
381 constDZ1[i] = 0.0;
382 constRX1[i] = 0.0;
383 constRY1[i] = 0.0;
384 constRZ1[i] = 0.0;
385
386 constDX2[i] = 0.0;
387 constDZ2[i] = 0.0;
388 constRX2[i] = 0.0;
389 constRY2[i] = 0.0;
390 constRZ2[i] = 0.0;
391
392 constDX3DX4[i] = 0.0;
393 constDZ3DZ4[i] = 0.0;
394 constRX3RX4[i] = 0.0;
395 constRY3RY4[i] = 0.0;
396 constRZ3RZ4[i] = 0.0;
397
398 constRX3[i] = 0.0;
399 constRY3[i] = 0.0;
400 constRX4[i] = 0.0;
401 constRY4[i] = 0.0;
402
403 }
404
405
406
407
408
409
410
411
412
413
414
415 constDY1[6] = 1.0;
416 constDY2[7] = 1.0;
417 constDY3[8] = 1.0;
418 constDY4[9] = 1.0;
419 constDY5[10] = 1.0;
420 constDY6[11] = 1.0;
421
422
423 constDX5[4] = 1.0;
424 constDZ5[16] = 1.0;
425 constRX5[22] = 1.0;
426 constRY5[28] = 1.0;
427 constRZ5[34] = 1.0;
428
429 constDX6[5] = 1.0;
430 constDZ6[17] = 1.0;
431 constRX6[23] = 1.0;
432 constRY6[29] = 1.0;
433 constRZ6[35] = 1.0;
434
435
436 constDX1[0] = 1.0;
437 constDZ1[12] = 1.0;
438 constRX1[18] = 1.0;
439 constRY1[24] = 1.0;
440 constRZ1[30] = 1.0;
441
442 constDX2[1] = 1.0;
443 constDZ2[13] = 1.0;
444 constRX2[19] = 1.0;
445 constRY2[25] = 1.0;
446 constRZ2[31] = 1.0;
447
448
449 constDX3DX4[2] = 1.0;
450 constDX3DX4[3] = -1.0;
451
452 constDZ3DZ4[14] = 1.0;
453 constDZ3DZ4[15] = -1.0;
454
455 constRX3RX4[20] = 1.0;
456 constRX3RX4[21] = -1.0;
457 constRX3[20] = 1.0;
458 constRX4[21] = 1.0;
459
460 constRY3RY4[26] = 1.0;
461 constRY3RY4[27] = -1.0;
462 constRY3[26] = 1.0;
463 constRY4[27] = 1.0;
464
465 constRZ3RZ4[32] = 1.0;
466 constRZ3RZ4[33] = -1.0;
467
468
469 m_pMilleAlign -> ConstF(&constDY1[0], 0.0);
470 m_pMilleAlign -> ConstF(&constDY2[0], 0.0);
471 m_pMilleAlign -> ConstF(&constDY3[0], 0.0);
472 m_pMilleAlign -> ConstF(&constDY4[0], 0.0);
473 m_pMilleAlign -> ConstF(&constDY5[0], 0.0);
474 m_pMilleAlign -> ConstF(&constDY6[0], 0.0);
475
476 m_pMilleAlign -> ConstF(&constDX5[0], 0.0);
477 m_pMilleAlign -> ConstF(&constDZ5[0], 0.0);
478 m_pMilleAlign -> ConstF(&constRX5[0], 0.0);
479 m_pMilleAlign -> ConstF(&constRY5[0], 0.0);
480
481
482 m_pMilleAlign -> ConstF(&constDX6[0], 0.0);
483 m_pMilleAlign -> ConstF(&constDZ6[0], 0.0);
484 m_pMilleAlign -> ConstF(&constRX6[0], 0.0);
485 m_pMilleAlign -> ConstF(&constRY6[0], 0.0);
486
487
488 m_pMilleAlign -> ConstF(&constDX1[0], 0.0);
489 m_pMilleAlign -> ConstF(&constDZ1[0], 0.0);
490 m_pMilleAlign -> ConstF(&constRX1[0], 0.0);
491 m_pMilleAlign -> ConstF(&constRY1[0], 0.0);
492 m_pMilleAlign -> ConstF(&constRZ1[0], 0.0);
493
494 m_pMilleAlign -> ConstF(&constDX2[0], 0.0);
495 m_pMilleAlign -> ConstF(&constDZ2[0], 0.0);
496 m_pMilleAlign -> ConstF(&constRX2[0], 0.0);
497 m_pMilleAlign -> ConstF(&constRY2[0], 0.0);
498 m_pMilleAlign -> ConstF(&constRZ2[0], 0.0);
499
500 m_pMilleAlign -> ConstF(&constDX3DX4[0], 0.0);
501
502
503
504
505
506
507
508
509
510
511
512
513}
virtual void initialize(TObjArray *hlist, ICgemGeomSvc *cgemGeomSvc, ICgemCalibFunSvc *cgemFunSvc)=0
double getDx(int layer_vir)
double getRx(int layer_vir)
double getRy(int layer_vir)
double getRz(int layer_vir)
double getDz(int layer_vir)
double getDy(int layer_vir)
virtual CgemGeoLayer * getCgemLayer(int i) const =0
virtual CgemGeoAlign * getAlignPtr() const =0
virtual CgemMidDriftPlane * getMidDriftPtr() const =0
const double g_start_chi_cut
const double g_res_cut_init