ATLAS Offline Software
SCT_FlaggedConditionTool.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 /*
8  * @file SCT_FlaggedConditionTool.h
9  * header file for tool allowing one to flag modules as 'bad' with a reason
10  * @author gwilliam@mail.cern.ch
11  */
12 
13 #ifndef SCT_FlaggedConditionTool_h
14 #define SCT_FlaggedConditionTool_h
15 
16 // Athena
21 
22 // STL
23 #include <atomic>
24 
25 // Forward declarations
26 class SCT_ID;
27 
28 /*
29  * @class SCT_FlaggedConditionTool
30  * Service allowing one to flag detector elements as 'bad' with a reason
31  */
32 
33 class SCT_FlaggedConditionTool: public extends<AthAlgTool, ISCT_FlaggedConditionTool> {
34 
35 public:
36  //@name Tool methods
38  SCT_FlaggedConditionTool(const std::string& type, const std::string& name, const IInterface* parent);
39  virtual ~SCT_FlaggedConditionTool() = default;
40  virtual StatusCode initialize() override;
41  virtual StatusCode finalize() override;
43 
45  virtual bool canReportAbout(InDetConditions::Hierarchy h) const override;
46 
48  virtual bool isGood(const Identifier& elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override;
49  virtual bool isGood(const Identifier& elementId, const EventContext& ctx, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override;
50  virtual bool isGood(const IdentifierHash& hashId) const override;
51  virtual bool isGood(const IdentifierHash& hashId, const EventContext& ctx) const override;
52  virtual void getDetectorElementStatus(const EventContext& ctx, InDet::SiDetectorElementStatus &element_status,
54 
56  virtual const std::string& details(const Identifier& id) const override;
57  virtual const std::string& details(const Identifier& id, const EventContext& ctx) const override;
59  virtual const std::string& details(const IdentifierHash& id) const override;
60  virtual const std::string& details(const IdentifierHash& id, const EventContext& ctx) const override;
61 
63  virtual int numBadIds() const override;
64  virtual int numBadIds(const EventContext& ctx) const override;
65 
67  virtual const IDCInDetBSErrContainer* getBadIds() const override;
68  virtual const IDCInDetBSErrContainer* getBadIds(const EventContext& ctx) const override;
69 
70  private:
71  // SCT_FlaggedCondData created by SCT_Clusterization
72  // SCT_FlaggedCondData_TRIG created by SCT_TrgClusterization for InDetTrigInDetSCT_FlaggedConditionTool
73  SG::ReadHandleKey<IDCInDetBSErrContainer> m_badIds{this, "SCT_FlaggedCondData", "SCT_FlaggedCondData", "SCT flagged conditions data"};
74 
75  UnsignedIntegerProperty m_maxNumWarnForFailures{this, "MaxNumWarnForFailures", 5};
76  mutable std::atomic_uint m_numWarnForFailures{0};
77 
78  const SCT_ID* m_sctID{nullptr};
79 
80  const IDCInDetBSErrContainer* getCondData(const EventContext& ctx) const;
81 };
82 
83 #endif // SCT_FlaggedConditionTool_h
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SCT_FlaggedConditionTool::m_sctID
const SCT_ID * m_sctID
ID helper for SCT.
Definition: SCT_FlaggedConditionTool.h:78
SCT_FlaggedConditionTool::m_numWarnForFailures
std::atomic_uint m_numWarnForFailures
Definition: SCT_FlaggedConditionTool.h:76
ISCT_FlaggedConditionTool.h
SCT_FlaggedConditionTool::getDetectorElementStatus
virtual void getDetectorElementStatus(const EventContext &ctx, InDet::SiDetectorElementStatus &element_status, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const override
Definition: SCT_FlaggedConditionTool.cxx:74
IDCInDetBSErrContainer
IDC like storage for BS errors, TODO, customise implementation further so that we store int rather th...
Definition: IDCInDetBSErrContainer.h:19
SCT_FlaggedConditionTool::finalize
virtual StatusCode finalize() override
Definition: SCT_FlaggedConditionTool.cxx:35
InDetConditions::Hierarchy
Hierarchy
Definition: InDetHierarchy.h:14
SG::ReadHandleKey< IDCInDetBSErrContainer >
SCT_FlaggedConditionTool::isGood
virtual bool isGood(const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override
Is the detector element good?
Definition: SCT_FlaggedConditionTool.cxx:51
SCT_FlaggedConditionTool::getCondData
const IDCInDetBSErrContainer * getCondData(const EventContext &ctx) const
Definition: SCT_FlaggedConditionTool.cxx:185
SCT_FlaggedConditionTool::m_maxNumWarnForFailures
UnsignedIntegerProperty m_maxNumWarnForFailures
Definition: SCT_FlaggedConditionTool.h:75
SCT_FlaggedConditionTool
Definition: SCT_FlaggedConditionTool.h:33
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDetHierarchy.h
SCT_FlaggedConditionTool::numBadIds
virtual int numBadIds() const override
Get number flagged as bad (per event)
Definition: SCT_FlaggedConditionTool.cxx:171
SCT_FlaggedConditionTool::initialize
virtual StatusCode initialize() override
Definition: SCT_FlaggedConditionTool.cxx:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
h
SCT_ID
Definition: SCT_ID.h:68
SCT_FlaggedConditionTool::details
virtual const std::string & details(const Identifier &id) const override
Get the reason why the wafer is bad (by Identifier)
Definition: SCT_FlaggedConditionTool.cxx:150
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SCT_FlaggedConditionTool::m_badIds
SG::ReadHandleKey< IDCInDetBSErrContainer > m_badIds
Definition: SCT_FlaggedConditionTool.h:73
SCT_FlaggedConditionTool::SCT_FlaggedConditionTool
SCT_FlaggedConditionTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SCT_FlaggedConditionTool.cxx:14
SCT_FlaggedConditionTool::getBadIds
virtual const IDCInDetBSErrContainer * getBadIds() const override
Get IdentifierHashs ofwafers flagged as bad + reason (per event)
Definition: SCT_FlaggedConditionTool.cxx:180
SCT_FlaggedConditionTool::~SCT_FlaggedConditionTool
virtual ~SCT_FlaggedConditionTool()=default
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
InDetConditions::DEFAULT
@ DEFAULT
Definition: InDetHierarchy.h:14
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
SCT_FlaggedConditionTool::canReportAbout
virtual bool canReportAbout(InDetConditions::Hierarchy h) const override
Can the tool report about the given component? (chip, module...)
Definition: SCT_FlaggedConditionTool.cxx:40
Identifier
Definition: IdentifierFieldParser.cxx:14