ATLAS Offline Software
SCT_ConditionsParameterTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
10 #ifndef SCT_ConditionsParameterTool_h
11 #define SCT_ConditionsParameterTool_h
12 
13 //local includes
15 
16 //Athena includes
20 
21 //STL includes
22 #include <list>
23 #include <vector>
24 
29 class SCT_ConditionsParameterTool: public extends<AthAlgTool, ISCT_ConditionsParameterTool> {
30  public:
32  SCT_ConditionsParameterTool(const std::string& type, const std::string& name, const IInterface* parent);
33 
35  virtual ~SCT_ConditionsParameterTool() = default;
36 
37  //@name Methods implemented from virtual baseclass methods
39  virtual StatusCode initialize() override;
40  virtual StatusCode finalize() override;
42 
44  virtual bool available(const SCT_CondParameterData::ParameterIndex iparam, const EventContext& ctx) const override;
45  virtual bool available(const SCT_CondParameterData::ParameterIndex iparam) const override;
46 
48  virtual float value(const IdentifierHash& idHash, const SCT_CondParameterData::ParameterIndex iparam, const EventContext& ctx) const override;
49  virtual float value(const IdentifierHash& idHash, const SCT_CondParameterData::ParameterIndex iparam) const override;
50 
52  virtual float validity(const IdentifierHash& idHash, const SCT_CondParameterData::ParameterIndex iparam, const EventContext& ctx) const override;
53  virtual float validity(const IdentifierHash& idHash, const SCT_CondParameterData::ParameterIndex iparam) const override;
54 
56  virtual bool isValid(const float parameterValue, const SCT_CondParameterData::ParameterIndex iparam, const EventContext& ctx) const override;
57  virtual bool isValid(const float parameterValue, const SCT_CondParameterData::ParameterIndex iparam) const override;
58 
60  virtual float invalid(const unsigned int iparam, const EventContext& ctx) const override;
61  virtual float invalid(const unsigned int iparam) const override;
62 
64  virtual float max(const SCT_CondParameterData::ParameterIndex iparam, const EventContext& ctx) const override;
65  virtual float max(const SCT_CondParameterData::ParameterIndex iparam) const override;
66 
68  virtual float min(const SCT_CondParameterData::ParameterIndex iparam, const EventContext& ctx) const override;
69  virtual float min(const SCT_CondParameterData::ParameterIndex iparam) const override;
70 
72  virtual float avg(const SCT_CondParameterData::ParameterIndex iparam, const EventContext& ctx) const override;
73  virtual float avg(const SCT_CondParameterData::ParameterIndex iparam) const override;
74 
76  virtual float sd(const SCT_CondParameterData::ParameterIndex iparam, const EventContext& ctx) const override;
77  virtual float sd(const SCT_CondParameterData::ParameterIndex iparam) const override;
78 
80  virtual unsigned int n(const SCT_CondParameterData::ParameterIndex iparam, const EventContext& ctx) const override;
81  virtual unsigned int n(const SCT_CondParameterData::ParameterIndex iparam) const override;
82 
84  virtual void getValues(std::vector<float>& userVector, const SCT_CondParameterData::ParameterIndex iparam, const EventContext& ctx) const override;
85  virtual void getValues(std::vector<float>& userVector, const SCT_CondParameterData::ParameterIndex iparam) const override;
86 
88  virtual bool filled(const EventContext& ctx) const override;
89  virtual bool filled() const override;
90 
91  private:
92  //the data structure
93  SG::ReadCondHandleKey<SCT_CondParameterData> m_condKey{this, "CondKey", "SCT_CondParameterData", "SCT parameters"};
94  const SCT_CondParameterData* getCondData(const EventContext& ctx) const;
95 };
96 
97 #endif // SCT_ConditionsParameterTool_h
SCT_ConditionsParameterTool::filled
virtual bool filled() const override
Definition: SCT_ConditionsParameterTool.cxx:193
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
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
SCT_ConditionsParameterTool::finalize
virtual StatusCode finalize() override
Definition: SCT_ConditionsParameterTool.cxx:29
SCT_ConditionsParameterTool
Definition: SCT_ConditionsParameterTool.h:29
SCT_ConditionsParameterTool::SCT_ConditionsParameterTool
SCT_ConditionsParameterTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor necessary for Svc factory.
Definition: SCT_ConditionsParameterTool.cxx:15
SCT_CondParameterData::ParameterIndex
ParameterIndex
Parameters.
Definition: SCT_CondParameterData.h:35
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
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
ISCT_ConditionsParameterTool.h
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
SCT_CondParameterData.h
header file for data object for SCT_ConditionsParameterTool and SCT_ConditionsParameterCondAlg.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
SCT_ConditionsParameterTool::getCondData
const SCT_CondParameterData * getCondData(const EventContext &ctx) const
Definition: SCT_ConditionsParameterTool.cxx:198
ReadCondHandleKey.h
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
SCT_ConditionsParameterTool::sd
virtual float sd(const SCT_CondParameterData::ParameterIndex iparam, const EventContext &ctx) const override
Standard deviation.
Definition: SCT_ConditionsParameterTool.cxx:145
SG::ReadCondHandleKey< SCT_CondParameterData >
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_ConditionsParameterTool::~SCT_ConditionsParameterTool
virtual ~SCT_ConditionsParameterTool()=default
(virtual) Destructor does nothing
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_ConditionsParameterTool::initialize
virtual StatusCode initialize() override
Definition: SCT_ConditionsParameterTool.cxx:21
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
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