|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/EventIDRange.h"
11 #include <nlohmann/json.hpp>
30 return StatusCode::SUCCESS;
38 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.
fullKey() <<
" is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order.");
39 return StatusCode::SUCCESS;
44 std::unique_ptr<PixelDeadMapCondData> writeCdo(std::make_unique<PixelDeadMapCondData>());
46 const EventIDBase
start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0,
47 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
48 const EventIDBase
stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1,
49 EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
56 if (readCdo==
nullptr) {
58 return StatusCode::FAILURE;
61 if (not readHandle.
range(rangeW)) {
63 return StatusCode::FAILURE;
66 for (
const auto & attrList : *readCdo) {
70 if (
payload.exists(
"data_array") and not
payload[
"data_array"].isNull()) {
71 const std::string &stringStatus =
payload[
"data_array"].data<std::string>();
74 for (
const auto & [
hash,
status] : hashStatusVector){
87 if (!json_file.is_open()) {
88 ATH_MSG_ERROR(
"Failed to open the json file with dead pixel modules");
89 return StatusCode::FAILURE;
94 for (
const auto&
i : dead_module_data) {
95 std::string id_mod =
i[
"Decimal_ID"];
96 unsigned long long idull = std::stoull(id_mod);
109 ATH_MSG_DEBUG(
"No readKey and jsonFile have been passed to PixelDeadMapCondAlg.");
112 if (rangeW.stop().isValid() and rangeW.start()>rangeW.stop()) {
114 return StatusCode::FAILURE;
117 if (writeHandle.
record(rangeW, std::move(writeCdo)).isFailure()) {
118 ATH_MSG_FATAL(
"Could not record PixelDeadMapCondData " << writeHandle.
key() <<
" with EventRange " << rangeW <<
" into Conditions Store");
119 return StatusCode::FAILURE;
122 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.
key() <<
" with range " << rangeW <<
" into Conditions Store");
124 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
const PixelID * m_pixelID
std::vector< std::pair< int, int > > parseDeadMapString(const std::string &s)
bool range(EventIDRange &r)
bool empty() const
Test if the key is blank.
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
This class is a collection of AttributeLists where each one is associated with a channel number....
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
PixelDeadMapCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
An algorithm that can be simultaneously executed in multiple threads.
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
const DataObjID & fullKey() const
void setModuleStatus(const int chanNum, const int value)
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::WriteCondHandleKey< PixelDeadMapCondData > m_writeKey
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey
void setChipStatus(const int chanNum, const int value)
Gaudi::Property< std::string > m_JsonLocation
virtual StatusCode initialize() override final
const std::string & key() const
StatusCode initialize(bool used=true)
coral::AttributeList AttributeList
const std::string & key() const
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...