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

Class to give a numerical value from conditions for each detector element (module side). More...

#include <SCT_ConditionsParameterTool.h>

Inheritance diagram for SCT_ConditionsParameterTool:
Collaboration diagram for SCT_ConditionsParameterTool:

Public Member Functions

 SCT_ConditionsParameterTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor necessary for Svc factory.
virtual ~SCT_ConditionsParameterTool ()=default
 (virtual) Destructor does nothing
virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual bool available (const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Is the required parameter available?
virtual float value (const IdentifierHash &idHash, const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Give the indicated value for a module identifier hash.
virtual float validity (const IdentifierHash &idHash, const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Measure of how many valid values went to calculate it. Should be 1 but if, say, 3 chip values were valid out of 6, it could be less (0.5 in this case).
virtual bool isValid (const float parameterValue, const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Is a given value within acceptable limits?
virtual float invalid (const unsigned int iparam, const EventContext &ctx) const override
 What is the default error value for this parameter?
virtual float max (const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Maximum value read in from the database.
virtual float min (const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Minimum value read in from the database.
virtual float avg (const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Average value.
virtual float sd (const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Standard deviation.
virtual unsigned int n (const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Number of values read in.
virtual void getValues (std::vector< float > &userVector, const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Fill a user-provided vector with the values (hopefully won't be needed?).
virtual bool filled (const EventContext &ctx) const override
 Report whether the structure was filled.

Private Member Functions

const SCT_CondParameterDatagetCondData (const EventContext &ctx) const

Private Attributes

SG::ReadCondHandleKey< SCT_CondParameterDatam_condKey {this, "CondKey", "SCT_CondParameterData", "SCT parameters"}

Detailed Description

Class to give a numerical value from conditions for each detector element (module side).

Definition at line 29 of file SCT_ConditionsParameterTool.h.

Constructor & Destructor Documentation

◆ SCT_ConditionsParameterTool()

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

Constructor necessary for Svc factory.

Definition at line 15 of file SCT_ConditionsParameterTool.cxx.

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

◆ ~SCT_ConditionsParameterTool()

virtual SCT_ConditionsParameterTool::~SCT_ConditionsParameterTool ( )
virtualdefault

(virtual) Destructor does nothing

Member Function Documentation

◆ available()

bool SCT_ConditionsParameterTool::available ( const SCT_CondParameterData::ParameterIndex iparam,
const EventContext & ctx ) const
overridevirtual

Is the required parameter available?

Definition at line 35 of file SCT_ConditionsParameterTool.cxx.

◆ avg()

float SCT_ConditionsParameterTool::avg ( const SCT_CondParameterData::ParameterIndex iparam,
const EventContext & ctx ) const
overridevirtual

Average value.

Definition at line 89 of file SCT_ConditionsParameterTool.cxx.

89 {
90 const SCT_CondParameterData* data{getCondData(ctx)};
91 if (data==nullptr) return invalid(iparam, ctx);
92 return data->avg(iparam);
93}
const SCT_CondParameterData * getCondData(const EventContext &ctx) const
virtual float invalid(const unsigned int iparam, const EventContext &ctx) const override
What is the default error value for this parameter?

◆ filled()

bool SCT_ConditionsParameterTool::filled ( const EventContext & ctx) const
overridevirtual

Report whether the structure was filled.

Definition at line 121 of file SCT_ConditionsParameterTool.cxx.

121 {
122 const SCT_CondParameterData* data{getCondData(ctx)};
123 return (data!=nullptr);
124}

◆ finalize()

StatusCode SCT_ConditionsParameterTool::finalize ( )
overridevirtual

Definition at line 29 of file SCT_ConditionsParameterTool.cxx.

29 {
30 return StatusCode::SUCCESS;
31}

◆ getCondData()

const SCT_CondParameterData * SCT_ConditionsParameterTool::getCondData ( const EventContext & ctx) const
private

Definition at line 126 of file SCT_ConditionsParameterTool.cxx.

126 {
127 SG::ReadCondHandle<SCT_CondParameterData> condData{m_condKey, ctx};
128 if (not condData.isValid()) {
129 ATH_MSG_ERROR("Failed to get " << m_condKey.key());
130 return nullptr;
131 }
132 return *condData;
133}
#define ATH_MSG_ERROR(x)
SG::ReadCondHandleKey< SCT_CondParameterData > m_condKey

◆ getValues()

void SCT_ConditionsParameterTool::getValues ( std::vector< float > & userVector,
const SCT_CondParameterData::ParameterIndex iparam,
const EventContext & ctx ) const
overridevirtual

Fill a user-provided vector with the values (hopefully won't be needed?).

Definition at line 113 of file SCT_ConditionsParameterTool.cxx.

113 {
114 const SCT_CondParameterData* data{getCondData(ctx)};
115 if (data!=nullptr) data->getValues(userVector, iparam);
116 //no return value
117}

◆ initialize()

StatusCode SCT_ConditionsParameterTool::initialize ( )
overridevirtual

Definition at line 21 of file SCT_ConditionsParameterTool.cxx.

21 {
22 ATH_CHECK(m_condKey.initialize());
23
24 return StatusCode::SUCCESS;
25}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ invalid()

float SCT_ConditionsParameterTool::invalid ( const unsigned int iparam,
const EventContext & ctx ) const
overridevirtual

What is the default error value for this parameter?

Definition at line 63 of file SCT_ConditionsParameterTool.cxx.

63 {
64 float result{0.0};
66 result=std::numeric_limits<float>::quiet_NaN();
67 }
68 return result;
69}

◆ isValid()

bool SCT_ConditionsParameterTool::isValid ( const float parameterValue,
const SCT_CondParameterData::ParameterIndex iparam,
const EventContext & ctx ) const
overridevirtual

Is a given value within acceptable limits?

Definition at line 55 of file SCT_ConditionsParameterTool.cxx.

55 {
56 const SCT_CondParameterData* data{getCondData(ctx)};
57 if (data==nullptr) return invalid(iparam, ctx);
58 return SCT_CondParameterData::isValid(parameterValue, iparam);
59}
static bool isValid(const float parameterValue, const SCT_CondParameterData::ParameterIndex iparam)
Is a given value within acceptable limits?

◆ max()

float SCT_ConditionsParameterTool::max ( const SCT_CondParameterData::ParameterIndex iparam,
const EventContext & ctx ) const
overridevirtual

Maximum value read in from the database.

Definition at line 73 of file SCT_ConditionsParameterTool.cxx.

73 {
74 const SCT_CondParameterData* data{getCondData(ctx)};
75 if (data==nullptr) return invalid(iparam, ctx);
76 return data->max(iparam);
77}

◆ min()

float SCT_ConditionsParameterTool::min ( const SCT_CondParameterData::ParameterIndex iparam,
const EventContext & ctx ) const
overridevirtual

Minimum value read in from the database.

Definition at line 81 of file SCT_ConditionsParameterTool.cxx.

81 {
82 const SCT_CondParameterData* data{getCondData(ctx)};
83 if (data==nullptr) return invalid(iparam, ctx);
84 return data->min(iparam);
85}

◆ n()

unsigned int SCT_ConditionsParameterTool::n ( const SCT_CondParameterData::ParameterIndex iparam,
const EventContext & ctx ) const
overridevirtual

Number of values read in.

Definition at line 105 of file SCT_ConditionsParameterTool.cxx.

105 {
106 const SCT_CondParameterData* data{getCondData(ctx)};
107 if (data==nullptr) return 0;
108 return data->n(iparam);
109}

◆ sd()

float SCT_ConditionsParameterTool::sd ( const SCT_CondParameterData::ParameterIndex iparam,
const EventContext & ctx ) const
overridevirtual

Standard deviation.

Definition at line 97 of file SCT_ConditionsParameterTool.cxx.

97 {
98 const SCT_CondParameterData* data{getCondData(ctx)};
99 if (data==nullptr) return invalid(iparam, ctx);
100 return data->sd(iparam);
101}

◆ validity()

float SCT_ConditionsParameterTool::validity ( const IdentifierHash & idHash,
const SCT_CondParameterData::ParameterIndex iparam,
const EventContext & ctx ) const
overridevirtual

Measure of how many valid values went to calculate it. Should be 1 but if, say, 3 chip values were valid out of 6, it could be less (0.5 in this case).

Definition at line 49 of file SCT_ConditionsParameterTool.cxx.

49 {
50 return 1.0;
51}

◆ value()

float SCT_ConditionsParameterTool::value ( const IdentifierHash & idHash,
const SCT_CondParameterData::ParameterIndex iparam,
const EventContext & ctx ) const
overridevirtual

Give the indicated value for a module identifier hash.

Definition at line 41 of file SCT_ConditionsParameterTool.cxx.

41 {
42 const SCT_CondParameterData* data{getCondData(ctx)};
43 if (data==nullptr) return invalid(iparam, ctx);
44 return data->getValue(idHash, iparam);
45}

Member Data Documentation

◆ m_condKey

SG::ReadCondHandleKey<SCT_CondParameterData> SCT_ConditionsParameterTool::m_condKey {this, "CondKey", "SCT_CondParameterData", "SCT parameters"}
private

Definition at line 81 of file SCT_ConditionsParameterTool.h.

81{this, "CondKey", "SCT_CondParameterData", "SCT parameters"};

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