126 int tmpArray[] = {15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18,
127 18, 18, 18, 18, 19, 19, 19, 18,
128 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21,
129 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 23,
130 23, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26,
131 26, 26, 26, 26, 27, 27, 27, 27, 27, 28, 28, 28, 28,
132 28, 29, 29, 29, 29, 28, -1};
136 while( -1 != tmpArray[i] )
138 RunningCount += tmpArray[i];
157 int moduleId, strawLayerId, strawInLayerId;
161 uint32_t strawNumber, bufferOffset;
164 std::string dataFile;
167 std::ifstream *inputFile;
205 dataFile =
"TRT_SR1_ec_rod1l.dat";
207 inputFile =
new std::ifstream(
file.c_str() );
209 if (!inputFile->is_open())
211 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
214 while ( getline( *inputFile, thisLine ) )
216 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
218 string::size_type loc = thisLine.find(
'#' );
219 if ( loc != string::npos )
221 thisLine.replace( loc, thisLine.length(), 1,
' ' );
223 loc = thisLine.find_first_not_of(
" \t" );
224 if ( loc == string::npos )
228 istringstream
parse( thisLine );
230 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
239 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
241 bufferOffset = ((3 - rodgroup) * 444) + 14;
244 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
248 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
262 dataFile =
"TRT_SR1_ec_rod2l.dat";
264 inputFile =
new std::ifstream(
file.c_str() );
266 if (!inputFile->is_open())
268 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
271 while ( getline( *inputFile, thisLine ) )
273 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
275 string::size_type loc = thisLine.find(
'#' );
276 if ( loc != string::npos )
278 thisLine.replace( loc, thisLine.length(), 1,
' ' );
280 loc = thisLine.find_first_not_of(
" \t" );
281 if ( loc == string::npos )
285 istringstream
parse( thisLine );
287 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
296 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
298 bufferOffset = ((1 - rodgroup) * 444) + 14;
301 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
305 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
319 dataFile =
"TRT_SR1_ec_rod3l.dat";
321 inputFile =
new std::ifstream(
file.c_str() );
323 if (!inputFile->is_open())
325 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
328 while ( getline( *inputFile, thisLine ) )
330 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
332 string::size_type loc = thisLine.find(
'#' );
333 if ( loc != string::npos )
335 thisLine.replace( loc, thisLine.length(), 1,
' ' );
337 loc = thisLine.find_first_not_of(
" \t" );
338 if ( loc == string::npos )
342 istringstream
parse( thisLine );
344 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
353 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
355 bufferOffset = ((3 - rodgroup) * 444) + 14;
358 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
362 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
376 dataFile =
"TRT_SR1_ec_rod1r.dat";
378 inputFile =
new std::ifstream(
file.c_str() );
380 if (!inputFile->is_open())
382 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
385 while ( getline( *inputFile, thisLine ) )
387 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
389 string::size_type loc = thisLine.find(
'#' );
390 if ( loc != string::npos )
392 thisLine.replace( loc, thisLine.length(), 1,
' ' );
394 loc = thisLine.find_first_not_of(
" \t" );
395 if ( loc == string::npos )
399 istringstream
parse( thisLine );
401 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
410 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
412 bufferOffset = ((3 - rodgroup) * 444) + 14;
415 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
419 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
433 dataFile =
"TRT_SR1_ec_rod2r.dat";
435 inputFile =
new std::ifstream(
file.c_str() );
437 if (!inputFile->is_open())
439 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
442 while ( getline( *inputFile, thisLine ) )
444 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
446 string::size_type loc = thisLine.find(
'#' );
447 if ( loc != string::npos )
449 thisLine.replace( loc, thisLine.length(), 1,
' ' );
451 loc = thisLine.find_first_not_of(
" \t" );
452 if ( loc == string::npos )
456 istringstream
parse( thisLine );
458 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
467 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
469 bufferOffset = ((1 - rodgroup) * 444) + 14;
472 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
476 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
490 dataFile =
"TRT_SR1_ec_rod3r.dat";
492 inputFile =
new std::ifstream(
file.c_str() );
494 if (!inputFile->is_open())
496 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
499 while ( getline( *inputFile, thisLine ) )
501 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
503 string::size_type loc = thisLine.find(
'#' );
504 if ( loc != string::npos )
506 thisLine.replace( loc, thisLine.length(), 1,
' ' );
508 loc = thisLine.find_first_not_of(
" \t" );
509 if ( loc == string::npos )
513 istringstream
parse( thisLine );
515 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
524 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
526 bufferOffset = ((3 - rodgroup) * 444) + 14;
529 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
533 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
547 dataFile =
"TRT_SR1_EndcapC_Cable_map.dat";
551 inputFile =
new std::ifstream(
file.c_str() );
553 if (!inputFile->is_open())
555 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
561 while ( getline( *inputFile, thisLine ) )
563 if ( thisLine.length() == 0 )
566 string::size_type loc = thisLine.find(
'#' );
567 if ( loc != string::npos )
569 thisLine.replace( loc, thisLine.length(), 1,
' ' );
571 loc = thisLine.find_first_not_of(
" \t" );
572 if ( loc == string::npos )
577 istringstream
parse( thisLine );
586 if ( (srcId & 0xFF0000) == 0x310000 )
591 else if ( (srcId & 0xFF0000) == 0x320000 )
596 else if ( (srcId & 0xFF0000) == 0x330000 )
601 else if ( (srcId & 0xFF0000) == 0x340000 )
607 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Invalid source id " << (hex) << srcId << (dec) );
622 int my_phi = my_map->
SubDet * 32 + my_map->
Phi;
625 std::vector<uint32_t>::iterator it = (
m_phi_to_source[my_phi]).begin();
642 for ( ptk_i=1; ptk_i<=444; ptk_i++ )
644 std::map<int, int>::iterator map_it =
m_1BS_1BL_map.find( ptk_i );
650 GlobalCableMap::iterator pos;
653 std::vector< GlobalCableMap_t *> GCM;
659 int ConnectorCount=-1;
660 std::vector< GlobalCableMap_t *>::iterator it;
661 for ( it=GCM.begin(); it != GCM.end(); ++it )
666 std::map<int, int> con_map;
669 if ( my_map->
FEid ==
"1BS_1BL" )
671 else if ( my_map->
FEid ==
"2BS_2BL1" )
673 else if ( my_map->
FEid ==
"2BL2_3BL1" )
675 else if ( my_map->
FEid ==
"3BL2" )
677 else if ( my_map->
FEid ==
"3BS" )
679 else if ( my_map->
FEid ==
"1FS_1FL" )
681 else if ( my_map->
FEid ==
"2FS_2FL1" )
683 else if ( my_map->
FEid ==
"2FL2_3FL1" )
685 else if ( my_map->
FEid ==
"3FL2" )
687 else if ( my_map->
FEid ==
"3FS" )
689 else if ( my_map->
FEid ==
"ec_rod1l" )
691 else if ( my_map->
FEid ==
"ec_rod2l" )
693 else if ( my_map->
FEid ==
"ec_rod3l" )
695 else if ( my_map->
FEid ==
"ec_rod1r" )
697 else if ( my_map->
FEid ==
"ec_rod2r" )
699 else if ( my_map->
FEid ==
"ec_rod3r" )
706 if ( abs( my_map->
SubDet ) == 1 )
708 for ( i=1; i<=444; i++ )
710 std::map<int, int>::iterator map_it = con_map.find( i );
712 if ( map_it == con_map.end() )
714 m_cabling->set_identifierForAllStraws( pos->first,
715 i + ConnectorCount*444,
720 int BufferLocation = map_it->first + ConnectorCount*444;
721 int Straw = map_it->second - 1;
756 moduleId, strawLayerId,
760 m_cabling->set_identifierForAllStraws( pos->first, BufferLocation,
769 my_map->
Phi, moduleId,
778 <<
" SubDet = " << my_map->
SubDet \
779 <<
" Phi = " << my_map->
Phi \
780 <<
" Module = " << moduleId \
781 <<
" Layer = " << strawLayerId \
782 <<
" StrInLay = " << strawInLayerId );
786 m_cabling->set_identifierHashForAllStraws( pos->first,
793 for ( i=0; i<1776; i++ )
795 std::map<int, int>::iterator map_it = con_map.find( i );
797 if ( map_it == con_map.end() )
799 m_cabling->set_identifierForAllStraws( pos->first, i,
804 int BufferLocation = i;
805 int Straw = map_it->second;
807 strawLayerId = (Straw >> 8) & 0xff;
808 strawInLayerId = Straw & 0xff;
810 moduleId = strawLayerId / 8;
813 moduleId = moduleId / 2;
814 strawLayerId = strawLayerId % 16;
818 moduleId = moduleId - 6;
819 strawLayerId = strawLayerId % 8;
824 moduleId, strawLayerId,
837 m_cabling->set_identifierForAllStraws( pos->first, BufferLocation,
846 my_map->
Phi, moduleId,
855 <<
" SubDet = " << my_map->
SubDet \
856 <<
" Phi = " << my_map->
Phi \
857 <<
" Module = " << moduleId \
858 <<
" Layer = " << strawLayerId \
859 <<
" StrInLay = " << strawInLayerId );
863 m_cabling->set_identifierHashForAllStraws( pos->first,