Tool allowing one to manually declare detector elements as 'bad' in the joboptions file.
More...
#include <SCT_ModuleVetoTool.h>
|
| | SCT_ModuleVetoTool (const std::string &type, const std::string &name, const IInterface *parent) |
| virtual | ~SCT_ModuleVetoTool ()=default |
| virtual StatusCode | initialize () override |
| virtual StatusCode | finalize () override |
| virtual bool | canReportAbout (InDetConditions::Hierarchy h) const override |
| | Can the service report about the given component? (chip, module...)
|
| virtual bool | isGood (const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override |
| | Is the detector element good?
|
| virtual bool | isGood (const Identifier &elementId, const EventContext &ctx, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override |
| virtual bool | isGood (const IdentifierHash &hashId) const override |
| | is it good?, using wafer hash
|
| virtual bool | isGood (const IdentifierHash &hashId, const EventContext &ctx) const override |
| virtual void | getDetectorElementStatus (const EventContext &ctx, InDet::SiDetectorElementStatus &element_status, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const override |
|
| StringArrayProperty | m_badElements {this, "BadModuleIdentifiers", {}, "list of bad detector elements (= module sides)"} |
| SCT_ModuleVetoCondData | m_localCondData {} |
| const SCT_ID * | m_pHelper {nullptr} |
| bool | m_useDatabase {false} |
| StringProperty | m_JsonLocation {this, "JsonPath", "", "Path to the JSON file containing list of modules to be masked."} |
| BooleanProperty | m_maskLayers {this, "MaskLayers", false, "Mask full layers/disks in overlay"} |
| IntegerProperty | m_maskSide {this, "MaskSide", -1, "Mask full modules (-1), inner (0) or outer (1) sides"} |
| IntegerArrayProperty | m_layersToMask {this, "LayersToMask", {}, "Which barrel layers to mask out, goes from 0 to N-1"} |
| IntegerArrayProperty | m_disksToMask {this, "DisksToMask", {}, "Which endcap disks to mask out, goes from -N+1 to N+1 , skipping zero"} |
| SG::ReadCondHandleKey< SCT_ModuleVetoCondData > | m_condKey {this, "CondKey", "SCT_ModuleVetoCondData", "SCT modules to be vetoed"} |
Tool allowing one to manually declare detector elements as 'bad' in the joboptions file.
Definition at line 36 of file SCT_ModuleVetoTool.h.
◆ SCT_ModuleVetoTool()
| SCT_ModuleVetoTool::SCT_ModuleVetoTool |
( |
const std::string & | type, |
|
|
const std::string & | name, |
|
|
const IInterface * | parent ) |
◆ ~SCT_ModuleVetoTool()
| virtual SCT_ModuleVetoTool::~SCT_ModuleVetoTool |
( |
| ) |
|
|
virtualdefault |
◆ canReportAbout()
Can the service report about the given component? (chip, module...)
Definition at line 93 of file SCT_ModuleVetoTool.cxx.
◆ fillData()
| StatusCode SCT_ModuleVetoTool::fillData |
( |
| ) |
|
|
private |
Definition at line 164 of file SCT_ModuleVetoTool.cxx.
164 {
165
167
168
169
170
172 {
174 if (!json_file.is_open()) {
176 return StatusCode::FAILURE;
177 }
178
180
181 for(
const auto& i:
data)
182 {
183 std::string id_mod =
i[
"Decimal_ID"];
184 unsigned long long id_cstring = std::stoull(id_mod);
187 }
188 return StatusCode::SUCCESS;
189 }
190
191
192
197 }
198
199
200 bool success{true};
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()))};
206 }
207
208
209
213 for(
unsigned int i{0};
i <
m_pHelper->wafer_hash_max();
i++) {
217 int layer_disk{
m_pHelper->layer_disk(mID)};
218
224 }
225 }
226 }
227
229
231 ATH_MSG_DEBUG(
"Successfully filled bad SCT identifiers list");
232 return (success ?
sc : StatusCode::FAILURE);
233}
char data[hepevt_bytes_allocation_ATLAS]
::StatusCode StatusCode
StatusCode definition for legacy code.
◆ finalize()
| StatusCode SCT_ModuleVetoTool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ getCondData()
◆ getDetectorElementStatus()
Definition at line 135 of file SCT_ModuleVetoTool.cxx.
136 {
140 }
143 }
145 SG::ReadCondHandle<SCT_ModuleVetoCondData> condDataHandle{
m_condKey, ctx};
146 if (not condDataHandle.
isValid()) {
148 return;
149 }
150 const SCT_ModuleVetoCondData* condData{ condDataHandle.
cptr() };
151 if (whandle) {
153 }
154 if (condData) {
155 for (
const Identifier &wafer_id: condData->
badWaferIds()) {
157 }
158 }
159 }
160}
const std::vector< bool > & getElementStatus() const
const std::set< Identifier > & badWaferIds() const
const_pointer_type cptr()
void addDependency(const EventIDRange &range)
◆ initialize()
| StatusCode SCT_ModuleVetoTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 39 of file SCT_ModuleVetoTool.cxx.
39 {
41 ATH_MSG_INFO(
"Layer/Disk masking enabled, but no layer/disk specified!");
43 }
44
46 ATH_MSG_INFO(
"Layer/Disk to mask specified, but masking is disabled!");
47 }
48
50 ATH_MSG_INFO(
"Layer/Disk side to mask specified, but masking is disabled!");
51 }
52
55 }
56
59 return StatusCode::FAILURE;
60 } else {
62 }
63
64
67
71 return StatusCode::FAILURE;
72 }
73 }
74
75
77
78 const std::string databaseUseString{
m_useDatabase ?
"" :
"not "};
81 << " elements declared bad. Database will " << databaseUseString << "be used.");
82
83 return StatusCode::SUCCESS;
84}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
retrieve(aClass, aKey=None)
◆ isGood() [1/4]
Definition at line 98 of file SCT_ModuleVetoTool.cxx.
98 {
100
101 const Identifier waferId{
m_pHelper->wafer_id(elementId)};
102
103
105
107
108 const SCT_ModuleVetoCondData* condData{
getCondData(ctx)};
109
110 if (condData==nullptr) return true;
111
112
114}
bool isBadWaferId(const Identifier waferId) const
Check if a wafer ID is bad or not.
◆ isGood() [2/4]
Is the detector element good?
Definition at line 117 of file SCT_ModuleVetoTool.cxx.
117 {
118 const EventContext& ctx{Gaudi::Hive::currentContext()};
119 return isGood(elementId, ctx, h);
120}
◆ isGood() [3/4]
| bool SCT_ModuleVetoTool::isGood |
( |
const IdentifierHash & | hashId | ) |
const |
|
overridevirtual |
is it good?, using wafer hash
Definition at line 129 of file SCT_ModuleVetoTool.cxx.
129 {
130 const EventContext& ctx{Gaudi::Hive::currentContext()};
131 return isGood(hashId, ctx);
132}
◆ isGood() [4/4]
| bool SCT_ModuleVetoTool::isGood |
( |
const IdentifierHash & | hashId, |
|
|
const EventContext & | ctx ) const |
|
overridevirtual |
◆ m_badElements
| StringArrayProperty SCT_ModuleVetoTool::m_badElements {this, "BadModuleIdentifiers", {}, "list of bad detector elements (= module sides)"} |
|
private |
Definition at line 60 of file SCT_ModuleVetoTool.h.
60{this, "BadModuleIdentifiers", {}, "list of bad detector elements (= module sides)"};
◆ m_condKey
Definition at line 71 of file SCT_ModuleVetoTool.h.
71{this, "CondKey", "SCT_ModuleVetoCondData", "SCT modules to be vetoed"};
◆ m_disksToMask
| IntegerArrayProperty SCT_ModuleVetoTool::m_disksToMask {this, "DisksToMask", {}, "Which endcap disks to mask out, goes from -N+1 to N+1 , skipping zero"} |
|
private |
Definition at line 68 of file SCT_ModuleVetoTool.h.
68{this, "DisksToMask", {}, "Which endcap disks to mask out, goes from -N+1 to N+1 , skipping zero"};
◆ m_JsonLocation
| StringProperty SCT_ModuleVetoTool::m_JsonLocation {this, "JsonPath", "", "Path to the JSON file containing list of modules to be masked."} |
|
private |
Definition at line 64 of file SCT_ModuleVetoTool.h.
64{this, "JsonPath", "", "Path to the JSON file containing list of modules to be masked."};
◆ m_layersToMask
| IntegerArrayProperty SCT_ModuleVetoTool::m_layersToMask {this, "LayersToMask", {}, "Which barrel layers to mask out, goes from 0 to N-1"} |
|
private |
Definition at line 67 of file SCT_ModuleVetoTool.h.
67{this, "LayersToMask", {}, "Which barrel layers to mask out, goes from 0 to N-1"};
◆ m_localCondData
◆ m_maskLayers
| BooleanProperty SCT_ModuleVetoTool::m_maskLayers {this, "MaskLayers", false, "Mask full layers/disks in overlay"} |
|
private |
Definition at line 65 of file SCT_ModuleVetoTool.h.
65{this, "MaskLayers", false, "Mask full layers/disks in overlay"};
◆ m_maskSide
| IntegerProperty SCT_ModuleVetoTool::m_maskSide {this, "MaskSide", -1, "Mask full modules (-1), inner (0) or outer (1) sides"} |
|
private |
Definition at line 66 of file SCT_ModuleVetoTool.h.
66{this, "MaskSide", -1, "Mask full modules (-1), inner (0) or outer (1) sides"};
◆ m_pHelper
| const SCT_ID* SCT_ModuleVetoTool::m_pHelper {nullptr} |
|
private |
◆ m_useDatabase
| bool SCT_ModuleVetoTool::m_useDatabase {false} |
|
private |
The documentation for this class was generated from the following files: