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;
92 std::array<xAOD::ZdcModule*, 2> zdcSideSum_ptrs;
94 for (
int iside = 0;iside<2;iside++)
98 zdcSideSum_ptrs[iside] = new_sum;
106 uint32_t lucrod_id = zld->GetLucrodID();
107 ATH_MSG_DEBUG(
"Unpacking LUCROD ID " << lucrod_id <<
" with BCID=" << zld->GetBCID());
108 rodBCID.push_back(zld->GetBCID());
110 const std::vector<uint16_t> zlt = zld->GetTrigData();
112 for (
size_t i=0;
i<zld->GetChanDataSize();
i++)
114 ATH_MSG_DEBUG(
"Accessing LUCROD ID " << lucrod_id <<
" chan data " <<
i);
126 unsigned int row = -1;
127 unsigned int col = -1;
143 if (iter == digits_map.end())
149 digits_map.insert(std::pair<uint32_t,xAOD::ZdcModule*>(chan_hash,new_mod));
150 iter = digits_map.find(chan_hash);
151 (*iter).second->setZdcId(chan_hash);
152 (*iter).second->setZdcSide(
side);
153 (*iter).second->setZdcModule(
module);
154 (*iter).second->setZdcType(
type);
155 (*iter).second->setZdcChannel(
channel);
166 xposRelAcc (*iter->second) = xpos;
167 yposRelAcc (*iter->second) = ypos;
168 rowAcc (*iter->second) =
row;
169 colAcc (*iter->second) =
col;
173 if (iter != digits_map.end())
180 (*iter).second->setWaveform(
"g0data",zlc.
waveform);
184 (*iter).second->setWaveform(
"g1data",zlc.
waveform);
190 LucrodTriggerAmpLGAcc (*iter->second) = zlt.at(
i);
194 LucrodTriggerAmpAcc (*iter->second) = zlt.at(
i);
209 std::string auxName = (
gain == 0 ?
"LucrodTriggerSideAmpLG" :
"LucrodTriggerSideAmp");
211 auxNameAcc ( *zdcSideSum_ptrs[0]) = zld->GetTrigAvgC();
212 auxNameAcc ( *zdcSideSum_ptrs[1]) = zld->GetTrigAvgA();
220 rodBCIDAcc (*global_sum) = std::move (rodBCID);