ATLAS Offline Software
Loading...
Searching...
No Matches
MuonSegmentCnv_p2.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5
12
13
14void MuonSegmentCnv_p2::persToTrans( const Muon::MuonSegment_p1 *persObj, Muon::MuonSegment *transObj, MsgStream &log )
15{
16 Amg::Vector2D locSegPos;
17 locSegPos.setZero();
18
19 Trk::LocalDirection localDirection;
20 m_localDirCnv.persToTrans(&persObj->m_localDirection,&localDirection,log);
21
22 Trk::PlaneSurface* associatedSurface =
23 static_cast<Trk::PlaneSurface*>(this->createTransFromPStore( &m_surfCnv, persObj->m_associatedSurface, log ));
24
25 *transObj = Muon::MuonSegment (locSegPos,
26 localDirection,
27 Amg::MatrixX(), // locErr,
28 associatedSurface,
30 nullptr, // qual
32 );
33 fillTransFromPStore( &m_segmentCnv, persObj->m_segment, transObj, log );
34 transObj->setT0Error (persObj->m_t0, persObj->m_t0Error);
35 transObj->recalculateCache();
36}
37
38
39void MuonSegmentCnv_p2::transToPers( const Muon::MuonSegment *transObj, Muon::MuonSegment_p1 *persObj, MsgStream &log )
40{
41 persObj->m_segment = baseToPersistent( &m_segmentCnv, transObj, log );
42 m_localDirCnv.transToPers(&transObj->localDirection(),&persObj->m_localDirection,log);
43
44 m_surfCnv=nullptr;
45 if (transObj->associatedSurface().isFree() ) // if this is a free surface, write it out 'as is'
46 persObj->m_associatedSurface = toPersistent(&m_surfCnv, &transObj->associatedSurface(), log);
47 else { // else, make it into a DetElementSurface, to allow the correct convertor to be called
49 persObj->m_associatedSurface = toPersistent(&m_surfCnv, &surf, log);
50 }
51
52 persObj->m_t0 = transObj->time();
53 persObj->m_t0Error = transObj->errorTime();
54
55}
Derived DataVector<T>.
Definition DataVector.h:795
TPObjRef baseToPersistent(CNV **cnv, const typename CNV::Trans_t *transObj, MsgStream &log) const
Definition TPConverter.h:97
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
LocalDirectionCnv_p1 m_localDirCnv
void persToTrans(const Muon ::MuonSegment_p1 *persObj, Muon::MuonSegment *transObj, MsgStream &log)
void transToPers(const Muon ::MuonSegment *transObj, Muon::MuonSegment_p1 *persObj, MsgStream &log)
SegmentCnv_p1 * m_segmentCnv
ITPConverterFor< Trk::Surface > * m_surfCnv
Trk::LocalDirection_p1 m_localDirection
This is the common class for 3D segments used in the muon spectrometer.
void recalculateCache()
recalculate the cache
void setT0Error(float t0, float t0Error)
set the fitted time and error on the time
virtual const Trk::PlaneSurface & associatedSurface() const override final
returns the surface for the local to global transformation
represents the three-dimensional global direction with respect to a planar surface frame.
Class for a planaer rectangular or trapezoidal surface in the ATLAS detector.
float errorTime() const
access to the error on the measured time
float time() const
access to the measured time
bool isFree() const
Returns 'true' if this surface is 'free', i.e.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D