6 #include "GaudiKernel/DataObject.h"
7 #include "GaudiKernel/IRegistry.h"
8 #include "MuCalDecode/CalibData.h"
9 #include "MuCalDecode/CalibEvent.h"
10 #include "MuCalDecode/CalibUti.h"
24 #include "GaudiKernel/ServiceHandle.h"
51 return StatusCode::SUCCESS;
70 ATH_MSG_DEBUG(
"RPC core decode processed in MT decode (calibration stream event)");
72 return StatusCode::SUCCESS;
82 return StatusCode::SUCCESS;
91 std::list<RpcCalibData> calib_pad = (
event->rpc())->
data();
94 ATH_MSG_DEBUG(
"fillCollections: number of matrices= " << calib_pad.size());
98 std::vector<std::unique_ptr<RpcPad>> rpcPadCollections{};
102 for (
int j = 0; j < max_pad; ++j) {
104 int name{0},
eta{0},
phi{0}, doublet_r{0}, doublet_z{0}, doublet_phi{0}, gas_gap{0}, measures_phi{0},
strip{0};
106 unsigned int sector = (
event->rpc())->sectorId();
107 unsigned int subsys = (
event->rpc())->subsystemId();
108 unsigned int pad_id = (
event->rpc())->padId();
110 unsigned int errorCode = (
event->rpc())->
error_code();
113 if (subsys == 0x65) sector = sector + 32;
115 ATH_MSG_DEBUG(
"fillCollections: pad no= " << j <<
" sector= " << sector <<
" subsys= " << subsys <<
" pad id= " << pad_id
116 <<
" status= " <<
status <<
" error code= " << errorCode);
118 int side = (sector < 32) ? 0 : 1;
119 int logic_sector = sector % 32;
120 int key =
side * 10000 + logic_sector * 100 + pad_id;
125 index.offline_indexes(
name,
eta,
phi, doublet_r, doublet_z, doublet_phi, gas_gap, measures_phi,
strip);
130 std::unique_ptr<RpcPad> newpad = std::make_unique<RpcPad>(
id,
index.hash(), pad_id,
status, errorCode, sector);
134 for (RpcCalibData &calib_matrix : calib_pad) {
135 unsigned int cmid = calib_matrix.onlineId();
136 unsigned int crc = calib_matrix.crc();
137 unsigned int fel1id = calib_matrix.fel1Id();
138 unsigned int febcid = calib_matrix.febcId();
139 ATH_MSG_DEBUG(
"fillCollections: matrix no= " << cmid <<
" crc= " << crc <<
" fel1id= " << fel1id <<
" febcid= " << febcid);
140 std::unique_ptr<RpcCoinMatrix>
matrix = std::make_unique<RpcCoinMatrix>(
id, cmid, crc, fel1id, febcid);
144 for (
short unsigned int i = 0;
i < calib_matrix.hitNum(); ++
i) {
145 std::unique_ptr<RpcFiredChannel> rpcfiredchannel = nullptr ;
149 ATH_MSG_DEBUG(
"Check BIS78 updates? " << __FILE__ <<
" " << __LINE__);
151 rpcfiredchannel = std::make_unique<RpcFiredChannel>(
bcid,
time, ijk,
channel);
153 }
else if (ijk == 7) {
154 rpcfiredchannel = std::make_unique<RpcFiredChannel>(
bcid,
time, ijk, thr, ovl);
157 ATH_MSG_DEBUG(
"fillCollections: hit no= " <<
i <<
" bcid= " <<
bcid <<
" time= " <<
time <<
" ijk= " << ijk
158 <<
" channel=" <<
channel <<
" ovl= " << ovl <<
" thr= " << thr);
159 matrix->push_back(std::move(rpcfiredchannel));
169 rpcPadCollections.push_back(std::move(newpad));
172 ATH_MSG_DEBUG(
"fillCollections: pad added to the pad vector");
175 for (
auto& coll : rpcPadCollections) {
182 ATH_MSG_DEBUG(
"Wrote " << rpcPadCollections.size() <<
" RPC PAD");
184 return StatusCode::SUCCESS;