13 #include "GaudiKernel/IInterface.h"
14 #include "GaudiKernel/MsgStream.h"
22 #define LUCROD_TRIG_ID 1
30 declareInterface<ZdcRecChannelToolLucrod>(
this);
37 if ( inc.type() == IncidentType::EndEvent) {
48 const ZdcID* zdcId =
nullptr;
50 msg(MSG::ERROR) <<
"execute: Could not retrieve ZdcID object from the detector store" <<
endmsg;
51 return StatusCode::FAILURE;
59 CHECK(incidentSvc.retrieve());
60 incidentSvc->addListener(
this, IncidentType::EndEvent);
63 return StatusCode::SUCCESS;
73 return StatusCode::SUCCESS;
85 typedef std::map<uint32_t,xAOD::ZdcModule*> hashmapType;
86 hashmapType digits_map;
91 std::vector<uint16_t> rodBCID;
96 uint32_t lucrod_id = zld->GetLucrodID();
97 ATH_MSG_DEBUG(
"Unpacking LUCROD ID " << lucrod_id <<
" with BCID=" << zld->GetBCID());
98 rodBCID.push_back(zld->GetBCID());
100 const std::vector<uint16_t> zlt = zld->GetTrigData();
102 for (
size_t i=0;
i<zld->GetChanDataSize();
i++)
104 ATH_MSG_DEBUG(
"Accessing LUCROD ID " << lucrod_id <<
" chan data " <<
i);
116 unsigned int row = -1;
117 unsigned int col = -1;
133 if (iter == digits_map.end())
139 digits_map.insert(std::pair<uint32_t,xAOD::ZdcModule*>(chan_hash,new_mod));
140 iter = digits_map.find(chan_hash);
141 (*iter).second->setZdcId(chan_hash);
142 (*iter).second->setZdcSide(
side);
143 (*iter).second->setZdcModule(
module);
144 (*iter).second->setZdcType(
type);
145 (*iter).second->setZdcChannel(
channel);
156 xposRelAcc (*iter->second) = xpos;
157 yposRelAcc (*iter->second) = ypos;
158 rowAcc (*iter->second) =
row;
159 colAcc (*iter->second) =
col;
163 if (iter != digits_map.end())
170 (*iter).second->setWaveform(
"g0data",zlc.
waveform);
174 (*iter).second->setWaveform(
"g1data",zlc.
waveform);
180 LucrodTriggerAmpAcc (*iter->second) = zlt.at(
i);
188 for (
int iside = 0;iside<2;iside++)
194 LucrodTriggerSideAmpAcc (*new_sum) = (iside==0) ? zld->GetTrigAvgC() : zld->GetTrigAvgA();
203 rodBCIDAcc (*global_sum) = std::move (rodBCID);