ATLAS Offline Software
SegmentCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TrkSegment/Segment.h"
9 
10 void SegmentCnv_p1::persToTrans( const Trk::Segment_p1 *persObj, Trk::Segment *transObj, MsgStream &log )
11 {
15  EigenHelpers::vectorToEigenMatrix(dummy.values, transObj->m_localCovariance, "SegmentCnv_p1");
16 
18 
19  std::unique_ptr<DataVector<const Trk::MeasurementBase>> containedMeasBase(
21 
22  transObj->m_containedMeasBases = std::move(*containedMeasBase);
23 
24  transObj->m_author = static_cast<Trk::Segment::Author>( persObj->m_author );
25 }
26 
27 
28 void SegmentCnv_p1::transToPers( const Trk::Segment * transObj, Trk::Segment_p1 * persObj, MsgStream & log)
29 {
30 
31  persObj->m_localParameters = toPersistent( &m_localParCnv, &transObj->m_localParams, log );
32 
33  Trk::ErrorMatrix pMat;
35  pMat.values, transObj->m_localCovariance, "SegmentCnv_p1");
36  persObj->m_localErrorMatrix = toPersistent(&m_errorMxCnv, &pMat, log);
37 
38  persObj->m_fitQuality =
40  transObj->m_fitQuality.get(),
41  log);
42 
44  &transObj->m_containedMeasBases, &persObj->m_containedMeasBases, log);
45  persObj->m_author = static_cast<uint16_t>(transObj->m_author);
46 }
Trk::Segment::Author
Author
enum to identify who created the segment.
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:63
ITPConverterFor< Trk::FitQuality >
Trk::Segment_p1::m_containedMeasBases
std::vector< TPObjRef > m_containedMeasBases
Definition: Segment_p1.h:35
Trk::Segment_p1::m_author
uint16_t m_author
Definition: Segment_p1.h:37
Trk::Segment_p1
Definition: Segment_p1.h:23
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
Trk::Segment::m_containedMeasBases
DataVector< const MeasurementBase > m_containedMeasBases
The vector of contained (generic) Trk::MeasurementBase objects.
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:153
Trk::Segment_p1::m_localParameters
TPObjRef m_localParameters
Definition: Segment_p1.h:26
SegmentCnv_p1::m_containedMeasBasesCnv
MeasurementBaseCnv_p1 m_containedMeasBasesCnv
Definition: SegmentCnv_p1.h:49
ITPConverterFor< TRANS_BASE >::fillTransFromPStore
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
Convert persistent object, stored in the the top-level persistent object and referenced by the TP Ref...
Definition: TPConverter.h:145
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
Trk::Segment_p1::m_localErrorMatrix
TPObjRef m_localErrorMatrix
Definition: Segment_p1.h:31
SegmentCnv_p1::m_errorMxCnv
ErrorMatrixCnv_p1 * m_errorMxCnv
Definition: SegmentCnv_p1.h:47
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
Segment.h
Trk::Segment
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:56
EigenHelpers.h
TPPolyVectorCnv::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
Definition: TPConverter.h:1122
python.xAODType.dummy
dummy
Definition: xAODType.py:4
Trk::MeasurementBase::m_localParams
LocalParameters m_localParams
Definition: MeasurementBase.h:111
EigenHelpers::eigenMatrixToVector
static void eigenMatrixToVector(VECTOR &vec, COVARIANCE &cov, const char *)
Helper fn to get raw data (vec<float>) from the covariance.
Definition: EigenHelpers.h:30
ITPConverterFor< TRANS_BASE >::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Persistify an object and store the persistent represenation in the storage vector of the top-level pe...
Definition: TPConverter.h:119
Trk::Segment::m_fitQuality
std::unique_ptr< FitQuality > m_fitQuality
The fit quality of the Segment.
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:150
Trk::Segment::m_author
Author m_author
segment author
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:156
Trk::ErrorMatrix::values
std::vector< float > values
Definition: ErrorMatrixCnv_p1.h:27
Trk::MeasurementBase::m_localCovariance
Amg::MatrixX m_localCovariance
Definition: MeasurementBase.h:112
SegmentCnv_p1::persToTrans
void persToTrans(const Trk::Segment_p1 *persObj, Trk::Segment *transObj, MsgStream &log)
Definition: SegmentCnv_p1.cxx:10
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SegmentCnv_p1::m_localParCnv
LocalParametersCnv_p1 * m_localParCnv
Definition: SegmentCnv_p1.h:46
SegmentCnv_p1::transToPers
void transToPers(const Trk::Segment *transObj, Trk::Segment_p1 *persObj, MsgStream &log)
Definition: SegmentCnv_p1.cxx:28
Trk::Segment_p1::m_fitQuality
TPObjRef m_fitQuality
Definition: Segment_p1.h:33
FitQuality.h
ITPConverterFor< TRANS_BASE >::createTransFromPStore
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Create transient representation of a persistent object, stored in the the top-level persistent object...
Definition: TPConverter.h:172
SegmentCnv_p1.h