ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_LinkMaskingTool Class Reference

#include <SCT_LinkMaskingTool.h>

Inheritance diagram for SCT_LinkMaskingTool:
Collaboration diagram for SCT_LinkMaskingTool:

Public Member Functions

 SCT_LinkMaskingTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~SCT_LinkMaskingTool ()=default
virtual StatusCode initialize () override
virtual bool canReportAbout (InDetConditions::Hierarchy h) const override
 Can the service report about the given component?
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?
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

Private Member Functions

const SCT_ModuleVetoCondDatagetCondData (const EventContext &ctx) const

Private Attributes

const SCT_IDm_sctHelper {nullptr}
 ID helper for SCT.
SG::ReadCondHandleKey< SCT_ModuleVetoCondDatam_condKey {this, "CondKey", "SCT_LinkMaskingCondData", "SCT Front End olinks to be masked"}

Detailed Description

Definition at line 33 of file SCT_LinkMaskingTool.h.

Constructor & Destructor Documentation

◆ SCT_LinkMaskingTool()

SCT_LinkMaskingTool::SCT_LinkMaskingTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 12 of file SCT_LinkMaskingTool.cxx.

12 :
13 base_class(type, name, parent)
14{
15}

◆ ~SCT_LinkMaskingTool()

virtual SCT_LinkMaskingTool::~SCT_LinkMaskingTool ( )
virtualdefault

Member Function Documentation

◆ canReportAbout()

bool SCT_LinkMaskingTool::canReportAbout ( InDetConditions::Hierarchy h) const
overridevirtual

Can the service report about the given component?

(chip, module...)

Definition at line 34 of file SCT_LinkMaskingTool.cxx.

◆ getCondData()

const SCT_ModuleVetoCondData * SCT_LinkMaskingTool::getCondData ( const EventContext & ctx) const
private

Definition at line 91 of file SCT_LinkMaskingTool.cxx.

91 {
92 SG::ReadCondHandle<SCT_ModuleVetoCondData> condData{m_condKey, ctx};
93 return condData.retrieve();
94}
SG::ReadCondHandleKey< SCT_ModuleVetoCondData > m_condKey
const_pointer_type retrieve()

◆ getDetectorElementStatus()

void SCT_LinkMaskingTool::getDetectorElementStatus ( const EventContext & ctx,
InDet::SiDetectorElementStatus & element_status,
SG::WriteCondHandle< InDet::SiDetectorElementStatus > * whandle ) const
overridevirtual

Definition at line 68 of file SCT_LinkMaskingTool.cxx.

69 {
70 SG::ReadCondHandle<SCT_ModuleVetoCondData> condDataHandle{m_condKey, ctx};
71 if (not condDataHandle.isValid()) {
72 ATH_MSG_ERROR("Failed to get " << m_condKey.key());
73 return;
74 }
75 const SCT_ModuleVetoCondData* condData{condDataHandle.cptr()};
76 if (whandle) {
77 whandle->addDependency (condDataHandle);
78 }
79 if (condData) {
80 std::vector<bool> &status = element_status.getElementStatus();
81 if (status.empty()) {
82 status.resize(m_sctHelper->wafer_hash_max(),true);
83 }
84 for (const Identifier &wafer_id: condData->badWaferIds()) {
85 status.at( m_sctHelper->wafer_hash(wafer_id) ) = false;
86 }
87 }
88}
#define ATH_MSG_ERROR(x)
const std::vector< bool > & getElementStatus() const
const SCT_ID * m_sctHelper
ID helper for SCT.
const std::set< Identifier > & badWaferIds() const
const_pointer_type cptr()
void addDependency(const EventIDRange &range)
status
Definition merge.py:16

◆ initialize()

StatusCode SCT_LinkMaskingTool::initialize ( )
overridevirtual

Definition at line 18 of file SCT_LinkMaskingTool.cxx.

18 {
19 ATH_MSG_DEBUG("Initializing configuration");
20
21 // Retrieve SCT ID helper
22 if (detStore()->retrieve(m_sctHelper, "SCT_ID").isFailure()) {
23 ATH_MSG_FATAL("Could not get SCT ID helper");
24 return StatusCode::FAILURE;
25 }
26
27 // Read Cond Handle
28 ATH_CHECK(m_condKey.initialize());
29
30 return StatusCode::SUCCESS;
31}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ isGood() [1/4]

bool SCT_LinkMaskingTool::isGood ( const Identifier & elementId,
const EventContext & ctx,
InDetConditions::Hierarchy h = InDetConditions::DEFAULT ) const
overridevirtual

Definition at line 39 of file SCT_LinkMaskingTool.cxx.

39 {
40 if (not canReportAbout(h)) return true;
41
42 const SCT_ModuleVetoCondData* condData{getCondData(ctx)};
43 // If database cannot be retrieved, all wafer IDs are good.
44 if (condData==nullptr) return true;
45
46 // Return the result of database
47 return (not condData->isBadWaferId(elementId));
48}
const SCT_ModuleVetoCondData * getCondData(const EventContext &ctx) const
virtual bool canReportAbout(InDetConditions::Hierarchy h) const override
Can the service report about the given component?
bool isBadWaferId(const Identifier waferId) const
Check if a wafer ID is bad or not.

◆ isGood() [2/4]

bool SCT_LinkMaskingTool::isGood ( const Identifier & elementId,
InDetConditions::Hierarchy h = InDetConditions::DEFAULT ) const
overridevirtual

Is the detector element good?

Definition at line 50 of file SCT_LinkMaskingTool.cxx.

50 {
51 const EventContext& ctx{Gaudi::Hive::currentContext()};
52
53 return isGood(elementId, ctx, h);
54}
virtual bool isGood(const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override
Is the detector element good?

◆ isGood() [3/4]

bool SCT_LinkMaskingTool::isGood ( const IdentifierHash & hashId) const
overridevirtual

Is it good?

, using wafer hash

Definition at line 62 of file SCT_LinkMaskingTool.cxx.

62 {
63 const EventContext& ctx{Gaudi::Hive::currentContext()};
64
65 return isGood(hashId, ctx);
66}

◆ isGood() [4/4]

bool SCT_LinkMaskingTool::isGood ( const IdentifierHash & hashId,
const EventContext & ctx ) const
overridevirtual

Definition at line 57 of file SCT_LinkMaskingTool.cxx.

57 {
58 Identifier elementId{m_sctHelper->wafer_id(hashId)};
59 return isGood(elementId, ctx, InDetConditions::SCT_SIDE);
60}

Member Data Documentation

◆ m_condKey

SG::ReadCondHandleKey<SCT_ModuleVetoCondData> SCT_LinkMaskingTool::m_condKey {this, "CondKey", "SCT_LinkMaskingCondData", "SCT Front End olinks to be masked"}
private

Definition at line 60 of file SCT_LinkMaskingTool.h.

60{this, "CondKey", "SCT_LinkMaskingCondData", "SCT Front End olinks to be masked"};

◆ m_sctHelper

const SCT_ID* SCT_LinkMaskingTool::m_sctHelper {nullptr}
private

ID helper for SCT.

Definition at line 57 of file SCT_LinkMaskingTool.h.

57{nullptr};

The documentation for this class was generated from the following files: