ATLAS Offline Software
Loading...
Searching...
No Matches
MuonFixedIdManipulator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace MuonCalib {
8
10 if (id.is_mdt()) return PhiStationUnknown;
11
12 std::string stName = id.stationNumberToFixedStationString(id.stationName());
13 if (id.is_rpc()) {
14 if (stName[1] == 'M') {
15 if (id.rpcDoubletR() == 1)
16 return RPCBMR1;
17 else
18 return RPCBMR2;
19 }
20 return RPCBO;
21 }
22
23 if (id.is_tgc()) {
24 if (stName[1] == '4') return T4;
25 if (stName[1] == '1') return T1;
26 if (stName[1] == '2') return T2;
27 return T3;
28 }
29 if (id.is_csc()) return CS;
30
31 return PhiStationUnknown;
32 }
33
37
39 MuonFixedId newId;
40
41 if (stIndex == CSA) {
42 newId.set_csc();
43 newId.setStationEta(-1);
44 }
45 if (stIndex == CSC) {
46 newId.set_csc();
47 newId.setStationEta(1);
48 }
49
50 newId.set_mdt();
51 int stName = 0;
52 int eta = 1;
53 if (stIndex == BI)
54 stName = 1;
55 else if (stIndex == BM)
56 stName = 3;
57 else if (stIndex == BO)
58 stName = 5;
59 else if (stIndex == BE)
60 stName = 7;
61 else if (stIndex == EIA)
62 stName = 14;
63 else if (stIndex == EMA)
64 stName = 19;
65 else if (stIndex == EOA)
66 stName = 22;
67 else if (stIndex == EEA)
68 stName = 16;
69 else if (stIndex == EIC) {
70 stName = 14;
71 eta = -1;
72 } else if (stIndex == EMC) {
73 stName = 19;
74 eta = -1;
75 } else if (stIndex == EOC) {
76 stName = 22;
77 eta = -1;
78 } else if (stIndex == EEC) {
79 stName = 16;
80 eta = -1;
81 }
83 newId.setStationEta(eta);
84 return newId;
85 }
86
88 std::string stName = id.stationNumberToFixedStationString(id.stationName());
89 if (stName[0] == 'B') {
90 if (stName[1] == 'I') return BI;
91 if (stName[1] == 'M') return BM;
92 if (stName[1] == 'O') return BO;
93 if (stName[1] == 'E') return BE;
94 } else {
95 int eta = id.eta();
96 if (stName[1] == 'I') {
97 if (eta < 0)
98 return EIA;
99 else
100 return EIC;
101 }
102 if (stName[1] == 'M') {
103 if (eta < 0)
104 return EMA;
105 else
106 return EMC;
107 }
108 if (stName[1] == 'O') {
109 if (eta < 0)
110 return EOA;
111 else
112 return EOC;
113 }
114 if (stName[1] == 'E') {
115 if (eta < 0)
116 return EEA;
117 else
118 return EEC;
119 }
120 if (stName[2] == 'C') {
121 if (eta < 0)
122 return CSA;
123 else
124 return CSC;
125 }
126 }
127 return StationUnknown;
128 }
129
131 MuonFixedId newId;
132 if (id.is_mdt()) {
133 newId.set_mdt();
134 } else if (id.is_rpc()) {
135 if (mapOnMdts) {
136 // map RPC onto MDT chamber
137 newId.set_mdt();
138 } else {
139 newId.set_rpc();
140 newId.setRpcDoubletR(id.rpcDoubletR());
141 }
142 } else if (id.is_tgc()) {
143 newId.set_tgc();
144 } else if (id.is_csc()) {
145 newId.set_csc();
146 newId.setCscChamberLayer(id.cscChamberLayer());
147 }
148 newId.setStationName(id.stationName());
149 newId.setStationEta(id.eta());
150 newId.setStationPhi(id.phi());
151 return newId;
152 }
153
155 MuonFixedId newId = stationIdentifier(id);
156 if (id.is_rpc()) newId.setRpcDoubletR(id.rpcDoubletR());
157 return newId;
158 }
159
160 MuonFixedId MuonFixedIdManipulator::moduleIdentifier(const MuonFixedId& id, bool includeMeasuresPhi) const {
161 MuonFixedId newId = stationIdentifier(id, false);
162 if (id.is_rpc()) {
163 newId.setRpcDoubletZ(id.rpcDoubletZ());
164 newId.setRpcDoubletPhi(id.rpcDoubletPhi());
165 if (includeMeasuresPhi) newId.setRpcMeasuresPhi(newId.rpcMeasuresPhi());
166
167 } else if (id.is_tgc()) {
168 if (includeMeasuresPhi) newId.setTgcIsStrip(newId.tgcIsStrip());
169
170 } else if (id.is_csc()) {
171 if (includeMeasuresPhi) newId.setCscMeasuresPhi(newId.cscMeasuresPhi());
172 }
173 return newId;
174 }
175
176 MuonFixedId MuonFixedIdManipulator::gasGapIdentifier(const MuonFixedId& id, bool includeMeasuresPhi) const {
177 MuonFixedId newId = moduleIdentifier(id, includeMeasuresPhi);
178 if (id.is_mdt()) {
179 newId.setMdtMultilayer(id.mdtMultilayer());
180 newId.setMdtTubeLayer(id.mdtTubeLayer());
181 } else if (id.is_rpc()) {
182 newId.setRpcGasGap(id.rpcGasGap());
183
184 } else if (id.is_tgc()) {
185 newId.setTgcGasGap(id.tgcGasGap());
186
187 } else if (id.is_csc()) {
188 newId.setCscWireLayer(id.cscWireLayer());
189 }
190 return newId;
191 }
192
193} // namespace MuonCalib
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
MuonFixedId stationLayerIdentifier(const MuonFixedId &id) const
returns a station layer identifier for the give identifier
StationIndex
enum defining station layers
PhiStationIndex phiStationLayerIndex(const MuonFixedId &id) const
return phi station layer index for a give identifier
MuonFixedId gasGapIdentifier(const MuonFixedId &id, bool includeMeasuresPhi=false) const
returns gas gap Identifier for the give id MDT: same as tube identifier RPC: station name/eta/phi/dou...
MuonFixedId chamberIdentifier(const MuonFixedId &id) const
returns chamber Identifier for the give id, same as stationIdentifier RPC: includes doubletR
StationIndex stationLayerIndex(const MuonFixedId &id) const
returns station layer index for a give identifier
PhiStationIndex
enum defining trigger phi layers
MuonFixedId moduleIdentifier(const MuonFixedId &id, bool includeMeasuresPhi=false) const
returns layer Identifier for the give id MDT: station name/eta/phi/ml/lay RPC: station name/eta/phi/d...
MuonFixedId stationIdentifier(const MuonFixedId &id, bool mapOnMdts=false) const
returns station Identifier for the give id MDT: station name (BMS)/eta/phi RPC: name of associated MD...
Implements fixed identifiers not dependent upon Athena Identifier for internal use in the calibration...
Definition MuonFixedId.h:50
bool setTgcIsStrip(int num)
Tgc specific: set is_strip to num.
bool setRpcDoubletZ(int num)
Rpc specific: set doublet_Z to num.
void set_rpc()
set identifier to RPC technology type
bool setCscWireLayer(int num)
Csc specific: set wire layer to num.
void set_csc()
set identifier to CSC technology type
bool setTgcGasGap(int num)
Tgc specific: set gas_gap to num.
bool setCscChamberLayer(int num)
Csc specific: set chamber layer to num.
bool setRpcGasGap(int num)
Rpc specific: set gas_gap to num.
bool setStationEta(int num)
set station eta to num in the fixed identifier
bool setCscMeasuresPhi(int num)
Csc specific: set measures_phi to num.
void set_tgc()
set identifier to TGC technology type
int tgcIsStrip() const
Tgc specific:
bool setRpcMeasuresPhi(int num)
Rpc specific: set measures_phi to num.
bool setMdtTubeLayer(int num)
Mdt specific: set layer to num.
bool setStationPhi(int num)
set station phi to num in the fixed identifier
int cscMeasuresPhi() const
Csc specific:
bool setRpcDoubletR(int num)
Rpc specific: set doublet_R to num.
int rpcMeasuresPhi() const
Rpc specific:
bool setMdtMultilayer(int num)
Mdt specific: set multilayer to num.
bool setRpcDoubletPhi(int num)
Rpc specific: set doublet_Phi to num.
bool setStationName(int num)
set station name to num in the fixed identifier
void set_mdt()
set identifier to MDT technology type
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
const std::string & stName(StIndex index)
convert StIndex into a string