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

#include <SCT_MajorityConditionsTool.h>

Inheritance diagram for SCT_MajorityConditionsTool:
Collaboration diagram for SCT_MajorityConditionsTool:

Public Member Functions

 SCT_MajorityConditionsTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~SCT_MajorityConditionsTool ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual bool isGood () const override
 Is the detector good? More...
 
virtual bool isGood (const EventContext &ctx) const override
 
virtual bool isGood (int bec) const override
 Is a barrel/endcap good? More...
 
virtual bool isGood (int bec, const EventContext &ctx) const override
 

Private Member Functions

const SCT_MajorityCondDatagetCondData (const EventContext &ctx) const
 

Private Attributes

BooleanProperty m_overall {this, "UseOverall", false, "Use overall value or ECA/B/ECC"}
 
FloatProperty m_majorityFraction {this, "MajorityFraction", 0.9, "Required fraction in majority state"}
 
SG::ReadCondHandleKey< SCT_MajorityCondDatam_condKey {this, "CondKey", "SCT_MajorityCondData", "Majority of SCT status"}
 

Detailed Description

Tool which reports on whether the majority of the SCT (or component) is in LV/HV on state with at least a fraction (default 0.9) of the HV in that state

Definition at line 38 of file SCT_MajorityConditionsTool.h.

Constructor & Destructor Documentation

◆ SCT_MajorityConditionsTool()

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

Definition at line 16 of file SCT_MajorityConditionsTool.cxx.

16  :
17  base_class(type, name, parent)
18 {
19 }

◆ ~SCT_MajorityConditionsTool()

virtual SCT_MajorityConditionsTool::~SCT_MajorityConditionsTool ( )
virtualdefault

Member Function Documentation

◆ finalize()

StatusCode SCT_MajorityConditionsTool::finalize ( )
overridevirtual

Definition at line 32 of file SCT_MajorityConditionsTool.cxx.

32  {
33  ATH_MSG_INFO("Finalizing SCT_MajorityConditionsTool");
34 
35  return StatusCode::SUCCESS;
36 }

◆ getCondData()

const SCT_MajorityCondData * SCT_MajorityConditionsTool::getCondData ( const EventContext &  ctx) const
private

Definition at line 85 of file SCT_MajorityConditionsTool.cxx.

85  {
87  return condData.retrieve();
88 }

◆ initialize()

StatusCode SCT_MajorityConditionsTool::initialize ( )
overridevirtual

Definition at line 22 of file SCT_MajorityConditionsTool.cxx.

22  {
23  ATH_MSG_INFO("Initializing SCT_MajorityConditionsTool");
24 
25  // Read Cond Handle Key
27 
28  return StatusCode::SUCCESS;
29 }

◆ isGood() [1/4]

bool SCT_MajorityConditionsTool::isGood ( ) const
overridevirtual

Is the detector good?

Definition at line 53 of file SCT_MajorityConditionsTool.cxx.

53  {
54  const EventContext& ctx{Gaudi::Hive::currentContext()};
55  return isGood(ctx);
56 }

◆ isGood() [2/4]

bool SCT_MajorityConditionsTool::isGood ( const EventContext &  ctx) const
overridevirtual

Definition at line 39 of file SCT_MajorityConditionsTool.cxx.

39  {
40  const SCT_MajorityCondData* condData{getCondData(ctx)};
41  if (condData==nullptr) return false;
42 
43  if (m_overall) {
44  return (condData->getMajorityState(OVERALL) and (condData->getHVFraction(OVERALL) > m_majorityFraction));
45  } else {
46  return ((condData->getMajorityState(BARREL) and condData->getMajorityState(ECA) and condData->getMajorityState(ECC)) and
47  (condData->getHVFraction(BARREL) > m_majorityFraction) and
48  (condData->getHVFraction(ECA) > m_majorityFraction) and
49  (condData->getHVFraction(ECC) > m_majorityFraction));
50  }
51 }

◆ isGood() [3/4]

bool SCT_MajorityConditionsTool::isGood ( int  bec) const
overridevirtual

Is a barrel/endcap good?

Definition at line 80 of file SCT_MajorityConditionsTool.cxx.

80  {
81  const EventContext& ctx{Gaudi::Hive::currentContext()};
82  return isGood(bec, ctx);
83 }

◆ isGood() [4/4]

bool SCT_MajorityConditionsTool::isGood ( int  bec,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 59 of file SCT_MajorityConditionsTool.cxx.

59  {
60  const SCT_MajorityCondData* condData{getCondData(ctx)};
61  if (condData==nullptr) return false;
62 
63  bool result{true};
64 
65  // Check numbering
66 
67  if (bec == bec_BARREL) {
68  result = (condData->getMajorityState(BARREL) and (condData->getHVFraction(BARREL) > m_majorityFraction));
69  } else if (bec == bec_ECC) {
70  result = (condData->getMajorityState(ECC) and (condData->getHVFraction(ECC) > m_majorityFraction));
71  } else if (bec == bec_ECA) {
72  result = (condData->getMajorityState(ECA) and (condData->getHVFraction(ECA) > m_majorityFraction));
73  } else {
74  ATH_MSG_WARNING("Unrecognised BEC " << bec);
75  }
76 
77  return result;
78 }

Member Data Documentation

◆ m_condKey

SG::ReadCondHandleKey<SCT_MajorityCondData> SCT_MajorityConditionsTool::m_condKey {this, "CondKey", "SCT_MajorityCondData", "Majority of SCT status"}
private

Definition at line 61 of file SCT_MajorityConditionsTool.h.

◆ m_majorityFraction

FloatProperty SCT_MajorityConditionsTool::m_majorityFraction {this, "MajorityFraction", 0.9, "Required fraction in majority state"}
private

Definition at line 59 of file SCT_MajorityConditionsTool.h.

◆ m_overall

BooleanProperty SCT_MajorityConditionsTool::m_overall {this, "UseOverall", false, "Use overall value or ECA/B/ECC"}
private

Definition at line 58 of file SCT_MajorityConditionsTool.h.


The documentation for this class was generated from the following files:
SCT_ConditionsData::ECC
@ ECC
Definition: SCT_ConditionsParameters.h:27
SCT_MajorityConditionsTool::m_majorityFraction
FloatProperty m_majorityFraction
Definition: SCT_MajorityConditionsTool.h:59
get_generator_info.result
result
Definition: get_generator_info.py:21
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
SCT_MajorityCondData
Class for data object used in SCT_MajorityCondAlg and SCT_MajorityConditionsTool.
Definition: SCT_MajorityCondData.h:23
SCT_MajorityConditionsTool::isGood
virtual bool isGood() const override
Is the detector good?
Definition: SCT_MajorityConditionsTool.cxx:53
SCT_ConditionsData::bec_ECA
@ bec_ECA
Definition: SCT_ConditionsParameters.h:31
SCT_ConditionsData::bec_BARREL
@ bec_BARREL
Definition: SCT_ConditionsParameters.h:31
SCT_MajorityConditionsTool::m_overall
BooleanProperty m_overall
Definition: SCT_MajorityConditionsTool.h:58
SCT_ConditionsData::bec_ECC
@ bec_ECC
Definition: SCT_ConditionsParameters.h:31
SCT_ConditionsData::ECA
@ ECA
Definition: SCT_ConditionsParameters.h:26
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SCT_ConditionsData::OVERALL
@ OVERALL
Definition: SCT_ConditionsParameters.h:24
SCT_MajorityConditionsTool::getCondData
const SCT_MajorityCondData * getCondData(const EventContext &ctx) const
Definition: SCT_MajorityConditionsTool.cxx:85
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
BARREL
@ BARREL
Definition: TRTRadiatorParameters.h:10
SCT_MajorityConditionsTool::m_condKey
SG::ReadCondHandleKey< SCT_MajorityCondData > m_condKey
Definition: SCT_MajorityConditionsTool.h:61