ATLAS Offline Software
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 
7 namespace 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 
36  }
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  }
82  newId.setStationName(stName);
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
createDCubeDigitHistograms.mdtTubeLayer
mdtTubeLayer
Definition: createDCubeDigitHistograms.py:111
MuonCalib::MuonFixedIdManipulator::EMA
@ EMA
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedIdManipulator::stationLayerIdentifier
MuonFixedId stationLayerIdentifier(const MuonFixedId &id) const
returns a station layer identifier for the give identifier
Definition: MuonFixedIdManipulator.cxx:34
MuonCalib::MuonFixedId::setMdtTubeLayer
bool setMdtTubeLayer(int num)
Mdt specific: set layer to num.
Definition: MuonFixedId.h:805
MuonCalib::MuonFixedId::setMdtMultilayer
bool setMdtMultilayer(int num)
Mdt specific: set multilayer to num.
Definition: MuonFixedId.h:827
MuonCalib::MuonFixedId::setTgcIsStrip
bool setTgcIsStrip(int num)
Tgc specific: set is_strip to num.
Definition: MuonFixedId.h:1164
MuonCalib::MuonFixedId::setCscChamberLayer
bool setCscChamberLayer(int num)
Csc specific: set chamber layer to num.
Definition: MuonFixedId.h:886
MuonCalib::MuonFixedIdManipulator::StationIndex
StationIndex
enum defining station layers
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedIdManipulator::chamberIdentifier
MuonFixedId chamberIdentifier(const MuonFixedId &id) const
returns chamber Identifier for the give id, same as stationIdentifier RPC: includes doubletR
Definition: MuonFixedIdManipulator.cxx:154
MuonCalib::MuonFixedIdManipulator::CSA
@ CSA
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedId::setTgcGasGap
bool setTgcGasGap(int num)
Tgc specific: set gas_gap to num.
Definition: MuonFixedId.h:1142
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
MuonCalib::MuonFixedIdManipulator::PhiStationIndex
PhiStationIndex
enum defining trigger phi layers
Definition: MuonFixedIdManipulator.h:19
MuonCalib::MuonFixedIdManipulator::BM
@ BM
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedIdManipulator::T1
@ T1
Definition: MuonFixedIdManipulator.h:19
MuonCalib::MuonFixedId::set_csc
void set_csc()
set identifier to CSC technology type
Definition: MuonFixedId.h:579
MuonCalib::MuonFixedId::set_rpc
void set_rpc()
set identifier to RPC technology type
Definition: MuonFixedId.h:587
MuonCalib::MuonFixedId::setCscWireLayer
bool setCscWireLayer(int num)
Csc specific: set wire layer to num.
Definition: MuonFixedId.h:909
MuonCalib::MuonFixedId::set_mdt
void set_mdt()
set identifier to MDT technology type
Definition: MuonFixedId.h:575
MuonCalib::MuonFixedIdManipulator::phiStationLayerIndex
PhiStationIndex phiStationLayerIndex(const MuonFixedId &id) const
return phi station layer index for a give identifier
Definition: MuonFixedIdManipulator.cxx:9
MuonCalib::MuonFixedIdManipulator::BO
@ BO
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedIdManipulator::EOC
@ EOC
Definition: MuonFixedIdManipulator.h:17
createDCubeHistograms.cscWireLayer
cscWireLayer
Definition: createDCubeHistograms.py:87
MuonCalib::MuonFixedIdManipulator::gasGapIdentifier
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...
Definition: MuonFixedIdManipulator.cxx:176
MuonCalib::MuonFixedIdManipulator::CS
@ CS
Definition: MuonFixedIdManipulator.h:19
MuonCalib::MuonFixedIdManipulator::RPCBMR1
@ RPCBMR1
Definition: MuonFixedIdManipulator.h:19
MuonCalib::MuonFixedIdManipulator::EMC
@ EMC
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedIdManipulator::EEC
@ EEC
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedIdManipulator::RPCBMR2
@ RPCBMR2
Definition: MuonFixedIdManipulator.h:19
MuonCalib::MuonFixedIdManipulator::T2
@ T2
Definition: MuonFixedIdManipulator.h:19
MuonCalib::MuonFixedIdManipulator::BI
@ BI
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedIdManipulator::moduleIdentifier
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...
Definition: MuonFixedIdManipulator.cxx:160
MuonCalib::MuonFixedId::setStationPhi
bool setStationPhi(int num)
set station phi to num in the fixed identifier
Definition: MuonFixedId.h:696
MuonCalib::MuonFixedId::setCscMeasuresPhi
bool setCscMeasuresPhi(int num)
Csc specific: set measures_phi to num.
Definition: MuonFixedId.h:931
MuonCalib::MuonFixedId::set_tgc
void set_tgc()
set identifier to TGC technology type
Definition: MuonFixedId.h:583
MuonCalib::MuonFixedId::setStationName
bool setStationName(int num)
set station name to num in the fixed identifier
Definition: MuonFixedId.h:643
MuonCalib::MuonFixedId::tgcIsStrip
int tgcIsStrip() const
Tgc specific:
Definition: MuonFixedId.h:1172
MuonCalib::MuonFixedIdManipulator::EIA
@ EIA
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedIdManipulator::T3
@ T3
Definition: MuonFixedIdManipulator.h:19
MuonCalib::MuonFixedId::setRpcGasGap
bool setRpcGasGap(int num)
Rpc specific: set gas_gap to num.
Definition: MuonFixedId.h:1074
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::MuonFixedId::setRpcMeasuresPhi
bool setRpcMeasuresPhi(int num)
Rpc specific: set measures_phi to num.
Definition: MuonFixedId.h:1096
MuonCalib::MuonFixedId::rpcMeasuresPhi
int rpcMeasuresPhi() const
Rpc specific:
Definition: MuonFixedId.h:1104
MuonCalib::MuonFixedIdManipulator::EEA
@ EEA
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedIdManipulator::stationIdentifier
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...
Definition: MuonFixedIdManipulator.cxx:130
MuonCalib::MuonFixedId
Definition: MuonFixedId.h:50
createDCubeDigitHistograms.rpcGasGap
rpcGasGap
Definition: createDCubeDigitHistograms.py:60
MuonCalib::MuonFixedIdManipulator::RPCBO
@ RPCBO
Definition: MuonFixedIdManipulator.h:19
MuonCalib::MuonFixedId::setRpcDoubletPhi
bool setRpcDoubletPhi(int num)
Rpc specific: set doublet_Phi to num.
Definition: MuonFixedId.h:1052
MuonCalib::MuonFixedId::setStationEta
bool setStationEta(int num)
set station eta to num in the fixed identifier
Definition: MuonFixedId.h:673
MuonCalib::MuonFixedId::setRpcDoubletR
bool setRpcDoubletR(int num)
Rpc specific: set doublet_R to num.
Definition: MuonFixedId.h:1008
createDCubeHistograms.tgcGasGap
tgcGasGap
Definition: createDCubeHistograms.py:107
MuonCalib::MuonFixedId::setRpcDoubletZ
bool setRpcDoubletZ(int num)
Rpc specific: set doublet_Z to num.
Definition: MuonFixedId.h:1030
MuonCalib::MuonFixedIdManipulator::stationLayerIndex
StationIndex stationLayerIndex(const MuonFixedId &id) const
returns station layer index for a give identifier
Definition: MuonFixedIdManipulator.cxx:87
MuonCalib::MuonFixedIdManipulator::EIC
@ EIC
Definition: MuonFixedIdManipulator.h:17
createDCubeDigitHistograms.mdtMultilayer
mdtMultilayer
Definition: createDCubeDigitHistograms.py:112
MuonCalib::MuonFixedIdManipulator::StationUnknown
@ StationUnknown
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedIdManipulator::EOA
@ EOA
Definition: MuonFixedIdManipulator.h:17
MuonCalib::MuonFixedIdManipulator::T4
@ T4
Definition: MuonFixedIdManipulator.h:19
MuonCalib::MuonFixedIdManipulator::CSC
@ CSC
Definition: MuonFixedIdManipulator.h:17
MuonFixedIdManipulator.h
MuonCalib::MuonFixedIdManipulator::PhiStationUnknown
@ PhiStationUnknown
Definition: MuonFixedIdManipulator.h:19
MuonCalib::MuonFixedId::cscMeasuresPhi
int cscMeasuresPhi() const
Csc specific:
Definition: MuonFixedId.h:939
MuonCalib::MuonFixedIdManipulator::BE
@ BE
Definition: MuonFixedIdManipulator.h:17