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