11#ifndef IChargeCalibrationParser_h
12#define IChargeCalibrationParser_h
16#include <nlohmann/json.hpp>
18#include "Identifier/Identifier.h"
57 template<
typename T,
typename b = std::is_
integral<T>>
58 std::function<T(
size_t)>
60 auto f = [&
data](
size_t i)->T {
61 return b::value ? std::stoi(
data[i]) : std::stof(
data[i]);
68 std::function<T(
size_t)>
70 auto f = [&
data](
size_t i)->T {
71 return data[i].get<T>();
79 parseImpl(
unsigned int ,
const nlohmann::json & ,
int ) = 0;
81 parseImpl(
unsigned int ,
const nlohmann::json & ) = 0;
Struct for holding vectors of charge calibration constants, with utility methods.
char data[hepevt_bytes_allocation_ATLAS]
This is an Identifier helper class for the Pixel subdetector.
Class to hold the SiDetectorElement objects to be put in the detector store.
virtual ChargeCalibrationBundle parseImpl(unsigned int, const nlohmann::json &)=0
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.
const PixelID * m_pixelID
static constexpr float m_chargeLimit
If the calculated charge exceeds this limit, a linear extrapolation is used at this point.
virtual ~IChargeCalibrationParser()=default
IChargeCalibrationParser(const PixelModuleData *pModData, const InDetDD::SiDetectorElementCollection *pElements, const PixelID *pId)
ChargeCalibrationBundle parse(unsigned int hash, const T &data, int inputSource)
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.
virtual ChargeCalibrationBundle parseImpl(unsigned int, const std::string &)=0
virtual ChargeCalibrationBundle parseImpl(unsigned int, const nlohmann::json &, int)=0
const PixelModuleData * m_configData
ChargeCalibrationBundle parse(unsigned int hash, const T &data)
const InDetDD::SiDetectorElementCollection * m_elements
This is an Identifier helper class for the Pixel subdetector.
bundles of parameters used together in the PixelChargeCalibCondAlg