ATLAS Offline Software
Loading...
Searching...
No Matches
MuonEtaPhiRIO_OnTrackErrorScaling.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
5#include <iostream>
6
8 "Phi",
9 "Eta"
10 };
11
12namespace {
13 inline double square(double a) { return a*a; }
14}
15
19
21 checkParameters("MuonEtaPhiRIO_OnTrackErrorScaling", kNParamTypes, s_names, 2);
22 return true;
23}
24
26 const Trk::ParamDefs measuredCoord) const
27{
28 Amg::MatrixX newCov(std::move(cov_input));
29 double a,b = 0.0;
30 if (measuredCoord == Trk::distPhi) {
31 a = params()[kPhi][0];
32 b = params()[kPhi][1];
33 } else if (measuredCoord == Trk::distEta) {
34 a = params()[kEta][0];
35 b = params()[kEta][1];
36 } else {
37 throw std::runtime_error("Invalid measured coordinate. Only Trk::distPhi and Trk::distEta are supported.");
38 }
39 newCov(0,0) *= square(a);
40 newCov(0,0) += square(b);
41 return newCov;
42}
43
44
std::vector< Identifier > ID
uint32_t CLID
The Class ID type.
static Double_t a
Amg::MatrixX getScaledCovariance(Amg::MatrixX &&cov_input, const Trk::ParamDefs measuredCoord) const
static const char *const s_names[kNParamTypes]
void checkParameters(const char *label, unsigned int n_paramter_sets, const char *const *param_names, unsigned int n_paramters) const
Convenience function to check whether the number of parameters is correct.
std::vector< std::vector< double > > & params()
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
ParamDefs
This file defines the parameter enums in the Trk namespace.
Definition ParamDefs.h:32
@ distEta
readout for silicon
Definition ParamDefs.h:51
@ distPhi
Definition ParamDefs.h:50
Default, invalid implementation of ClassID_traits.