ATLAS Offline Software
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
10 #include "AthenaKernel/CondCont.h"
11 #include "AthenaKernel/BaseInfo.h"
16 #include <functional>
17 #include <map>
18 
20  public:
25  struct Input {
31  double locTheta{0.};
33  double locPhi{0.};
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,
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:
75  std::vector<double> m_pars{};
76  };
77 
81  };
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 
103 CLASS_DEF( NswErrorCalibData , 118696870 , 1 );
105 
106 #endif
NswErrorCalibData
Definition: NswErrorCalibData.h:19
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
CondCont.h
Hold mappings of ranges to condition objects.
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
NswErrorCalibData::ErrorConstants::clusterUncertainty
double clusterUncertainty(const Input &clustInfo) const
Calculates the cluster uncertainty.
Definition: NswErrorCalibData.cxx:82
NswErrorCalibData::ErrorConstants::m_stripMin
uint16_t m_stripMin
Strip range for which the constants are valid.
Definition: NswErrorCalibData.h:73
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
operator<
bool operator<(const NswErrorCalibData::ErrorConstants &a, const NswErrorCalibData::ErrorIdentifier &b)
Definition: NswErrorCalibData.cxx:53
NswErrorCalibData::Input::clusterError
double clusterError
cluster error as calculated by the cluster builder tool
Definition: NswErrorCalibData.h:39
NswErrorCalibData::Input::locPhi
double locPhi
Azimuthal angle in the local frame.
Definition: NswErrorCalibData.h:33
NswErrorCalibData::errorParametrizer
std::function< double(const Input &input, const std::vector< double > &pars)> errorParametrizer
Definition: NswErrorCalibData.h:43
NswErrorCalibData::ErrorConstants
Helper struct to store different error calibrations for a certain channel range & also for seperate C...
Definition: NswErrorCalibData.h:50
NswErrorCalibData::ErrorConstants::m_pars
std::vector< double > m_pars
Definition: NswErrorCalibData.h:75
NswErrorCalibData::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: NswErrorCalibData.h:95
NswErrorCalibData::~NswErrorCalibData
~NswErrorCalibData()=default
NswErrorCalibData::Input::clusterSize
unsigned int clusterSize
Cluster size.
Definition: NswErrorCalibData.h:37
NswErrorCalibData::ErrorIdentifier
Definition: NswErrorCalibData.h:78
NswErrorCalibData::Input::locTheta
double locTheta
Direction of the muon in the local coordinate frame.
Definition: NswErrorCalibData.h:31
CLASS_DEF
CLASS_DEF(NswErrorCalibData, 118696870, 1)
GeoPrimitives.h
NswErrorCalibData::Input::localPos
Amg::Vector2D localPos
Local position on the surface.
Definition: NswErrorCalibData.h:35
NswErrorCalibData::getParametrizer
static errorParametrizer getParametrizer(const std::string &funcName)
Definition: NswErrorCalibData.cxx:28
NswErrorCalibData::ErrorConstants::ErrorConstants
ErrorConstants(const std::string &funcName, uint8_t author, uint16_t minStrip, uint16_t maxStrip, std::vector< double > &&parameters)
Definition: NswErrorCalibData.cxx:68
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
NswErrorCalibData::NswErrorCalibData
NswErrorCalibData(const Muon::IMuonIdHelperSvc *idHelperSvc)
Definition: NswErrorCalibData.cxx:91
NswErrorCalibData::ErrorConstants::m_clusAlgAuthor
uint8_t m_clusAlgAuthor
Author of the cluster to apply the error.
Definition: NswErrorCalibData.h:71
BaseInfo.h
Provide an interface for finding inheritance information at run time.
NswErrorCalibData::ErrorMap
std::unordered_map< Identifier, ErrorConstantsSet > ErrorMap
Definition: NswErrorCalibData.h:96
NswErrorCalibData::ErrorConstants::maxStrip
uint16_t maxStrip() const
Returns the maximal strip of validity.
Definition: NswErrorCalibData.cxx:80
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
NswErrorCalibData::ErrorConstants::operator<
bool operator<(const ErrorConstants &other) const
Definition: NswErrorCalibData.cxx:61
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
NswErrorCalibData::clusterUncertainty
double clusterUncertainty(const Input &clustInfo) const
Definition: NswErrorCalibData.cxx:96
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
NswErrorCalibData::ErrorConstantsSet
std::set< ErrorConstants, std::less<> > ErrorConstantsSet
Share the same error constants amongst several gasGaps.
Definition: NswErrorCalibData.h:83
NswErrorCalibData::ErrorConstants::author
uint8_t author() const
Returns the cluster author flag.
Definition: NswErrorCalibData.cxx:81
NswErrorCalibData::ErrorConstants::m_stripMax
uint16_t m_stripMax
Definition: NswErrorCalibData.h:74
NswErrorCalibData::Input::stripId
Identifier stripId
Identifier of the strip.
Definition: NswErrorCalibData.h:27
NswErrorCalibData::storeConstants
StatusCode storeConstants(const Identifier &gasGapId, ErrorConstants &&newConstants)
Definition: NswErrorCalibData.cxx:128
NswErrorCalibData::ErrorIdentifier::strip
uint16_t strip
Definition: NswErrorCalibData.h:79
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
NswErrorCalibData::ErrorConstants::m_evalFunc
errorParametrizer m_evalFunc
Definition: NswErrorCalibData.h:69
NswErrorCalibData::ErrorConstants::pars
const std::vector< double > & pars() const
Definition: NswErrorCalibData.h:67
NswErrorCalibData::ErrorConstants::minStrip
uint16_t minStrip() const
Returns the minimal strip of validitiy.
Definition: NswErrorCalibData.cxx:79
a
TList * a
Definition: liststreamerinfos.cxx:10
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
TransientConstSharedPtr.h
NswErrorCalibData::m_database
ErrorMap m_database
Definition: NswErrorCalibData.h:97
AthMessaging.h
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:27
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
NswErrorCalibData::Input
Helper struct to be parsed to the object to derive the specific error of the cluster.
Definition: NswErrorCalibData.h:25
NswErrorCalibData::ErrorIdentifier::clusAlgAuthor
uint8_t clusAlgAuthor
Definition: NswErrorCalibData.h:80
IMuonIdHelperSvc.h
NswErrorCalibData::Input::clusterAuthor
uint8_t clusterAuthor
Author of the cluster.
Definition: NswErrorCalibData.h:29
CONDCONT_DEF
CONDCONT_DEF(NswErrorCalibData, 134103948)
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
Identifier
Definition: IdentifierFieldParser.cxx:14