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.size() >= 2) {
150 for (std::size_t i = 0; i + 1 < corridors.size(); ) {
151 auto&
a = corridors[i];
152 auto& b = corridors[i + 1];
153 if (std::abs(
a.first.first - b.first.first) < 0.480) {
154 if (
a.second > b.second) {
155 corridors.erase(corridors.begin() + (i + 1));
156 }
else if (
a.second < b.second) {
157 corridors.erase(corridors.begin() + i);
160 corridors.erase(corridors.begin() + (i + 1));
181 std::vector< Edge > edges;
183 findEdges( no_Detector, no_Orient, edges);
184 if( edges.empty() )
return kFALSE;
188 if( corridors.empty() )
194 UInt_t minHits = 0.5*corridors.front().second;
196 while( maxCorr < corridors.size() && minHits < corridors.at(maxCorr).second ){
199 if( maxCorr != corridors.size() ){
200 corridors.resize( maxCorr );
205 if( corridors.size() > 5 ){
243 std::vector< Edge > edges;
244 findEdges( no_Detector, no_Orient, edges);
247 std::vector< Corridor > corridors;
249 if( corridors.empty() )
return kFALSE;
252 if( std::abs( pos - corridors.front().first.first ) > 0.480 || std::abs( level - (Int_t)corridors.front().second ) > 1 )
return kFALSE;
254 corr = corridors.front();
265 for (std::size_t i = 0; i < tracks.size(); ) {
266 auto& tr = tracks[i];
267 readUVONE(no_Detector, tr.first.first.first, tr.second.first.first);
269 iterNext(no_Detector, 0, tr.first.first.first, tr.first.second, corr_U) &&
270 iterNext(no_Detector, 1, tr.second.first.first, tr.second.second, corr_V);
273 tr = std::make_pair(corr_U, corr_V);
276 tracks.erase(tracks.begin() + i);
280 if( tracks.empty() )
return kFALSE;
310 readUVONE(no_Detector, track.first.first.first, track.second.first.first );
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) ){
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;
323 selectedFib[nL] = nF + 9000;
327 selectedFib[nL] = nF + 2999;
328 }
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] ){
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;
333 selectedFib[nL] = nF + 9000;
337 nF > 4 ? nF -= 5 : nF = 0;
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 ){
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;
351 selectedFib[nL] = nF + 9000;
355 selectedFib[nL] = nF + 2999;
356 }
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] ){
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;
361 selectedFib[nL] = nF + 9000;
365 nF > 4 ? nF -= 5 : nF = 0;
370 Float_t fLeft, fRight;
372 for(UInt_t nL = 0; nL < 16; nL+=2){
373 fLow = selectedFib[nL]%1000;
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] ){
383 if(
m_uv_geo[no_Detector][nL][fLow] >
m_uv_geo[no_Detector][nL+2][fLow-1] ){
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;
392 if( fLeft < fRight ){
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 );
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 );
408 for(UInt_t nL = 1; nL < 17; nL+=2){
409 fLow = selectedFib[nL]%1000;
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] ){
419 if(
m_uv_geo[no_Detector][nL][fLow] >
m_uv_geo[no_Detector][nL+2][fLow-1] ){
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 ){
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 );
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 );
454 for(Int_t no_Layer=0; no_Layer<20; no_Layer++){
455 if(
m_faMD[no_Detector][no_Layer][0]<0){
456 for(Int_t no_Fiber=0; no_Fiber<64; no_Fiber++){
457 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]);
460 for(Int_t no_Fiber=0; no_Fiber<64; no_Fiber++){
461 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]);