ATLAS Offline Software
MuonSegmentCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include "TrkSurfaces/Surface.h"
11 
12 
13 void MuonSegmentCnv_p1::persToTrans( const Muon::MuonSegment_p1 *persObj, Muon::MuonSegment *transObj, MsgStream &log )
14 {
15  Amg::Vector2D locSegPos;
16  locSegPos.setZero();
17 
18  Trk::LocalDirection localDirection;
19  m_localDirCnv.persToTrans(&persObj->m_localDirection,&localDirection,log);
20 
21  ITPConverterFor<Trk::Surface> *associatedSurfaceCnv(nullptr);
22  Trk::Surface* temp = createTransFromPStore( &associatedSurfaceCnv, persObj->m_associatedSurface, log );
23  Trk::PlaneSurface* associatedSurface =
24  dynamic_cast<Trk::PlaneSurface*>(temp);
25  if(!associatedSurface) throw std::runtime_error( "MuonSegmentCnv_p1::persToTrans : Cannot get associated surface!" );
26 
27 
28  *transObj = Muon::MuonSegment (locSegPos,
29  localDirection,
30  Amg::MatrixX(), // locErr,
31  associatedSurface,
33  nullptr, // qual
35  );
36  fillTransFromPStore( &m_segmentCnv, persObj->m_segment, transObj, log );
37  transObj->setT0Error (persObj->m_t0, persObj->m_t0Error);
38  transObj->recalculateCache();
39 }
40 
41 
42 void MuonSegmentCnv_p1::transToPers( const Muon::MuonSegment */*transObj*/, Muon::MuonSegment_p1 */*persObj*/, MsgStream &/*log*/ )
43 {
44  throw std::runtime_error( "MuonSegmentCnv_p1::transToPers is deprecated!" );
45 }
Muon::MuonSegment_p1::m_t0Error
float m_t0Error
Definition: MuonSegment_p1.h:29
ITPConverterFor< Trk::Surface >
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
Surface.h
Muon::MuonSegment_p1::m_associatedSurface
TPObjRef m_associatedSurface
Definition: MuonSegment_p1.h:27
Muon::MuonSegment_p1::m_localDirection
Trk::LocalDirection_p1 m_localDirection
Definition: MuonSegment_p1.h:26
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
MuonSegmentCnv_p1::transToPers
void transToPers(const Muon ::MuonSegment *transObj, Muon::MuonSegment_p1 *persObj, MsgStream &log)
Definition: MuonSegmentCnv_p1.cxx:42
MuonSegmentCnv_p1.h
MuonSegmentCnv_p1::persToTrans
void persToTrans(const Muon ::MuonSegment_p1 *persObj, Muon::MuonSegment *transObj, MsgStream &log)
Definition: MuonSegmentCnv_p1.cxx:13
Muon::MuonSegment_p1::m_segment
TPObjRef m_segment
Definition: MuonSegment_p1.h:24
xAOD::MuonSegment
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Definition: Event/xAOD/xAODMuon/xAODMuon/MuonSegment.h:13
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
MuonSegmentCnv_p1::m_segmentCnv
SegmentCnv_p1 * m_segmentCnv
Definition: MuonSegmentCnv_p1.h:38
Muon::MuonSegment::setT0Error
void setT0Error(float t0, float t0Error)
set the fitted time and error on the time
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:205
Trk::Segment::AuthorUnknown
@ AuthorUnknown
Definition: TrkEvent/TrkSegment/TrkSegment/Segment.h:64
DataVector< const Trk::MeasurementBase >
Trk::LocalDirection
represents the three-dimensional global direction with respect to a planar surface frame.
Definition: LocalDirection.h:81
Muon::MuonSegment::recalculateCache
void recalculateCache()
recalculate the cache
Definition: MuonSegment.cxx:109
Trk::PlaneSurface
Definition: PlaneSurface.h:64
PlaneSurface.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MuonSegmentCnv_p1::m_localDirCnv
LocalDirectionCnv_p1 m_localDirCnv
Definition: MuonSegmentCnv_p1.h:39
MuonSegment.h
Muon::MuonSegment_p1
Definition: MuonSegment_p1.h:20
LocalDirection.h
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Muon::MuonSegment_p1::m_t0
float m_t0
Definition: MuonSegment_p1.h:28
DetElementSurface.h
LocalDirectionCnv_p1::persToTrans
virtual void persToTrans(const Trk ::LocalDirection_p1 *persObj, Trk ::LocalDirection *transObj, MsgStream &log)
Definition: LocalDirectionCnv_p1.cxx:14
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