ATLAS Offline Software
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 
27  Amg::MatrixX localCovariance;
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 
50 transToPers( const Muon::CscClusterOnTrack *transObj,
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 );
63  Trk::ErrorMatrix pMat;
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 
Trk::LocalParameters
Definition: LocalParameters.h:98
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
CscClusterOnTrackCnv_p2::transToPers
void transToPers(const Muon ::CscClusterOnTrack *transObj, Muon ::CscClusterOnTrack_p2 *persObj, MsgStream &log)
Definition: CscClusterOnTrackCnv_p2.cxx:50
index
Definition: index.py:1
Muon::CscClusterOnTrack_p2::m_time
float m_time
Definition: CscClusterOnTrack_p2.h:39
Trk::IEventCnvSuperTool::ELIndex_t
unsigned int ELIndex_t
Definition: IEventCnvSuperTool.h:30
CscClusterOnTrackCnv_p2.h
Muon::CscClusterOnTrack_p2::m_prdLink
ElementLinkInt_p3 m_prdLink
Link to PRD.
Definition: CscClusterOnTrack_p2.h:31
Muon::MuonClusterOnTrack::idDE
virtual IdentifierHash idDE() const override
Returns an invalid hash.
Definition: MuonClusterOnTrack.h:116
Muon::CscClusterOnTrack_p2::m_localParams
TPObjRef m_localParams
Definition: CscClusterOnTrack_p2.h:27
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
Muon::CscClusterOnTrack::detectorElement
virtual const MuonGM::CscReadoutElement * detectorElement() const override final
Returns the detector element, associated with the PRD of this class.
Definition: CscClusterOnTrack.h:167
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
Muon::CscClusterOnTrack_p2::m_localErrMat
TPObjRef m_localErrMat
Definition: CscClusterOnTrack_p2.h:28
Muon::CscClusterOnTrack::timeStatus
CscTimeStatus timeStatus() const
Returns Csc time measurement status flag.
Definition: CscClusterOnTrack.h:183
Identifier32::get_compact
value_type get_compact(void) const
Get the compact id.
Definition: Identifier32.h:171
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
CscClusterOnTrackCnv_p2::m_localParCnv
LocalParametersCnv_p1 * m_localParCnv
Definition: CscClusterOnTrackCnv_p2.h:48
CscClusterOnTrack.h
CscClusterOnTrackCnv_p2::m_eventCnvTool
ToolHandle< Trk::IEventCnvSuperTool > m_eventCnvTool
Definition: CscClusterOnTrackCnv_p2.h:47
Muon::CscClusterOnTrack_p2::m_positionAlongStrip
float m_positionAlongStrip
position along strip (double in transient world)
Definition: CscClusterOnTrack_p2.h:37
EigenHelpers.h
Muon::CscClusterOnTrack_p2::m_status
unsigned int m_status
Corresponds to CscClusterStatus in transient class.
Definition: CscClusterOnTrack_p2.h:34
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
Muon::CscClusterOnTrack::time
float time() const
Return the time(ns)
Definition: CscClusterOnTrack.h:188
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
CscClusterOnTrackCnv_p2::persToTrans
void persToTrans(const Muon ::CscClusterOnTrack_p2 *persObj, Muon ::CscClusterOnTrack *transObj, MsgStream &log)
Definition: CscClusterOnTrackCnv_p2.cxx:17
Muon::CscClusterOnTrack_p2
Version 1 of the persistent class representing the transient class Muon::CscClusterOnTrack.
Definition: CscClusterOnTrack_p2.h:21
CscClusterOnTrackCnv_p2::m_errorMxCnv
ErrorMatrixCnv_p1 * m_errorMxCnv
Definition: CscClusterOnTrackCnv_p2.h:49
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
CscClusterOnTrackCnv_p2::m_elCnv
ElementLinkCnv_p3< ElementLinkToIDC_CSC_Container > m_elCnv
Definition: CscClusterOnTrackCnv_p2.h:46
DeMoScan.index
string index
Definition: DeMoScan.py:362
Muon::CscClusterOnTrack
Class to represent the calibrated clusters created from CSC strips.
Definition: CscClusterOnTrack.h:47
Muon::CscClusterOnTrack::status
CscClusterStatus status() const
Returns Csc position measurement status flag.
Definition: CscClusterOnTrack.h:178
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::RIO_OnTrack::identify
virtual Identifier identify() const final
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:155
Muon::MuonClusterOnTrack::positionAlongStrip
virtual double positionAlongStrip() const
Definition: MuonClusterOnTrack.h:68
Muon::CscClusterOnTrack_p2::m_id
Identifier32::value_type m_id
base RIO_OnTrack_p1 info
Definition: CscClusterOnTrack_p2.h:26
Muon::CscClusterStatus
CscClusterStatus
Enum to represent the cluster status - see the specific enum values for more details.
Definition: CscClusterStatus.h:23
Identifier::get_identifier32
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Muon::CscTimeStatus
CscTimeStatus
Enum to represent the cluster time measurement status - see the specific enum values for more details...
Definition: CscTimeStatus.h:24