14 #include "GaudiKernel/IIncidentSvc.h"
35 #include "CoralBase/Blob.h"
36 #include <boost/crc.hpp>
41 m_IOVSvc (
"IOVSvc",
name),
42 m_detStore (
"DetectorStore",
name),
43 m_clidSvc (
"ClassIDSvc",
name),
47 m_doRegularCells(true),
54 m_objInfo[2].m_classname=
"LArHVScaleCorrFlat";
55 m_objInfo[3].m_classname=
"LArPedestalFlat";
57 m_objInfo[5].m_classname=
"LArMphysOverMcalFlat";
63 m_objInfo[2].m_ifacename=
"ILArHVScaleCorr";
66 m_objInfo[5].m_ifacename=
"ILArMphysOverMcal";
76 m_objInfo[13].m_classname=
"LArPedestalSC";
163 msg(MSG::WARNING) <<
"Both DoSuperCells and DoRegularCells set to false. Do nothing ?!?" <<
endmsg;
168 if (
sc.isFailure()) {
169 msg(MSG::ERROR) <<
"Unable to get the IncidentSvc" <<
endmsg;
170 return StatusCode::FAILURE;
173 incSvc->addListener(
this,
"BeginRun", 100 );
176 for (
size_t i=0;
i<nObj;++
i) {
183 return StatusCode::SUCCESS;
198 for (
size_t i=minIdx;
i<maxIdx;++
i) {
206 if (
sc.isFailure()) {
207 msg(MSG::ERROR) <<
"IOVSvc failed to preLoadTAD" <<
endmsg;
212 tlist.push_back(tad);
215 return StatusCode::SUCCESS;
221 const EventContext& ) {
230 const std::string&
key=tad->
name();
232 std::vector<objInfo_t>::const_iterator objIt=
m_objInfo.begin();
233 std::vector<objInfo_t>::const_iterator objIt_e=
m_objInfo.end();
235 for (;objIt!=objIt_e && objIt->m_clid!=clid;++objIt);
236 if (objIt==objIt_e) {
238 return(StatusCode::FAILURE);
243 ATH_MSG_DEBUG(
"updateAddress: Still in initialization phase. Do nothing");
244 return StatusCode::SUCCESS;
250 if (
sc.isFailure()) {
251 msg(MSG::ERROR) <<
"Failed to retrieve a CondAttrListCollection with key " << objIt->m_inputKey <<
endmsg;
252 return StatusCode::FAILURE;
259 if (
sc.isFailure()) {
260 msg(MSG::ERROR) <<
"Failed to get IOV range for CondAttrListCollection with key " << objIt->m_inputKey <<
" from IOVSvc" <<
endmsg;
268 if (this->createFlatObj<LAruA2MeVFlat>(attrlist,tad)==
nullptr) {
269 msg(MSG::ERROR) <<
"Problem creating LAruA2MeVFlat object" <<
endmsg;
270 return StatusCode::FAILURE;
277 if (this->createFlatObj<LArDAC2uAFlat>(attrlist,tad)==
nullptr) {
278 msg(MSG::ERROR) <<
"Problem creating LArDAC2uAFlat object" <<
endmsg;
279 return StatusCode::FAILURE;
285 if (this->createFlatObj<LArHVScaleCorrFlat>(attrlist,tad)==
nullptr) {
286 msg(MSG::ERROR) <<
"Problem creating LArHVScaleCorrFlat object " <<
endmsg;
287 return StatusCode::FAILURE;
293 if (this->createFlatObj<LArPedestalFlat>(attrlist,tad)==
nullptr) {
294 msg(MSG::ERROR) <<
"Problem creating LArPedestalFlat object" <<
endmsg;
295 return StatusCode::FAILURE;
301 if (this->createFlatObj<LArRampFlat>(attrlist,tad)==
nullptr) {
302 msg(MSG::ERROR) <<
"Problem creating LArRampFlat object" <<
endmsg;
303 return StatusCode::FAILURE;
309 if (this->createFlatObj<LArMphysOverMcalFlat>(attrlist,tad)==
nullptr) {
310 msg(MSG::ERROR) <<
"Problem creating LArMphysOverMcalFlat object" <<
endmsg;
311 return StatusCode::FAILURE;
317 if (this->createFlatObj<LArOFCFlat>(attrlist,tad)==
nullptr) {
318 msg(MSG::ERROR) <<
"Problem creating LArOFCFlat object" <<
endmsg;
319 return StatusCode::FAILURE;
325 if (this->createFlatObj<LArShapeFlat>(attrlist,tad)==
nullptr) {
326 msg(MSG::ERROR) <<
"Problem creating LArShapeFlat object" <<
endmsg;
327 return StatusCode::FAILURE;
335 if (this->createFlatObj<LArAutoCorrSC>(attrlist,tad)==
nullptr) {
336 msg(MSG::ERROR) <<
"Problem creating LArAutoCorrSC object" <<
endmsg;
337 return StatusCode::FAILURE;
343 if (this->createFlatObj<LAruA2MeVSC>(attrlist,tad)==
nullptr) {
344 msg(MSG::ERROR) <<
"Problem creating LAruA2MeVSC object" <<
endmsg;
345 return StatusCode::FAILURE;
351 if (this->createFlatObj<LArDAC2uASC>(attrlist,tad)==
nullptr) {
352 msg(MSG::ERROR) <<
"Problem creating LArDAC2uASC object" <<
endmsg;
353 return StatusCode::FAILURE;
359 if (this->createFlatObj<LArfSamplSC>(attrlist,tad)==
nullptr) {
360 msg(MSG::ERROR) <<
"Problem creating LArfSamplSC object" <<
endmsg;
361 return StatusCode::FAILURE;
366 if (this->createFlatObj<LArNoiseSC>(attrlist,tad)==
nullptr) {
367 msg(MSG::ERROR) <<
"Problem creating LArNoiseSC object" <<
endmsg;
368 return StatusCode::FAILURE;
373 if (this->createFlatObj<LArPedestalSC>(attrlist,tad)==
nullptr) {
374 msg(MSG::ERROR) <<
"Problem creating LArPedestal object" <<
endmsg;
375 return StatusCode::FAILURE;
380 if (this->createFlatObj<LArRampSC>(attrlist,tad)==
nullptr) {
381 msg(MSG::ERROR) <<
"Problem creating LArRampSC object" <<
endmsg;
382 return StatusCode::FAILURE;
387 if (this->createFlatObj<LArShapeSC>(attrlist,tad)==
nullptr) {
388 msg(MSG::ERROR) <<
"Problem creating LArShapeSC object" <<
endmsg;
389 return StatusCode::FAILURE;
394 if (this->createFlatObj<LArMinBiasSC>(attrlist,tad)==
nullptr) {
395 msg(MSG::ERROR) <<
"Problem creating LArMinBiasSC object" <<
endmsg;
396 return StatusCode::FAILURE;
402 msg(MSG::ERROR) <<
"Something screwed up at " << __FILE__ <<
" line " << __LINE__ <<
endmsg;
403 return StatusCode::FAILURE;
407 if (
sc.isFailure()) {
408 msg(MSG::ERROR) <<
"Failed to set IOV range for object " << objIt->m_classname <<
" with key " << objIt->m_outputKey <<
endmsg;
413 return StatusCode::SUCCESS;
417 return StatusCode::SUCCESS;
423 ATH_MSG_DEBUG(
"entering handle(), incident type " << inc.type()
424 <<
" from " << inc.source());
433 const std::string&
key=tad->
name();
437 msg(MSG::ERROR) <<
"Failed to covert AthenaAttributeList to flat LAr conditions object with clid/key "
445 proxy->setObject(dObj);
452 if (!
msgLvl(MSG::INFO))
return;
459 boost::crc_32_type crc32;
465 for (;
it!=it_e;++
it) {
467 const unsigned gain=
it->first;
468 msg(MSG::INFO) <<
" Gain " <<
gain;
469 for (
const auto& attr : attrList) {
470 const std::string&
typeName=attr.specification().typeName();
471 if (
typeName.substr(0, 4) ==
"blob") {
474 const std::string& blobName=attr.specification().name();
475 crc32.process_bytes(
blob.startingAddress(),
blob.size());
476 cnv.usn= crc32.checksum();
477 msg(MSG::INFO) <<
", " << blobName <<
" checksum=" << cnv.sn;