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

Service allowing one to manually declare detector strips as 'bad' in the joboptions file. More...

#include <SCT_StripVetoTool.h>

Inheritance diagram for SCT_StripVetoTool:
Collaboration diagram for SCT_StripVetoTool:

Public Member Functions

 SCT_StripVetoTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~SCT_StripVetoTool ()=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::SCT_STRIP) const override
 Is the detector element good?
virtual bool isGood (const Identifier &elementId, const EventContext &ctx, InDetConditions::Hierarchy h=InDetConditions::SCT_STRIP) 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

Private Member Functions

StatusCode fillData ()

Private Attributes

StringArrayProperty m_badElements {this, "BadStripIdentifiers", {}, "list of bad detector elements (= strips). Identifiers should be given as strings and decimal."}
std::set< Identifierm_badIds
const SCT_IDm_pHelper {nullptr}

Detailed Description

Service allowing one to manually declare detector strips as 'bad' in the joboptions file.

Definition at line 32 of file SCT_StripVetoTool.h.

Constructor & Destructor Documentation

◆ SCT_StripVetoTool()

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

Definition at line 21 of file SCT_StripVetoTool.cxx.

21 :
22 base_class(type, name, parent) {
23}

◆ ~SCT_StripVetoTool()

virtual SCT_StripVetoTool::~SCT_StripVetoTool ( )
virtualdefault

Member Function Documentation

◆ canReportAbout()

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

Can the service report about the given component? (chip, module...)

Definition at line 50 of file SCT_StripVetoTool.cxx.

50 {
51 return (h==InDetConditions::SCT_STRIP); //default case is the side, which we cant report on
52}

◆ fillData()

StatusCode SCT_StripVetoTool::fillData ( )
private

Definition at line 82 of file SCT_StripVetoTool.cxx.

82 {
83 if (m_badElements.value().empty()) ATH_MSG_INFO("No bad strips.");
84 std::vector<std::string>::const_iterator pId{m_badElements.value().begin()};
85 std::vector<std::string>::const_iterator last{m_badElements.value().end()};
86 bool success{true};
87 for(; pId not_eq last; ++pId) {
88 success &= m_badIds.insert(Identifier(static_cast<Identifier::value_type>(atoll(pId->c_str())))).second;
89 }
90 return (success ? StatusCode::SUCCESS : StatusCode::FAILURE);
91}
#define ATH_MSG_INFO(x)
StringArrayProperty m_badElements
std::set< Identifier > m_badIds

◆ finalize()

StatusCode SCT_StripVetoTool::finalize ( )
overridevirtual

Definition at line 45 of file SCT_StripVetoTool.cxx.

45 {
46 return StatusCode::SUCCESS;
47}

◆ getDetectorElementStatus()

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

Definition at line 77 of file SCT_StripVetoTool.cxx.

77{ }

◆ initialize()

StatusCode SCT_StripVetoTool::initialize ( )
overridevirtual

Definition at line 27 of file SCT_StripVetoTool.cxx.

27 {
28 if (fillData().isFailure()) {
29 ATH_MSG_ERROR("Failed to fill data");
30 return StatusCode::FAILURE;
31 }
32
33 ATH_MSG_INFO("Initialized SCT_StripVetoTool with " << m_badElements.value().size() << " elements declared bad.");
34
35 if (detStore()->retrieve(m_pHelper, "SCT_ID").isFailure()) {
36 ATH_MSG_ERROR("SCT helper failed to retrieve");
37 return StatusCode::FAILURE;
38 }
39
40 return StatusCode::SUCCESS;
41}
#define ATH_MSG_ERROR(x)
const SCT_ID * m_pHelper
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ isGood() [1/4]

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

Definition at line 61 of file SCT_StripVetoTool.cxx.

61 {
62 return isGood(elementId, h);
63}
virtual bool isGood(const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::SCT_STRIP) const override
Is the detector element good?

◆ isGood() [2/4]

bool SCT_StripVetoTool::isGood ( const Identifier & elementId,
InDetConditions::Hierarchy h = InDetConditions::SCT_STRIP ) const
overridevirtual

Is the detector element good?

Definition at line 55 of file SCT_StripVetoTool.cxx.

55 {
56 if (not canReportAbout(h)) return true;
57 return (m_badIds.find(elementId) == m_badIds.end());
58}
virtual bool canReportAbout(InDetConditions::Hierarchy h) const override
Can the service report about the given component? (chip, module...)

◆ isGood() [3/4]

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

is it good?, using wafer hash

Definition at line 66 of file SCT_StripVetoTool.cxx.

66 { //comment out unused parameter to prevent compiler warning
67 return true; //cant answer questions about the module side
68}

◆ isGood() [4/4]

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

Definition at line 71 of file SCT_StripVetoTool.cxx.

71 {
72 return isGood(hashId);
73}

Member Data Documentation

◆ m_badElements

StringArrayProperty SCT_StripVetoTool::m_badElements {this, "BadStripIdentifiers", {}, "list of bad detector elements (= strips). Identifiers should be given as strings and decimal."}
private

Definition at line 58 of file SCT_StripVetoTool.h.

58{this, "BadStripIdentifiers", {}, "list of bad detector elements (= strips). Identifiers should be given as strings and decimal."};

◆ m_badIds

std::set<Identifier> SCT_StripVetoTool::m_badIds
private

Definition at line 59 of file SCT_StripVetoTool.h.

◆ m_pHelper

const SCT_ID* SCT_StripVetoTool::m_pHelper {nullptr}
private

Definition at line 60 of file SCT_StripVetoTool.h.

60{nullptr};

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