|
ATLAS Offline Software
|
Go to the documentation of this file.
3 #include "GeoModelKernel/throwExcept.h"
8 inline double evalPoly(
const double val,
const std::vector<double>&
pars) {
10 for (
size_t c = 0 ;
c <
pars.size(); ++
c) {
15 inline double scaleErrorAndAddSyst(
const double val,
const std::vector<double>&
pars) {
29 if (funcName ==
"tanThetaPolynomial") {
33 }
else if (funcName ==
"thetaPolynomial") {
37 }
else if (funcName ==
"scaleErrorAndAddSyst"){
39 return scaleErrorAndAddSyst(
input.clusterError,
pars);
43 return [funcName](
const Input&,
const std::vector<double>& ) {
44 std::stringstream except_str{};
45 except_str<<
"NswErrorCalibData::parametrizer() - The function '"<<funcName<<
"' is unknown.";
46 except_str<<
"Please check"<<__FILE__<<
" for the set of valid function names. ";
54 if (
a.author() !=
b.clusAlgAuthor)
return a.author() <
b.clusAlgAuthor;
55 return a.maxStrip() <
b.strip;
58 if (
a.clusAlgAuthor !=
b.author())
return a.clusAlgAuthor <
b.author();
59 return a.strip <
b.minStrip();
70 std::vector<double>&&
pars):
75 m_pars (std::move(
pars))
83 return m_evalFunc(clustInfo, m_pars);
93 m_idHelperSvc{idHelperSvc} {
111 const ErrorConstantsSet::const_iterator layConstItr = errorsInLay.find(errorId);
112 if (layConstItr != errorsInLay.end()) {
113 const double uncert = layConstItr->clusterUncertainty(clustInfo);
116 <<
" is smaller than zero ("<<uncert<<
"). theta: "<<clustInfo.
locTheta
120 <<
", pars " << layConstItr->pars());
125 <<
", cluster Author: "<<
static_cast<int>(clustInfo.
clusterAuthor));
131 if (newConstants.minStrip() > newConstants.maxStrip()) {
133 <<
" have an invalid strip range"<<newConstants.minStrip()<<
" to "<<newConstants.maxStrip());
134 return StatusCode::FAILURE;
137 if (!
constants.insert(std::move(newConstants)).second) {
139 return StatusCode::FAILURE;
141 return StatusCode::SUCCESS;
NswErrorCalibData::errorParametrizer errorParametrizer
virtual const sTgcIdHelper & stgcIdHelper() const =0
access to TgcIdHelper
double clusterUncertainty(const Input &clustInfo) const
Calculates the cluster uncertainty.
std::function< double(const Input &input, const std::vector< double > &pars)> errorParametrizer
Helper struct to store different error calibrations for a certain channel range & also for seperate C...
const Muon::IMuonIdHelperSvc * m_idHelperSvc
bool operator<(const NswErrorCalibData::ErrorConstants &a, const NswErrorCalibData::ErrorIdentifier &b)
#define THROW_EXCEPTION(MSG)
virtual const MmIdHelper & mmIdHelper() const =0
access to CscIdHelper
static errorParametrizer getParametrizer(const std::string &funcName)
ErrorConstants(const std::string &funcName, uint8_t author, uint16_t minStrip, uint16_t maxStrip, std::vector< double > &¶meters)
int channel(const Identifier &id) const override
NswErrorCalibData(const Muon::IMuonIdHelperSvc *idHelperSvc)
uint8_t m_clusAlgAuthor
Author of the cluster to apply the error.
uint16_t maxStrip() const
Returns the maximal strip of validity.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool operator<(const ErrorConstants &other) const
virtual std::string toStringGasGap(const Identifier &id) const =0
print all fields up to gas gap to string
Class to provide easy MsgStream access and capabilities.
double clusterUncertainty(const Input &clustInfo) const
std::set< ErrorConstants, std::less<> > ErrorConstantsSet
Share the same error constants amongst several gasGaps.
uint8_t author() const
Returns the cluster author flag.
StatusCode storeConstants(const Identifier &gasGapId, ErrorConstants &&newConstants)
virtual bool isMM(const Identifier &id) const =0
returns whether this is a MM Identifier or not
virtual Identifier gasGapId(const Identifier &id) const =0
create a gasGap ID (will return layer Id for MDTs)
uint16_t minStrip() const
Returns the minimal strip of validitiy.
int channel(const Identifier &id) const override
virtual std::string toString(const Identifier &id) const =0
print all fields to string
#define ATH_MSG_WARNING(x)
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
constexpr int pow(int base, int exp) noexcept
NswErrorCalibData::Input Input
virtual bool issTgc(const Identifier &id) const =0
returns whether this is a sTGC Identifier or not