11 base_class(
type, name, parent)
20 return StatusCode::SUCCESS;
25 ATH_MSG_DEBUG(
"in the finalize of SiLocAlignDBTool, bye bye");
26 return StatusCode::SUCCESS;
32 ATH_MSG_DEBUG(
"will get local alignment for run "<<ctx.eventID().run_number()<<
", lb "<<ctx.eventID().lumi_block()<<
", event "<<ctx.eventID().event_number());
36 if ( attrLocList ==
nullptr )
39 return nlohmann::json::parse(
"");
42 if(attrLocList->
size()>1)
ATH_MSG_INFO(
"there should be only one real channel in "<<
m_rch_loc.fullKey() <<
", there are "<<attrLocList->
size()<<
" real channels, only the first one will be used ");
45 const coral::AttributeList &atr = itr->second;
46 std::string
data = *(
static_cast<const std::string *
>((atr[
"data"]).addressOfData()));
48 return nlohmann::json::parse(
data);
54 ATH_MSG_DEBUG(
"will get local alignment for station "<<stationID<<
", layerID "<<layerID);
55 nlohmann::json channeldata=jsondata[
"data"];
58 int guess_ch=stationID*4+layerID;
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)
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"]);
70 ATH_MSG_DEBUG(
"channel was not guessed correctly, stationID "<<st<<
", layerId "<<la<<
", channel guess "<<guess_ch);
74 for(
auto& chan : channeldata.items())
77 nlohmann::json aligndata=chan.value();
79 int st=aligndata[
"stationID"];
80 int la=aligndata[
"layerID"];
82 if(stationID==st && layerID==la)
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"]);
89 ATH_MSG_WARNING(
"local alignment data stationID "<<stationID<<
", layerId "<<layerID<<
" not found in any channels, returning zeros");
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
Class storing information about alignment.
This class is a collection of AttributeLists where each one is associated with a channel number.
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
size_type size() const
number of Chan/AttributeList pairs
ChanAttrListMap::const_iterator const_iterator
Header file for interface of SiGlobAlignDBTool used to read global alignment for database.