ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
SCT_CondParameterData Class Reference

Data object for SCT_ConditionsParameterTool and SCT_ConditionsParameterCondAlg. More...

#include <SCT_CondParameterData.h>

Collaboration diagram for SCT_CondParameterData:

Public Types

enum  ParameterIndex { AVG_THRESHOLD, N_PARAMETERS, INVALID_PARAMETER }
 Parameters. More...
 

Public Member Functions

 SCT_CondParameterData ()
 Constructor. More...
 
virtual ~SCT_CondParameterData ()=default
 Destructor. More...
 
float getValue (const IdentifierHash &idHash, const SCT_CondParameterData::ParameterIndex iparam) const
 Get the indicated value for a module identifier hash. More...
 
void getValues (std::vector< float > &userVector, const SCT_CondParameterData::ParameterIndex iparam) const
 Fill a user-provided vector with the values. More...
 
void setValue (const IdentifierHash &idHash, const SCT_CondParameterData::ParameterIndex iparam, const float value)
 Get the indicated value for a module identifier hash. More...
 
bool insert (const IdentifierHash &idHash, const SCT_CondParameterData::ParameterIndex iparam, const float value)
 Extended methods for data structure insertion. More...
 
float max (const SCT_CondParameterData::ParameterIndex iparam) const
 Get maximum value. More...
 
float min (const SCT_CondParameterData::ParameterIndex iparam) const
 Get minimum value. More...
 
float avg (const SCT_CondParameterData::ParameterIndex iparam) const
 Get average value. More...
 
float sd (const SCT_CondParameterData::ParameterIndex iparam) const
 Get standard deviation. More...
 
unsigned int n (const SCT_CondParameterData::ParameterIndex iparam) const
 Get the number of values. More...
 
void clear ()
 Clear all data members. More...
 

Static Public Member Functions

static bool isValid (const float parameterValue, const SCT_CondParameterData::ParameterIndex iparam)
 Is a given value within acceptable limits? More...
 
static float invalid (const unsigned int iparam)
 What is the default error value for this parameter? More...
 

Private Attributes

std::array< std::array< float, N_PARAMETERS >, SCT_ConditionsData::NUMBER_OF_WAFERSm_values {}
 
float m_min [N_PARAMETERS] {}
 
float m_max [N_PARAMETERS] {}
 
unsigned int m_n [N_PARAMETERS] {}
 
float m_sum [N_PARAMETERS] {}
 
float m_sumsq [N_PARAMETERS] {}
 

Detailed Description

Data object for SCT_ConditionsParameterTool and SCT_ConditionsParameterCondAlg.

Definition at line 32 of file SCT_CondParameterData.h.

Member Enumeration Documentation

◆ ParameterIndex

Parameters.

Enumerator
AVG_THRESHOLD 
N_PARAMETERS 
INVALID_PARAMETER 

Definition at line 35 of file SCT_CondParameterData.h.

Constructor & Destructor Documentation

◆ SCT_CondParameterData()

SCT_CondParameterData::SCT_CondParameterData ( )

Constructor.

Definition at line 11 of file SCT_CondParameterData.cxx.

11  {
12  clear();
13 }

◆ ~SCT_CondParameterData()

virtual SCT_CondParameterData::~SCT_CondParameterData ( )
virtualdefault

Destructor.

Member Function Documentation

◆ avg()

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

Get average value.

Definition at line 78 of file SCT_CondParameterData.cxx.

78  {
79  return (m_n[iparam]!=0)?(m_sum[iparam]/m_n[iparam]):(std::numeric_limits<float>::quiet_NaN());
80 }

◆ clear()

void SCT_CondParameterData::clear ( )

Clear all data members.

Definition at line 94 of file SCT_CondParameterData.cxx.

94  {
95  std::array<float, N_PARAMETERS> init{};
96  for (unsigned int i{0}; i!=N_PARAMETERS; ++i) {
99  m_n[i] = 0;
100  m_sum[i] = 0.0;
101  m_sumsq[i] = 0.0;
102  init[i] = invalid(i);
103  }
104 
105  //initialize array
106  m_values.fill(init);
107 }

◆ getValue()

float SCT_CondParameterData::getValue ( const IdentifierHash idHash,
const SCT_CondParameterData::ParameterIndex  iparam 
) const

Get the indicated value for a module identifier hash.

Definition at line 16 of file SCT_CondParameterData.cxx.

16  {
17  return m_values[idHash][iparam];
18 }

◆ getValues()

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

Fill a user-provided vector with the values.

Definition at line 21 of file SCT_CondParameterData.cxx.

21  {
22  for (unsigned int i{0}; i!=m_values.size(); ++i) {
23  userVector.push_back(m_values[i][iparam]);
24  }
25 }

◆ insert()

bool SCT_CondParameterData::insert ( const IdentifierHash idHash,
const SCT_CondParameterData::ParameterIndex  iparam,
const float  value 
)

Extended methods for data structure insertion.

Definition at line 39 of file SCT_CondParameterData.cxx.

39  {
40  // theValue must be valid
41  if (not isValid(theValue, iparam)) return false;
42  std::array<float,N_PARAMETERS>& paramArray = m_values[idHash];
43  // initial value should be invalid, only insert if this is the case
44  if (not isValid(paramArray[iparam], iparam)) {
45  paramArray[iparam] = theValue;
46  return true;
47  } else {
48  return false;
49  }
50 }

◆ invalid()

float SCT_CondParameterData::invalid ( const unsigned int  iparam)
static

What is the default error value for this parameter?

Definition at line 59 of file SCT_CondParameterData.cxx.

59  {
60  float result{0.0};
61  if (iparam==AVG_THRESHOLD) {
62  result=std::numeric_limits<float>::quiet_NaN();
63  }
64  return result;
65 }

◆ isValid()

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

Is a given value within acceptable limits?

Definition at line 53 of file SCT_CondParameterData.cxx.

53  {
54  // Second condition is to check if it is nan.
55  return !(iparam==AVG_THRESHOLD and (parameterValue!=parameterValue));
56 }

◆ max()

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

Get maximum value.

Definition at line 68 of file SCT_CondParameterData.cxx.

68  {
69  return m_max[iparam];
70 }

◆ min()

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

Get minimum value.

Definition at line 73 of file SCT_CondParameterData.cxx.

73  {
74  return m_min[iparam];
75 }

◆ n()

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

Get the number of values.

Definition at line 89 of file SCT_CondParameterData.cxx.

89  {
90  return m_n[iparam];
91 }

◆ sd()

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

Get standard deviation.

Definition at line 83 of file SCT_CondParameterData.cxx.

83  {
84  float mu{m_sum[iparam]/m_n[iparam]};
85  return std::sqrt((m_sumsq[iparam]/m_n[iparam]) - mu*mu);
86 }

◆ setValue()

void SCT_CondParameterData::setValue ( const IdentifierHash idHash,
const SCT_CondParameterData::ParameterIndex  iparam,
const float  value 
)

Get the indicated value for a module identifier hash.

Definition at line 28 of file SCT_CondParameterData.cxx.

28  {
29  if (insert(idHash, iparam, value)) {
30  m_n[iparam]++;
31  m_sum[iparam] += value;
32  m_sumsq[iparam] += value*value;
33  m_min[iparam] = std::min(m_min[iparam], value);
34  m_max[iparam] = std::max(m_max[iparam], value);
35  }
36 }

Member Data Documentation

◆ m_max

float SCT_CondParameterData::m_max[N_PARAMETERS] {}
private

Definition at line 74 of file SCT_CondParameterData.h.

◆ m_min

float SCT_CondParameterData::m_min[N_PARAMETERS] {}
private

Definition at line 73 of file SCT_CondParameterData.h.

◆ m_n

unsigned int SCT_CondParameterData::m_n[N_PARAMETERS] {}
private

Definition at line 75 of file SCT_CondParameterData.h.

◆ m_sum

float SCT_CondParameterData::m_sum[N_PARAMETERS] {}
private

Definition at line 76 of file SCT_CondParameterData.h.

◆ m_sumsq

float SCT_CondParameterData::m_sumsq[N_PARAMETERS] {}
private

Definition at line 77 of file SCT_CondParameterData.h.

◆ m_values

std::array<std::array<float, N_PARAMETERS>, SCT_ConditionsData::NUMBER_OF_WAFERS> SCT_CondParameterData::m_values {}
private

Definition at line 71 of file SCT_CondParameterData.h.


The documentation for this class was generated from the following files:
SCT_CondParameterData::m_sum
float m_sum[N_PARAMETERS]
Definition: SCT_CondParameterData.h:76
SCT_CondParameterData::m_max
float m_max[N_PARAMETERS]
Definition: SCT_CondParameterData.h:74
get_generator_info.result
result
Definition: get_generator_info.py:21
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
athena.value
value
Definition: athena.py:124
SCT_CondParameterData::m_sumsq
float m_sumsq[N_PARAMETERS]
Definition: SCT_CondParameterData.h:77
SCT_CondParameterData::clear
void clear()
Clear all data members.
Definition: SCT_CondParameterData.cxx:94
SCT_CondParameterData::invalid
static float invalid(const unsigned int iparam)
What is the default error value for this parameter?
Definition: SCT_CondParameterData.cxx:59
lumiFormat.i
int i
Definition: lumiFormat.py:85
SCT_CondParameterData::m_n
unsigned int m_n[N_PARAMETERS]
Definition: SCT_CondParameterData.h:75
SCT_CondParameterData::N_PARAMETERS
@ N_PARAMETERS
Definition: SCT_CondParameterData.h:35
SCT_CondParameterData::INVALID_PARAMETER
@ INVALID_PARAMETER
Definition: SCT_CondParameterData.h:35
python.PyKernel.init
def init(v_theApp, v_rootStream=None)
Definition: PyKernel.py:45
SCT_CondParameterData::m_values
std::array< std::array< float, N_PARAMETERS >, SCT_ConditionsData::NUMBER_OF_WAFERS > m_values
Definition: SCT_CondParameterData.h:71
SCT_CondParameterData::insert
bool insert(const IdentifierHash &idHash, const SCT_CondParameterData::ParameterIndex iparam, const float value)
Extended methods for data structure insertion.
Definition: SCT_CondParameterData.cxx:39
SCT_CondParameterData::AVG_THRESHOLD
@ AVG_THRESHOLD
Definition: SCT_CondParameterData.h:35
SCT_CondParameterData::m_min
float m_min[N_PARAMETERS]
Definition: SCT_CondParameterData.h:73
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
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53