ATLAS Offline Software
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;
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 
40 transToPers( const Muon::sTgcClusterOnTrack *transObj,
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 );
57  Trk::ErrorMatrix pMat;
58  EigenHelpers::eigenMatrixToVector(pMat.values, transObj->localCovariance(), "STGC_ClusterOnTrackCnv_p1");
59  persObj->m_localErrMat = toPersistent( &m_errorMxCnv, &pMat, log );
60 }
61 
62 
sTgcClusterOnTrack.h
Muon::STGC_ClusterOnTrack_p1
Version 1 of the persistent class representing the transient class Muon::STGC_ClusterOnTrack.
Definition: STGC_ClusterOnTrack_p1.h:21
Muon::sTgcClusterOnTrack::m_rio
ElementLinkToIDC_STGC_Container m_rio
PrepRawData object assoicated with this measurement.
Definition: sTgcClusterOnTrack.h:95
Muon::STGC_ClusterOnTrack_p1::m_localErrMat
TPObjRef m_localErrMat
Definition: STGC_ClusterOnTrack_p1.h:28
index
Definition: index.py:1
Muon::STGC_ClusterOnTrack_p1::m_localParams
TPObjRef m_localParams
Definition: STGC_ClusterOnTrack_p1.h:27
Trk::IEventCnvSuperTool::ELIndex_t
unsigned int ELIndex_t
Definition: IEventCnvSuperTool.h:30
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
STGC_ClusterOnTrackCnv_p1::m_errorMxCnv
ErrorMatrixCnv_p1 * m_errorMxCnv
Definition: STGC_ClusterOnTrackCnv_p1.h:46
Muon::STGC_ClusterOnTrack_p1::m_positionAlongStrip
float m_positionAlongStrip
position along strip (double in transient world)
Definition: STGC_ClusterOnTrack_p1.h:34
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
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
STGC_ClusterOnTrackCnv_p1::persToTrans
void persToTrans(const Muon ::STGC_ClusterOnTrack_p1 *persObj, Muon ::sTgcClusterOnTrack *transObj, MsgStream &log)
Definition: STGC_ClusterOnTrackCnv_p1.cxx:16
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
STGC_ClusterOnTrackCnv_p1::m_eventCnvTool
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
Definition: STGC_ClusterOnTrackCnv_p1.h:44
STGC_ClusterOnTrackCnv_p1.h
EigenHelpers.h
python.xAODType.dummy
dummy
Definition: xAODType.py:4
Muon::sTgcClusterOnTrack::detectorElement
virtual const MuonGM::sTgcReadoutElement * detectorElement() const override final
Returns the detector element, assoicated with the PRD of this class.
Definition: sTgcClusterOnTrack.h:123
Muon::STGC_ClusterOnTrack_p1::m_id
Identifier32::value_type m_id
base RIO_OnTrack_p1 info
Definition: STGC_ClusterOnTrack_p1.h:26
STGC_ClusterOnTrackCnv_p1::m_localParCnv
LocalParametersCnv_p1 * m_localParCnv
Definition: STGC_ClusterOnTrackCnv_p1.h:45
Trk::MeasurementBase::m_localParams
LocalParameters m_localParams
Definition: MeasurementBase.h:111
Muon::sTgcClusterOnTrack
Class to represent calibrated clusters formed from TGC strips.
Definition: sTgcClusterOnTrack.h:30
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
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
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::STGC_ClusterOnTrack_p1::m_prdLink
ElementLinkInt_p3 m_prdLink
Link to PRD.
Definition: STGC_ClusterOnTrack_p1.h:31
Trk::MeasurementBase::m_localCovariance
Amg::MatrixX m_localCovariance
Definition: MeasurementBase.h:112
DeMoScan.index
string index
Definition: DeMoScan.py:364
Trk::RIO_OnTrack::m_identifier
Identifier m_identifier
Identifier of the RIO_OnTrack (comes from the associated Trk::PrepRawData)
Definition: RIO_OnTrack.h:149
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
STGC_ClusterOnTrackCnv_p1::transToPers
void transToPers(const Muon ::sTgcClusterOnTrack *transObj, Muon ::STGC_ClusterOnTrack_p1 *persObj, MsgStream &log)
Definition: STGC_ClusterOnTrackCnv_p1.cxx:40
STGC_ClusterOnTrackCnv_p1::m_elCnv
ElementLinkCnv_p3< ElementLinkToIDC_STGC_Container > m_elCnv
Definition: STGC_ClusterOnTrackCnv_p1.h:43
Muon::MuonClusterOnTrack::m_positionAlongStrip
double m_positionAlongStrip
The position along the strip - used to calculate the GlobalPosition.
Definition: MuonClusterOnTrack.h:97
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37