Skip to content

Commit 9607305

Browse files
authored
Add MID local board hardware name in the mapping info (#14034)
1 parent d2bd60f commit 9607305

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Detectors/MUON/MID/GlobalMapping/exe/global-mapper.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ void stripsInfo2json(const std::vector<o2::mid::ExtendedMappingInfo>& infos, con
5757
writer.Int(infos[idx].locId);
5858
writer.Key("locIdDcs");
5959
writer.String(infos[idx].locIdDcs.c_str());
60+
writer.Key("locIdHw");
61+
writer.String(infos[idx].locIdHw.c_str());
6062
writer.EndObject();
6163
}
6264
writer.EndArray();

Detectors/MUON/MID/GlobalMapping/include/MIDGlobalMapping/ExtendedMappingInfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct ExtendedMappingInfo {
3434
int cathode; ///< Bending (0) or Non-bending (1) planes
3535
int locId; ///< Local board ID
3636
std::string locIdDcs; ///< Local board ID for DCS
37+
std::string locIdHw; /// Local board ID in the hardware
3738
int xpos; ///< Position X
3839
int ypos; ///< Position Y
3940
int xwidth; ///< Width X (signed)

Detectors/MUON/MID/GlobalMapping/src/GlobalMapper.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ std::array<int, 4> GlobalMapper::getStripGeom(int deId, int columnId, int lineId
7979
ExtendedMappingInfo GlobalMapper::buildExtendedInfo(int deId, int columnId, int lineId, int stripId, int cathode) const
8080
{
8181
ExtendedMappingInfo info;
82+
std::array<std::string, 4> boards{"12", "34", "56", "78"};
8283
info.id = getStripId(deId, columnId, lineId, stripId, cathode);
84+
int irpc = detparams::getRPCLine(deId);
85+
int iline = (irpc == 5 && columnId == 0) ? lineId - 1 : lineId;
8386
auto locId = static_cast<int>(mCrateMapper.deLocalBoardToRO(deId, columnId, lineId));
8487
info.locId = locId;
8588
std::string side = detparams::isRightSide(deId) ? "R" : "L";
@@ -92,6 +95,7 @@ ExtendedMappingInfo GlobalMapper::buildExtendedInfo(int deId, int columnId, int
9295
info.stripId = stripId;
9396
info.cathode = cathode;
9497
info.locIdDcs = fmt::format("{}{}{}{}", crateId, side, (locInCrate >= 8 ? "1" : "0"), locInCrate);
98+
info.locIdHw = fmt::format("{}{}C{}L{}B{}", detparams::getChamber(deId) + 1, side, columnId + 1, irpc + 1, boards[iline]);
9599
auto geom = getStripGeom(deId, columnId, lineId, stripId, cathode);
96100
info.xpos = geom[0];
97101
info.ypos = geom[1];

0 commit comments

Comments
 (0)