ATLAS Offline Software
RpcClusterOnTrackCnv_p3.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: RpcClusterOnTrackCnv_p3.cxx
8 //
9 //-----------------------------------------------------------------------------
10 
14 
15 
18  Muon::RpcClusterOnTrack *transObj, MsgStream &log )
19 {
20  Trk::LocalParameters localParams;
21  fillTransFromPStore( &m_localParCnv, persObj->m_localParams, &localParams, log );
22 
24  Amg::MatrixX localCovariance;
26  EigenHelpers::vectorToEigenMatrix(dummy.values, localCovariance, "RpcClusterOnTrackCnv_p3");
27 
29  m_elCnv.persToTrans(&persObj->m_prdLink,&rio,log);
30 
31  *transObj = Muon::RpcClusterOnTrack (rio,
32  std::move(localParams),
33  std::move(localCovariance),
34  Identifier(persObj->m_id),
35  nullptr, // detEL
36  persObj->m_positionAlongStrip,
37  persObj->m_time
38  );
39 
40  // Attempt to call supertool to fill in detElements
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 
50 transToPers( const Muon::RpcClusterOnTrack *transObj,
51  Muon::RpcClusterOnTrack_p3 *persObj, MsgStream &log )
52 {
53  // Prepare ELs
56  m_eventCnvTool->prepareRIO_OnTrackLink(transObj, key, index);
58 
59  m_elCnv.transToPers(&eltmp,&persObj->m_prdLink,log);
60  persObj->m_positionAlongStrip = transObj->positionAlongStrip();
61  persObj->m_time = transObj->time();
62  persObj->m_id = transObj->identify().get_identifier32().get_compact();
63  persObj->m_localParams = toPersistent( &m_localParCnv, &transObj->localParameters(), log );
64  Trk::ErrorMatrix pMat;
65  EigenHelpers::eigenMatrixToVector(pMat.values, transObj->localCovariance(), "RpcClusterOnTrackCnv_p3");
66  persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &pMat, log );
67 }
68 
69 
Muon::RpcClusterOnTrack::detectorElement
virtual const MuonGM::RpcReadoutElement * detectorElement() const override final
Returns the detector element, assoicated with the PRD of this class.
Definition: RpcClusterOnTrack.h:138
Trk::LocalParameters
Definition: LocalParameters.h:98
Muon::RpcClusterOnTrack_p3::m_localErrMat
TPObjRef m_localErrMat
Definition: RpcClusterOnTrack_p3.h:28
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
index
Definition: index.py:1
RpcClusterOnTrackCnv_p3::transToPers
void transToPers(const Muon ::RpcClusterOnTrack *transObj, Muon ::RpcClusterOnTrack_p3 *persObj, MsgStream &log)
Definition: RpcClusterOnTrackCnv_p3.cxx:50
RpcClusterOnTrackCnv_p3::m_errorMxCnv
ErrorMatrixCnv_p1 * m_errorMxCnv
Definition: RpcClusterOnTrackCnv_p3.h:47
Trk::IEventCnvSuperTool::ELIndex_t
unsigned int ELIndex_t
Definition: IEventCnvSuperTool.h:30
Muon::RpcClusterOnTrack_p3
Version 1 of the persistent class representing the transient class Muon::RpcClusterOnTrack.
Definition: RpcClusterOnTrack_p3.h:21
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Muon::RpcClusterOnTrack
Class to represent calibrated clusters formed from RPC strips.
Definition: RpcClusterOnTrack.h:35
RpcClusterOnTrackCnv_p3.h
Muon::MuonClusterOnTrack::idDE
virtual IdentifierHash idDE() const override
Returns an invalid hash.
Definition: MuonClusterOnTrack.h:116
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
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
Trk::ErrorMatrix
Definition: ErrorMatrixCnv_p1.h:25
Trk::IEventCnvSuperTool::ELKey_t
std::string ELKey_t
Key and index types used for an EL to IdentifiableContainer.
Definition: IEventCnvSuperTool.h:29
RpcClusterOnTrackCnv_p3::persToTrans
void persToTrans(const Muon ::RpcClusterOnTrack_p3 *persObj, Muon ::RpcClusterOnTrack *transObj, MsgStream &log)
Definition: RpcClusterOnTrackCnv_p3.cxx:17
EigenHelpers::vectorToEigenMatrix
static void vectorToEigenMatrix(VECTOR &vec, COVARIANCE &cov, const char *)
Helper fn to fill the covariance from the raw data (vec<float>)
Definition: EigenHelpers.h:22
RpcClusterOnTrack.h
Muon::RpcClusterOnTrack_p3::m_time
float m_time
Time in ns.
Definition: RpcClusterOnTrack_p3.h:37
RpcClusterOnTrackCnv_p3::m_localParCnv
LocalParametersCnv_p1 * m_localParCnv
Definition: RpcClusterOnTrackCnv_p3.h:46
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Muon::RpcClusterOnTrack_p3::m_localParams
TPObjRef m_localParams
Definition: RpcClusterOnTrack_p3.h:27
EigenHelpers.h
python.xAODType.dummy
dummy
Definition: xAODType.py:4
Muon::RpcClusterOnTrack_p3::m_prdLink
ElementLinkInt_p3 m_prdLink
Link to PRD.
Definition: RpcClusterOnTrack_p3.h:31
Muon::RpcClusterOnTrack_p3::m_positionAlongStrip
float m_positionAlongStrip
position along strip (double in transient world)
Definition: RpcClusterOnTrack_p3.h:34
EigenHelpers::eigenMatrixToVector
static void eigenMatrixToVector(VECTOR &vec, COVARIANCE &cov, const char *)
Helper fn to get raw data (vec<float>) from the covariance.
Definition: EigenHelpers.h:30
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
Muon::RpcClusterOnTrack_p3::m_id
Identifier32::value_type m_id
base RIO_OnTrack_p1 info
Definition: RpcClusterOnTrack_p3.h:26
ITPConverterFor< TRANS_BASE >::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Persistify an object and store the persistent represenation in the storage vector of the top-level pe...
Definition: TPConverter.h:119
RpcClusterOnTrackCnv_p3::m_eventCnvTool
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
Definition: RpcClusterOnTrackCnv_p3.h:45
Muon::RpcClusterOnTrack::time
float time() const
Return the time (ns)
Definition: RpcClusterOnTrack.h:159
Trk::ErrorMatrix::values
std::vector< float > values
Definition: ErrorMatrixCnv_p1.h:27
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
DeMoScan.index
string index
Definition: DeMoScan.py:364
RpcClusterOnTrackCnv_p3::m_elCnv
ElementLinkCnv_p3< ElementLinkToIDC_RPC_Container > m_elCnv
Definition: RpcClusterOnTrackCnv_p3.h:44
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Muon::MuonClusterOnTrack::positionAlongStrip
virtual double positionAlongStrip() const
Definition: MuonClusterOnTrack.h:68
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14