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;
126 if (status.empty()) {
127 status.resize(
m_pHelper->wafer_hash_max(),
true);
130 status.at(
m_pHelper->wafer_hash(wafer_id) ) =
false;
134 if (not condDataHandle.
isValid()) {
144 status.at(
m_pHelper->wafer_hash(wafer_id) ) =
false;
162 if (!json_file.is_open()) {
164 return StatusCode::FAILURE;
167 json data = json::parse(json_file);
169 for(
const auto& i:data)
171 std::string id_mod = i[
"Decimal_ID"];
172 unsigned long long id_cstring = std::stoull(id_mod);
176 return StatusCode::SUCCESS;
181 StatusCode
sc{StatusCode::SUCCESS};
189 std::vector<std::string>::const_iterator pId{
m_badElements.value().begin()};
190 std::vector<std::string>::const_iterator last{
m_badElements.value().end()};
191 for(; pId not_eq last;++pId) {
192 unsigned long long idToWrite{
static_cast<unsigned long long>(atoll(pId->c_str()))};
201 for(
unsigned int i{0}; i <
m_pHelper->wafer_hash_max(); i++) {
205 int layer_disk{
m_pHelper->layer_disk(mID)};
219 ATH_MSG_DEBUG(
"Successfully filled bad SCT identifiers list");
220 return (success ?
sc : StatusCode::FAILURE);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
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)