146{
148
149
150
151 int moduleId, strawLayerId, strawInLayerId;
152 Identifier strawID;
153 IdentifierHash hashId;
154
156 string thisLine;
157
158 std::string dataFile;
160
162
163
164
165
166
167
168
169
171
172 dataFile = "TRT_SR1_1BS-1BL_map.dat";
175
177 {
178 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Could not open file " << dataFile );
179 }
180
181 while ( getline( *inputFile, thisLine ) )
182 {
183 istringstream
parse( thisLine );
184
185 parse >> strawNumber >> bufferOffset;
186
188 }
189
190
193
194
195
196
197
199
200 dataFile = "TRT_SR1_2BS-2BL1_map.dat";
203
205 {
206 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Could not open file " << dataFile );
207 }
208
209 while ( getline( *inputFile, thisLine ) )
210 {
211 istringstream
parse( thisLine );
212
213 parse >> strawNumber >> bufferOffset;
214
216 }
217
218
221
222
223
224
225
227
228 dataFile = "TRT_SR1_2BL2-3BL1_map.dat";
231
233 {
234 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Could not open file " << dataFile );
235 }
236
237 while ( getline( *inputFile, thisLine ) )
238 {
239 istringstream
parse( thisLine );
240
241 parse >> strawNumber >> bufferOffset;
242
244 }
245
247
248
249
250
251
253
254 dataFile = "TRT_SR1_3BL2_map.dat";
257
259 {
260 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Could not open file " << dataFile );
261 }
262
263 while ( getline( *inputFile, thisLine ) )
264 {
265 istringstream
parse( thisLine );
266
267 parse >> strawNumber >> bufferOffset;
268
270 }
271
273
274
275
276
277
279
280 dataFile = "TRT_SR1_3BS_map.dat";
283
285 {
286 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Could not open file " << dataFile );
287 }
288
289 while ( getline( *inputFile, thisLine ) )
290 {
291 istringstream
parse( thisLine );
292
293 parse >> strawNumber >> bufferOffset;
294
296 }
297
299
300
301
302
303
304
305
306
307
309
310 dataFile = "TRT_SR1_1FS-1FL_map.dat";
313
315 {
316 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Could not open file " << dataFile );
317 }
318
319 while ( getline( *inputFile, thisLine ) )
320 {
321 istringstream
parse( thisLine );
322
323 parse >> strawNumber >> bufferOffset;
324
326 }
327
329
330
331
332
333
335
336 dataFile = "TRT_SR1_2FS-2FL1_map.dat";
339
341 {
342 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Could not open file " << dataFile );
343 }
344
345 while ( getline( *inputFile, thisLine ) )
346 {
347 istringstream
parse( thisLine );
348
349 parse >> strawNumber >> bufferOffset;
350
352 }
353
355
356
357
358
359
361
362 dataFile = "TRT_SR1_2FL2-3FL1_map.dat";
365
367 {
368 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Could not open file " << dataFile );
369 }
370
371 while ( getline( *inputFile, thisLine ) )
372 {
373 istringstream
parse( thisLine );
374
375 parse >> strawNumber >> bufferOffset;
376
378 }
379
381
382
383
384
385
387
388 dataFile = "TRT_SR1_3FL2_map.dat";
391
393 {
394 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Could not open file " << dataFile );
395 }
396
397 while ( getline( *inputFile, thisLine ) )
398 {
399 istringstream
parse( thisLine );
400
401 parse >> strawNumber >> bufferOffset;
402
404 }
405
407
408
409
410
411
413
414 dataFile = "TRT_SR1_3FS_map.dat";
417
419 {
420 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Could not open file " << dataFile );
421 }
422
423 while ( getline( *inputFile, thisLine ) )
424 {
425 istringstream
parse( thisLine );
426
427 parse >> strawNumber >> bufferOffset;
428
430 }
431
433
434
435
436
437
438
440
441 dataFile = "TRT_SR1_Barrel_Cable_map.dat";
442
443
446
448 {
449 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Could not open file " << dataFile );
450 }
451
453 std::string feId;
454
455 while ( getline( *inputFile, thisLine ) )
456 {
457 if ( thisLine.length() == 0 )
458 continue;
459
460 string::size_type loc = thisLine.find( '#' );
461 if ( loc != string::npos )
462 {
463 thisLine.replace( loc, thisLine.length(), 1, ' ' );
464
465 loc = thisLine.find_first_not_of( " \t" );
466 if ( loc == string::npos )
467 continue;
468 }
469
470
471 istringstream
parse( thisLine );
472
473 GlobalCableMap_t *my_map = new GlobalCableMap_t;
474
476
477
478
479
480 if ( (srcId & 0xFF0000) == 0x310000 )
481 {
483
484 }
485 else if ( (srcId & 0xFF0000) == 0x320000 )
486 {
488
489 }
490 else if ( (srcId & 0xFF0000) == 0x330000 )
491 {
493
494 }
495 else if ( (srcId & 0xFF0000) == 0x340000 )
496 {
498
499 }
500 else {
501 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1: Invalid source id " << (hex) << srcId << (dec) );
503 }
504
505
506
507
508
509
510
511
512
513
514
515
516 int my_phi = my_map->
SubDet * 32 + my_map->
Phi;
517
518
522
524 {
526 }
527
528
530 }
531
533
534#ifdef NOTDEF
535 int ptk_i;
536 for ( ptk_i=1; ptk_i<=444; ptk_i++ )
537 {
538 std::map<int, int>::iterator map_it =
m_1BS_1BL_map.find( ptk_i );
539
540
541 }
542#endif
543
544 GlobalCableMap::iterator
pos;
546 {
547 std::vector< GlobalCableMap_t *> GCM;
548
550
552
553 int ConnectorCount=-1;
554 std::vector< GlobalCableMap_t *>::iterator
it;
555 for ( it=GCM.begin(); it != GCM.end(); ++it )
556 {
557 ConnectorCount++;
558
559 GlobalCableMap_t *my_map = *
it;
560 std::map<int, int> con_map;
561
562
563 if ( my_map->
FEid ==
"1BS_1BL" )
565 else if ( my_map->
FEid ==
"2BS_2BL1" )
567 else if ( my_map->
FEid ==
"2BL2_3BL1" )
569 else if ( my_map->
FEid ==
"3BL2" )
571 else if ( my_map->
FEid ==
"3BS" )
573 else if ( my_map->
FEid ==
"1FS_1FL" )
575 else if ( my_map->
FEid ==
"2FS_2FL1" )
577 else if ( my_map->
FEid ==
"2FL2_3FL1" )
579 else if ( my_map->
FEid ==
"3FL2" )
581 else if ( my_map->
FEid ==
"3FS" )
583 else if ( my_map->
FEid ==
"ec_rod1l" )
585 else if ( my_map->
FEid ==
"ec_rod2l" )
587 else if ( my_map->
FEid ==
"ec_rod3l" )
589 else if ( my_map->
FEid ==
"ec_rod1r" )
591 else if ( my_map->
FEid ==
"ec_rod2r" )
593 else if ( my_map->
FEid ==
"ec_rod3r" )
595
596
598 Identifier NULLstrawID(0);
599
600 if ( abs( my_map->
SubDet ) == 1 )
601 {
602 for ( i=1;
i<=444;
i++ )
603 {
604 std::map<int, int>::iterator map_it = con_map.find( i );
605
606 if ( map_it == con_map.end() )
607 {
609 i + ConnectorCount*444,
610 NULLstrawID );
611 continue;
612 }
613
614 int BufferLocation = map_it->first + ConnectorCount*444;
615 int Straw = map_it->second - 1;
616
617 strawLayerId = 0;
620 {
621 strawLayerId++;
622 }
623
625 {
627 continue;
628 }
629
630
632
633 moduleId = -1;
635 moduleId = 0;
637 {
638 moduleId = 1;
640 }
642 {
643 moduleId = 2;
645 }
646
647
648
650 moduleId, strawLayerId,
651 strawInLayerId );
652
653
654 m_cabling->set_identifierForAllStraws(
pos->first, BufferLocation,
655 strawID );
656
657
658
659
660
661
663 my_map->
Phi, moduleId,
664 strawLayerId );
665
667 if ( result != 0 )
668 {
672 <<
" SubDet = " << my_map->
SubDet \
673 <<
" Phi = " << my_map->
Phi \
674 << " Module = " << moduleId \
675 << " Layer = " << strawLayerId \
676 << " StrInLay = " << strawInLayerId );
677 }
678
679
681 BufferLocation,
682 hashId );
683 }
684 }
685 else
686 {
687 for ( i=0;
i<1776;
i++ )
688 {
689 std::map<int, int>::iterator map_it = con_map.find( i );
690
691 if ( map_it == con_map.end() )
692 {
694 NULLstrawID );
695 continue;
696 }
697
698 int BufferLocation =
i;
699 int Straw = map_it->second;
700
701 strawLayerId = (
Straw >> 8) & 0xff;
702 strawInLayerId =
Straw & 0xff;
703
704 moduleId = strawLayerId / 8;
705 if ( moduleId < 12 )
706 {
707 moduleId = moduleId / 2;
708 strawLayerId = strawLayerId % 16;
709 }
710 else
711 {
712 moduleId = moduleId - 6;
713 strawLayerId = strawLayerId % 8;
714 }
715
716
718 moduleId, strawLayerId,
719 strawInLayerId );
720
721
722 m_cabling->set_identifierForAllStraws(
pos->first, BufferLocation,
723 strawID );
724
725
726
727
728
729
731 my_map->
Phi, moduleId,
732 strawLayerId );
733
735 if ( result != 0 )
736 {
738
740 <<
" SubDet = " << my_map->
SubDet \
741 <<
" Phi = " << my_map->
Phi \
742 << " Module = " << moduleId \
743 << " Layer = " << strawLayerId \
744 << " StrInLay = " << strawInLayerId );
745 }
746
747
749 BufferLocation,
750 hashId );
751 }
752 }
753 }
754 }
755
756
757
759
760 return;
761}
#define ATH_MSG_WARNING(x)
static bool greater_RG_GCM(const GlobalCableMap_t *a, const GlobalCableMap_t *b)
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
std::map< int, int > m_ec_1r_map
std::map< int, int > m_ec_3l_map
std::map< int, int > m_3BS_map
std::map< int, int > m_2BL2_3BL1_map
std::map< int, int > m_1FS_1FL_map
std::map< int, int > m_ec_3r_map
std::map< int, int > m_1BS_1BL_map
std::map< int, int > m_ec_2r_map
std::map< int, int > m_2FL2_3FL1_map
std::map< int, int > m_2BS_2BL1_map
std::map< int, int > m_3FS_map
std::map< int, int > m_2FS_2FL1_map
std::map< int, int > m_3BL2_map
std::map< int, std::vector< uint32_t > > m_phi_to_source
std::map< int, int > m_3FL2_map
std::map< int, int > m_ec_2l_map
std::map< int, int > m_ec_1l_map
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.