Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SCT_StripVetoTool Class Reference

#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...) More...
 
virtual bool isGood (const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::SCT_STRIP) const override
 Is the detector element good? More...
 
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 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

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 }

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

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

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

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

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


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SCT_StripVetoTool::m_badIds
std::set< Identifier > m_badIds
Definition: SCT_StripVetoTool.h:59
SCT_StripVetoTool::fillData
StatusCode fillData()
Definition: SCT_StripVetoTool.cxx:82
SCT_StripVetoTool::canReportAbout
virtual bool canReportAbout(InDetConditions::Hierarchy h) const override
Can the service report about the given component? (chip, module...)
Definition: SCT_StripVetoTool.cxx:50
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SCT_StripVetoTool::m_badElements
StringArrayProperty m_badElements
Definition: SCT_StripVetoTool.h:58
test_pyathena.parent
parent
Definition: test_pyathena.py:15
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
SCT_StripVetoTool::isGood
virtual bool isGood(const Identifier &elementId, InDetConditions::Hierarchy h=InDetConditions::SCT_STRIP) const override
Is the detector element good?
Definition: SCT_StripVetoTool.cxx:55
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
SCT_StripVetoTool::m_pHelper
const SCT_ID * m_pHelper
Definition: SCT_StripVetoTool.h:60
h
Identifier::value_type
unsigned long long value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:27
InDetConditions::SCT_STRIP
@ SCT_STRIP
Definition: InDetHierarchy.h:14
Identifier
Definition: IdentifierFieldParser.cxx:14