ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | List of all members
PixelChargeCalib::IChargeCalibrationParser Class Referenceabstract

#include <IChargeCalibrationParser.h>

Inheritance diagram for PixelChargeCalib::IChargeCalibrationParser:
Collaboration diagram for PixelChargeCalib::IChargeCalibrationParser:

Public Member Functions

 IChargeCalibrationParser (const PixelModuleData *pModData, const InDetDD::SiDetectorElementCollection *pElements, const PixelID *pId)
 
template<class T >
ChargeCalibrationBundle parse (unsigned int hash, const T &data)
 
template<class T >
ChargeCalibrationBundle parse (unsigned int hash, const T &data, int inputSource)
 
virtual ~IChargeCalibrationParser ()=default
 

Protected Member Functions

template<typename T , typename b = std::is_integral<T>>
std::function< T(size_t)> getFunc (const std::vector< std::string > &data)
 Return function converting a string to number type T at index i of data vector. More...
 
template<typename T >
std::function< T(size_t)> getFunc (const nlohmann::json &data)
 Return function converting an item to number type T at index i of json data. More...
 

Protected Attributes

const PixelModuleDatam_configData {}
 
const InDetDD::SiDetectorElementCollectionm_elements {}
 
const PixelIDm_pixelID {}
 

Static Protected Attributes

static constexpr float m_chargeLimit = 1e5
 If the calculated charge exceeds this limit, a linear extrapolation is used at this point. More...
 

Private Member Functions

virtual ChargeCalibrationBundle parseImpl (unsigned int, const nlohmann::json &, int)=0
 
virtual ChargeCalibrationBundle parseImpl (unsigned int, const nlohmann::json &)=0
 
virtual ChargeCalibrationBundle parseImpl (unsigned int, const std::string &)=0
 

Detailed Description

Definition at line 31 of file IChargeCalibrationParser.h.

Constructor & Destructor Documentation

◆ IChargeCalibrationParser()

PixelChargeCalib::IChargeCalibrationParser::IChargeCalibrationParser ( const PixelModuleData pModData,
const InDetDD::SiDetectorElementCollection pElements,
const PixelID pId 
)
inline

Definition at line 33 of file IChargeCalibrationParser.h.

34  : m_configData(pModData),
35  m_elements(pElements), m_pixelID(pId){
36 
37  }

◆ ~IChargeCalibrationParser()

virtual PixelChargeCalib::IChargeCalibrationParser::~IChargeCalibrationParser ( )
virtualdefault

Member Function Documentation

◆ getFunc() [1/2]

template<typename T >
std::function<T(size_t)> PixelChargeCalib::IChargeCalibrationParser::getFunc ( const nlohmann::json data)
inlineprotected

Return function converting an item to number type T at index i of json data.

Definition at line 69 of file IChargeCalibrationParser.h.

69  {
70  auto f = [&data](size_t i)->T {
71  return data[i].get<T>();
72  };
73  return f;
74  }

◆ getFunc() [2/2]

template<typename T , typename b = std::is_integral<T>>
std::function<T(size_t)> PixelChargeCalib::IChargeCalibrationParser::getFunc ( const std::vector< std::string > &  data)
inlineprotected

Return function converting a string to number type T at index i of data vector.

Definition at line 59 of file IChargeCalibrationParser.h.

59  {
60  auto f = [&data](size_t i)->T {
61  return b::value ? std::stoi(data[i]) : std::stof(data[i]);
62  };
63  return f;
64  }

◆ parse() [1/2]

template<class T >
ChargeCalibrationBundle PixelChargeCalib::IChargeCalibrationParser::parse ( unsigned int  hash,
const T &  data 
)
inline

Definition at line 41 of file IChargeCalibrationParser.h.

41  {
42  return parseImpl(hash, data);
43  }

◆ parse() [2/2]

template<class T >
ChargeCalibrationBundle PixelChargeCalib::IChargeCalibrationParser::parse ( unsigned int  hash,
const T &  data,
int  inputSource 
)
inline

Definition at line 45 of file IChargeCalibrationParser.h.

45  {
46  return parseImpl(hash, data, inputSource);
47  }

◆ parseImpl() [1/3]

virtual ChargeCalibrationBundle PixelChargeCalib::IChargeCalibrationParser::parseImpl ( unsigned int  ,
const nlohmann::json  
)
privatepure virtual

◆ parseImpl() [2/3]

virtual ChargeCalibrationBundle PixelChargeCalib::IChargeCalibrationParser::parseImpl ( unsigned int  ,
const nlohmann::json ,
int   
)
privatepure virtual

◆ parseImpl() [3/3]

virtual ChargeCalibrationBundle PixelChargeCalib::IChargeCalibrationParser::parseImpl ( unsigned int  ,
const std::string &   
)
privatepure virtual

Member Data Documentation

◆ m_chargeLimit

constexpr float PixelChargeCalib::IChargeCalibrationParser::m_chargeLimit = 1e5
staticconstexprprotected

If the calculated charge exceeds this limit, a linear extrapolation is used at this point.

Definition at line 55 of file IChargeCalibrationParser.h.

◆ m_configData

const PixelModuleData* PixelChargeCalib::IChargeCalibrationParser::m_configData {}
protected

Definition at line 51 of file IChargeCalibrationParser.h.

◆ m_elements

const InDetDD::SiDetectorElementCollection* PixelChargeCalib::IChargeCalibrationParser::m_elements {}
protected

Definition at line 52 of file IChargeCalibrationParser.h.

◆ m_pixelID

const PixelID* PixelChargeCalib::IChargeCalibrationParser::m_pixelID {}
protected

Definition at line 53 of file IChargeCalibrationParser.h.


The documentation for this class was generated from the following file:
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
athena.value
value
Definition: athena.py:124
PixelChargeCalib::IChargeCalibrationParser::parseImpl
virtual ChargeCalibrationBundle parseImpl(unsigned int, const nlohmann::json &, int)=0
lumiFormat.i
int i
Definition: lumiFormat.py:85
PixelChargeCalib::IChargeCalibrationParser::m_configData
const PixelModuleData * m_configData
Definition: IChargeCalibrationParser.h:51
hist_file_dump.f
f
Definition: hist_file_dump.py:135
PixelChargeCalib::IChargeCalibrationParser::m_elements
const InDetDD::SiDetectorElementCollection * m_elements
Definition: IChargeCalibrationParser.h:52
PixelChargeCalib::IChargeCalibrationParser::m_pixelID
const PixelID * m_pixelID
Definition: IChargeCalibrationParser.h:53
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35