9 #include "nlohmann/json.hpp"
21 ATH_MSG_FATAL(
"You can't write rpc cablings without rpc detectors? ");
22 return StatusCode::FAILURE;
26 return StatusCode::SUCCESS;
30 if (!outStream.good()) {
32 return StatusCode::FAILURE;
35 std::vector<const MuonGMR4::RpcReadoutElement*> reEles{
m_detMgr->getAllRpcReadoutElements()};
38 constexpr
int subDetA = 0x65;
39 constexpr
int subDetB = 0x66;
40 constexpr
unsigned int nStripsPerTdc = 64;
42 unsigned int tdcSecA{0}, tdcSecC{0};
49 const unsigned int subDet = reEle->stationEta() > 0 ? subDetA : subDetB;
50 const unsigned int tdcSec = reEle->stationEta() > 0 ? (++tdcSecA) : (++tdcSecC);
54 for (
bool measPhi: {
false,
true}) {
55 const unsigned int nStrips = (measPhi ? reEle->nPhiStrips() : reEle->nEtaStrips())+1;
56 const unsigned int nTdcStrips = (
nStrips % nStripsPerTdc ? 1 : 0) +
58 for (
bool side : {
false,
true}) {
63 unsigned int measPhiSide = (
side * stripSideBit) | (measPhi * measPhiBit);
66 cablingChannel[
"station"] =
m_idHelperSvc->stationNameString(reEle->identify());
67 cablingChannel[
"eta"] = reEle->stationEta();
68 cablingChannel[
"phi"] = reEle->stationPhi();
69 cablingChannel[
"doubletR"] = reEle->doubletR();
70 cablingChannel[
"doubletZ"] = reEle->doubletZ();
72 cablingChannel[
"gasGap"] =
gasGap;
73 cablingChannel[
"measPhi"] = measPhiSide;
75 cablingChannel[
"subDetector"] = subDet;
76 cablingChannel[
"tdcSector"] = tdcSec;
77 cablingChannel[
"firstStrip"] = (1 + nStripsPerTdc*
strip);
78 cablingChannel[
"lastStrip"] = nStripsPerTdc*(
strip +1);
79 cablingChannel[
"firstTdcChan"] = 1;
80 cablingChannel[
"lastTdcChan"] = nStripsPerTdc;
81 cablingChannel[
"tdc"] = (++tdc);
83 overallMap.push_back(cablingChannel);
90 outStream<<overallMap.dump(2)<<std::endl;
91 return StatusCode::SUCCESS;