53 {
54 ATH_MSG_DEBUG(
"will get local alignment for station "<<stationID<<
", layerID "<<layerID);
55 nlohmann::json channeldata=jsondata["data"];
56
57
59
60 nlohmann::json aligndata=channeldata.at(std::to_string(guess_ch));
61 int st=aligndata[
"stationID"];
62 int la=aligndata["layerID"];
63 if(stationID==st && layerID==la)
64 {
65 ATH_MSG_DEBUG(
"channel guessed correctly, stationID "<<st<<
", layerId "<<la<<
", channel guess "<<guess_ch);
66 return SiLocAlignData(st, la, aligndata["shiftX"], aligndata["shiftY"], aligndata["shiftZ"], aligndata["alpha"], aligndata["beta"], aligndata["gamma"]);
67 }
68 else
69 {
70 ATH_MSG_DEBUG(
"channel was not guessed correctly, stationID "<<st<<
", layerId "<<la<<
", channel guess "<<guess_ch);
71 }
72
73
74 for(auto& chan : channeldata.items())
75 {
76
77 nlohmann::json aligndata=
chan.value();
78
79 int st=aligndata[
"stationID"];
80 int la=aligndata["layerID"];
81
82 if(stationID==st && layerID==la)
83 {
84 ATH_MSG_DEBUG(
"channel found for stationID "<<st<<
", layerId "<<la<<
", channel nr. "<<
chan.key());
85 return SiLocAlignData(st, la, aligndata["shiftX"], aligndata["shiftY"], aligndata["shiftZ"], aligndata["alpha"], aligndata["beta"], aligndata["gamma"]);
86 }
87 }
88
89 ATH_MSG_WARNING(
"local alignment data stationID "<<stationID<<
", layerId "<<layerID<<
" not found in any channels, returning zeros");
90 return SiLocAlignData(stationID,layerID);
91 }
#define ATH_MSG_WARNING(x)
constexpr uint8_t stationID
Large or Small wedge.