ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Attributes | Private Attributes | List of all members
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 *constparamNames ()
 

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. More...
 

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

Enumerator
kBarrel 
kEndcap 
kNParamTypes 

Definition at line 18 of file TRTRIO_OnTrackErrorScaling.h.

19  {
20  kBarrel,
21  kEndcap,
23  };

◆ Type

Enumerator
Pixel 
SCT 
TRT 
MuonEtaPhi 
Unknown 

Definition at line 16 of file RIO_OnTrackErrorScaling.h.

16  {
17  Pixel = 0,
18  SCT = 1,
19  TRT = 2,
20  MuonEtaPhi = 3,
21  Unknown = 99
22  };

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 }

◆ clid()

CLID TRTRIO_OnTrackErrorScaling::clid ( ) const
finaloverridevirtual

Reimplemented from RIO_OnTrackErrorScaling.

Definition at line 16 of file TRTRIO_OnTrackErrorScaling.cxx.

◆ 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 }

◆ paramNames()

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

Definition at line 25 of file TRTRIO_OnTrackErrorScaling.h.

25 { return s_names; }

◆ 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; }

◆ 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 }

◆ 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;}

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 30 of file TRTRIO_OnTrackErrorScaling.h.

◆ s_type

constexpr 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:
TRTRIO_OnTrackErrorScaling::kEndcap
@ kEndcap
Definition: TRTRIO_OnTrackErrorScaling.h:21
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
Pixel
Definition: PixelFEUtils.h:16
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
TRTRIO_OnTrackErrorScaling::s_type
static constexpr RIO_OnTrackErrorScaling::Type s_type
Definition: TRTRIO_OnTrackErrorScaling.h:11
TRTRIO_OnTrackErrorScaling::kBarrel
@ kBarrel
Definition: TRTRIO_OnTrackErrorScaling.h:20
ReweightUtils.message
message
Definition: ReweightUtils.py:15
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TRT
Definition: HitInfo.h:33
RIO_OnTrackErrorScaling::m_params
std::vector< std::vector< double > > m_params
Definition: RIO_OnTrackErrorScaling.h:47
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
TRTRIO_OnTrackErrorScaling::kNParamTypes
@ kNParamTypes
Definition: TRTRIO_OnTrackErrorScaling.h:22
SCT
Definition: SCT_ChipUtils.h:14
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
RIO_OnTrackErrorScaling::Unknown
@ Unknown
Definition: RIO_OnTrackErrorScaling.h:21
RIO_OnTrackErrorScaling::MuonEtaPhi
@ MuonEtaPhi
Definition: RIO_OnTrackErrorScaling.h:20
RIO_OnTrackErrorScaling::params
std::vector< std::vector< double > > & params()
Definition: RIO_OnTrackErrorScaling.h:29
TRTRIO_OnTrackErrorScaling::s_names
static const char *const s_names[kNParamTypes]
Definition: TRTRIO_OnTrackErrorScaling.h:30
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
python.compressB64.c
def c
Definition: compressB64.py:93