ATLAS Offline Software
Loading...
Searching...
No Matches
STGC_ClusterOnTrackCnv_p1.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: STGCClusterOnTrackCnv_p1.cxx
8//
9//-----------------------------------------------------------------------------
10
14
17 Muon::sTgcClusterOnTrack *transObj, MsgStream &log )
18{
19 // std::cout<<"BLAH! STGC_ClusterOnTrackCnv_p1::persToTrans"<<std::endl;
20
21 transObj->m_identifier = persObj->m_id;
22 fillTransFromPStore( &m_localParCnv, persObj->m_localParams, &transObj->m_localParams, log );
23 Trk::ErrorMatrix dummy;
24 fillTransFromPStore( &m_errorMxCnv, persObj->m_localErrMat, &dummy, log );
25 EigenHelpers::vectorToEigenMatrix(dummy.values, transObj->m_localCovariance, "RIO_OnTrackCnv_p2");
26
27 m_elCnv.persToTrans(&persObj->m_prdLink,&transObj->m_rio,log);
28 transObj->m_positionAlongStrip = persObj->m_positionAlongStrip;
29
30 // Attempt to call supertool to fill in detElements
31 m_eventCnvTool->recreateRIO_OnTrack(transObj);
32 if (transObj->detectorElement()==nullptr)
33 log << MSG::WARNING<<"Unable to reset DetEl for this RIO_OnTrack, "
34 << "probably because of a problem with the Identifier/IdentifierHash : ("
35 << transObj->identify()<<"/"<<transObj->idDE()<<")"<<endmsg;
36}
37
38
41 Muon::STGC_ClusterOnTrack_p1 *persObj, MsgStream &log )
42{
43 // std::cout<<"BLAH! STGC_ClusterOnTrackCnv_p1::persToTrans"<<std::endl;
44 // log << MSG::INFO<<"Identifier/IdentifierHash : ("
45 // << transObj->identify()<<"/"<<transObj->idDE()<<endmsg;
46
47 // Prepare ELs
50 m_eventCnvTool->prepareRIO_OnTrackLink(transObj, key, index);
52
53 m_elCnv.transToPers(&eltmp, &persObj->m_prdLink,log);
54 persObj->m_positionAlongStrip = transObj->positionAlongStrip();
55 persObj->m_id = transObj->identify().get_identifier32().get_compact();
56 persObj->m_localParams = toPersistent( &m_localParCnv, &transObj->localParameters(), log );
58 EigenHelpers::eigenMatrixToVector(pMat.values, transObj->localCovariance(), "STGC_ClusterOnTrackCnv_p1");
59 persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &pMat, log );
60}
61
62
#define endmsg
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
double m_positionAlongStrip
The position along the strip - used to calculate the GlobalPosition.
virtual IdentifierHash idDE() const override
Returns an invalid hash.
Version 1 of the persistent class representing the transient class Muon::STGC_ClusterOnTrack.
float m_positionAlongStrip
position along strip (double in transient world)
Identifier32::value_type m_id
base RIO_OnTrack_p1 info
ElementLinkInt_p3 m_prdLink
Link to PRD.
Class to represent calibrated clusters formed from TGC strips.
virtual const MuonGM::sTgcReadoutElement * detectorElement() const override final
Returns the detector element, assoicated with the PRD of this class.
ElementLinkToIDC_STGC_Container m_rio
PrepRawData object assoicated with this measurement.
void persToTrans(const Muon ::STGC_ClusterOnTrack_p1 *persObj, Muon ::sTgcClusterOnTrack *transObj, MsgStream &log)
ElementLinkCnv_p3< ElementLinkToIDC_STGC_Container > m_elCnv
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
LocalParametersCnv_p1 * m_localParCnv
void transToPers(const Muon ::sTgcClusterOnTrack *transObj, Muon ::STGC_ClusterOnTrack_p1 *persObj, MsgStream &log)
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.
LocalParameters m_localParams
Amg::MatrixX m_localCovariance
Identifier identify() const
return the identifier -extends MeasurementBase
Identifier m_identifier
Identifier of the RIO_OnTrack (comes from the associated Trk::PrepRawData)
static void eigenMatrixToVector(VECTOR &vec, COVARIANCE &cov, const char *)
Definition index.py:1
ElementLink< Muon::sTgcPrepDataContainer > ElementLinkToIDC_STGC_Container