ATLAS Offline Software
Loading...
Searching...
No Matches
CscClusterOnTrackCnv_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: CscClusterOnTrackCnv_p2.cxx
8//
9//-----------------------------------------------------------------------------
10
14
15
18 Muon::CscClusterOnTrack *transObj, MsgStream &log )
19{
21 m_elCnv.persToTrans(&persObj->m_prdLink,&rio,log);
22
23 Trk::LocalParameters localParams;
24 fillTransFromPStore( &m_localParCnv, persObj->m_localParams, &localParams, log );
25
26 Trk::ErrorMatrix dummy;
27 Amg::MatrixX localCovariance;
28 fillTransFromPStore( &m_errorMxCnv, persObj->m_localErrMat, &dummy, log );
29 EigenHelpers::vectorToEigenMatrix(dummy.values, localCovariance, "CscClusterOnTrackCnv_p2");
30
31 *transObj = Muon::CscClusterOnTrack (rio,
32 std::move(localParams),
33 std::move(localCovariance),
34 Identifier(persObj->m_id),
35 nullptr, // detEL
36 persObj->m_positionAlongStrip,
37 static_cast<Muon::CscClusterStatus>((persObj->m_status)&0xFF), // First 8 bits reserved for ClusterStatus.
38 static_cast<Muon::CscTimeStatus>((persObj->m_status)>>8),
39 persObj->m_time);
40
41 m_eventCnvTool->recreateRIO_OnTrack(transObj);
42 if (transObj->detectorElement()==nullptr)
43 log << MSG::WARNING<<"Unable to reset DetEl for this RIO_OnTrack, "
44 << "probably because of a problem with the Identifier/IdentifierHash : ("
45 << transObj->identify()<<"/"<<transObj->idDE()<<endmsg;
46}
47
48
51 Muon::CscClusterOnTrack_p2 *persObj, MsgStream &log )
52{
53 // Prepare ELs
56 m_eventCnvTool->prepareRIO_OnTrackLink(transObj, key, index);
58 m_elCnv.transToPers(&eltmp, &persObj->m_prdLink,log);
59
60 persObj->m_id = transObj->identify().get_identifier32().get_compact();
61 persObj->m_localParams = toPersistent( &m_localParCnv, &transObj->localParameters(), log );
62 // persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &transObj->m_localErrMat, log );
64 EigenHelpers::eigenMatrixToVector(pMat.values, transObj->localCovariance(), "CscClusterOnTrackCnv_p2");
65 persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &pMat, log );
66
67 persObj->m_status = (transObj->timeStatus()<<8); // First 8 bits reserved for ClusterStatus.
68 persObj->m_status += transObj->status();
69 persObj->m_positionAlongStrip = transObj->positionAlongStrip();
70 persObj->m_time = transObj->time();
71}
72
73
#define endmsg
ElementLink< Muon::CscPrepDataContainer > ElementLinkToIDC_CSC_Container
Class to implement Cluster On Track for Si.
void transToPers(const Muon ::CscClusterOnTrack *transObj, Muon ::CscClusterOnTrack_p2 *persObj, MsgStream &log)
void persToTrans(const Muon ::CscClusterOnTrack_p2 *persObj, Muon ::CscClusterOnTrack *transObj, MsgStream &log)
ElementLinkCnv_p3< ElementLinkToIDC_CSC_Container > m_elCnv
LocalParametersCnv_p1 * m_localParCnv
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
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.
Version 1 of the persistent class representing the transient class Muon::CscClusterOnTrack.
float m_positionAlongStrip
position along strip (double in transient world)
ElementLinkInt_p3 m_prdLink
Link to PRD.
Identifier32::value_type m_id
base RIO_OnTrack_p1 info
unsigned int m_status
Corresponds to CscClusterStatus in transient class.
Class to represent the calibrated clusters created from CSC strips.
virtual const MuonGM::CscReadoutElement * detectorElement() const override final
Returns the detector element, associated with the PRD of this class.
CscClusterStatus status() const
Returns Csc position measurement status flag.
CscTimeStatus timeStatus() const
Returns Csc time measurement status flag.
float time() const
Return the time(ns)
virtual double positionAlongStrip() const
virtual IdentifierHash idDE() const override
Returns an invalid hash.
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 *)
CscClusterStatus
Enum to represent the cluster status - see the specific enum values for more details.
CscTimeStatus
Enum to represent the cluster time measurement status - see the specific enum values for more details...
Definition index.py:1