ATLAS Offline Software
Loading...
Searching...
No Matches
TgcClusterOnTrackCnv_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//-----------------------------------------------------------------------------
6//
7// file: TgcClusterOnTrackCnv_p2.cxx
8//
9//-----------------------------------------------------------------------------
10
14
15
18 Muon::TgcClusterOnTrack *transObj, MsgStream &log )
19{
20 Trk::LocalParameters localParams;
21 fillTransFromPStore( &m_localParCnv, persObj->m_localParams, &localParams, log );
22
23 Trk::ErrorMatrix dummy;
24 Amg::MatrixX localCovariance;
25 fillTransFromPStore( &m_errorMxCnv, persObj->m_localErrMat, &dummy, log );
26 EigenHelpers::vectorToEigenMatrix(dummy.values, localCovariance, "TgcClusterOnTrackCnv_p2");
27
29 m_elCnv.persToTrans(&persObj->m_prdLink,&rio,log);
30
31 *transObj = Muon::TgcClusterOnTrack (rio,
32 std::move(localParams),
33 std::move(localCovariance),
34 Identifier(persObj->m_id),
35 nullptr,
36 persObj->m_positionAlongStrip);
37
38
39 // Attempt to call supertool to fill in detElements
40 m_eventCnvTool->recreateRIO_OnTrack(transObj);
41 if (!transObj->detectorElement())
42 log << MSG::WARNING<<"Unable to reset DetEl for this RIO_OnTrack, "
43 << "probably because of a problem with the Identifier/IdentifierHash : ("
44 << transObj->identify()<<"/"<<transObj->idDE()<<endmsg;
45 }
46
47
50 Muon::TgcClusterOnTrack_p2 *persObj, MsgStream &log )
51{
52 // Prepare ELs
55 m_eventCnvTool->prepareRIO_OnTrackLink(transObj, key, index);
57
58 m_elCnv.transToPers(&eltmp, &persObj->m_prdLink,log);
59 persObj->m_positionAlongStrip = transObj->positionAlongStrip();
60
61 persObj->m_id = transObj->identify().get_identifier32().get_compact();
62 persObj->m_localParams = toPersistent( &m_localParCnv, &transObj->localParameters(), log );
64 EigenHelpers::eigenMatrixToVector(pMat.values, transObj->localCovariance(), "TgcClusterOnTrackCnv_p2");
65 persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &pMat, log );
66}
67
68
#define endmsg
ElementLink< Muon::TgcPrepDataContainer > ElementLinkToIDC_TGC_Container
Class to implement Cluster On Track for Si.
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
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
virtual double positionAlongStrip() const
virtual IdentifierHash idDE() const override
Returns an invalid hash.
Version 2 of the persistent class representing the transient class Muon::TgcClusterOnTrack.
Identifier32::value_type m_id
base RIO_OnTrack_p1 info
float m_positionAlongStrip
position along strip (double in transient world)
ElementLinkInt_p3 m_prdLink
Link to PRD.
Class to represent calibrated clusters formed from TGC strips.
virtual const MuonGM::TgcReadoutElement * detectorElement() const
Returns the detector element, assoicated with the PRD of this class.
ElementLinkCnv_p3< ElementLinkToIDC_TGC_Container > m_elCnv
void persToTrans(const Muon ::TgcClusterOnTrack_p2 *persObj, Muon ::TgcClusterOnTrack *transObj, MsgStream &log)
void transToPers(const Muon ::TgcClusterOnTrack *transObj, Muon ::TgcClusterOnTrack_p2 *persObj, MsgStream &log)
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
LocalParametersCnv_p1 * m_localParCnv
std::vector< float > values
std::string ELKey_t
Key and index types used for an EL to IdentifiableContainer.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Identifier identify() const
return the identifier -extends MeasurementBase
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
static void eigenMatrixToVector(VECTOR &vec, COVARIANCE &cov, const char *)
Definition index.py:1