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

#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. More...
 
virtual ~SCT_ConditionsParameterTool ()=default
 (virtual) Destructor does nothing More...
 
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? More...
 
virtual bool available (const SCT_CondParameterData::ParameterIndex iparam) const override
 
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. More...
 
virtual float value (const IdentifierHash &idHash, const SCT_CondParameterData::ParameterIndex iparam) const override
 
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) More...
 
virtual float validity (const IdentifierHash &idHash, const SCT_CondParameterData::ParameterIndex iparam) const override
 
virtual bool isValid (const float parameterValue, const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Is a given value within acceptable limits? More...
 
virtual bool isValid (const float parameterValue, const SCT_CondParameterData::ParameterIndex iparam) const override
 
virtual float invalid (const unsigned int iparam, const EventContext &ctx) const override
 What is the default error value for this parameter? More...
 
virtual float invalid (const unsigned int iparam) const override
 
virtual float max (const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Maximum value read in from the database. More...
 
virtual float max (const SCT_CondParameterData::ParameterIndex iparam) const override
 
virtual float min (const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Minimum value read in from the database. More...
 
virtual float min (const SCT_CondParameterData::ParameterIndex iparam) const override
 
virtual float avg (const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Average value. More...
 
virtual float avg (const SCT_CondParameterData::ParameterIndex iparam) const override
 
virtual float sd (const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Standard deviation. More...
 
virtual float sd (const SCT_CondParameterData::ParameterIndex iparam) const override
 
virtual unsigned int n (const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
 Number of values read in. More...
 
virtual unsigned int n (const SCT_CondParameterData::ParameterIndex iparam) const override
 
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?) More...
 
virtual void getValues (std::vector< float > &userVector, const SCT_CondParameterData::ParameterIndex iparam) const override
 
virtual bool filled (const EventContext &ctx) const override
 Report whether the structure was filled. More...
 
virtual bool filled () const override
 

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() [1/2]

bool SCT_ConditionsParameterTool::available ( const SCT_CondParameterData::ParameterIndex  iparam) const
overridevirtual

Definition at line 40 of file SCT_ConditionsParameterTool.cxx.

40  {
41  const EventContext& ctx{Gaudi::Hive::currentContext()};
42  return available(iparam, ctx);
43 }

◆ available() [2/2]

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.

35  {
36  return (iparam==SCT_CondParameterData::AVG_THRESHOLD);
37 }

◆ avg() [1/2]

float SCT_ConditionsParameterTool::avg ( const SCT_CondParameterData::ParameterIndex  iparam) const
overridevirtual

Definition at line 138 of file SCT_ConditionsParameterTool.cxx.

138  {
139  const EventContext& ctx{Gaudi::Hive::currentContext()};
140  return avg(iparam, ctx);
141 }

◆ avg() [2/2]

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

Average value.

Definition at line 131 of file SCT_ConditionsParameterTool.cxx.

131  {
133  if (data==nullptr) return invalid(iparam);
134  return data->avg(iparam);
135 }

◆ filled() [1/2]

bool SCT_ConditionsParameterTool::filled ( ) const
overridevirtual

Definition at line 193 of file SCT_ConditionsParameterTool.cxx.

193  {
194  const EventContext& ctx{Gaudi::Hive::currentContext()};
195  return filled(ctx);
196 }

◆ filled() [2/2]

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

Report whether the structure was filled.

Definition at line 187 of file SCT_ConditionsParameterTool.cxx.

187  {
189  return (data!=nullptr);
190 }

◆ 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 198 of file SCT_ConditionsParameterTool.cxx.

198  {
200  if (not condData.isValid()) {
201  ATH_MSG_ERROR("Failed to get " << m_condKey.key());
202  return nullptr;
203  }
204  return *condData;
205 }

◆ getValues() [1/2]

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

Definition at line 180 of file SCT_ConditionsParameterTool.cxx.

180  {
181  const EventContext& ctx{Gaudi::Hive::currentContext()};
182  getValues(userVector, iparam, ctx);
183 }

◆ getValues() [2/2]

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 173 of file SCT_ConditionsParameterTool.cxx.

173  {
175  if (data!=nullptr) data->getValues(userVector, iparam);
176  //no return value
177 }

◆ initialize()

StatusCode SCT_ConditionsParameterTool::initialize ( )
overridevirtual

Definition at line 21 of file SCT_ConditionsParameterTool.cxx.

21  {
23 
24  return StatusCode::SUCCESS;
25 }

◆ invalid() [1/2]

float SCT_ConditionsParameterTool::invalid ( const unsigned int  iparam) const
overridevirtual

Definition at line 96 of file SCT_ConditionsParameterTool.cxx.

96  {
97  const EventContext& ctx{Gaudi::Hive::currentContext()};
98  return invalid(iparam, ctx);
99 }

◆ invalid() [2/2]

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 87 of file SCT_ConditionsParameterTool.cxx.

87  {
88  float result{0.0};
90  result=std::numeric_limits<float>::quiet_NaN();
91  }
92  return result;
93 }

◆ isValid() [1/2]

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

Definition at line 80 of file SCT_ConditionsParameterTool.cxx.

80  {
81  const EventContext& ctx{Gaudi::Hive::currentContext()};
82  return isValid(parameterValue, iparam, ctx);
83 }

◆ isValid() [2/2]

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 73 of file SCT_ConditionsParameterTool.cxx.

73  {
75  if (data==nullptr) return invalid(iparam);
76  return SCT_CondParameterData::isValid(parameterValue, iparam);
77 }

◆ max() [1/2]

float SCT_ConditionsParameterTool::max ( const SCT_CondParameterData::ParameterIndex  iparam) const
overridevirtual

Definition at line 110 of file SCT_ConditionsParameterTool.cxx.

110  {
111  const EventContext& ctx{Gaudi::Hive::currentContext()};
112  return max(iparam, ctx);
113 }

◆ max() [2/2]

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

Maximum value read in from the database.

Definition at line 103 of file SCT_ConditionsParameterTool.cxx.

103  {
105  if (data==nullptr) return invalid(iparam);
106  return data->max(iparam);
107 }

◆ min() [1/2]

float SCT_ConditionsParameterTool::min ( const SCT_CondParameterData::ParameterIndex  iparam) const
overridevirtual

Definition at line 124 of file SCT_ConditionsParameterTool.cxx.

124  {
125  const EventContext& ctx{Gaudi::Hive::currentContext()};
126  return min(iparam, ctx);
127 }

◆ min() [2/2]

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

Minimum value read in from the database.

Definition at line 117 of file SCT_ConditionsParameterTool.cxx.

117  {
119  if (data==nullptr) return invalid(iparam);
120  return data->min(iparam);
121 }

◆ n() [1/2]

unsigned int SCT_ConditionsParameterTool::n ( const SCT_CondParameterData::ParameterIndex  iparam) const
overridevirtual

Definition at line 166 of file SCT_ConditionsParameterTool.cxx.

166  {
167  const EventContext& ctx{Gaudi::Hive::currentContext()};
168  return n(iparam, ctx);
169 }

◆ n() [2/2]

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

Number of values read in.

Definition at line 159 of file SCT_ConditionsParameterTool.cxx.

159  {
161  if (data==nullptr) return 0;
162  return data->n(iparam);
163 }

◆ sd() [1/2]

float SCT_ConditionsParameterTool::sd ( const SCT_CondParameterData::ParameterIndex  iparam) const
overridevirtual

Definition at line 152 of file SCT_ConditionsParameterTool.cxx.

152  {
153  const EventContext& ctx{Gaudi::Hive::currentContext()};
154  return sd(iparam, ctx);
155 }

◆ sd() [2/2]

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

Standard deviation.

Definition at line 145 of file SCT_ConditionsParameterTool.cxx.

145  {
147  if (data==nullptr) return invalid(iparam);
148  return data->sd(iparam);
149 }

◆ validity() [1/2]

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

Definition at line 66 of file SCT_ConditionsParameterTool.cxx.

66  {
67  const EventContext& ctx{Gaudi::Hive::currentContext()};
68  return validity(idHash, iparam, ctx);
69 }

◆ validity() [2/2]

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 61 of file SCT_ConditionsParameterTool.cxx.

61  {
62  return 1.0;
63 }

◆ value() [1/2]

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

Definition at line 54 of file SCT_ConditionsParameterTool.cxx.

54  {
55  const EventContext& ctx{Gaudi::Hive::currentContext()};
56  return value(idHash, iparam, ctx);
57 }

◆ value() [2/2]

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 47 of file SCT_ConditionsParameterTool.cxx.

47  {
49  if (data==nullptr) return invalid(iparam);
50  return data->getValue(idHash, iparam);
51 }

Member Data Documentation

◆ m_condKey

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

Definition at line 93 of file SCT_ConditionsParameterTool.h.


The documentation for this class was generated from the following files:
SCT_ConditionsParameterTool::filled
virtual bool filled() const override
Definition: SCT_ConditionsParameterTool.cxx:193
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
SCT_ConditionsParameterTool::value
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.
Definition: SCT_ConditionsParameterTool.cxx:47
get_generator_info.result
result
Definition: get_generator_info.py:21
SCT_ConditionsParameterTool::n
virtual unsigned int n(const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
Number of values read in.
Definition: SCT_ConditionsParameterTool.cxx:159
SCT_CondParameterData
Data object for SCT_ConditionsParameterTool and SCT_ConditionsParameterCondAlg.
Definition: SCT_CondParameterData.h:32
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
SCT_ConditionsParameterTool::isValid
virtual bool isValid(const float parameterValue, const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
Is a given value within acceptable limits?
Definition: SCT_ConditionsParameterTool.cxx:73
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SCT_ConditionsParameterTool::invalid
virtual float invalid(const unsigned int iparam, const EventContext &ctx) const override
What is the default error value for this parameter?
Definition: SCT_ConditionsParameterTool.cxx:87
SCT_ConditionsParameterTool::validity
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 va...
Definition: SCT_ConditionsParameterTool.cxx:61
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SCT_ConditionsParameterTool::getCondData
const SCT_CondParameterData * getCondData(const EventContext &ctx) const
Definition: SCT_ConditionsParameterTool.cxx:198
SCT_ConditionsParameterTool::m_condKey
SG::ReadCondHandleKey< SCT_CondParameterData > m_condKey
Definition: SCT_ConditionsParameterTool.h:93
SCT_ConditionsParameterTool::getValues
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?)
Definition: SCT_ConditionsParameterTool.cxx:173
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
SCT_ConditionsParameterTool::sd
virtual float sd(const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
Standard deviation.
Definition: SCT_ConditionsParameterTool.cxx:145
SCT_ConditionsParameterTool::max
virtual float max(const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
Maximum value read in from the database.
Definition: SCT_ConditionsParameterTool.cxx:103
SCT_CondParameterData::AVG_THRESHOLD
@ AVG_THRESHOLD
Definition: SCT_CondParameterData.h:35
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SCT_ConditionsParameterTool::min
virtual float min(const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
Minimum value read in from the database.
Definition: SCT_ConditionsParameterTool.cxx:117
SCT_CondParameterData::isValid
static bool isValid(const float parameterValue, const SCT_CondParameterData::ParameterIndex iparam)
Is a given value within acceptable limits?
Definition: SCT_CondParameterData.cxx:53
SCT_ConditionsParameterTool::available
virtual bool available(const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
Is the required parameter available?
Definition: SCT_ConditionsParameterTool.cxx:35
SCT_ConditionsParameterTool::avg
virtual float avg(const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
Average value.
Definition: SCT_ConditionsParameterTool.cxx:131