ATLAS Offline Software
SCT_ConfigurationConditionsTool.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 
13 #ifndef SCT_ConfigurationConditionsTool_h
14 #define SCT_ConfigurationConditionsTool_h
15 
16 // Athena includes
19 
23 
24 // Gaudi includes
25 #include "GaudiKernel/ToolHandle.h"
26 #include "GaudiKernel/EventContext.h"
27 #include "GaudiKernel/ContextSpecificPtr.h"
28 
29 // STL includes
30 #include <string>
31 
32 // Forward declarations
33 class SCT_ID;
34 
41 class SCT_ConfigurationConditionsTool: public extends<AthAlgTool, ISCT_ConfigurationConditionsTool> {
42  public:
43 
44  //@name Tool methods
46  SCT_ConfigurationConditionsTool(const std::string& type, const std::string& name, const IInterface* parent);
47  virtual ~SCT_ConfigurationConditionsTool() = default;
48  virtual StatusCode initialize() override;
50 
52  virtual bool canReportAbout(InDetConditions::Hierarchy h) const override;
53 
55  virtual bool isGood(const Identifier& elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override;
56  virtual bool isGood(const Identifier& elementId, const EventContext& ctx, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override;
57 
59  virtual bool isGood(const IdentifierHash& hashId) const override;
60  virtual bool isGood(const IdentifierHash& hashId, const EventContext& ctx) const override;
61 
62  virtual void getDetectorElementStatus(const EventContext& ctx, InDet::SiDetectorElementStatus &element_status,
64 
66  virtual const std::set<Identifier>* badModules(const EventContext& ctx) const override;
67  virtual const std::set<Identifier>* badModules() const override;
69  virtual void badStrips(std::set<Identifier>& strips, const EventContext& ctx, bool ignoreBadModules=false, bool ignoreBadChips=false) const override;
70  virtual void badStrips(std::set<Identifier>& strips, bool ignoreBadModules=false, bool ignoreBadChips=false) const override;
72  virtual void badStrips(const Identifier& moduleId, std::set<Identifier>& strips, const EventContext& ctx, bool ignoreBadModules=false, bool ignoreBadChips=false) const override;
73  virtual void badStrips(const Identifier& moduleId, std::set<Identifier>& strips, bool ignoreBadModules=false, bool ignoreBadChips=false) const override;
75  virtual std::pair<bool, bool> badLinks(const IdentifierHash& hash, const EventContext& ctx) const override;
76  virtual std::pair<bool, bool> badLinks(const IdentifierHash& hash) const override;
78  virtual const std::map<IdentifierHash, std::pair<bool, bool>>* badLinks(const EventContext& ctx) const override;
79  virtual const std::map<IdentifierHash, std::pair<bool, bool>>* badLinks() const override;
81  virtual const std::map<Identifier, unsigned int>* badChips(const EventContext& ctx) const override;
82  virtual const std::map<Identifier, unsigned int>* badChips() const override;
84  virtual unsigned int badChips(const Identifier& moduleId, const EventContext& ctx) const override;
85  virtual unsigned int badChips(const Identifier& moduleId) const override;
87  virtual int getChip(const Identifier& stripId, const EventContext& ctx) const override;
88  virtual int getChip(const Identifier& stripId) const override;
89 
90  private:
91  SG::ReadCondHandleKey<SCT_ConfigurationCondData> m_condKey{this, "CondKey", "SCT_ConfigurationCondData", "SCT DAQ configuration"};
92  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
93 
94  const SCT_ID* m_pHelper{nullptr};
95  BooleanProperty m_checkStripsInsideModules{this, "checkStripsInsideModule", true, " Do we want to check if a strip is bad because it is inside a bad module"};
96 
98  bool isStripInBadModule(const Identifier& stripId, const SCT_ConfigurationCondData*) const;
100  bool isWaferInBadModule(const Identifier& waferId, const EventContext& ctx) const;
101 
103  bool isGoodChip(const Identifier& stripId, const EventContext& ctx) const;
104 
107 
108  const SCT_ConfigurationCondData* getCondData(const EventContext& ctx) const;
109  const InDetDD::SiDetectorElement* getDetectorElement(const IdentifierHash& waferHash, const EventContext& ctx) const;
110 };
111 
112 #endif // SCT_ConfigurationConditionsTool_h
SCT_ConfigurationConditionsTool::badModules
virtual const std::set< Identifier > * badModules() const override
Definition: SCT_ConfigurationConditionsTool.cxx:262
SCT_ConfigurationConditionsTool::isStripInBadModule
bool isStripInBadModule(const Identifier &stripId, const SCT_ConfigurationCondData *) const
Is a strip within a bad module.
Definition: SCT_ConfigurationConditionsTool.cxx:213
SCT_ConfigurationConditionsTool::stripsPerChip
@ stripsPerChip
Definition: SCT_ConfigurationConditionsTool.h:106
SCT_ConfigurationConditionsTool::badStrips
virtual void badStrips(std::set< Identifier > &strips, const EventContext &ctx, bool ignoreBadModules=false, bool ignoreBadChips=false) const override
List of bad strips.
Definition: SCT_ConfigurationConditionsTool.cxx:361
SCT_ConfigurationConditionsTool::getCondData
const SCT_ConfigurationCondData * getCondData(const EventContext &ctx) const
Definition: SCT_ConfigurationConditionsTool.cxx:398
SCT_ConfigurationConditionsTool::getDetectorElementStatus
virtual void getDetectorElementStatus(const EventContext &ctx, InDet::SiDetectorElementStatus &element_status, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const override
Definition: SCT_ConfigurationConditionsTool.cxx:72
InDetConditions::Hierarchy
Hierarchy
Definition: InDetHierarchy.h:14
SCT_ConfigurationConditionsTool::badLinks
virtual const std::map< IdentifierHash, std::pair< bool, bool > > * badLinks() const override
Definition: SCT_ConfigurationConditionsTool.cxx:325
SCT_ConfigurationConditionsTool::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: SCT_ConfigurationConditionsTool.h:92
SCT_ConfigurationConditionsTool::isGood
virtual bool isGood(const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override
Is the detector element good?
Definition: SCT_ConfigurationConditionsTool.cxx:155
SCT_ConfigurationConditionsTool::badChips
virtual const std::map< Identifier, unsigned int > * badChips() const override
Definition: SCT_ConfigurationConditionsTool.cxx:340
SCT_ConfigurationCondData.h
SCT_ConfigurationConditionsTool::m_checkStripsInsideModules
BooleanProperty m_checkStripsInsideModules
Definition: SCT_ConfigurationConditionsTool.h:95
SCT_ConfigurationConditionsTool::getDetectorElement
const InDetDD::SiDetectorElement * getDetectorElement(const IdentifierHash &waferHash, const EventContext &ctx) const
Definition: SCT_ConfigurationConditionsTool.cxx:403
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
SCT_ConfigurationConditionsTool::isGoodChip
bool isGoodChip(const Identifier &stripId, const EventContext &ctx) const
Is a chip with this Identifier good?
Definition: SCT_ConfigurationConditionsTool.cxx:173
SCT_ConfigurationConditionsTool::SCT_ConfigurationConditionsTool
SCT_ConfigurationConditionsTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SCT_ConfigurationConditionsTool.cxx:18
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SCT_ConfigurationConditionsTool::invalidChipNumber
@ invalidChipNumber
Definition: SCT_ConfigurationConditionsTool.h:106
AthAlgTool.h
SCT_ConfigurationConditionsTool::m_pHelper
const SCT_ID * m_pHelper
ID helper for SCT.
Definition: SCT_ConfigurationConditionsTool.h:94
test_pyathena.parent
parent
Definition: test_pyathena.py:15
SCT_ConfigurationCondData
Class for data object used in SCT_ConfigurationCondAlg and SCT_ConfigurationConditionsTool.
Definition: SCT_ConfigurationCondData.h:30
SCT_ConfigurationConditionsTool::initialize
virtual StatusCode initialize() override
Definition: SCT_ConfigurationConditionsTool.cxx:24
ReadCondHandleKey.h
SCT_ConfigurationConditionsTool
Definition: SCT_ConfigurationConditionsTool.h:41
SCT_ConfigurationConditionsTool::isWaferInBadModule
bool isWaferInBadModule(const Identifier &waferId, const EventContext &ctx) const
Is a wafer in a bad module.
Definition: SCT_ConfigurationConditionsTool.cxx:224
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SiDetectorElementCollection.h
SCT_ConfigurationConditionsTool::getChip
virtual int getChip(const Identifier &stripId, const EventContext &ctx) const override
Get the chip number containing a particular strip.
Definition: SCT_ConfigurationConditionsTool.cxx:236
ISCT_ConfigurationConditionsTool.h
SG::ReadCondHandleKey< SCT_ConfigurationCondData >
h
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
SCT_ID
Definition: SCT_ID.h:68
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SCT_ConfigurationConditionsTool::m_condKey
SG::ReadCondHandleKey< SCT_ConfigurationCondData > m_condKey
Definition: SCT_ConfigurationConditionsTool.h:91
SCT_ConfigurationConditionsTool::canReportAbout
virtual bool canReportAbout(InDetConditions::Hierarchy h) const override
Can the tool report about the given component? (chip, module...)
Definition: SCT_ConfigurationConditionsTool.cxx:37
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
SCT_ConfigurationConditionsTool::lastStrip
@ lastStrip
Definition: SCT_ConfigurationConditionsTool.h:106
InDetConditions::DEFAULT
@ DEFAULT
Definition: InDetHierarchy.h:14
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
SCT_ConfigurationConditionsTool::~SCT_ConfigurationConditionsTool
virtual ~SCT_ConfigurationConditionsTool()=default
Identifier
Definition: IdentifierFieldParser.cxx:14