ATLAS Offline Software
Loading...
Searching...
No Matches
TRTRIO_OnTrackErrorScaling Class Referencefinal

#include <TRTRIO_OnTrackErrorScaling.h>

Inheritance diagram for TRTRIO_OnTrackErrorScaling:
Collaboration diagram for TRTRIO_OnTrackErrorScaling:

Public Types

enum  ETRTErrorScalingRegions { kBarrel , kEndcap , kNParamTypes }
enum  Type {
  Pixel = 0 , SCT = 1 , TRT = 2 , MuonEtaPhi = 3 ,
  Unknown = 99
}

Public Member Functions

virtual CLID clid () const override final
Amg::MatrixX getScaledCovariance (Amg::MatrixX &&cov_input, bool is_endcap, double mu) const
virtual bool postProcess () override final
virtual Type type () const override final
std::vector< std::vector< double > > & params ()
const std::vector< std::vector< double > > & params () const

Static Public Member Functions

static const char *const * paramNames ()

Static Public Attributes

static constexpr RIO_OnTrackErrorScaling::Type s_type = RIO_OnTrackErrorScaling::TRT

Protected Member Functions

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.

Static Protected Attributes

static const char *const s_names [kNParamTypes]

Private Attributes

std::vector< std::vector< double > > m_params

Detailed Description

Definition at line 8 of file TRTRIO_OnTrackErrorScaling.h.

Member Enumeration Documentation

◆ ETRTErrorScalingRegions

◆ Type

Enumerator
Pixel 
SCT 
TRT 
MuonEtaPhi 
Unknown 

Definition at line 16 of file RIO_OnTrackErrorScaling.h.

Member Function Documentation

◆ checkParameters()

void RIO_OnTrackErrorScaling::checkParameters ( const char * label,
unsigned int n_paramter_sets,
const char *const * param_names,
unsigned int n_paramters ) const
protectedinherited

Convenience function to check whether the number of parameters is correct.

Parameters
labela label for the error scaling class in case an error is issued.
n_paramter_setsthe number of parameter sets
param_namesthe names of the parameter sets
n_paramtersthe number of parameters per set.

Definition at line 14 of file RIO_OnTrackErrorScaling.cxx.

18{
19 if (params().size() != n_paramter_sets ) {
20 std::stringstream message;
21 message << label << ": Expecting parameters for 2 parameters for";
22 for (unsigned int idx=0; idx < n_paramter_sets; ++idx) {
23 message << " " << param_names[idx];
24 }
25 message << " But got " << params().size() << ".";
26 throw std::runtime_error( message.str() );
27 }
28 for (unsigned int idx=0; idx<params().size(); ++idx) {
29 if (params()[idx].size() != n_paramters) {
30 assert( idx < n_paramter_sets );
31 std::stringstream message;
32 message << label << ": Expected 2 parameters for " << param_names[idx] << " but got " << params()[idx].size()
33 << ".";
34 throw std::runtime_error( message.str() );
35 }
36 }
37}
std::vector< std::vector< double > > & params()
std::string label(const std::string &format, int i)
Definition label.h:19

◆ clid()

CLID TRTRIO_OnTrackErrorScaling::clid ( ) const
finaloverridevirtual

Reimplemented from RIO_OnTrackErrorScaling.

Definition at line 16 of file TRTRIO_OnTrackErrorScaling.cxx.

16 {
17 return ClassID_traits<CondCont<TRTRIO_OnTrackErrorScaling> >::ID();
18}
std::vector< Identifier > ID

◆ getScaledCovariance()

Amg::MatrixX TRTRIO_OnTrackErrorScaling::getScaledCovariance ( Amg::MatrixX && cov_input,
bool is_endcap,
double mu ) const

Definition at line 48 of file TRTRIO_OnTrackErrorScaling.cxx.

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}
static Double_t a
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.

◆ paramNames()

const char *const * TRTRIO_OnTrackErrorScaling::paramNames ( )
inlinestatic

Definition at line 25 of file TRTRIO_OnTrackErrorScaling.h.

25{ return s_names; }
static const char *const s_names[kNParamTypes]

◆ params() [1/2]

std::vector< std::vector< double > > & RIO_OnTrackErrorScaling::params ( )
inlineinherited

Definition at line 29 of file RIO_OnTrackErrorScaling.h.

29{ return m_params; }
std::vector< std::vector< double > > m_params

◆ params() [2/2]

const std::vector< std::vector< double > > & RIO_OnTrackErrorScaling::params ( ) const
inlineinherited

Definition at line 30 of file RIO_OnTrackErrorScaling.h.

30{ return m_params; }

◆ postProcess()

bool TRTRIO_OnTrackErrorScaling::postProcess ( )
finaloverridevirtual

Reimplemented from RIO_OnTrackErrorScaling.

Definition at line 20 of file TRTRIO_OnTrackErrorScaling.cxx.

20 {
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}
std::atomic< const char * > ClassID_traits< ViewVector< DV > >::s_name
Definition ViewVector.h:339

◆ type()

virtual Type TRTRIO_OnTrackErrorScaling::type ( ) const
inlinefinaloverridevirtual

Reimplemented from RIO_OnTrackErrorScaling.

Definition at line 28 of file TRTRIO_OnTrackErrorScaling.h.

28{return s_type;}
static constexpr RIO_OnTrackErrorScaling::Type s_type

Member Data Documentation

◆ m_params

std::vector<std::vector<double> > RIO_OnTrackErrorScaling::m_params
privateinherited

Definition at line 47 of file RIO_OnTrackErrorScaling.h.

◆ s_names

const char *const TRTRIO_OnTrackErrorScaling::s_names
staticprotected
Initial value:
={
"TRT Barrel",
"TRT Endcap"
}

Definition at line 7 of file TRTRIO_OnTrackErrorScaling.h.

9{
10public:

◆ s_type

RIO_OnTrackErrorScaling::Type TRTRIO_OnTrackErrorScaling::s_type = RIO_OnTrackErrorScaling::TRT
staticconstexpr

Definition at line 11 of file TRTRIO_OnTrackErrorScaling.h.


The documentation for this class was generated from the following files: