ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SCT_ConditionsSummaryTool Class Reference

#include <SCT_ConditionsSummaryTool.h>

Inheritance diagram for SCT_ConditionsSummaryTool:
Collaboration diagram for SCT_ConditionsSummaryTool:

Public Member Functions

 SCT_ConditionsSummaryTool (const std::string &type, const std::string &name, const IInterface *parent)
 Tool constructor. More...
 
virtual ~SCT_ConditionsSummaryTool ()=default
 
virtual StatusCode initialize () override
 Tool init. More...
 
virtual bool isActive (const Identifier &elementId, const InDetConditions::Hierarchy h, const EventContext &ctx) const override
 
virtual bool isActive (const IdentifierHash &elementHash, const EventContext &ctx) const override
 
virtual bool isActive (const IdentifierHash &elementHash, const Identifier &elementId, const EventContext &ctx) const override
 
virtual double activeFraction (const IdentifierHash &elementHash, const Identifier &idStart, const Identifier &idEnd, const EventContext &ctx) const override
 
virtual bool isGood (const Identifier &elementId, const InDetConditions::Hierarchy h, const EventContext &ctx) const override
 
virtual bool isGood (const IdentifierHash &elementHash, const EventContext &ctx) const override
 
virtual bool isGood (const IdentifierHash &elementHash, const Identifier &elementId, const EventContext &ctx) const override
 
virtual double goodFraction (const IdentifierHash &elementHash, const Identifier &idStart, const Identifier &idEnd, const EventContext &ctx) const override
 
virtual std::unique_ptr< InDet::SiDetectorElementStatusgetDetectorElementStatus (const EventContext &ctx, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const override
 
virtual bool hasBSError (const IdentifierHash &elementHash, const EventContext &ctx) const override
 
virtual bool hasBSError (const IdentifierHash &elementHash, Identifier elementId, const EventContext &ctx) const override
 
virtual uint64_t getBSErrorWord (const IdentifierHash &moduleHash, const EventContext &ctx) const override
 
virtual uint64_t getBSErrorWord (const IdentifierHash &moduleHash, const int index, const EventContext &ctx) const override
 

Private Member Functions

std::unique_ptr< InDet::SiDetectorElementStatuscreateDetectorElementStatus (const EventContext &ctx, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const
 

Private Attributes

ToolHandleArray< ISCT_ConditionsToolm_toolHandles {this, "ConditionsTools", {},""}
 
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_SCTDetEleCollKey {this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}
 
SG::ReadHandleKey< InDet::SiDetectorElementStatusm_SCTDetElStatusEventKey {this, "SCTDetElStatusEventDataBaseKey", "", "Optional event data key of an input SiDetectorElementStatus on which the newly created object will be based."}
 
SG::ReadCondHandleKey< InDet::SiDetectorElementStatusm_SCTDetElStatusCondKey {this, "SCTDetElStatusCondDataBaseKey", "" , "Optional conditions data key of an input SiDetectorElementStatus on which the newly created object will be based."}
 
const SCT_IDm_id_sct {nullptr}
 Handle to SCT ID helper. More...
 
bool m_noReports {true}
 

Detailed Description

Interface class for tool providing summary of status of an SCT detector element

Definition at line 38 of file SCT_ConditionsSummaryTool.h.

Constructor & Destructor Documentation

◆ SCT_ConditionsSummaryTool()

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

Tool constructor.

Definition at line 19 of file SCT_ConditionsSummaryTool.cxx.

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

◆ ~SCT_ConditionsSummaryTool()

virtual SCT_ConditionsSummaryTool::~SCT_ConditionsSummaryTool ( )
virtualdefault

Member Function Documentation

◆ activeFraction()

double SCT_ConditionsSummaryTool::activeFraction ( const IdentifierHash elementHash,
const Identifier idStart,
const Identifier idEnd,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 45 of file SCT_ConditionsSummaryTool.cxx.

45  {
46  return goodFraction(elementHash, idStart, idEnd, ctx);
47 }

◆ createDetectorElementStatus()

std::unique_ptr< InDet::SiDetectorElementStatus > SCT_ConditionsSummaryTool::createDetectorElementStatus ( const EventContext &  ctx,
SG::WriteCondHandle< InDet::SiDetectorElementStatus > *  whandle 
) const
private

Definition at line 98 of file SCT_ConditionsSummaryTool.cxx.

99  {
100  std::string tool_name (name());
101  (void) tool_name;
104  if (whandle) {
105  whandle->addDependency (input_element_status);
106  }
107  return std::make_unique<InDet::SCT_DetectorElementStatus>(*castToDerived(input_element_status.cptr()));
108  }
109  else if (!m_SCTDetElStatusEventKey.empty()) {
111  std::string key (m_SCTDetElStatusEventKey.key());
112  (void) key;
113  return std::make_unique<InDet::SCT_DetectorElementStatus>(*castToDerived(input_element_status.cptr()));
114  }
115  else {
117  if (whandle) {
118  whandle->addDependency (sctDetEleHandle);
119  }
120  const InDetDD::SiDetectorElementCollection* elements(*sctDetEleHandle);
121  return std::make_unique<InDet::SCT_DetectorElementStatus>(*elements);
122  }
123 }

◆ getBSErrorWord() [1/2]

uint64_t SCT_ConditionsSummaryTool::getBSErrorWord ( const IdentifierHash moduleHash,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 173 of file SCT_ConditionsSummaryTool.cxx.

173  {
174  ATH_MSG_WARNING("getBSErrorWord() is not implemented for SCT_ConditionsSummaryTool");
175  return 0;
176 }

◆ getBSErrorWord() [2/2]

uint64_t SCT_ConditionsSummaryTool::getBSErrorWord ( const IdentifierHash moduleHash,
const int  index,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 179 of file SCT_ConditionsSummaryTool.cxx.

179  {
180  ATH_MSG_WARNING("getBSErrorWord() is not implemented for SCT_ConditionsSummaryTool");
181  return 0;
182 }

◆ getDetectorElementStatus()

std::unique_ptr< InDet::SiDetectorElementStatus > SCT_ConditionsSummaryTool::getDetectorElementStatus ( const EventContext &  ctx,
SG::WriteCondHandle< InDet::SiDetectorElementStatus > *  whandle 
) const
overridevirtual

Definition at line 126 of file SCT_ConditionsSummaryTool.cxx.

127  {
128  std::unique_ptr<InDet::SiDetectorElementStatus>
129  element_status( createDetectorElementStatus(ctx, whandle) );
130  if (not m_noReports) {
131  for (const ToolHandle<ISCT_ConditionsTool>& tool: m_toolHandles) {
132  // @TODO also check if it can report about chips ?
133  if ((tool->canReportAbout(InDetConditions::SCT_SIDE) or
134  tool->canReportAbout(InDetConditions::SCT_MODULE) or
135  tool->canReportAbout(InDetConditions::SCT_STRIP))) {
136  tool->getDetectorElementStatus(ctx,*element_status,whandle);
137  }
138  }
139  }
140  return element_status;
141 }

◆ goodFraction()

double SCT_ConditionsSummaryTool::goodFraction ( const IdentifierHash elementHash,
const Identifier idStart,
const Identifier idEnd,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 154 of file SCT_ConditionsSummaryTool.cxx.

154  {
155  double result{1.0};
156  ATH_MSG_WARNING("goodFraction is a deprecated function always returning 1.0 ");
157  return result;
158 }

◆ hasBSError() [1/2]

bool SCT_ConditionsSummaryTool::hasBSError ( const IdentifierHash elementHash,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 161 of file SCT_ConditionsSummaryTool.cxx.

161  {
162  ATH_MSG_WARNING("hasBSError() is not implemented for SCT_ConditionsSummaryTool");
163  return true;
164 }

◆ hasBSError() [2/2]

bool SCT_ConditionsSummaryTool::hasBSError ( const IdentifierHash elementHash,
Identifier  elementId,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 167 of file SCT_ConditionsSummaryTool.cxx.

167  {
168  ATH_MSG_WARNING("hasBSError() is not implemented for SCT_ConditionsSummaryTool");
169  return true;
170 }

◆ initialize()

StatusCode SCT_ConditionsSummaryTool::initialize ( )
overridevirtual

Tool init.

Definition at line 26 of file SCT_ConditionsSummaryTool.cxx.

26  {
27  StatusCode sc{m_toolHandles.retrieve()};
28  if (sc.isFailure()) {
29  ATH_MSG_ERROR("Retrieval of ToolHandleArray<ISCT_ConditionsTool> failed.");
30  return sc;
31  }
34  ATH_MSG_FATAL("The event data (SCTDetElStatusEventDataBaseKey) and cond data (SCTDetElStatusCondDataBaseKey) keys cannot be set at the same time.");
35  }
38  // Get SCT helper
39  ATH_CHECK(detStore()->retrieve(m_id_sct, "SCT_ID"));
40  m_noReports = m_toolHandles.empty();
41  return sc;
42 }

◆ isActive() [1/3]

bool SCT_ConditionsSummaryTool::isActive ( const Identifier elementId,
const InDetConditions::Hierarchy  h,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 50 of file SCT_ConditionsSummaryTool.cxx.

50  {
51  return isGood(elementId, h, ctx);
52 }

◆ isActive() [2/3]

bool SCT_ConditionsSummaryTool::isActive ( const IdentifierHash elementHash,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 55 of file SCT_ConditionsSummaryTool.cxx.

55  {
56  return isGood(elementHash, ctx);
57 }

◆ isActive() [3/3]

bool SCT_ConditionsSummaryTool::isActive ( const IdentifierHash elementHash,
const Identifier elementId,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 60 of file SCT_ConditionsSummaryTool.cxx.

60  {
61  return isGood(elementHash, elementId, ctx);
62 }

◆ isGood() [1/3]

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

Definition at line 65 of file SCT_ConditionsSummaryTool.cxx.

65  {
66  if (not m_noReports) {
67  for (const ToolHandle<ISCT_ConditionsTool>& tool: m_toolHandles) {
68  if (tool->canReportAbout(h) and (not tool->isGood(elementId, ctx, h))) return false;
69  }
70  }
71  return true;
72 }

◆ isGood() [2/3]

bool SCT_ConditionsSummaryTool::isGood ( const IdentifierHash elementHash,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 75 of file SCT_ConditionsSummaryTool.cxx.

75  {
76  if (not m_noReports) {
77  for (const ToolHandle<ISCT_ConditionsTool>& tool: m_toolHandles) {
78  if ((tool->canReportAbout(InDetConditions::SCT_SIDE) or
79  tool->canReportAbout(InDetConditions::SCT_MODULE)) and
80  (not tool->isGood(elementHash, ctx))) {
81  return false;
82  }
83  }
84  }
85  return true;
86 }

◆ isGood() [3/3]

bool SCT_ConditionsSummaryTool::isGood ( const IdentifierHash elementHash,
const Identifier elementId,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 144 of file SCT_ConditionsSummaryTool.cxx.

144  {
145  if (not m_noReports) {
146  for (const ToolHandle<ISCT_ConditionsTool>& tool: m_toolHandles) {
147  if (tool->canReportAbout(InDetConditions::SCT_STRIP) and (not tool->isGood(elementId, ctx))) return false;
148  }
149  }
150  return true;
151 }

Member Data Documentation

◆ m_id_sct

const SCT_ID* SCT_ConditionsSummaryTool::m_id_sct {nullptr}
private

Handle to SCT ID helper.

Definition at line 81 of file SCT_ConditionsSummaryTool.h.

◆ m_noReports

bool SCT_ConditionsSummaryTool::m_noReports {true}
private

Definition at line 84 of file SCT_ConditionsSummaryTool.h.

◆ m_SCTDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> SCT_ConditionsSummaryTool::m_SCTDetEleCollKey {this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}
private

Definition at line 75 of file SCT_ConditionsSummaryTool.h.

◆ m_SCTDetElStatusCondKey

SG::ReadCondHandleKey<InDet::SiDetectorElementStatus> SCT_ConditionsSummaryTool::m_SCTDetElStatusCondKey {this, "SCTDetElStatusCondDataBaseKey", "" , "Optional conditions data key of an input SiDetectorElementStatus on which the newly created object will be based."}
private

Definition at line 79 of file SCT_ConditionsSummaryTool.h.

◆ m_SCTDetElStatusEventKey

SG::ReadHandleKey<InDet::SiDetectorElementStatus> SCT_ConditionsSummaryTool::m_SCTDetElStatusEventKey {this, "SCTDetElStatusEventDataBaseKey", "", "Optional event data key of an input SiDetectorElementStatus on which the newly created object will be based."}
private

Definition at line 77 of file SCT_ConditionsSummaryTool.h.

◆ m_toolHandles

ToolHandleArray<ISCT_ConditionsTool> SCT_ConditionsSummaryTool::m_toolHandles {this, "ConditionsTools", {},""}
private

Definition at line 73 of file SCT_ConditionsSummaryTool.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_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SCT_ConditionsSummaryTool::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: SCT_ConditionsSummaryTool.h:76
SCT_ConditionsSummaryTool::m_SCTDetElStatusCondKey
SG::ReadCondHandleKey< InDet::SiDetectorElementStatus > m_SCTDetElStatusCondKey
Definition: SCT_ConditionsSummaryTool.h:80
get_generator_info.result
result
Definition: get_generator_info.py:21
SCT_ConditionsSummaryTool::isGood
virtual bool isGood(const Identifier &elementId, const InDetConditions::Hierarchy h, const EventContext &ctx) const override
Definition: SCT_ConditionsSummaryTool.cxx:65
InDetDD::SiDetectorElementCollection
Definition: SiDetectorElementCollection.h:30
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
SCT_ConditionsSummaryTool::m_id_sct
const SCT_ID * m_id_sct
Handle to SCT ID helper.
Definition: SCT_ConditionsSummaryTool.h:81
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
SCT_ConditionsSummaryTool::goodFraction
virtual double goodFraction(const IdentifierHash &elementHash, const Identifier &idStart, const Identifier &idEnd, const EventContext &ctx) const override
Definition: SCT_ConditionsSummaryTool.cxx:154
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SCT_ConditionsSummaryTool::createDetectorElementStatus
std::unique_ptr< InDet::SiDetectorElementStatus > createDetectorElementStatus(const EventContext &ctx, SG::WriteCondHandle< InDet::SiDetectorElementStatus > *whandle) const
Definition: SCT_ConditionsSummaryTool.cxx:98
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InDetConditions::SCT_MODULE
@ SCT_MODULE
Definition: InDetHierarchy.h:14
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
SCT_ConditionsSummaryTool::m_SCTDetElStatusEventKey
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_SCTDetElStatusEventKey
Definition: SCT_ConditionsSummaryTool.h:78
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SCT_ConditionsSummaryTool::m_noReports
bool m_noReports
Definition: SCT_ConditionsSummaryTool.h:84
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDetConditions::SCT_STRIP
@ SCT_STRIP
Definition: InDetHierarchy.h:14
InDetConditions::SCT_SIDE
@ SCT_SIDE
Definition: InDetHierarchy.h:14
SCT_ConditionsSummaryTool::m_toolHandles
ToolHandleArray< ISCT_ConditionsTool > m_toolHandles
Definition: SCT_ConditionsSummaryTool.h:74
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition: WriteCondHandle.h:275
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37