ATLAS Offline Software
TrackParametersCovarianceCnv.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
16 #ifndef TRKEVENTTPCNV_TRACKPARAMETERSCOVARIANCECNV_H
17 #define TRKEVENTTPCNV_TRACKPARAMETERSCOVARIANCECNV_H
18 
19 
21 
22 template <typename PARMS>
24 {
25 public:
26  static void setCovariance (PARMS* p,
27  const Trk::ErrorMatrix& mat);
28 };
29 
30 
31 template <typename PARMS>
33  const Trk::ErrorMatrix& mat)
34 {
35  if (!p->m_covariance || p->m_covariance->size() != PARMS::dim) {
36  p->m_covariance.emplace();
37  }
38  if (mat.values.size() == PARMS::dim*(PARMS::dim+1)/2){
39  EigenHelpers::vectorToEigenMatrix(mat.values, *(p->m_covariance), "TrackParametersCovarianceCnv");
40  }
41  else if (mat.values.size() == 6) {
42  auto& cov = *(p->m_covariance);
43  cov.setZero();
44  unsigned int pos = 0;
45  for (unsigned int i=0; i < 3; i++)
46  for (unsigned int j=0; j <= i; j++)
47  cov.fillSymmetric (i, j, mat.values[pos++]);
48  }
49  else
50  std::abort();
51 }
52 
53 
54 #endif // not TRKEVENTTPCNV_TRACKPARAMETERSCOVARIANCECNV_H
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
Trk::ErrorMatrix
Definition: ErrorMatrixCnv_p1.h:25
EigenHelpers::vectorToEigenMatrix
static void vectorToEigenMatrix(VECTOR &vec, COVARIANCE &cov, const char *)
Helper fn to fill the covariance from the raw data (vec<float>)
Definition: EigenHelpers.h:22
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ParametersBase.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrackParametersCovarianceCnv
Definition: ParametersBase.h:22
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TrackParametersCovarianceCnv::setCovariance
static void setCovariance(PARMS *p, const Trk::ErrorMatrix &mat)
Definition: TrackParametersCovarianceCnv.h:32