ATLAS Offline Software
Loading...
Searching...
No Matches
MuonFixedLongId.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5/***************************************************************************
6 * Muon Calibration Utilities
7 * -----------------------------------------
8 *
9 * Authors : Martin Woudstra, Zdenko van Kesteren, Peter Kluit
10 * Creation Date: 21 March 2005
11 * Updated : 03 December 2007
12 * Updated : 16 January 2015 E. Diehl Add BME/BOE/BMG chambers
13 * Note: BOE=BOL in offline, so do not need to explicitly add BOE, it will be handled as BOL
14 ***************************************************************************/
15
16
17#ifndef MUONCALIBIDENTIFIER_MUONFIXEDLONGID_H
18#define MUONCALIBIDENTIFIER_MUONFIXEDLONGID_H
19
21
22// std
23#include <iostream>
24#include <iomanip>
25#include <string>
26
27#include <cstdlib>
28#include <limits>
29#include <cstdint>
30
34
35namespace MuonCalib {
36
49
51public:
52
62
65 BIL = 1,
66 BIS = 2,
67 BML = 3,
68 BMS = 4,
69 BOL = 5,
70 BOS = 6,
71 BEE = 7,
72 BIR = 8,
73 BMF = 9,
74 BOF = 10,
75 BOG = 11,
76 BME = 12,
77 BIM = 13,
78 EIC = 14,
79 EIL = 15,
80 EEL = 16,
81 EES = 17,
82 EMC = 18,
83 EML = 19,
84 EMS = 20,
85 EOC = 21,
86 EOL = 22,
87 EOS = 23,
88 EIS = 24,
89 T1F = 25,
90 T1E = 26,
91 T2F = 27,
92 T2E = 28,
93 T3F = 29,
94 T3E = 30,
95 T4F = 31,
96 T4E = 32,
97 CSS = 33,
98 CSL = 34,
99 BMG = 35,
100 MMS = 36,
101 MML = 37,
102 STS = 38,
103 STL = 39,
105 };
106
113
117 explicit MuonFixedLongId( uint64_t id );
118
120 void initFromFixedId(MuonFixedId other);
121
123 uint64_t getIdLong() const;
125 void clear();
127 bool isValid() const;
128
130 bool is_mdt() const;
132 bool is_tgc() const;
134 bool is_csc() const;
136 bool is_rpc() const;
138 bool is_mmg() const;
140 bool is_stg() const;
141
143 void set_mdt();
145 void set_tgc();
147 void set_csc();
149 void set_rpc();
151 void set_mmg();
153 void set_stg();
154
155
157 bool operator==( const MuonFixedLongId& rhs ) const;
159 bool operator!=( const MuonFixedLongId& rhs ) const;
161 bool operator<( const MuonFixedLongId& rhs ) const;
162
164 std::ostream& dump(std::ostream& os) const;
165
166// friend std::istream& operator>>( std::istream& is, MuonCalib::MuonFixedLongId& id );
167
168// Muon generic code
169
172 bool setTechnology( Technology num );
175 bool setStationName( StationName num );
178 bool setStationEta( int num );
181 bool setStationPhi( int num );
182
184 Technology technology() const;
186 std::string_view technologyString() const;
188 StationName stationName() const;
190 std::string_view stationNameString() const;
192 int eta() const;
194 int phi() const;
195
197 static int technologyMin();
199 static int stationNameMin();
201 static int etaMin();
203 static int phiMin();
204
206 static int technologyMax();
208 static int stationNameMax();
210 static int etaMax();
212 static int phiMax();
213
217 static StationName stationStringToFixedStationNumber(std::string_view station);
221 static std::string_view stationNumberToFixedStationString(StationName station);
222
223
224// Mdt specific code
225
228 bool setMdtTube( int num );
231 bool setMdtTubeLayer( int num );
234 bool setMdtMultilayer( int num );
235
237 int mdtTube() const;
239 int mdtTubeLayer() const;
241 int mdtMultilayer() const;
244 int mdtMezzanine() const;
245
248
251
253 static int mdtTubeMin();
255 static int mdtTubeLayerMin();
257 static int mdtMultilayerMin();
258
260 static int mdtTubeMax();
262 static int mdtTubeLayerMax();
264 static int mdtMultilayerMax();
265
266
267// Csc specific code
268
271 bool setCscChamberLayer( int num );
274 bool setCscWireLayer( int num );
277 bool setCscMeasuresPhi( int num );
280 bool setCscStrip( int num );
281
283 int cscChamberLayer() const;
285 int cscWireLayer() const;
287 int cscMeasuresPhi() const;
289 int cscStrip() const;
290
292 static int cscChamberLayerMin();
294 static int cscWireLayerMin();
296 static int cscMeasuresPhiMin();
298 static int cscStripMin();
299
301 static int cscChamberLayerMax();
303 static int cscWireLayerMax();
305 static int cscMeasuresPhiMax();
307 static int cscStripMax();
308
309// Rpc specific code
310
313 bool setRpcDoubletR( int num );
316 bool setRpcDoubletZ( int num );
319 bool setRpcDoubletPhi( int num );
322 bool setRpcGasGap( int num );
325 bool setRpcMeasuresPhi( int num );
328 bool setRpcStrip( int num );
329
332 int rpcDoubletR() const;
335 int rpcDoubletZ() const;
338 int rpcDoubletPhi() const;
341 int rpcGasGap() const;
344 int rpcMeasuresPhi() const;
347 int rpcStrip() const;
348
349// Tgc specific code
350
353 bool setTgcGasGap( int num );
356 bool setTgcIsStrip( int num );
359 bool setTgcChannel( int num );
360
363 int tgcGasGap() const;
366 int tgcIsStrip() const;
369 int tgcChannel() const;
370
371// Mmg specific code
372
375 bool setMmgMultilayer( int num );
378 bool setMmgGasGap( int num );
381 bool setMmgStrip( int num );
382
385 int mmgMultilayer() const;
388 int mmgGasGap() const;
390 int mmgStrip() const;
392 bool mmgIsStereo() const;
393
394// Stg specific code
395
398 bool setStgMultilayer( int num );
401 bool setStgGasGap( int num );
407 bool setStgChannel( int num );
408
411 int stgMultilayer() const;
414 int stgGasGap() const;
420 int stgChannel() const;
421
422
423private:
424 // Private member functions
425
426// Muon generic code
427
430 bool setTechnologyIndex( uint64_t idx );
433 bool setStationNameIndex( uint64_t idx );
436 bool setStationEtaIndex( uint64_t idx );
439 bool setStationPhiIndex( uint64_t idx );
440
442 unsigned int technologyIndex() const;
444 unsigned int stationNameIndex() const;
446 unsigned int etaIndex() const;
448 unsigned int phiIndex() const;
449
450// Mdt specific code
451
454 bool setMdtTubeIndex( uint64_t idx ) ;
457 bool setMdtTubeLayerIndex( uint64_t idx ) ;
460 bool setMdtMultilayerIndex( uint64_t idx ) ;
461
463 unsigned int mdtTubeIndex() const;
465 unsigned int mdtTubeLayerIndex() const;
467 unsigned int mdtMultilayerIndex() const;
468
469// Csc specific code
470
473 bool setCscChamberLayerIndex( uint64_t idx );
476 bool setCscWireLayerIndex( uint64_t idx );
479 bool setCscMeasuresPhiIndex( uint64_t idx );
482 bool setCscStripIndex( uint64_t idx );
483
485 unsigned int cscChamberLayerIndex() const;
487 unsigned int cscWireLayerIndex() const;
489 unsigned int cscMeasuresPhiIndex() const;
491 unsigned int cscStripIndex() const;
492
493// Rpc specific code
494
497 bool setRpcDoubletRIndex( uint64_t idx );
500 bool setRpcDoubletZIndex( uint64_t idx );
503 bool setRpcDoubletPhiIndex( uint64_t idx );
506 bool setRpcGasGapIndex( uint64_t idx );
509 bool setRpcMeasuresPhiIndex( uint64_t idx );
512 bool setRpcStripIndex( uint64_t idx );
513
516 unsigned int rpcDoubletRIndex() const;
519 unsigned int rpcDoubletZIndex() const;
522 unsigned int rpcDoubletPhiIndex() const;
525 unsigned int rpcGasGapIndex() const;
528 unsigned int rpcMeasuresPhiIndex() const;
531 unsigned int rpcStripIndex() const;
532
533// Tgc specific code
534
537 bool setTgcGasGapIndex( uint64_t idx );
540 bool setTgcIsStripIndex( uint64_t idx );
543 bool setTgcChannelIndex( uint64_t idx );
544
547 unsigned int tgcGasGapIndex() const;
550 unsigned int tgcIsStripIndex() const;
553 unsigned int tgcChannelIndex() const;
554
555// Mmg specific code
556
559 bool setMmgMultilayerIndex( uint64_t idx ) ;
562 bool setMmgGasGapIndex( uint64_t idx );
565 bool setMmgStripIndex( uint64_t idx );
566
568 unsigned int mmgMultilayerIndex() const;
571 unsigned int mmgGasGapIndex() const;
573 unsigned int mmgStripIndex() const;
574
575// Stg specific code
576
579 bool setStgMultilayerIndex( uint64_t idx ) ;
582 bool setStgGasGapIndex( uint64_t idx );
585 bool setStgChannelTypeIndex( uint64_t idx );
588 bool setStgChannelIndex( uint64_t idx );
589
591 unsigned int stgMultilayerIndex() const;
594 unsigned int stgGasGapIndex() const;
597 unsigned int stgChannelTypeIndex() const;
600 unsigned int stgChannelIndex() const;
601
602
603
604 // the member holding the packed fields
605 uint64_t m_data;
606
607 static const uint64_t kInvalidData = 0xFFFFFFFFFFFFFFFF;
608
609// Muon generic
610
611 static const uint64_t kTechnologyMask = 15;
612 static const unsigned int kTechnologyShift = 60;
613 static const int kTechnologyMin = 0;
614
615 static const int kNumberOfTechnologies = 6;
617
618 static const uint64_t kStationNameMask = 127;
619 static const unsigned int kStationNameShift = 53;
620 static const int kStationNameMin = 1;
621
622 static const uint64_t kStationEtaMask = 63;
623 static const unsigned int kStationEtaShift = 47;
624 static const int kStationEtaMin = -31;
625
626 static const uint64_t kStationPhiMask = 127;
627 static const unsigned int kStationPhiShift = 40;
628 static const int kStationPhiMin = 1;
629
630 static const int kNumberOfStationNames = 39;
632
633 // the full station information for making a station identifier
634 static const unsigned int kStationShift = kStationPhiShift; // the smallest shift
635 static const uint64_t kStationMask =
639 (kStationPhiMask << kStationPhiShift) ) >> kStationShift; // kStationShift for consistent meaning
640
641// Mdt specific code
642
643 static const uint64_t kMdtMultilayerMask = 7;
644 static const unsigned int kMdtMultilayerShift = 14;
645 static const int kMdtMultilayerMin = 1;
646
647 static const uint64_t kMdtTubeLayerMask = 15;
648 static const unsigned int kMdtTubeLayerShift = 10;
649 static const int kMdtTubeLayerMin = 1;
650
651 static const uint64_t kMdtTubeMask = 1023;
652 static const unsigned int kMdtTubeShift = 0;
653 static const int kMdtTubeMin = 1;
654
655// Csc specific code
656
657 static const uint64_t kCscChamberLayerMask = 7;
658 static const unsigned int kCscChamberLayerShift = 15;
659 static const int kCscChamberLayerMin = 1;
660
661 static const uint64_t kCscWireLayerMask = 15;
662 static const unsigned int kCscWireLayerShift = 11;
663 static const int kCscWireLayerMin = 1;
664
665 static const uint64_t kCscMeasuresPhiMask = 1;
666 static const unsigned int kCscMeasuresPhiShift = 10;
667 static const int kCscMeasuresPhiMin = 0;
668
669 static const uint64_t kCscStripMask = 1023;
670 static const unsigned int kCscStripShift = 0;
671 static const int kCscStripMin = 1;
672
673// Rpc specific code
674
675 static const uint64_t kRpcDoubletRMask = 3;
676 static const unsigned int kRpcDoubletRShift = 20;
677 static const int kRpcDoubletRMin = 1;
678
679 static const uint64_t kRpcDoubletZMask = 15;
680 static const unsigned int kRpcDoubletZShift = 16;
681 static const int kRpcDoubletZMin = 1;
682
683 static const uint64_t kRpcDoubletPhiMask = 3;
684 static const unsigned int kRpcDoubletPhiShift = 14;
685 static const int kRpcDoubletPhiMin = 1;
686
687 static const uint64_t kRpcGasGapMask = 3;
688 static const unsigned int kRpcGasGapShift = 12;
689 static const int kRpcGasGapMin = 1;
690
691 static const uint64_t kRpcMeasuresPhiMask = 3;
692 static const unsigned int kRpcMeasuresPhiShift = 10;
693 static const int kRpcMeasuresPhiMin = 0;
694
695 static const uint64_t kRpcStripMask = 1023;
696 static const unsigned int kRpcStripShift = 0;
697 static const int kRpcStripMin = 1;
698
699// Tgc specific code
700 static const uint64_t kTgcGasGapMask = 7;
701 static const unsigned int kTgcGasGapShift = 11;
702 static const int kTgcGasGapMin = 1;
703
704 static const uint64_t kTgcIsStripMask = 1;
705 static const unsigned int kTgcIsStripShift = 10;
706 static const int kTgcIsStripMin = 0;
707
708 static const uint64_t kTgcChannelMask = 1023;
709 static const unsigned int kTgcChannelShift = 0;
710 static const int kTgcChannelMin = 1;
711
712// MM specific code
713 static const uint64_t kMmgMultilayerMask = 7;
714 static const unsigned int kMmgMultilayerShift = 19;
715 static const int kMmgMultilayerMin = 1;
716
717 static const uint64_t kMmgGasGapMask = 15;
718 static const unsigned int kMmgGasGapShift = 15;
719 static const int kMmgGasGapMin = 1;
720
721 static const uint64_t kMmgStripMask = 32767;
722 static const unsigned int kMmgStripShift = 0;
723 static const int kMmgStripMin = 0;
724
725// sTGC specific code
726 static const uint64_t kStgMultilayerMask = 7;
727 static const unsigned int kStgMultilayerShift = 21;
728 static const int kStgMultilayerMin = 1;
729
730 static const uint64_t kStgGasGapMask = 15;
731 static const unsigned int kStgGasGapShift = 17;
732 static const int kStgGasGapMin = 1;
733
734 static const uint64_t kStgChannelTypeMask = 3;
735 static const unsigned int kStgChannelTypeShift = 15;
736 static const int kStgChannelTypeMin = 0;
737
738 static const uint64_t kStgChannelMask = 32767;
739 static const unsigned int kStgChannelShift = 0;
740 static const int kStgChannelMin = 0;
741};
742
743// Muon generic methods
744
748
749inline MuonFixedLongId::MuonFixedLongId( uint64_t id ) {
750 if (id <= std::numeric_limits<uint32_t>::max()) {
751 // we were passed a 32 bit identifier, import values from MuonFixedId
752 initFromFixedId(MuonFixedId(static_cast<uint32_t>(id)));
753 } else {
754 m_data = id;
755 }
756}
757
758inline uint64_t MuonFixedLongId::getIdLong() const{
759 return m_data;
760}
761/* void MuonFixedLongId::setMuonIdentifier( int id ){ */
762/* if( id>-1 || id<kInvalidData ) m_data = id; */
763/* else m_data = kInvalidData; */
764/* } */
765
768}
769
770inline bool MuonFixedLongId::isValid() const {
771 return m_data != kInvalidData;
772}
773
774inline bool MuonFixedLongId::is_mdt() const{
776}
777
778inline bool MuonFixedLongId::is_tgc() const{
780}
781
782inline bool MuonFixedLongId::is_csc() const{
784}
785
786inline bool MuonFixedLongId::is_rpc() const{
788}
789
790inline bool MuonFixedLongId::is_mmg() const{
792}
793
794inline bool MuonFixedLongId::is_stg() const{
796}
797
801
805
809
813
817
821
822inline bool MuonFixedLongId::operator==( const MuonFixedLongId& rhs ) const {
823 return m_data == rhs.m_data;
824}
825
826inline bool MuonFixedLongId::operator!=( const MuonFixedLongId& rhs ) const {
827 return m_data != rhs.m_data;
828}
829
830inline bool MuonFixedLongId::operator<( const MuonFixedLongId& rhs ) const {
831 return m_data < rhs.m_data;
832}
833
834inline bool MuonFixedLongId::setTechnologyIndex( uint64_t idx ) {
835 if ( idx > kTechnologyMask ) {
836 clear();
837 return false;
838 }
841 return true;
842}
843
845 return setTechnologyIndex( num - kTechnologyMin );
846}
847
848inline unsigned int MuonFixedLongId::technologyIndex() const {
850}
851
855
856inline std::string_view MuonFixedLongId::technologyString() const {
857 int index = technologyIndex();
858 if ( index >= 0 && index < kNumberOfTechnologies ) {
860 }
861 return "???";
862}
863
864inline bool MuonFixedLongId::setStationNameIndex( uint64_t idx ) {
865 if ( idx > kStationNameMask ) {
866 clear();
867 return false;
868 }
871 return true;
872}
873
877
878inline unsigned int MuonFixedLongId::stationNameIndex() const {
880}
881
885
886inline std::string_view MuonFixedLongId::stationNameString() const {
887 int index = stationNameIndex();
888 if ( index >= 0 && index < kNumberOfStationNames ) {
890 }
891 return "XXX";
892}
893
894inline bool MuonFixedLongId::setStationEtaIndex( uint64_t idx ) {
895 if ( idx > kStationEtaMask ) {
896 clear();
897 return false;
898 }
901 return true;
902}
903
904inline bool MuonFixedLongId::setStationEta( int num ) {
905 return setStationEtaIndex( num - kStationEtaMin );
906}
907
908inline unsigned int MuonFixedLongId::etaIndex() const {
910}
911
912inline int MuonFixedLongId::eta() const {
913 return etaIndex() + kStationEtaMin;
914}
915
916
917inline bool MuonFixedLongId::setStationPhiIndex( uint64_t idx ) {
918 if ( idx > kStationPhiMask ) {
919 clear();
920 return false;
921 }
924 return true;
925}
926
927inline bool MuonFixedLongId::setStationPhi( int num ) {
928 return setStationPhiIndex( num - kStationPhiMin );
929}
930
931inline unsigned int MuonFixedLongId::phiIndex() const {
933}
934
935inline int MuonFixedLongId::phi() const {
936 return phiIndex() + kStationPhiMin;
937}
938
940 return kTechnologyMin;
941}
942
946
948 return kStationEtaMin;
949}
950
952 return kStationPhiMin;
953}
954
958
962
966
970
972 for ( int i = 0; i < kNumberOfStationNames; ++i ) {
973 if ( station == kStationNameStrings[i] ) return static_cast<StationName>(i + kStationNameMin);
974 }
975 return StationName::INVALID; // signal error if not found
976}
977
979 int index = station - kStationNameMin;
980 if ( index >= 0 && index < kNumberOfStationNames ) {
982 }
983 return "XXX"; // signal error if not found
984}
985
986// Mdt specific methods
987
988inline bool MuonFixedLongId::setMdtTubeIndex( uint64_t idx ) {
989 if ( idx > kMdtTubeMask ) {
990 clear();
991 return false;
992 }
994 m_data |= (idx & kMdtTubeMask) << kMdtTubeShift;
995 return true;
996}
997
998inline bool MuonFixedLongId::setMdtTube( int num ) {
999 return setMdtTubeIndex( num - kMdtTubeMin );
1000}
1001
1002inline unsigned int MuonFixedLongId::mdtTubeIndex() const {
1003 return (m_data >> kMdtTubeShift) & kMdtTubeMask;
1004}
1005
1006inline int MuonFixedLongId::mdtTube() const {
1007 return mdtTubeIndex() + kMdtTubeMin;
1008}
1009
1011 StationName Ichamber = stationName() ;
1012 int Ieta = eta() ;
1013 int Iphi = phi() ;
1014 int Iml = mdtMultilayer() ;
1015 int Itube = mdtTube() ;
1016 if (Ieta < 0 ) Ieta = -Ieta*10 ;
1017 int ImezzTubes = 8 ;
1018 if (Ichamber==StationName::BIL || Ichamber==StationName::BIS || Ichamber==StationName::BIR
1019 || Ichamber==StationName::BIM || Ichamber==StationName::BEE || Ichamber==StationName::EIL
1020 || Ichamber==StationName::EIS) {
1021 ImezzTubes=6;
1022 }
1023//exception BIS eta=8 is a 3-layer chamber
1024 if(Ichamber==StationName::BIS && std::abs(Ieta)==8) ImezzTubes=8;
1025 int Imezz = ((Itube-1)/ImezzTubes)*2+(Iml-1) ;
1026 Imezz = 9*100000000 + Ichamber*1000000 + Ieta*10000 + Iphi*100 + Imezz ;
1027 return Imezz ;
1028}
1029
1030inline bool MuonFixedLongId::setMdtTubeLayerIndex( uint64_t idx ) {
1031 if ( idx > kMdtTubeLayerMask ) {
1032 clear();
1033 return false;
1034 }
1037 return true;
1038}
1039
1040inline bool MuonFixedLongId::setMdtTubeLayer( int num ) {
1041 return setMdtTubeLayerIndex( num - kMdtTubeLayerMin );
1042}
1043
1044inline unsigned int MuonFixedLongId::mdtTubeLayerIndex() const {
1046}
1047
1050}
1051
1052inline bool MuonFixedLongId::setMdtMultilayerIndex( uint64_t idx ) {
1053 if ( idx > kMdtMultilayerMask ) {
1054 clear();
1055 return false;
1056 }
1059 return true;
1060}
1061
1064}
1065
1066inline unsigned int MuonFixedLongId::mdtMultilayerIndex() const {
1068}
1069
1072}
1073
1075 return kMdtTubeMin;
1076}
1077
1079 return kMdtTubeMin + kMdtTubeMask;
1080}
1081
1085
1089
1093
1097
1099 // mdt chamber id = muon station id
1101}
1102
1104 // mdt multilayer id = muon station id + multilayer field
1106}
1107
1108
1109// Csc specific methods
1110
1111inline bool MuonFixedLongId::setCscChamberLayerIndex( uint64_t idx ) {
1112 if ( idx > kCscChamberLayerMask ) {
1113 clear();
1114 return false;
1115 }
1118 return true;
1119}
1120
1123}
1124
1125inline unsigned int MuonFixedLongId::cscChamberLayerIndex() const {
1127}
1128
1132
1133
1134inline bool MuonFixedLongId::setCscWireLayerIndex( uint64_t idx ) {
1135 if ( idx > kCscWireLayerMask ) {
1136 clear();
1137 return false;
1138 }
1141 return true;
1142}
1143
1144inline bool MuonFixedLongId::setCscWireLayer( int num ) {
1145 return setCscWireLayerIndex( num - kCscWireLayerMin );
1146}
1147
1148inline unsigned int MuonFixedLongId::cscWireLayerIndex() const {
1150}
1151
1154}
1155
1156inline bool MuonFixedLongId::setCscMeasuresPhiIndex( uint64_t idx ) {
1157 if ( idx > kCscMeasuresPhiMask ) {
1158 clear();
1159 return false;
1160 }
1163 return true;
1164}
1165
1168}
1169
1170inline unsigned int MuonFixedLongId::cscMeasuresPhiIndex() const {
1172}
1173
1177
1178inline bool MuonFixedLongId::setCscStripIndex( uint64_t idx ) {
1179 if ( idx > kCscStripMask ) {
1180 clear();
1181 return false;
1182 }
1184 m_data |= (idx & kCscStripMask) << kCscStripShift;
1185 return true;
1186}
1187
1188inline bool MuonFixedLongId::setCscStrip( int num ) {
1189 return setCscStripIndex( num - kCscStripMin );
1190}
1191
1192inline unsigned int MuonFixedLongId::cscStripIndex() const {
1193 return (m_data >> kCscStripShift) & kCscStripMask;
1194}
1195
1196inline int MuonFixedLongId::cscStrip() const {
1197 return cscStripIndex() + kCscStripMin;
1198}
1199
1203
1207
1211
1215
1219
1223
1225 return kCscStripMin;
1226}
1227
1231
1232// Rpc specific methods
1233inline bool MuonFixedLongId::setRpcDoubletRIndex( uint64_t idx ) {
1234 if ( idx > kRpcDoubletRMask ) {
1235 clear();
1236 return false;
1237 }
1240 return true;
1241}
1242
1243inline bool MuonFixedLongId::setRpcDoubletR( int num ) {
1244 return setRpcDoubletRIndex( num - kRpcDoubletRMin );
1245}
1246
1247inline unsigned int MuonFixedLongId::rpcDoubletRIndex() const {
1249}
1250
1253}
1254
1255inline bool MuonFixedLongId::setRpcDoubletZIndex( uint64_t idx ) {
1256 if ( idx > kRpcDoubletZMask ) {
1257 clear();
1258 return false;
1259 }
1262 return true;
1263}
1264
1265inline bool MuonFixedLongId::setRpcDoubletZ( int num ) {
1266 return setRpcDoubletZIndex( num - kRpcDoubletZMin );
1267}
1268
1269inline unsigned int MuonFixedLongId::rpcDoubletZIndex() const {
1271}
1272
1275}
1276
1277inline bool MuonFixedLongId::setRpcDoubletPhiIndex( uint64_t idx ) {
1278 if ( idx > kRpcDoubletPhiMask ) {
1279 clear();
1280 return false;
1281 }
1284 return true;
1285}
1286
1289}
1290
1291inline unsigned int MuonFixedLongId::rpcDoubletPhiIndex() const {
1293}
1294
1297}
1298
1299inline bool MuonFixedLongId::setRpcGasGapIndex( uint64_t idx ) {
1300 if ( idx > kRpcGasGapMask ) {
1301 clear();
1302 return false;
1303 }
1306 return true;
1307}
1308
1309inline bool MuonFixedLongId::setRpcGasGap( int num ) {
1310 return setRpcGasGapIndex( num - kRpcGasGapMin );
1311}
1312
1313inline unsigned int MuonFixedLongId::rpcGasGapIndex() const {
1315}
1316
1317inline int MuonFixedLongId::rpcGasGap() const {
1318 return rpcGasGapIndex() + kRpcGasGapMin;
1319}
1320
1321inline bool MuonFixedLongId::setRpcMeasuresPhiIndex( uint64_t idx ) {
1322 if ( idx > kRpcMeasuresPhiMask ) {
1323 clear();
1324 return false;
1325 }
1328 return true;
1329}
1330
1333}
1334
1335inline unsigned int MuonFixedLongId::rpcMeasuresPhiIndex() const {
1337}
1338
1342
1343inline bool MuonFixedLongId::setRpcStripIndex( uint64_t idx ) {
1344 if ( idx > kRpcStripMask ) {
1345 clear();
1346 return false;
1347 }
1349 m_data |= (idx & kRpcStripMask) << kRpcStripShift;
1350 return true;
1351}
1352
1353inline bool MuonFixedLongId::setRpcStrip( int num ) {
1354 return setRpcStripIndex( num - kRpcStripMin );
1355}
1356
1357inline unsigned int MuonFixedLongId::rpcStripIndex() const {
1358 return (m_data >> kRpcStripShift) & kRpcStripMask;
1359}
1360
1361inline int MuonFixedLongId::rpcStrip() const {
1362 return rpcStripIndex() + kRpcStripMin;
1363}
1364
1365
1366// Tgc specific methods
1367inline bool MuonFixedLongId::setTgcGasGapIndex( uint64_t idx ) {
1368 if ( idx > kTgcGasGapMask ) {
1369 clear();
1370 return false;
1371 }
1374 return true;
1375}
1376
1377inline bool MuonFixedLongId::setTgcGasGap( int num ) {
1378 return setTgcGasGapIndex( num - kTgcGasGapMin );
1379}
1380
1381inline unsigned int MuonFixedLongId::tgcGasGapIndex() const {
1383}
1384
1385inline int MuonFixedLongId::tgcGasGap() const {
1386 return tgcGasGapIndex() + kTgcGasGapMin;
1387}
1388
1389inline bool MuonFixedLongId::setTgcIsStripIndex( uint64_t idx ) {
1390 if ( idx > kTgcIsStripMask ) {
1391 clear();
1392 return false;
1393 }
1396 return true;
1397}
1398
1399inline bool MuonFixedLongId::setTgcIsStrip( int num ) {
1400 return setTgcIsStripIndex( num - kTgcIsStripMin );
1401}
1402
1403inline unsigned int MuonFixedLongId::tgcIsStripIndex() const {
1405}
1406
1409}
1410
1411
1412inline bool MuonFixedLongId::setTgcChannelIndex( uint64_t idx ) {
1413 if ( idx > kTgcChannelMask ) {
1414 clear();
1415 return false;
1416 }
1419 return true;
1420}
1421
1422inline bool MuonFixedLongId::setTgcChannel( int num ) {
1423 return setTgcChannelIndex( num - kTgcChannelMin );
1424}
1425
1426inline unsigned int MuonFixedLongId::tgcChannelIndex() const {
1428}
1429
1432}
1433
1434
1435// MMG specific methods
1436inline bool MuonFixedLongId::setMmgMultilayerIndex ( uint64_t idx ) {
1437 if ( idx > kMmgMultilayerMask ) {
1438 clear();
1439 return false;
1440 }
1443 return true;
1444}
1445inline bool MuonFixedLongId::setMmgMultilayer ( int num ) {
1447}
1448inline unsigned int MuonFixedLongId::mmgMultilayerIndex () const {
1450}
1453}
1454
1455inline bool MuonFixedLongId::setMmgGasGapIndex ( uint64_t idx ) {
1456 if ( idx > kMmgGasGapMask ) {
1457 clear();
1458 return false;
1459 }
1462 return true;
1463}
1464inline bool MuonFixedLongId::setMmgGasGap ( int num ) {
1465 return setMmgGasGapIndex( num - kMmgGasGapMin );
1466}
1467inline unsigned int MuonFixedLongId::mmgGasGapIndex () const {
1469}
1470inline int MuonFixedLongId::mmgGasGap () const {
1471 return mmgGasGapIndex() + kMmgGasGapMin;
1472}
1473
1474inline bool MuonFixedLongId::setMmgStripIndex ( uint64_t idx ) {
1475 if ( idx > kMmgStripMask ) {
1476 clear();
1477 return false;
1478 }
1480 m_data |= (idx & kMmgStripMask) << kMmgStripShift;
1481 return true;
1482}
1483inline bool MuonFixedLongId::setMmgStrip ( int num ) {
1484 return setMmgStripIndex( num - kMmgStripMin );
1485}
1486inline unsigned int MuonFixedLongId::mmgStripIndex () const {
1487 return (m_data >> kMmgStripShift) & kMmgStripMask;
1488}
1489inline int MuonFixedLongId::mmgStrip () const {
1490 return mmgStripIndex() + kMmgStripMin;
1491}
1492inline bool MuonFixedLongId::mmgIsStereo() const {
1493 if (mmgMultilayer() == 1) {
1494 return mmgGasGap() > 2;
1495 } else {
1496 return mmgGasGap() <= 2;
1497 }
1498}
1499
1500// STGC specific code
1501inline bool MuonFixedLongId::setStgMultilayerIndex ( uint64_t idx ) {
1502 if ( idx > kStgMultilayerMask ) {
1503 clear();
1504 return false;
1505 }
1508 return true;
1509}
1510inline bool MuonFixedLongId::setStgMultilayer ( int num ) {
1512}
1513inline unsigned int MuonFixedLongId::stgMultilayerIndex () const {
1515}
1518}
1519
1520inline bool MuonFixedLongId::setStgGasGapIndex ( uint64_t idx ) {
1521 if ( idx > kStgGasGapMask ) {
1522 clear();
1523 return false;
1524 }
1527 return true;
1528}
1529inline bool MuonFixedLongId::setStgGasGap ( int num ) {
1530 return setStgGasGapIndex( num - kStgGasGapMin );
1531}
1532inline unsigned int MuonFixedLongId::stgGasGapIndex () const {
1534}
1535inline int MuonFixedLongId::stgGasGap () const {
1536 return stgGasGapIndex() + kStgGasGapMin;
1537}
1538
1539inline bool MuonFixedLongId::setStgChannelTypeIndex ( uint64_t idx ) {
1540 if ( idx > kStgChannelTypeMask ) {
1541 clear();
1542 return false;
1543 }
1546 return true;
1547}
1551inline unsigned int MuonFixedLongId::stgChannelTypeIndex () const {
1553}
1557
1558inline bool MuonFixedLongId::setStgChannelIndex ( uint64_t idx ) {
1559 if ( idx > kStgChannelMask ) {
1560 clear();
1561 return false;
1562 }
1565 return true;
1566}
1567inline bool MuonFixedLongId::setStgChannel ( int num ) {
1568 return setStgChannelIndex( num - kStgChannelMin );
1569}
1570inline unsigned int MuonFixedLongId::stgChannelIndex () const {
1572}
1573inline int MuonFixedLongId::stgChannel () const {
1575}
1576
1577inline std::ostream& operator<<( std::ostream& os, const MuonCalib::MuonFixedLongId& id ) {
1578 return id.dump( os );
1579}
1580} //MuonCalib namespace
1581
1582/*
1583***** must solve conflicts between MuonCalib namespace and friendship
1584inline std::istream& operator>>( std::istream& is, MuonCalib::MuonFixedLongId& id){
1585 is >> id.m_data ;
1586 return is;
1587}
1588*/
1589#endif // MUONCALIBIDENTIFIER_MUONFIXEDLONGID_H
Implements fixed identifiers not dependent upon Athena Identifier for internal use in the calibration...
Definition MuonFixedId.h:50
static const int kStationNameMin
bool operator<(const MuonFixedLongId &rhs) const
comparison operator
static const int kNumberOfStationNames
bool setRpcDoubletPhiIndex(uint64_t idx)
Rpc specific: set index for doublet_Phi to idx.
void set_tgc()
set identifier to TGC technology type
static const unsigned int kRpcDoubletRShift
bool setRpcDoubletPhi(int num)
Rpc specific: set doublet_Phi to num.
int stgMultilayer() const
Stg specific:
static int cscStripMax()
Csc specific:
unsigned int stationNameIndex() const
int tgcIsStrip() const
Tgc specific:
static const uint64_t kMdtTubeLayerMask
static const uint64_t kRpcMeasuresPhiMask
bool setCscStrip(int num)
Csc specific: set strip to num.
bool setStgGasGapIndex(uint64_t idx)
Stg specific: set index for gas_gap to idx.
static const uint64_t kTgcGasGapMask
void set_rpc()
set identifier to RPC technology type
static const uint64_t kStationPhiMask
static const uint64_t kCscChamberLayerMask
static int mdtTubeMax()
Mdt specific:
static int cscMeasuresPhiMax()
Csc specific:
static const unsigned int kStgGasGapShift
void set_csc()
set identifier to CSC technology type
bool setRpcDoubletR(int num)
Rpc specific: set doublet_R to num.
bool setRpcDoubletZ(int num)
Rpc specific: set doublet_Z to num.
unsigned int rpcDoubletZIndex() const
Rpc specific:
static const unsigned int kTgcChannelShift
static const uint64_t kCscMeasuresPhiMask
bool setMdtMultilayer(int num)
Mdt specific: set multilayer to num.
static int cscChamberLayerMin()
Csc specific:
unsigned int phiIndex() const
bool setMdtTubeIndex(uint64_t idx)
Mdt specific: set index idx for tube.
bool mmgIsStereo() const
Mmg specific: check if layer is stereo.
static const int kStgMultilayerMin
static const int kTgcIsStripMin
bool setMmgGasGapIndex(uint64_t idx)
Mmg specific: set index for gas_gap to idx.
static const uint64_t kTgcChannelMask
int mmgGasGap() const
Mmg specific:
bool setRpcDoubletRIndex(uint64_t idx)
Rpc specific: set index for doublet_R to idx.
bool setCscChamberLayerIndex(uint64_t idx)
Csc specific: set chamber layer index to idx.
StgChannelType
an enum with the STGC channel types
static const uint64_t kInvalidData
int rpcStrip() const
Rpc specific:
unsigned int stgMultilayerIndex() const
Stg specific:
int mmgStrip() const
Mmg specific:
bool setCscStripIndex(uint64_t idx)
Csc specific: set strip index to idx.
static const int kStationEtaMin
StationName
an enum with the station names
bool setTgcGasGap(int num)
Tgc specific: set gas_gap to num.
static const int kMdtTubeLayerMin
static const uint64_t kStationNameMask
bool setStationNameIndex(uint64_t idx)
set station name index in the fixed identifier
static int mdtTubeMin()
Mdt specific:
unsigned int mmgGasGapIndex() const
Mmg specific:
void clear()
clear the identifier (=set to invalid)
MuonFixedLongId mdtChamberId() const
Mdt specific: convert channel ID into MDT Chamber ID.
bool operator==(const MuonFixedLongId &rhs) const
comparison operator
bool setRpcGasGapIndex(uint64_t idx)
Rpc specific: set index for gas_gap to idx.
static int cscWireLayerMin()
Csc specific:
unsigned int etaIndex() const
int cscWireLayer() const
Csc specific:
bool setTgcGasGapIndex(uint64_t idx)
Tgc specific: set index for gas_gap to idx.
bool setTgcChannelIndex(uint64_t idx)
Tgc specific: set index for channel to idx.
void initFromFixedId(MuonFixedId other)
for backward compatibility
bool setStgChannelTypeIndex(uint64_t idx)
Stg specific: set index for channel_type to idx.
static int cscChamberLayerMax()
Csc specific:
bool setTechnology(Technology num)
set technology to num in the fixed identifier
bool setStationName(StationName num)
set station name to num in the fixed identifier
bool setMdtTubeLayer(int num)
Mdt specific: set layer to num.
static const int kCscMeasuresPhiMin
bool setTgcIsStripIndex(uint64_t idx)
Tgc specific: set index for is_strip to idx.
unsigned int rpcMeasuresPhiIndex() const
Rpc specific:
static const unsigned int kRpcMeasuresPhiShift
unsigned int tgcGasGapIndex() const
Tgc specific:
Technology technology() const
int rpcGasGap() const
Rpc specific:
bool setMmgMultilayerIndex(uint64_t idx)
Mmg specific: set index idx for multilayer.
std::string_view stationNameString() const
static const int kRpcDoubletPhiMin
bool setRpcGasGap(int num)
Rpc specific: set gas_gap to num.
int rpcDoubletPhi() const
Rpc specific:
static const char kTechnologyStrings[kNumberOfTechnologies][4]
bool setRpcMeasuresPhi(int num)
Rpc specific: set measures_phi to num.
static const uint64_t kTgcIsStripMask
int tgcChannel() const
Tgc specific:
unsigned int stgGasGapIndex() const
Stg specific:
void set_mmg()
set identifier to MMG technology type
MuonFixedLongId mdtMultilayerId() const
Mdt specific: convert channel ID into MDT Multilayer ID.
bool setRpcMeasuresPhiIndex(uint64_t idx)
Rpc specific: set index for measures_phi to idx.
bool setRpcDoubletZIndex(uint64_t idx)
Rpc specific: set index for doublet_Z to idx.
static const unsigned int kMmgStripShift
static const uint64_t kStgGasGapMask
bool setStationEtaIndex(uint64_t idx)
set station eta index in the fixed identifier
static const uint64_t kRpcDoubletZMask
unsigned int cscStripIndex() const
Csc specific:
static const unsigned int kCscStripShift
static int cscMeasuresPhiMin()
Csc specific:
static const int kStgChannelMin
static const unsigned int kStgChannelShift
static const unsigned int kRpcDoubletZShift
unsigned int rpcDoubletRIndex() const
Rpc specific:
static const uint64_t kMmgGasGapMask
static const uint64_t kTechnologyMask
static const uint64_t kStgChannelTypeMask
unsigned int cscMeasuresPhiIndex() const
Csc specific:
unsigned int stgChannelTypeIndex() const
Stg specific:
static const int kStgChannelTypeMin
static const uint64_t kStationEtaMask
unsigned int rpcDoubletPhiIndex() const
Rpc specific:
bool setCscMeasuresPhiIndex(uint64_t idx)
Csc specific: set measures_phi index to idx.
bool setMdtTube(int num)
Mdt specific: set tube to num.
static const int kTechnologyMin
static const uint64_t kCscStripMask
bool setMmgStripIndex(uint64_t idx)
Mmg specific: set strip index to idx.
static const unsigned int kRpcGasGapShift
bool setStationEta(int num)
set station eta to num in the fixed identifier
static int cscWireLayerMax()
Csc specific:
static const unsigned int kTechnologyShift
int tgcGasGap() const
Tgc specific:
bool setMmgStrip(int num)
Mmg specific: set strip to num.
bool setRpcStripIndex(uint64_t idx)
Rpc specific: set index for strip to idx.
static const char kStationNameStrings[kNumberOfStationNames][4]
static const int kCscChamberLayerMin
int stgChannel() const
Stg specific:
static int mdtMultilayerMax()
Mdt specific:
unsigned int mdtTubeLayerIndex() const
Mdt specific:
int stgGasGap() const
Stg specific:
static const unsigned int kMmgGasGapShift
bool setCscMeasuresPhi(int num)
Csc specific: set measures_phi to num.
static const uint64_t kMmgMultilayerMask
static const uint64_t kStgChannelMask
bool setStgGasGap(int num)
Stg specific: set gas_gap to num.
static const unsigned int kRpcDoubletPhiShift
int rpcDoubletZ() const
Rpc specific:
static const unsigned int kStationEtaShift
static const int kTgcChannelMin
bool setMmgMultilayer(int num)
Mmg specific: set multilayer to num.
unsigned int rpcGasGapIndex() const
Rpc specific:
static const uint64_t kRpcDoubletPhiMask
int cscChamberLayer() const
Csc specific:
static int mdtTubeLayerMin()
Mdt specific:
unsigned int cscWireLayerIndex() const
Csc specific:
static const int kMdtMultilayerMin
bool setStgChannelType(StgChannelType num)
Stg specific: set channel_type to num.
static int mdtTubeLayerMax()
Mdt specific:
bool setMdtTubeLayerIndex(uint64_t idx)
Mdt specific: set index idx for layer.
static const uint64_t kStationMask
static const unsigned int kStationPhiShift
static const unsigned int kMdtTubeShift
bool setTgcChannel(int num)
Tgc specific: set channel to num.
unsigned int tgcIsStripIndex() const
Tgc specific:
unsigned int technologyIndex() const
static const unsigned int kStgMultilayerShift
static const unsigned int kStgChannelTypeShift
bool setStgMultilayer(int num)
Stg specific: set multilayer to num.
static const unsigned int kCscMeasuresPhiShift
bool setMmgGasGap(int num)
Mmg specific: set gas_gap to num.
static const unsigned int kStationNameShift
int mdtTubeLayer() const
Mdt specific:
Technology
constants for technology numbers
unsigned int cscChamberLayerIndex() const
Csc specific:
unsigned int mdtMultilayerIndex() const
Mdt specific:
bool setTgcIsStrip(int num)
Tgc specific: set is_strip to num.
static const unsigned int kMmgMultilayerShift
static const unsigned int kStationShift
static const uint64_t kRpcDoubletRMask
static int mdtMultilayerMin()
Mdt specific:
bool setStgChannelIndex(uint64_t idx)
Stg specific: set index for channel to idx.
std::string_view technologyString() const
static const unsigned int kMdtTubeLayerShift
StationName stationName() const
unsigned int mmgStripIndex() const
Mmg specific:
StgChannelType stgChannelType() const
Stg specific:
unsigned int rpcStripIndex() const
Rpc specific:
bool setCscWireLayer(int num)
Csc specific: set wire layer to num.
bool setRpcStrip(int num)
Rpc specific: set strip to num.
static const int kRpcDoubletZMin
bool setCscWireLayerIndex(uint64_t idx)
Csc specific: set wire layer index to idx.
static const uint64_t kCscWireLayerMask
int mdtMezzanine() const
Mdt specific: compute the mezzanine number.
static const unsigned int kTgcIsStripShift
bool operator!=(const MuonFixedLongId &rhs) const
comparison operator
static const int kMmgMultilayerMin
int mdtTube() const
Mdt specific:
static const uint64_t kMdtTubeMask
static const int kRpcMeasuresPhiMin
bool setStgMultilayerIndex(uint64_t idx)
Stg specific: set index idx for multilayer.
int cscStrip() const
Csc specific:
static std::string_view stationNumberToFixedStationString(StationName station)
unsigned int mmgMultilayerIndex() const
Mmg specific:
int rpcDoubletR() const
Rpc specific:
MuonFixedLongId()
default constructor
int rpcMeasuresPhi() const
Rpc specific:
static const unsigned int kMdtMultilayerShift
int mdtMultilayer() const
Mdt specific:
int mmgMultilayer() const
Mmg specific:
bool setStationPhi(int num)
set station phi to num in the fixed identifier
static const int kNumberOfTechnologies
unsigned int stgChannelIndex() const
Stg specific:
unsigned int tgcChannelIndex() const
Tgc specific:
static const uint64_t kRpcGasGapMask
static const unsigned int kTgcGasGapShift
static const int kStationPhiMin
bool setCscChamberLayer(int num)
Csc specific: set chamber layer to num.
static const int kCscWireLayerMin
static StationName stationStringToFixedStationNumber(std::string_view station)
static const uint64_t kStgMultilayerMask
bool setTechnologyIndex(uint64_t idx)
set technology index in the fixed identifier
static const unsigned int kCscChamberLayerShift
bool setStationPhiIndex(uint64_t idx)
set station phi index in the fixed identifier
int cscMeasuresPhi() const
Csc specific:
bool setStgChannel(int num)
Stg specific: set channel to num.
bool setMdtMultilayerIndex(uint64_t idx)
Mdt specific: set index idx for multilayer.
static const unsigned int kCscWireLayerShift
static const unsigned int kRpcStripShift
static int cscStripMin()
Csc specific:
static const uint64_t kMmgStripMask
static const uint64_t kRpcStripMask
void set_mdt()
set identifier to MDT technology type
static const int kRpcDoubletRMin
unsigned int mdtTubeIndex() const
Mdt specific:
static const uint64_t kMdtMultilayerMask
void set_stg()
set identifier to sTGC technology type
bool isValid() const
check validity of the identifier.
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
std::ostream & operator<<(std::ostream &os, const RtFullInfo &data)
-event-from-file
Definition index.py:1