83 for(UInt_t nL=no_Orient; nL<20; nL+=2){
84 for(UInt_t nF=0; nF<64; nF++){
90 edges.emplace_back( make_pair(
m_uv_geo[no_Detector][nL][left] - 0.240, kTRUE), kFALSE);
91 edges.emplace_back( make_pair(
m_uv_geo[no_Detector][nL][nF] + 0.240, kFALSE), kFALSE);
93 edges.emplace_back( make_pair(
m_uv_geo[no_Detector][nL][left] - 0.240, kTRUE), kTRUE);
94 edges.emplace_back( make_pair(
m_uv_geo[no_Detector][nL][nF] + 0.240, kFALSE), kTRUE);
110 Float_t leftEd = 9999.0;
113 for(UInt_t i = 0; i< (edges.size()-1); i++){
114 if( edges.at(i).first.second ){
116 if( edges.at(i).second ){
119 if( edges.at(i+1).first.second ){
122 if( alive < 3 ||
max ){
125 leftEd = edges.at(i).first.first;
131 if( edges.at(i).second ){
135 if( edges.at(i+1).first.second ){
136 if( edges.at(i+2).first.second ){
137 corridors.emplace_back( make_pair( 0.5*(leftEd + edges.at(i).first.first), edges.at(i).first.first - leftEd), level+1 );
142 corridors.emplace_back( make_pair( 0.5*(leftEd + edges.at(i).first.first), edges.at(i).first.first - leftEd), level+1 );
149 if( !corridors.empty() ){
150 for(UInt_t i = 0; i < corridors.size()-1; i++){
151 if( std::abs( corridors.at(i).first.first - corridors.at(i+1).first.first ) < 0.480){
152 if( corridors.at(i).second > corridors.at(i+1).second ){
153 corridors.erase(corridors.begin()+i+1);
155 }
else if ( corridors.at(i).second < corridors.at(i+1).second ){
156 corridors.erase(corridors.begin()+i);
176 std::vector< Edge > edges;
178 findEdges( no_Detector, no_Orient, edges);
179 if( edges.empty() )
return kFALSE;
183 if( corridors.empty() )
189 UInt_t minHits = 0.5*corridors.front().second;
191 while( maxCorr < corridors.size() && minHits < corridors.at(maxCorr).second ){
194 if( maxCorr != corridors.size() ){
195 corridors.resize( maxCorr );
200 if( corridors.size() > 5 ){
238 std::vector< Edge > edges;
239 findEdges( no_Detector, no_Orient, edges);
242 std::vector< Corridor > corridors;
244 if( corridors.empty() )
return kFALSE;
247 if( std::abs( pos - corridors.front().first.first ) > 0.480 || std::abs( level - (Int_t)corridors.front().second ) > 1 )
return kFALSE;
249 corr = corridors.front();
261 for(UInt_t i = 0; i < tracks.size(); i++){
262 readUVONE(no_Detector, tracks.at(i).first.first.first, tracks.at(i).second.first.first );
263 rem =
iterNext(no_Detector, 0, tracks.at(i).first.first.first, tracks.at(i).first.second, corr_U) &&
iterNext(no_Detector, 1, tracks.at(i).second.first.first, tracks.at(i).second.second, corr_V);
265 tracks.at(i) = make_pair( corr_U, corr_V );
267 tracks.erase(tracks.begin()+i);
272 if( tracks.empty() )
return kFALSE;
302 readUVONE(no_Detector, track.first.first.first, track.second.first.first );
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) ){
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;
315 selectedFib[nL] = nF + 9000;
319 selectedFib[nL] = nF + 2999;
320 }
else if( (
m_uv_geo[no_Detector][nL][nF]-0.2401) <= track.first.first.first + 0.5 * track.first.first.second &&
m_bFiberHitsMD[no_Detector][nL][nF] ){
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;
325 selectedFib[nL] = nF + 9000;
329 nF > 4 ? nF -= 5 : nF = 0;
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 ){
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;
343 selectedFib[nL] = nF + 9000;
347 selectedFib[nL] = nF + 2999;
348 }
else if( (
m_uv_geo[no_Detector][nL][nF]-0.2401) <= track.second.first.first + 0.5 * track.second.first.second &&
m_bFiberHitsMD[no_Detector][nL][nF] ){
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;
353 selectedFib[nL] = nF + 9000;
357 nF > 4 ? nF -= 5 : nF = 0;
362 Float_t fLeft, fRight;
364 for(UInt_t nL = 0; nL < 16; nL+=2){
365 fLow = selectedFib[nL]%1000;
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] ){
375 if(
m_uv_geo[no_Detector][nL][fLow] >
m_uv_geo[no_Detector][nL+2][fLow-1] ){
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;
384 if( fLeft < fRight ){
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 );
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 );
400 for(UInt_t nL = 1; nL < 17; nL+=2){
401 fLow = selectedFib[nL]%1000;
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] ){
411 if(
m_uv_geo[no_Detector][nL][fLow] >
m_uv_geo[no_Detector][nL+2][fLow-1] ){
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 ){
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 );
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 );
446 for(Int_t no_Layer=0; no_Layer<20; no_Layer++){
447 if(
m_faMD[no_Detector][no_Layer][0]<0){
448 for(Int_t no_Fiber=0; no_Fiber<64; no_Fiber++){
449 m_uv_geo[no_Detector][no_Layer][no_Fiber]=(v_pos*(1+
m_faMD[no_Detector][no_Layer][no_Fiber])-1.414213562373095*
m_fbMD[no_Detector][no_Layer][no_Fiber])/(1-
m_faMD[no_Detector][no_Layer][no_Fiber]);
452 for(Int_t no_Fiber=0; no_Fiber<64; no_Fiber++){
453 m_uv_geo[no_Detector][no_Layer][no_Fiber]=(u_pos*(1-
m_faMD[no_Detector][no_Layer][no_Fiber])+1.414213562373095*
m_fbMD[no_Detector][no_Layer][no_Fiber])/(1+
m_faMD[no_Detector][no_Layer][no_Fiber]);