ATLAS Offline Software
Loading...
Searching...
No Matches
NswErrorCalibData.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONCONDDATA_NSWERRORCALIBDATA_H
6#define MUONCONDDATA_NSWERRORCALIBDATA_H
7
8
9// Athena includes
16#include <functional>
17#include <map>
18
20 public:
25 struct Input {
29 uint8_t clusterAuthor{0};
31 double locTheta{0.};
33 double locPhi{0.};
35 Amg::Vector2D localPos{Amg::Vector2D::Zero()};
37 unsigned int clusterSize{0};
39 double clusterError{0};
40 };
41
42 using errorParametrizer = std::function<double(const Input& input,
43 const std::vector<double>& pars)>;
44
45 static errorParametrizer getParametrizer(const std::string& funcName);
51 public:
52 ErrorConstants(const std::string& funcName,
53 uint8_t author,
54 uint16_t minStrip,
55 uint16_t maxStrip,
56 std::vector<double>&& parameters);
58 uint16_t minStrip() const;
60 uint16_t maxStrip() const;
62 uint8_t author() const;
64 double clusterUncertainty(const Input& clustInfo) const;
65
66 bool operator<(const ErrorConstants& other) const;
67 const std::vector<double>& pars() const { return m_pars; }
68 private:
71 uint8_t m_clusAlgAuthor{0};
73 uint16_t m_stripMin{0};
74 uint16_t m_stripMax{0};
75 std::vector<double> m_pars{};
76 };
77
79 uint16_t strip{0};
80 uint8_t clusAlgAuthor{0};
81 };
82
83 using ErrorConstantsSet = std::set<ErrorConstants, std::less<>>;
84
85 public:
86 NswErrorCalibData(const Muon::IMuonIdHelperSvc* idHelperSvc);
87 ~NswErrorCalibData() = default;
88
89 StatusCode storeConstants(const Identifier& gasGapId,
90 ErrorConstants&& newConstants);
91
92 double clusterUncertainty(const Input& clustInfo) const;
93
94 private:
96 using ErrorMap = std::unordered_map<Identifier, ErrorConstantsSet>;
98};
99
102
103CLASS_DEF( NswErrorCalibData , 118696870 , 1 );
105
106#endif
Hold mappings of ranges to condition objects.
#define CONDCONT_DEF(...)
Definition CondCont.h:1413
Provide an interface for finding inheritance information at run time.
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
static Double_t a
bool operator<(const NswErrorCalibData::ErrorConstants &a, const NswErrorCalibData::ErrorIdentifier &b)
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Helper struct to store different error calibrations for a certain channel range & also for seperate C...
uint8_t m_clusAlgAuthor
Author of the cluster to apply the error.
bool operator<(const ErrorConstants &other) const
const std::vector< double > & pars() const
uint16_t minStrip() const
Returns the minimal strip of validitiy.
uint16_t maxStrip() const
Returns the maximal strip of validity.
double clusterUncertainty(const Input &clustInfo) const
Calculates the cluster uncertainty.
ErrorConstants(const std::string &funcName, uint8_t author, uint16_t minStrip, uint16_t maxStrip, std::vector< double > &&parameters)
uint8_t author() const
Returns the cluster author flag.
uint16_t m_stripMin
Strip range for which the constants are valid.
static errorParametrizer getParametrizer(const std::string &funcName)
const Muon::IMuonIdHelperSvc * m_idHelperSvc
double clusterUncertainty(const Input &clustInfo) const
~NswErrorCalibData()=default
StatusCode storeConstants(const Identifier &gasGapId, ErrorConstants &&newConstants)
NswErrorCalibData(const Muon::IMuonIdHelperSvc *idHelperSvc)
std::set< ErrorConstants, std::less<> > ErrorConstantsSet
Share the same error constants amongst several gasGaps.
std::unordered_map< Identifier, ErrorConstantsSet > ErrorMap
std::function< double(const Input &input, const std::vector< double > &pars)> errorParametrizer
Eigen::Matrix< double, 2, 1 > Vector2D
Helper struct to be parsed to the object to derive the specific error of the cluster.
unsigned int clusterSize
Cluster size.
double locTheta
Direction of the muon in the local coordinate frame.
double clusterError
cluster error as calculated by the cluster builder tool
Amg::Vector2D localPos
Local position on the surface.
Identifier stripId
Identifier of the strip.
uint8_t clusterAuthor
Author of the cluster.
double locPhi
Azimuthal angle in the local frame.