299{
301
303
305 for(UInt_t nL = 0; nL < 20; nL+=2){
306 selectedFib[nL] = 9999;
307 while( nF != 63 && (
m_uv_geo[no_Detector][nL][nF] + 0.2401) <= (
track.first.first.first + 0.5 *
track.first.first.second) ){
309 }
310
311 if( (
m_uv_geo[no_Detector][nL][nF]-0.2401) <=
track.first.first.first - 0.5 *
track.first.first.second ){
313 selectedFib[nL] =
nF;
314 } else {
315 selectedFib[nL] =
nF + 9000;
316 }
317 } else {
319 selectedFib[nL] =
nF + 2999;
321 selectedFib[nL] =
nF + 2000;
322 }
else if ( nF != 0 && (
m_uv_geo[no_Detector][nL][nF-1]+0.2401) <=
track.first.first.first - 0.5 *
track.first.first.second &&
m_bFiberHitsMD[no_Detector][nL][nF-1] ){
323 selectedFib[nL] =
nF + 999;
324 } else {
325 selectedFib[nL] =
nF + 9000;
326 }
327 }
328
329 nF > 4 ?
nF -= 5 :
nF = 0;
330 }
331
333 for(UInt_t nL = 1; nL < 20; nL+=2){
334 selectedFib[nL] = 9999;
335 while( nF != 63 && (
m_uv_geo[no_Detector][nL][nF] + 0.2401) <=
track.second.first.first + 0.5 *
track.second.first.second ){
337 }
338
339 if( (
m_uv_geo[no_Detector][nL][nF]-0.2401) <=
track.second.first.first - 0.5 *
track.second.first.second ){
341 selectedFib[nL] =
nF;
342 } else {
343 selectedFib[nL] =
nF + 9000;
344 }
345 } else {
347 selectedFib[nL] =
nF + 2999;
349 selectedFib[nL] =
nF + 2000;
350 }
else if ( nF != 0 && (
m_uv_geo[no_Detector][nL][nF-1]+0.2401) <=
track.second.first.first - 0.5 *
track.second.first.second &&
m_bFiberHitsMD[no_Detector][nL][nF-1] ){
351 selectedFib[nL] =
nF + 999;
352 } else {
353 selectedFib[nL] =
nF + 9000;
354 }
355 }
356
357 nF > 4 ?
nF -= 5 :
nF = 0;
358 }
359
361 Int_t fLow, fCur;
362 Float_t fLeft, fRight;
363
364 for(UInt_t nL = 0; nL < 16; nL+=2){
365 fLow = selectedFib[nL]%1000;
366
367 if( fLow > 1 && fLow < 62 && selectedFib[nL] < 8000 && selectedFib[nL+2] > 8000 && selectedFib[nL+4] < 8000 ){
369 if(
m_uv_geo[no_Detector][nL][fLow] >
m_uv_geo[no_Detector][nL+2][fLow+1] ){
370 fCur = fLow+1;
371 } else {
372 fCur = fLow;
373 }
374 } else {
375 if(
m_uv_geo[no_Detector][nL][fLow] >
m_uv_geo[no_Detector][nL+2][fLow-1] ){
376 fCur = fLow-1;
377 } else {
378 fCur = fLow-2;
379 }
380 }
381 fLeft =
m_uv_geo[no_Detector][nL+2][fCur] + 0.2399;
382 fRight =
m_uv_geo[no_Detector][nL+2][fCur+1] - 0.2401;
383
384 if( fLeft < fRight ){
385
386 if( fLeft >
track.first.first.first - 0.5 *
track.first.first.second && fLeft <
track.first.first.first + 0.5 *
track.first.first.second ){
387 track.first.first.first = 0.5 * (
track.first.first.first + 0.5 *
track.first.first.second + fLeft );
388 track.first.first.second = 2 * (
track.first.first.first - fLeft );
389 }
390
391 if( fRight >
track.first.first.first - 0.5 *
track.first.first.second && fRight <
track.first.first.first + 0.5 *
track.first.first.second ){
392 track.first.first.first = 0.5 * (
track.first.first.first - 0.5 *
track.first.first.second + fRight );
393 track.first.first.second = 2 * ( fRight -
track.first.first.first );
394 }
395 }
396 nL += 2;
397 }
398 }
399
400 for(UInt_t nL = 1; nL < 17; nL+=2){
401 fLow = selectedFib[nL]%1000;
402
403 if( fLow > 1 && fLow < 62 && selectedFib[nL] < 8000 && selectedFib[nL+2] > 8000 && selectedFib[nL+4] < 8000 ){
405 if(
m_uv_geo[no_Detector][nL][fLow] >
m_uv_geo[no_Detector][nL+2][fLow+1] ){
406 fCur = fLow+1;
407 } else {
408 fCur = fLow;
409 }
410 } else {
411 if(
m_uv_geo[no_Detector][nL][fLow] >
m_uv_geo[no_Detector][nL+2][fLow-1] ){
412 fCur = fLow-1;
413 } else {
414 fCur = fLow-2;
415 }
416 }
417 fLeft =
m_uv_geo[no_Detector][nL+2][fCur] + 0.2399;
418 fRight =
m_uv_geo[no_Detector][nL+2][fCur+1] - 0.2401;
419 if( fLeft < fRight ){
420
421 if( fLeft >
track.second.first.first - 0.5 *
track.second.first.second && fLeft <
track.second.first.first + 0.5 *
track.second.first.second ){
422 track.second.first.first = 0.5 * (
track.second.first.first + 0.5 *
track.second.first.second + fLeft );
423 track.second.first.second = 2 * (
track.second.first.first - fLeft );
424 }
425
426 if( fRight >
track.second.first.first - 0.5 *
track.second.first.second && fRight <
track.second.first.first + 0.5 *
track.second.first.second ){
427 track.second.first.first = 0.5 * (
track.second.first.first - 0.5 *
track.second.first.second + fRight );
428 track.second.first.second = 2 * ( fRight -
track.second.first.first );
429 }
430 }
431
432 nL += 2;
433 }
434 }
435 }
436}