12#include <nlohmann/json.hpp>
27using json = nlohmann::json;
33 base_class(
type, name, parent)
41 ATH_MSG_INFO(
"Layer/Disk masking enabled, but no layer/disk specified!");
46 ATH_MSG_INFO(
"Layer/Disk to mask specified, but masking is disabled!");
50 ATH_MSG_INFO(
"Layer/Disk side to mask specified, but masking is disabled!");
57 if (detStore()->retrieve(
m_pHelper,
"SCT_ID").isFailure()) {
59 return StatusCode::FAILURE;
71 return StatusCode::FAILURE;
78 const std::string databaseUseString{
m_useDatabase ?
"" :
"not "};
81 <<
" elements declared bad. Database will " << databaseUseString <<
"be used.");
83 return StatusCode::SUCCESS;
89 return StatusCode::SUCCESS;
110 if (condData==
nullptr)
return true;
118 const EventContext& ctx{Gaudi::Hive::currentContext()};
119 return isGood(elementId, ctx,
h);
130 const EventContext& ctx{Gaudi::Hive::currentContext()};
131 return isGood(hashId, ctx);
138 if (status.empty()) {
139 status.resize(
m_pHelper->wafer_hash_max(),
true);
142 status.at(
m_pHelper->wafer_hash(wafer_id) ) =
false;
146 if (not condDataHandle.
isValid()) {
156 status.at(
m_pHelper->wafer_hash(wafer_id) ) =
false;
174 if (!json_file.is_open()) {
176 return StatusCode::FAILURE;
181 for(
const auto& i:
data)
183 std::string id_mod = i[
"Decimal_ID"];
184 unsigned long long id_cstring = std::stoull(id_mod);
188 return StatusCode::SUCCESS;
193 StatusCode
sc{StatusCode::SUCCESS};
201 std::vector<std::string>::const_iterator pId{
m_badElements.value().begin()};
202 std::vector<std::string>::const_iterator last{
m_badElements.value().end()};
203 for(; pId not_eq last;++pId) {
204 unsigned long long idToWrite{
static_cast<unsigned long long>(atoll(pId->c_str()))};
213 for(
unsigned int i{0}; i <
m_pHelper->wafer_hash_max(); i++) {
217 int layer_disk{
m_pHelper->layer_disk(mID)};
231 ATH_MSG_DEBUG(
"Successfully filled bad SCT identifiers list");
232 return (success ?
sc : StatusCode::FAILURE);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
This is an Identifier helper class for the SCT subdetector.
Header file for AthHistogramAlgorithm.
This is a "hash" representation of an Identifier.
const std::vector< bool > & getElementStatus() const
Class for data object used in SCT_ModuleVetoCondAlg, SCT_LinkMaskingCondAlg, SCT_ModuleVetoTool,...
const std::set< Identifier > & badWaferIds() const
bool isBadWaferId(const Identifier waferId) const
Check if a wafer ID is bad or not.
const_pointer_type retrieve()
const_pointer_type cptr()
void addDependency(const EventIDRange &range)