151{
153
154
155
156
157 int moduleId, strawLayerId, strawInLayerId;
158 Identifier strawID;
159 IdentifierHash hashId;
160
162 string thisLine;
163
164 std::string dataFile;
166
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
204
205 dataFile = "TRT_SR1_ec_rod1l.dat";
208
210 {
211 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
212 }
213
214 while ( getline( *inputFile, thisLine ) )
215 {
216 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
217
218 string::size_type loc = thisLine.find( '#' );
219 if ( loc != string::npos )
220 {
221 thisLine.replace( loc, thisLine.length(), 1, ' ' );
222
223 loc = thisLine.find_first_not_of( " \t" );
224 if ( loc == string::npos )
225 continue;
226 }
227
228 istringstream
parse( thisLine );
229
230 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
231
232
233
234
235
236
237
238
239 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
240
241 bufferOffset = ((3 - rodgroup) * 444) + 14;
242 if ( rodline > 12 )
243 {
244 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
245 }
246 else
247 {
248 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
249 }
250
252 }
253
255
256
257
258
259
261
262 dataFile = "TRT_SR1_ec_rod2l.dat";
265
267 {
268 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
269 }
270
271 while ( getline( *inputFile, thisLine ) )
272 {
273 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
274
275 string::size_type loc = thisLine.find( '#' );
276 if ( loc != string::npos )
277 {
278 thisLine.replace( loc, thisLine.length(), 1, ' ' );
279
280 loc = thisLine.find_first_not_of( " \t" );
281 if ( loc == string::npos )
282 continue;
283 }
284
285 istringstream
parse( thisLine );
286
287 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
288
289
290
291
292
293
294
295
296 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
297
298 bufferOffset = ((1 - rodgroup) * 444) + 14;
299 if ( rodline > 12 )
300 {
301 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
302 }
303 else
304 {
305 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
306 }
307
309 }
310
312
313
314
315
316
318
319 dataFile = "TRT_SR1_ec_rod3l.dat";
322
324 {
325 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
326 }
327
328 while ( getline( *inputFile, thisLine ) )
329 {
330 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
331
332 string::size_type loc = thisLine.find( '#' );
333 if ( loc != string::npos )
334 {
335 thisLine.replace( loc, thisLine.length(), 1, ' ' );
336
337 loc = thisLine.find_first_not_of( " \t" );
338 if ( loc == string::npos )
339 continue;
340 }
341
342 istringstream
parse( thisLine );
343
344 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
345
346
347
348
349
350
351
352
353 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
354
355 bufferOffset = ((3 - rodgroup) * 444) + 14;
356 if ( rodline > 12 )
357 {
358 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
359 }
360 else
361 {
362 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
363 }
364
366 }
367
369
370
371
372
373
375
376 dataFile = "TRT_SR1_ec_rod1r.dat";
379
381 {
382 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
383 }
384
385 while ( getline( *inputFile, thisLine ) )
386 {
387 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
388
389 string::size_type loc = thisLine.find( '#' );
390 if ( loc != string::npos )
391 {
392 thisLine.replace( loc, thisLine.length(), 1, ' ' );
393
394 loc = thisLine.find_first_not_of( " \t" );
395 if ( loc == string::npos )
396 continue;
397 }
398
399 istringstream
parse( thisLine );
400
401 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
402
403
404
405
406
407
408
409
410 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
411
412 bufferOffset = ((3 - rodgroup) * 444) + 14;
413 if ( rodline > 12 )
414 {
415 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
416 }
417 else
418 {
419 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
420 }
421
423 }
424
426
427
428
429
430
432
433 dataFile = "TRT_SR1_ec_rod2r.dat";
436
438 {
439 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
440 }
441
442 while ( getline( *inputFile, thisLine ) )
443 {
444 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
445
446 string::size_type loc = thisLine.find( '#' );
447 if ( loc != string::npos )
448 {
449 thisLine.replace( loc, thisLine.length(), 1, ' ' );
450
451 loc = thisLine.find_first_not_of( " \t" );
452 if ( loc == string::npos )
453 continue;
454 }
455
456 istringstream
parse( thisLine );
457
458 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
459
460
461
462
463
464
465
466
467 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
468
469 bufferOffset = ((1 - rodgroup) * 444) + 14;
470 if ( rodline > 12 )
471 {
472 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
473 }
474 else
475 {
476 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
477 }
478
480 }
481
483
484
485
486
487
489
490 dataFile = "TRT_SR1_ec_rod3r.dat";
493
495 {
496 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
497 }
498
499 while ( getline( *inputFile, thisLine ) )
500 {
501 int rodgroup, rodline, dtmchannel, strawlayer, strawnumber;
502
503 string::size_type loc = thisLine.find( '#' );
504 if ( loc != string::npos )
505 {
506 thisLine.replace( loc, thisLine.length(), 1, ' ' );
507
508 loc = thisLine.find_first_not_of( " \t" );
509 if ( loc == string::npos )
510 continue;
511 }
512
513 istringstream
parse( thisLine );
514
515 parse >> rodgroup >> rodline >> dtmchannel >> strawlayer >> strawnumber;
516
517
518
519
520
521
522
523
524 strawNumber = (strawlayer & 0xff) << 8 | (strawnumber & 0xff);
525
526 bufferOffset = ((3 - rodgroup) * 444) + 14;
527 if ( rodline > 12 )
528 {
529 bufferOffset += (25 - rodline) + ((dtmchannel) * 13);
530 }
531 else
532 {
533 bufferOffset += 222 + (12 - rodline) + ((dtmchannel) * 13);
534 }
535
537 }
538
540
541
542
543
544
546
547 dataFile = "TRT_SR1_EndcapC_Cable_map.dat";
548
549
552
554 {
555 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Could not open file " << dataFile );
556 }
557
559 std::string feId;
560
561 while ( getline( *inputFile, thisLine ) )
562 {
563 if ( thisLine.length() == 0 )
564 continue;
565
566 string::size_type loc = thisLine.find( '#' );
567 if ( loc != string::npos )
568 {
569 thisLine.replace( loc, thisLine.length(), 1, ' ' );
570
571 loc = thisLine.find_first_not_of( " \t" );
572 if ( loc == string::npos )
573 continue;
574 }
575
576
577 istringstream
parse( thisLine );
578
579 GlobalCableMap_t *my_map = new GlobalCableMap_t;
580
582
583
584
585
586 if ( (srcId & 0xFF0000) == 0x310000 )
587 {
589
590 }
591 else if ( (srcId & 0xFF0000) == 0x320000 )
592 {
594
595 }
596 else if ( (srcId & 0xFF0000) == 0x330000 )
597 {
599
600 }
601 else if ( (srcId & 0xFF0000) == 0x340000 )
602 {
604
605 }
606 else {
607 ATH_MSG_FATAL(
"TRT_FillCablingData_SR1_ECC: Invalid source id " << (hex) << srcId << (dec) );
609 }
610
611
612
613
614
615
616
617
618
619
620
621
622 int my_phi = my_map->
SubDet * 32 + my_map->
Phi;
623
624
628
630 {
632 }
633
634
636 }
637
639
640#ifdef NOTDEF
641 int ptk_i;
642 for ( ptk_i=1; ptk_i<=444; ptk_i++ )
643 {
644 std::map<int, int>::iterator map_it =
m_1BS_1BL_map.find( ptk_i );
645
646
647 }
648#endif
649
650 GlobalCableMap::iterator
pos;
652 {
653 std::vector< GlobalCableMap_t *> GCM;
654
656
657 sort( GCM.begin(), GCM.end(), greater_RG_GCM );
658
659 int ConnectorCount=-1;
660 std::vector< GlobalCableMap_t *>::iterator
it;
661 for ( it=GCM.begin(); it != GCM.end(); ++it )
662 {
663 ConnectorCount++;
664
665 GlobalCableMap_t *my_map = *
it;
666 std::map<int, int> con_map;
667
668
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" )
701
702
704 Identifier NULLstrawID(0);
705
706 if ( abs( my_map->
SubDet ) == 1 )
707 {
708 for ( i=1;
i<=444;
i++ )
709 {
710 std::map<int, int>::iterator map_it = con_map.find( i );
711
712 if ( map_it == con_map.end() )
713 {
715 i + ConnectorCount*444,
716 NULLstrawID );
717 continue;
718 }
719
720 int BufferLocation = map_it->first + ConnectorCount*444;
721 int Straw = map_it->second - 1;
722
723 strawLayerId = 0;
726 {
727 strawLayerId++;
728 }
729
731 {
733 continue;
734 }
735
736
738
739 moduleId = -1;
741 moduleId = 0;
743 {
744 moduleId = 1;
746 }
748 {
749 moduleId = 2;
751 }
752
753
754
756 moduleId, strawLayerId,
757 strawInLayerId );
758
759
760 m_cabling->set_identifierForAllStraws(
pos->first, BufferLocation,
761 strawID );
762
763
764
765
766
767
769 my_map->
Phi, moduleId,
770 strawLayerId );
771
773 if ( result != 0 )
774 {
778 <<
" SubDet = " << my_map->
SubDet \
779 <<
" Phi = " << my_map->
Phi \
780 << " Module = " << moduleId \
781 << " Layer = " << strawLayerId \
782 << " StrInLay = " << strawInLayerId );
783 }
784
785
787 BufferLocation,
788 hashId );
789 }
790 }
791 else
792 {
793 for ( i=0;
i<1776;
i++ )
794 {
795 std::map<int, int>::iterator map_it = con_map.find( i );
796
797 if ( map_it == con_map.end() )
798 {
800 NULLstrawID );
801 continue;
802 }
803
804 int BufferLocation =
i;
805 int Straw = map_it->second;
806
807 strawLayerId = (
Straw >> 8) & 0xff;
808 strawInLayerId =
Straw & 0xff;
809
810 moduleId = strawLayerId / 8;
811 if ( moduleId < 12 )
812 {
813 moduleId = moduleId / 2;
814 strawLayerId = strawLayerId % 16;
815 }
816 else
817 {
818 moduleId = moduleId - 6;
819 strawLayerId = strawLayerId % 8;
820 }
821
822
824 moduleId, strawLayerId,
825 strawInLayerId );
826
827
828
829
830
831
832
833
834
835
836
837 m_cabling->set_identifierForAllStraws(
pos->first, BufferLocation,
838 strawID );
839
840
841
842
843
844
846 my_map->
Phi, moduleId,
847 strawLayerId );
848
850 if ( result != 0 )
851 {
853
855 <<
" SubDet = " << my_map->
SubDet \
856 <<
" Phi = " << my_map->
Phi \
857 << " Module = " << moduleId \
858 << " Layer = " << strawLayerId \
859 << " StrInLay = " << strawInLayerId );
860 }
861
862
864 BufferLocation,
865 hashId );
866 }
867 }
868 }
869 }
870
871
872
874
875 return;
876}
#define ATH_MSG_WARNING(x)
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
std::map< int, int > m_2BL2_3BL1_map
std::map< int, int > m_2FS_2FL1_map
std::map< int, int > m_ec_3r_map
std::map< int, int > m_1BS_1BL_map
std::map< int, int > m_ec_1r_map
std::map< int, int > m_ec_1l_map
std::map< int, int > m_3FL2_map
std::map< int, int > m_ec_2l_map
std::map< int, int > m_3BS_map
std::map< int, int > m_ec_3l_map
std::map< int, int > m_3BL2_map
std::map< int, int > m_3FS_map
std::map< int, int > m_1FS_1FL_map
std::map< int, int > m_2BS_2BL1_map
std::map< int, int > m_2FL2_3FL1_map
std::map< int, int > m_ec_2r_map
std::map< int, std::vector< uint32_t > > m_phi_to_source
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.