ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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? (chip, module...) More...
 
virtual bool isGood (const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override
 Is the detector element good? More...
 
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. More...
 
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. More...
 
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.

34  {
36 }

◆ getCondData()

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

Definition at line 91 of file SCT_LinkMaskingTool.cxx.

91  {
93  return condData.retrieve();
94 }

◆ 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  {
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 }

◆ 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
29 
30  return StatusCode::SUCCESS;
31 }

◆ 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 }

◆ 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 }

◆ 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.

◆ m_sctHelper

const SCT_ID* SCT_LinkMaskingTool::m_sctHelper {nullptr}
private

ID helper for SCT.

Definition at line 57 of file SCT_LinkMaskingTool.h.


The documentation for this class was generated from the following files:
SCT_LinkMaskingTool::m_sctHelper
const SCT_ID * m_sctHelper
ID helper for SCT.
Definition: SCT_LinkMaskingTool.h:57
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
InDet::SiDetectorElementStatus::getElementStatus
const std::vector< bool > & getElementStatus() const
Definition: SiDetectorElementStatus.h:116
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
SCT_LinkMaskingTool::isGood
virtual bool isGood(const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override
Is the detector element good?
Definition: SCT_LinkMaskingTool.cxx:50
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SCT_LinkMaskingTool::m_condKey
SG::ReadCondHandleKey< SCT_ModuleVetoCondData > m_condKey
Definition: SCT_LinkMaskingTool.h:60
SCT_ModuleVetoCondData
Class for data object used in SCT_ModuleVetoCondAlg, SCT_LinkMaskingCondAlg, SCT_ModuleVetoTool,...
Definition: SCT_ModuleVetoCondData.h:27
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SCT_ID::wafer_hash
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
Definition: SCT_ID.h:492
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SCT_ID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: SCT_ID.cxx:645
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
h
SCT_LinkMaskingTool::getCondData
const SCT_ModuleVetoCondData * getCondData(const EventContext &ctx) const
Definition: SCT_LinkMaskingTool.cxx:91
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
merge.status
status
Definition: merge.py:17
SCT_ID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition: SCT_ID.h:464
InDetConditions::SCT_SIDE
@ SCT_SIDE
Definition: InDetHierarchy.h:14
InDetConditions::DEFAULT
@ DEFAULT
Definition: InDetHierarchy.h:14
SCT_LinkMaskingTool::canReportAbout
virtual bool canReportAbout(InDetConditions::Hierarchy h) const override
Can the service report about the given component? (chip, module...)
Definition: SCT_LinkMaskingTool.cxx:34
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition: WriteCondHandle.h:275
Identifier
Definition: IdentifierFieldParser.cxx:14