ATLAS Offline Software
Loading...
Searching...
No Matches
SCTRIO_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 "SCT Barrel",
9 "SCT Endcap"
10};
11
12namespace {
13 inline double square(double a) { return a*a; }
14}
15
19
21 checkParameters("SCTRIO_OnTrackErrorScaling", kNParamTypes, s_names, 2);
22 return true;
23}
24
26 bool is_endcap,
27 double sinLocalAngle) const
28{
29 Amg::MatrixX newCov = std::move(cov_input);
30 if (is_endcap && newCov.rows() > 1) {
31 double Sn = sinLocalAngle;
32 double Sn2 = square(Sn);
33 double Cs2 = (1.-Sn)*(1.+Sn);
34 double SC = Sn*sqrt(Cs2);
35 double a = params()[kEndcap][0];
36 double b = params()[kEndcap][1];
37 double dV0 = (Cs2*newCov(0,0)+Sn2*newCov(1,1)
38 +2.*SC*newCov(1,0))*(square(a)-1.) + square(b);
39 newCov(0,0)+= (Cs2*dV0);
40 newCov(1,0)+= (SC *dV0);
41 newCov(0,1) = newCov(1,0);
42 newCov(1,1)+= (Sn2*dV0);
43 } else {
44 double a = (is_endcap) ? params()[kEndcap][0] : params()[kBarrel][0];
45 double b = (is_endcap) ? params()[kEndcap][1] : params()[kBarrel][1];
46 newCov(0,0) *= square(a);
47 newCov(0,0) += square(b);
48 }
49 //std::cout << "DEBUG createScaledSctCovariance endcap:" << is_endcap << " angle=" << sinLocalAngle << " " << cov_input << " -> " << newCov << std::endl;
50 return newCov;
51}
std::vector< Identifier > ID
uint32_t CLID
The Class ID type.
static Double_t a
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()
virtual bool postProcess() override final
Amg::MatrixX getScaledCovariance(Amg::MatrixX &&cov_input, bool is_endcap, double sinLocalAngle) const
virtual CLID clid() const 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.