ATLAS Offline Software
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 
24  Amg::MatrixX localCovariance;
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 
49 transToPers( const Muon::TgcClusterOnTrack *transObj,
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 );
63  Trk::ErrorMatrix pMat;
64  EigenHelpers::eigenMatrixToVector(pMat.values, transObj->localCovariance(), "TgcClusterOnTrackCnv_p2");
65  persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &pMat, log );
66 }
67 
68 
Muon::TgcClusterOnTrack_p2::m_id
Identifier32::value_type m_id
base RIO_OnTrack_p1 info
Definition: TgcClusterOnTrack_p2.h:26
Trk::LocalParameters
Definition: LocalParameters.h:98
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
TgcClusterOnTrackCnv_p2::m_eventCnvTool
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
Definition: TgcClusterOnTrackCnv_p2.h:44
Muon::TgcClusterOnTrack_p2
Version 2 of the persistent class representing the transient class Muon::TgcClusterOnTrack.
Definition: TgcClusterOnTrack_p2.h:21
index
Definition: index.py:1
Trk::IEventCnvSuperTool::ELIndex_t
unsigned int ELIndex_t
Definition: IEventCnvSuperTool.h:30
Muon::TgcClusterOnTrack_p2::m_positionAlongStrip
float m_positionAlongStrip
position along strip (double in transient world)
Definition: TgcClusterOnTrack_p2.h:34
Muon::TgcClusterOnTrack
Class to represent calibrated clusters formed from TGC strips.
Definition: TgcClusterOnTrack.h:46
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Muon::TgcClusterOnTrack::detectorElement
virtual const MuonGM::TgcReadoutElement * detectorElement() const
Returns the detector element, assoicated with the PRD of this class.
Definition: TgcClusterOnTrack.h:140
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
TgcClusterOnTrack.h
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
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EigenHelpers.h
python.xAODType.dummy
dummy
Definition: xAODType.py:4
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
TgcClusterOnTrackCnv_p2::m_elCnv
ElementLinkCnv_p3< ElementLinkToIDC_TGC_Container > m_elCnv
Definition: TgcClusterOnTrackCnv_p2.h:43
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
TgcClusterOnTrackCnv_p2::m_errorMxCnv
ErrorMatrixCnv_p1 * m_errorMxCnv
Definition: TgcClusterOnTrackCnv_p2.h:46
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
Muon::TgcClusterOnTrack_p2::m_localErrMat
TPObjRef m_localErrMat
Definition: TgcClusterOnTrack_p2.h:28
DeMoScan.index
string index
Definition: DeMoScan.py:364
TgcClusterOnTrackCnv_p2::persToTrans
void persToTrans(const Muon ::TgcClusterOnTrack_p2 *persObj, Muon ::TgcClusterOnTrack *transObj, MsgStream &log)
Definition: TgcClusterOnTrackCnv_p2.cxx:17
Trk::RIO_OnTrack::identify
Identifier identify() const
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:152
Muon::TgcClusterOnTrack_p2::m_prdLink
ElementLinkInt_p3 m_prdLink
Link to PRD.
Definition: TgcClusterOnTrack_p2.h:31
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TgcClusterOnTrackCnv_p2::m_localParCnv
LocalParametersCnv_p1 * m_localParCnv
Definition: TgcClusterOnTrackCnv_p2.h:45
Muon::MuonClusterOnTrack::positionAlongStrip
virtual double positionAlongStrip() const
Definition: MuonClusterOnTrack.h:68
Muon::TgcClusterOnTrack_p2::m_localParams
TPObjRef m_localParams
Definition: TgcClusterOnTrack_p2.h:27
TgcClusterOnTrackCnv_p2::transToPers
void transToPers(const Muon ::TgcClusterOnTrack *transObj, Muon ::TgcClusterOnTrack_p2 *persObj, MsgStream &log)
Definition: TgcClusterOnTrackCnv_p2.cxx:49
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TgcClusterOnTrackCnv_p2.h
Identifier
Definition: IdentifierFieldParser.cxx:14