ATLAS Offline Software
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 
12 namespace {
13  inline double square(double a) { return a*a; }
14 }
15 
18 }
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 }
SCTRIO_OnTrackErrorScaling.h
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
SCTRIO_OnTrackErrorScaling::postProcess
virtual bool postProcess() override final
Definition: SCTRIO_OnTrackErrorScaling.cxx:20
SCTRIO_OnTrackErrorScaling::clid
virtual CLID clid() const override final
Definition: SCTRIO_OnTrackErrorScaling.cxx:16
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
TRT_PAI_gasdata::SC
const float SC[NC]
Cross sections for Carbon.
Definition: TRT_PAI_gasdata.h:255
SCTRIO_OnTrackErrorScaling::kNParamTypes
@ kNParamTypes
Definition: SCTRIO_OnTrackErrorScaling.h:22
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
SCTRIO_OnTrackErrorScaling::s_names
static const char *const s_names[kNParamTypes]
Definition: SCTRIO_OnTrackErrorScaling.h:30
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10
SCTRIO_OnTrackErrorScaling::getScaledCovariance
Amg::MatrixX getScaledCovariance(Amg::MatrixX &&cov_input, bool is_endcap, double sinLocalAngle) const
Definition: SCTRIO_OnTrackErrorScaling.cxx:25
SCTRIO_OnTrackErrorScaling::kBarrel
@ kBarrel
Definition: SCTRIO_OnTrackErrorScaling.h:20
RIO_OnTrackErrorScaling::checkParameters
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.
Definition: RIO_OnTrackErrorScaling.cxx:14
SCTRIO_OnTrackErrorScaling::kEndcap
@ kEndcap
Definition: SCTRIO_OnTrackErrorScaling.h:21
RIO_OnTrackErrorScaling::params
std::vector< std::vector< double > > & params()
Definition: RIO_OnTrackErrorScaling.h:29