ATLAS Offline Software
CalibFunc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONCALIB_CALIBFUNC_H
6 #define MUONCALIB_CALIBFUNC_H
7 
8 #include <string>
9 #include <vector>
10 
11 namespace MuonCalib {
33  class CalibFunc {
34  public:
35  using ParVec = std::vector<double>;
36  explicit CalibFunc(const ParVec& vec) :
37  m_parameters{vec} {}
38  virtual ~CalibFunc() = default;
39  unsigned int nPar() const { return m_parameters.size(); }
40  const ParVec& parameters() const { return m_parameters; }
41  double par(unsigned int index) const {
42  if (index < nPar())
43  return m_parameters[index];
44  else
45  return 0.;
46  }
47  virtual std::string typeName() const = 0;
48  virtual std::string name() const = 0;
49 
50  private:
52  };
53 
54 } // namespace MuonCalib
55 
56 #endif
MuonCalib::CalibFunc::~CalibFunc
virtual ~CalibFunc()=default
index
Definition: index.py:1
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
MuonCalib::CalibFunc::par
double par(unsigned int index) const
Definition: CalibFunc.h:41
MuonCalib::CalibFunc::name
virtual std::string name() const =0
MuonCalib::CalibFunc::typeName
virtual std::string typeName() const =0
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::CalibFunc::ParVec
std::vector< double > ParVec
Definition: CalibFunc.h:35
DeMoScan.index
string index
Definition: DeMoScan.py:364
MuonCalib::CalibFunc::parameters
const ParVec & parameters() const
Definition: CalibFunc.h:40
MuonCalib::CalibFunc::m_parameters
ParVec m_parameters
Definition: CalibFunc.h:51
MuonCalib::CalibFunc::nPar
unsigned int nPar() const
Definition: CalibFunc.h:39
MuonCalib::CalibFunc
generic interface for a calibration function.
Definition: CalibFunc.h:33
MuonCalib::CalibFunc::CalibFunc
CalibFunc(const ParVec &vec)
Definition: CalibFunc.h:36