ATLAS Offline Software
Loading...
Searching...
No Matches
MdtCablingJsonDumpAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
10#include <fstream>
11#include <format>
12
13using namespace MuonValR4;
14namespace {
15 struct TdcIdentifier: public MdtCablingOnData {
16 uint8_t tdcId{0};
18 bool operator==(const TdcIdentifier& other) const noexcept{
19 return this->MdtCablingOnData::operator==(other) && tdcId == other.tdcId;
20 }
21 bool operator<(const TdcIdentifier& other) const noexcept {
22 if (this->MdtCablingOnData::operator!=(other)) return this->MdtCablingOnData::operator<(other);
23 return tdcId < other.tdcId;
24 }
25 TdcIdentifier(const MdtCablingData& cabling):
26 MdtCablingOnData{cabling},
27 tdcId{cabling.tdcId} {}
28 };
29
30 using Mapping = MdtMezzanineCard::Mapping;
31 using OfflineCh = MdtMezzanineCard::OfflineCh;
32
33}
34
35
36
38 ATH_CHECK(m_idHelperSvc.retrieve());
39 ATH_CHECK(m_DetectorManagerKey.initialize());
40 ATH_CHECK(m_cablingKey.initialize());
41 return StatusCode::SUCCESS;
42}
43
44
46 const EventContext& ctx = Gaudi::Hive::currentContext();
47 ATH_MSG_INFO("Dump cabling & mezzanines into JSON file");
48
49 const MuonGM::MuonDetectorManager* detectorMgr{nullptr};
50 ATH_CHECK(SG::get(detectorMgr, m_DetectorManagerKey, ctx));
51
52 const MuonMDT_CablingMap* cabling{nullptr};
53 ATH_CHECK(SG::get(cabling, m_cablingKey,ctx));
54
55 const MdtIdHelper& idHelper = m_idHelperSvc->mdtIdHelper();
56
57 std::vector<MdtMezzanineCard> cached_cards{};
58 std::set<MdtCablingData> cached_chnls{};
59 constexpr auto unsetArray{make_array<uint8_t,24>(MdtMezzanineCard::NOTSET)};
60 for (auto det_itr = idHelper.detectorElement_begin(); det_itr != idHelper.detectorElement_end(); ++det_itr){
61 const MuonGM::MdtReadoutElement* readEle = detectorMgr->getMdtReadoutElement(*det_itr);
62 if (!readEle) {
63 ATH_MSG_DEBUG("Detector element does not exist. ");
64 continue;
65 }
66 const Identifier station_id = idHelper.elementID(readEle->identify());
67 if(m_insertBISCabling && m_idHelperSvc->stationNameString(station_id)=="BIS" && readEle->getStationEta() < 7){
68 ATH_MSG_DEBUG("Will skip cabling for station "
69 <<m_idHelperSvc->toStringChamber(readEle->identify())
70 << " since it will be inserted manually");
71 continue;
72 }
73
75 MdtMezzanineCard dummy_card(Mapping{}, readEle->getNLayers(), -1);
76 std::map<TdcIdentifier, Mapping> chamber_mezz{};
77 const int nLayers{readEle->getNLayers()};
78 const int nTubes{readEle->getNtubesperlayer()};
79 const int multiLayer{readEle->getMultilayer()};
80
81 for (int layer = 1 ; layer <= nLayers; ++layer){
82 for (int tubeInLayer = 1 ; tubeInLayer <= nTubes; ++tubeInLayer) {
83 bool is_valid{false};
84 const Identifier tube_id = idHelper.channelID(station_id, multiLayer,
85 layer, tubeInLayer, is_valid);
86 if (!is_valid) {
87 ATH_MSG_VERBOSE("Invalid element");
88 continue;
89 }
91 MdtCablingData cabling_data{};
92 cabling->convert(tube_id,cabling_data);
94 if (!cabling->getOnlineId(cabling_data, msgStream())) {
95 ATH_MSG_WARNING("Could no retrieve a valid online channel for "<<m_idHelperSvc->toString(tube_id));
96 continue;
97 }
98 const TdcIdentifier tdc_id{cabling_data};
99 chamber_mezz.try_emplace(tdc_id,unsetArray);
100 chamber_mezz[tdc_id][cabling_data.channelId] = dummy_card.tubeNumber(layer, tubeInLayer);
101 }
102 }
104 for (auto&[tdc, mezz_mapping] : chamber_mezz) {
105 MdtCablingData mezzCablingId{};
106
108 static_cast<MdtCablingOnData&>(mezzCablingId) = tdc;
109 mezzCablingId.tdcId = tdc.tdcId;
110
111 MdtTdcOnlSorter chipInCab = cabling->getOnlineConvMap().at(tdc).all_modules.at(tdc.tdcId);
113 static_cast<MdtCablingOffData&>(mezzCablingId) = chipInCab->offId();
115 mezzCablingId.tube = chipInCab->tubeZero();
116
117 const uint8_t tubeOffSet = (mezzCablingId.tube-1)%dummy_card.numTubesPerLayer();
120 if (tubeOffSet) {
121 MdtMezzanineCard remap{mezz_mapping, dummy_card.numTubeLayers(), 0};
122 for (size_t chan = 0 ; chan < mezz_mapping.size(); ++chan) {
123 const OfflineCh tube_lay = remap.offlineTube(chan, msgStream());
124 if (!tube_lay.isValid) continue;
125 uint8_t tubeNumber = tube_lay.tube + tubeOffSet + 1;
126 mezz_mapping[chan] = remap.tubeNumber(tube_lay.layer, tubeNumber);
127 }
128 }
130 Mapping& mtmp = mezz_mapping; // Work around clang15 compilation error.
131 std::vector<MdtMezzanineCard>::const_iterator itr = std::find_if(cached_cards.begin(), cached_cards.end(),
132 [&dummy_card, &mtmp](const MdtMezzanineCard& card ){
133 if (dummy_card.numTubeLayers() != card.numTubeLayers()) return false;
134 for (size_t ch =0; ch < mtmp.size(); ++ch) {
135 if (mtmp[ch] != card.tdcToTubeMap()[ch]) return false;
136 }
137 return true;
138 });
139 if (itr != cached_cards.end()) {
140 mezzCablingId.mezzanine_type = itr->id();
141 } else {
142 cached_cards.emplace_back(mezz_mapping, dummy_card.numTubeLayers(), cached_cards.size() + 10);
143 if (!cached_cards.back().checkConsistency(msgStream())) {
144 ATH_MSG_ERROR("Wrong assignment for "<<mezzCablingId);
145 return StatusCode::FAILURE;
146 }
147 mezzCablingId.mezzanine_type = cached_cards.back().id();
148 }
149 cached_chnls.insert(std::move(mezzCablingId));
150 }
151 }
152
153 if(m_insertBISCabling){
154 ATH_MSG_INFO("Inserting BIS cabling manually");
155 // defining the costum mapping to be inserted for BIS chambers
156
157 /* The BIS chambers are build using two different tube stagering configurations, one for the A side and one for the C side
158 For sectors 12 and 16 the chambers of the A and C side are swapped following space constrains in the detector,
159 bringing the readout side of those chambers to the other side. This also swaps the tube staggering configuration.
160 Following the staggering configuration two types of mezzanine cards are used to read out the BIS chambers.
161
162 Mezanine type 6 are used for the A-side type chambers. It has the following channel mapping:
163
164 23 19 15 11 7 3
165 22 18 14 10 6 2
166 21 17 13 9 5 1
167 20 16 12 8 4 0
168
169 For the C-side type chambers mezzanine type 7 is used, with the following channel mapping:
170
171 1 5 9 13 17 21
172 0 4 8 12 16 20
173 3 7 11 15 19 23
174 2 6 10 14 18 22
175
176 For the mezz type 7 channel 0 is connected to layer 3 while for mezz type 6 channel 0 is connected to layer 4 so below the mapping will be rotated accordingly. Since the chambers have Nx6 - 2 tubes there are special mezzanine cards with a 4x5 configuration. Since they maintain the above design but missing the last row of tubes (the row on the opposite side of channel 0) so a 6b and 7b design will be introduced with 4 channels set to read tube 255 as proxy for not connected channels.
177
178 The CSM modules of each chamber can read up to 20 mezzanine cards. For BIS 2-7 this is enough to read out all the tube of the chamber.
179 For the BIS1 chambers the 24 mezzanine cards are readout by two CSMs each reading out 12 mezzanine cards. In general the channel number of the CSM to which the mezzanine is connected to is even for mezzanine cards connected to multilayer 1 and odd for multilayer 2, starting to count from 0. The channel number is increased in the direction of the global z coordinate axis.
180 */
181 constexpr std::array<uint8_t,24> mezzanineType6InvertedMap{23, 17, 11, 5,
182 22, 16, 10, 4,
183 21, 15, 9, 3,
184 20, 14, 8, 2,
185 19, 13, 7, 1,
186 18, 12, 6, 0};
187
188 constexpr std::array<uint8_t,24> mezzanineType6bInvertedMap{250, 250, 250,250,
189 22, 16, 10, 4,
190 21, 15, 9, 3,
191 20, 14, 8, 2,
192 19, 13, 7, 1,
193 18, 12, 6, 0};
194 constexpr std::array<uint8_t,24> mezzanineType6b2InvertedMap{250, 250, 250, 250,
195 23, 17, 11, 5,
196 22, 16, 10, 4,
197 21, 15, 9, 3,
198 20, 14, 8, 2,
199 19, 13, 7, 1};
200
201 constexpr std::array<uint8_t,24> mezzanineType7Map{12, 18, 0, 6,
202 13, 19, 1, 7,
203 14, 20, 2, 8,
204 15, 21, 3, 9,
205 16, 22, 4, 10,
206 17, 23, 5, 11};
207
208 constexpr std::array<uint8_t,24> mezzanineType7bMap{12, 18, 0, 6,
209 13, 19, 1, 7,
210 14, 20, 2, 8,
211 15, 21, 3, 9,
212 16, 22, 4, 10,
213 250, 250, 250, 250};
214
215 constexpr std::array<uint8_t,24> mezzanineType7b2Map{ 13, 19, 1, 7,
216 14, 20, 2, 8,
217 15, 21, 3, 9,
218 16, 22, 4, 10,
219 17, 23, 5, 11,
220 250, 250, 250, 250};
221
222
223
224 // Let's add the four types to the cached cards if not already present so we can reference them later
225 std::map<std::string, MdtMezzanineCard> mezzTypes{};
226 mezzTypes.emplace(std::make_pair("mezzanineType6", MdtMezzanineCard(mezzanineType6InvertedMap, 4, 0)));
227 mezzTypes.emplace(std::make_pair("mezzanineType6b", MdtMezzanineCard(mezzanineType6bInvertedMap, 4, 0)));
228 mezzTypes.emplace(std::make_pair("mezzanineType6b2", MdtMezzanineCard(mezzanineType6b2InvertedMap, 4, 0)));
229 mezzTypes.emplace(std::make_pair("mezzanineType7", MdtMezzanineCard(mezzanineType7Map, 4, 0)));
230 mezzTypes.emplace(std::make_pair("mezzanineType7b", MdtMezzanineCard(mezzanineType7bMap, 4, 0)));
231 mezzTypes.emplace(std::make_pair("mezzanineType7b2", MdtMezzanineCard(mezzanineType7b2Map, 4, 0)));
232 std::map<std::string, int> mezzTypeIds{};
233 for(auto& [type,card] : mezzTypes){
234 auto itr = std::ranges::find_if(cached_cards,
235 [&card](const MdtMezzanineCard& cachedCard){
236 if(cachedCard.numTubeLayers() != card.numTubeLayers()) {
237 return false;
238 }
239 for(size_t ch = 0; ch < card.tdcToTubeMap().size(); ++ch){
240 if(cachedCard.tdcToTubeMap()[ch] != card.tdcToTubeMap()[ch]) {
241 return false;
242 }
243 }
244 return true;
245 });
246 if(itr != cached_cards.end()){
247 mezzTypeIds[type] = itr->id();
248 } else {
249 cached_cards.emplace_back(card.tdcToTubeMap(), card.numTubeLayers(), cached_cards.size() + 10);
250 mezzTypeIds[type] = cached_cards.back().id();
251 }
252 }
253
254 for(auto& [type,card] : mezzTypes){
255 ATH_MSG_VERBOSE("mezzz type" << type << " has id " << mezzTypeIds[type]);
256 }
257 /* We have to keep track of the MROD and CSM numbers for each partition.
258 Since there are no MRODs in phase two we can assign the new BIS stations to fantasy MROD numbers while we wait for the new FELIX based cabling scheme. Since there are up to 51 MRODs per partition in RUN3 the new chambers will be assigned to MRDOs starting from 55 upwards. Each MROD can read up to 6 CSMs so the CSM counter will be increased accordingly when we assign the cabling for each chamber.
259 */
260 std::map<uint8_t, uint8_t> mrodMap, csmMap;
261 mrodMap[97] = 55; csmMap[97] = 0; // A-side barrel
262 mrodMap[98] = 55; csmMap[98] = 0; // C-side barrel
263
264 for (auto det_itr = idHelper.detectorElement_begin(); det_itr != idHelper.detectorElement_end(); ++det_itr){
265 const MuonGM::MdtReadoutElement* readEle = detectorMgr->getMdtReadoutElement(*det_itr);
266 if (!readEle) {
267 ATH_MSG_DEBUG("Detector element does not exist. ");
268 continue;
269 }
270 // since BIS 1-6 chambers have identical layouts for multilayer 1 and 2 and for BIS78C the second multilayer has more tubes, so we will loop only over the multilayer 2 readout elements here and take care of the multilayer 1 cabling at the same time
271 if(readEle->getMultilayer()!=2) {
272 continue;
273 }
274 const Identifier station_id = idHelper.elementID(readEle->identify());
275 if( !m_insertBISCabling || m_idHelperSvc->stationNameString(station_id)!="BIS" || readEle->getStationEta() >= 7) {
276 continue;
277 }
278 //find the multilayer 1 readout element to get the number of tubes per layer
279 Identifier id_ml1 = idHelper.multilayerID(readEle->identify(),1);
280 const MuonGM::MdtReadoutElement* readEle_ml1 = detectorMgr->getMdtReadoutElement(id_ml1);
281 int tubesPerLayer_ml1 = readEle_ml1->getNtubesperlayer();
282
283 ATH_MSG_INFO("Will insert cabling for station "<<m_idHelperSvc->toString(station_id));
284
285 const int nTubes{readEle->getNtubesperlayer()};
286 uint8_t tdcId{0};
288 uint8_t subdetectorId{0};
289 if(readEle->getStationEta() > 0){
290 subdetectorId = 97;
291 } else{
292 subdetectorId = 98;
293 }
294 for(int tubeInLayer = 1 ; tubeInLayer <= nTubes;
295 tubeInLayer += mezzTypes.at("mezzanineType6").numTubesPerLayer()){
296
297 if(tubeInLayer==1 && std::abs(readEle->getStationEta()) !=7){tubeInLayer -=1;} // account for the fact that the first mezzanine card only has 5 tubes per layer for BIS 1-6
298 MdtCablingData mezzCablingId_ml1{};
299 if(tubeInLayer <= tubesPerLayer_ml1){
300 mezzCablingId_ml1.stationIndex = m_idHelperSvc->stationName(station_id);
301 mezzCablingId_ml1.eta = readEle->getStationEta();
302 mezzCablingId_ml1.phi = readEle->getStationPhi();
303 mezzCablingId_ml1.multilayer = 1;
304 mezzCablingId_ml1.subdetectorId = subdetectorId;
305 mezzCablingId_ml1.csm = csmMap[subdetectorId];
306 mezzCablingId_ml1.mrod = mrodMap[subdetectorId];
307 mezzCablingId_ml1.tdcId = tdcId;
308 mezzCablingId_ml1.tube = tubeInLayer;
309 }
310
311
312 MdtCablingData mezzCablingId_ml2{};
313 mezzCablingId_ml2.stationIndex = m_idHelperSvc->stationName(station_id);
314 mezzCablingId_ml2.eta = readEle->getStationEta();
315 mezzCablingId_ml2.phi = readEle->getStationPhi();
316 mezzCablingId_ml2.multilayer = 2;
317 mezzCablingId_ml2.subdetectorId = subdetectorId;
318 mezzCablingId_ml2.csm = csmMap[subdetectorId];
319 mezzCablingId_ml2.mrod = mrodMap[subdetectorId];
320 mezzCablingId_ml2.tdcId = tdcId +1;
321 mezzCablingId_ml2.tube = tubeInLayer;
322
323
324 // A-side type chamber
325 std::string mezzEndString = "";
326 //The first and the last mezzanine cards of BIS1-6 chambers have a 4x5 configuration
327 if(std::abs(readEle->getStationEta()) !=7 && tubeInLayer + 6 > nTubes) { mezzEndString = "b"; }
328 if(std::abs(readEle->getStationEta()) !=7 && tubeInLayer==0 ) { mezzEndString = "b2"; }
329 ATH_MSG_VERBOSE("For station "<<m_idHelperSvc->toString(station_id) << " tube " << tubeInLayer<< " assigning mezzanine types for tubeInLayer "<<tubeInLayer <<" mezzEndString "<<mezzEndString);
330 if(readEle->getStationEta() > 0 ){
331 // swapped chamber in sectors 12 and 16
332 if(readEle->getStationPhi() == 6 || readEle->getStationPhi() == 8){
333 if(tubeInLayer <= tubesPerLayer_ml1) {
334 mezzCablingId_ml1.mezzanine_type = mezzTypeIds["mezzanineType7"+mezzEndString]; // type 7 is used for type C-side chambers
335 }
336 mezzCablingId_ml2.mezzanine_type = mezzTypeIds["mezzanineType7"+mezzEndString]; // type 7 is used for type C-side chambers
337 } else {
338 if(tubeInLayer <= tubesPerLayer_ml1) {
339 mezzCablingId_ml1.mezzanine_type = mezzTypeIds["mezzanineType6"+mezzEndString];
340 }
341 mezzCablingId_ml2.mezzanine_type = mezzTypeIds["mezzanineType6"+mezzEndString];
342 }
343 } else {
344 // swapped chamber in sectors 12 and 16
345 if(readEle->getStationPhi() == 6 || readEle->getStationPhi() == 8){
346 if(tubeInLayer <= tubesPerLayer_ml1){
347 mezzCablingId_ml1.mezzanine_type = mezzTypeIds["mezzanineType6"+mezzEndString]; // type 6 is used for type A-side chambers
348 }
349 mezzCablingId_ml2.mezzanine_type = mezzTypeIds["mezzanineType6"+mezzEndString]; // type 6 is used for type A-side chambers
350 } else {
351 if(tubeInLayer <= tubesPerLayer_ml1){
352 mezzCablingId_ml1.mezzanine_type = mezzTypeIds["mezzanineType7"+mezzEndString];
353 }
354 mezzCablingId_ml2.mezzanine_type = mezzTypeIds["mezzanineType7"+mezzEndString];
355 }
356 }
357 if(tubeInLayer <= tubesPerLayer_ml1) {
358 cached_chnls.insert(std::move(mezzCablingId_ml1));
359 }
360 cached_chnls.insert(std::move(mezzCablingId_ml2));
361 // Update identifier
362 tdcId+=2;
363 // since BIS1 and BIS78C chambers are read out by two CSMs we need to update the tdcId and CSM numbers accordingly
364 if((std::abs(readEle->getStationEta()) == 1 && tdcId >=12) ||
365 (readEle->getStationEta() == -7 && tdcId >=17) ){
366
367 tdcId = 0;
368 csmMap[subdetectorId] +=1;
369 if(csmMap[subdetectorId]>5){
370 csmMap[subdetectorId]=0;
371 mrodMap[subdetectorId]+=1;
372 }
373 }
374 }
375 // Update CSM and MROD for next chamber
376 csmMap[subdetectorId] +=1;
377 if(csmMap[subdetectorId]>5){
378 csmMap[subdetectorId]=0;
379 mrodMap[subdetectorId]+=1;
380 }
381 }
382 }
384 {
385 std::ofstream summary{m_summaryTxt};
386 if (!summary.good()) {
387 ATH_MSG_ERROR("Failed to write "<<m_summaryTxt);
388 return StatusCode::FAILURE;
389 }
390 summary<<"Extracted "<<cached_cards.size()<<" mezzanine card layouts and "
391 <<cached_chnls.size()<<" chamber channels. \n\n\n";
392 for (const MdtMezzanineCard& card : cached_cards) {
393 summary<<card;
394 MdtCablingOffData chamb{};
395 for (const MdtCablingData& cabling : cached_chnls) {
396 if (cabling.mezzanine_type != card.id()) continue;
397 if (chamb != cabling) {
398 chamb = cabling;
399 summary<<std::endl<<" *** "<<idHelper.stationNameString(chamb.stationIndex);
400 summary<<static_cast<int>(std::abs(chamb.eta));
401 summary<<(chamb.eta > 0 ? "A" : "C");
402 summary<<static_cast<int>(chamb.phi);
403 summary<<"M"<<static_cast<int>(chamb.multilayer);
404 summary<<" --- tdcs: ";
405 }
406 summary<<static_cast<int>(cabling.tdcId)<<", ";
407 }
408 summary<<"\n\n"
409 <<"##############################################################\n";
410 }
411 }
413 {
414 std::ofstream mezz_json{m_mezzJSON};
415 if (!mezz_json.good()) {
416 ATH_MSG_ERROR("Failed to write "<<m_summaryTxt);
417 return StatusCode::FAILURE;
418 }
419 mezz_json<<"["<<std::endl;
420 for (size_t i = 0; i < cached_cards.size() ; ++i) {
421 const MdtMezzanineCard& card = cached_cards[i];
422 mezz_json<<" {\n";
423 mezz_json<<" \"mezzId\": "<<static_cast<int>(card.id())<<",\n";
424 mezz_json<<" \"nTubeLayer\": "<<static_cast<int>(card.numTubeLayers())<<",\n";
425 mezz_json<<" \"tdcToTubeMap\": [";
426 for (size_t ch = 0 ; ch < card.tdcToTubeMap().size(); ++ch) {
427 mezz_json<<static_cast<int>(card.tdcToTubeMap()[ch]);
428 if (ch + 1 != card.tdcToTubeMap().size())mezz_json<<",";
429 }
430 mezz_json<<"]\n";
431 mezz_json<<" }";
432 if (i +1 != cached_cards.size()) mezz_json<<",";
433 mezz_json<<"\n";
434 }
435 mezz_json<<"]";
436 }
437 {
438 std::ofstream chamb_json{m_cablingJSON};
439 if (!chamb_json.good()) {
440 ATH_MSG_FATAL("Failed to write "<<m_cablingJSON);
441 return StatusCode::FAILURE;
442 }
443 chamb_json<<"[\n";
444 size_t i =0;
445 for (const MdtCablingData& chamb : cached_chnls){
446 chamb_json<<" {\n";
447 chamb_json<<" \"station\": \""<<idHelper.stationNameString(chamb.stationIndex)<<"\",\n";
448 chamb_json<<" \"eta\": "<<static_cast<int>(chamb.eta)<<",\n";
449 chamb_json<<" \"phi\": "<<static_cast<int>(chamb.phi)<<",\n";
450 chamb_json<<" \"ml\": "<<static_cast<int>(chamb.multilayer)<<",\n";
451 chamb_json<<" \"subDet\": "<<static_cast<int>(chamb.subdetectorId)<<",\n";
452 chamb_json<<" \"csm\": "<<static_cast<int>(chamb.csm)<<",\n";
453 chamb_json<<" \"mrod\": "<<static_cast<int>(chamb.mrod)<<",\n";
454 chamb_json<<" \"tdcId\": "<<static_cast<int>(chamb.tdcId)<<",\n";
455 chamb_json<<" \"mezzId\": "<<static_cast<int>(chamb.mezzanine_type)<<",\n";
456 chamb_json<<" \"tubeZero\": "<<static_cast<int>(chamb.tube)<<"\n";
457 chamb_json<<" }";
458 if (i +1 != cached_chnls.size()) chamb_json<<",";
459 chamb_json<<"\n";
460 ++i;
461 }
462 chamb_json<<"]"<<std::endl;
463 }
464
465
466 return StatusCode::SUCCESS;
467}
constexpr std::array< T, N > make_array(const T &def_val)
Helper function to initialize in-place arrays with non-zero values.
Definition ArrayHelper.h:10
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
bool operator<(const DataVector< T > &a, const DataVector< T > &b)
Vector ordering relation.
bool operator==(const DataVector< T > &a, const DataVector< T > &b)
Vector equality comparison.
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
SG::ReadCondHandleKey< MuonMDT_CablingMap > m_cablingKey
virtual StatusCode initialize() override
virtual StatusCode execute() override
Gaudi::Property< bool > m_insertBISCabling
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
MdtMezzanineCard - Helper struct to represent the structure of a mezzanine card in a consistent way E...
static constexpr uint8_t NOTSET
uint8_t numTubesPerLayer() const
returns the number of tubes per layer;
const Mapping & tdcToTubeMap() const
Returns the underlying TDC -> Tube conversion map.
uint8_t id() const
returns mezzanine database identifier
std::array< uint8_t, 24 > Mapping
uint8_t numTubeLayers() const
returns the number of layers
uint8_t tubeNumber(uint8_t tubeLay, uint8_t tube) const
returns the tube number
const MdtCablingOffData & offId() const
get the offline identifier
Definition MdtTdcMap.h:57
uint8_t tubeZero() const
Definition MdtTdcMap.h:72
int getNLayers() const
Returns the number of tube layers inside the multilayer.
int getMultilayer() const
Returns the multilayer represented by the readout element.
int getNtubesperlayer() const
Returns the number of tubes in each tube layer.
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
const_id_iterator detectorElement_end() const
std::map< std::string, std::string > remap
list of directories to be explicitly remapped
Definition hcg.cxx:95
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
uint8_t tdcId
Mezzanine type.
uint8_t mezzanine_type
Tube number in the layer.
int tube
Layer inside the multilayer.
Split the offline part of the cabling apart to use it later for sorting.
int8_t & multilayer
Phi sector of the MDT station.
int8_t & eta
Station of the chamber (i.e, BIL,BIS,etc.)
int8_t & phi
Eta of the MDT station.
bool operator==(const MdtCablingOnData &other) const
uint8_t & subdetectorId
CSM number.
uint8_t & csm
MROD number.
bool operator<(const MdtCablingOnData &other) const
Helper struct to pipe the result from the tdc -> offline channel translation.
Helper struct to search through the std::set if a conversion from online -> offline is needed.
Definition MdtTdcMap.h:100