ATLAS Offline Software
Loading...
Searching...
No Matches
TRTRIO_OnTrackErrorScaling.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
5#include <iostream>
6
8 "TRT Barrel",
9 "TRT Endcap"
10 };
11
12namespace {
13 inline double square(double a) { return a*a; }
14}
15
19
21 if (params().size() != kNParamTypes ) {
22 std::stringstream message;
23 message << " TRTRIO_OnTrackErrorScaling: Expecting parameters for et least 2 parameters for";
24 for (const auto *s_name : s_names) {
25 message << " " << s_name;
26 }
27 message << "(" << kNParamTypes << ") for run2.";
28 message << " But got " << params().size() << ".";
29 throw std::runtime_error( message.str() );
30 }
31 for (unsigned int idx=0; idx<params().size(); ++idx) {
32 if (params()[idx].size() != 3) {
33 if (params()[idx].size() == 2) {
34 params()[idx].push_back(0.);
35 }
36 else {
37 assert( idx < kNParamTypes );
38 std::stringstream message;
39 message << " TRTRIO_OnTrackErrorScaling: Expected 2 or 3 parameters for " << s_names[idx] << " but got " << params()[idx].size()
40 << ".";
41 throw std::runtime_error( message.str() );
42 }
43 }
44 }
45 return true;
46}
47
49 bool is_endcap,
50 double mu) const
51{
52 Amg::MatrixX newCov = std::move(cov_input);
53 double a = (is_endcap) ? params()[kEndcap][0] : params()[kBarrel][0];
54 double b = (is_endcap) ? params()[kEndcap][1] : params()[kBarrel][1];
55 double c = (is_endcap) ? params()[kEndcap][2] : params()[kBarrel][2];
56 newCov(0,0) *= square(a);
57 newCov(0,0) += square(b);
58 newCov(0,0) *= (1. + mu * c);
59 return newCov;
60}
61
62
std::vector< Identifier > ID
uint32_t CLID
The Class ID type.
static Double_t a
std::atomic< const char * > ClassID_traits< ViewVector< DV > >::s_name
Definition ViewVector.h:339
std::vector< std::vector< double > > & params()
Amg::MatrixX getScaledCovariance(Amg::MatrixX &&cov_input, bool is_endcap, double mu) const
virtual CLID clid() const override final
virtual bool postProcess() override final
static const char *const s_names[kNParamTypes]
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Default, invalid implementation of ClassID_traits.