9 #include "nlohmann/json.hpp"
21 ATH_MSG_FATAL(
"You can't write rpc cablings without rpc detectors? ");
22 return StatusCode::FAILURE;
27 return StatusCode::SUCCESS;
31 if (!outStream.good()) {
33 return StatusCode::FAILURE;
36 std::vector<const MuonGMR4::RpcReadoutElement*> reEles{
m_detMgr->getAllRpcReadoutElements()};
39 constexpr
int subDetA = 0x65;
40 constexpr
int subDetB = 0x66;
41 constexpr
unsigned int nStripsPerTdc = 64;
43 unsigned int tdcSecA{0}, tdcSecC{0};
50 const unsigned int subDet = reEle->stationEta() > 0 ? subDetA : subDetB;
51 const unsigned int tdcSec = reEle->stationEta() > 0 ? (++tdcSecA) : (++tdcSecC);
55 for (
bool measPhi: {
false,
true}) {
57 if (!reEle->nStrips(layHash))
continue;
58 const unsigned int nStrips = reEle->nStrips(layHash)+1;
59 const unsigned int nTdcStrips = (
nStrips % nStripsPerTdc ? 1 : 0) +
61 for (
bool side : {
false,
true}) {
62 bool run4_BIS = ((reEle->stationName() ==
m_BIS_stIdx) && (abs(reEle->stationEta()) < 7));
67 unsigned int measPhiSide = (
side * stripSideBit) | (measPhi * measPhiBit);
70 cablingChannel[
"station"] =
m_idHelperSvc->stationNameString(reEle->identify());
71 cablingChannel[
"eta"] = reEle->stationEta();
72 cablingChannel[
"phi"] = reEle->stationPhi();
73 cablingChannel[
"doubletR"] = reEle->doubletR();
74 cablingChannel[
"doubletZ"] = reEle->doubletZ();
76 cablingChannel[
"gasGap"] =
gasGap;
77 cablingChannel[
"measPhi"] = measPhiSide;
79 cablingChannel[
"subDetector"] = subDet;
80 cablingChannel[
"tdcSector"] = tdcSec;
81 cablingChannel[
"firstStrip"] = (1 + nStripsPerTdc*
strip);
82 cablingChannel[
"lastStrip"] = nStripsPerTdc*(
strip +1);
83 cablingChannel[
"firstTdcChan"] = 1;
84 cablingChannel[
"lastTdcChan"] = nStripsPerTdc;
85 cablingChannel[
"tdc"] = (++tdc);
87 overallMap.push_back(cablingChannel);
94 outStream<<overallMap.dump(2)<<std::endl;
95 return StatusCode::SUCCESS;