ATLAS Offline Software
Loading...
Searching...
No Matches
CscPrepDataCnv_p2.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5//-----------------------------------------------------------------------------
6//
7// file: CscPrepDataCnv_p2.cxx
8//
9//-----------------------------------------------------------------------------
10
13
16 const Identifier& clusId,
17 const MuonGM::CscReadoutElement* detEl,
18 MsgStream & log )
19{
20 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "CscPrepDataCnv_p2::persToTrans" << endmsg;
21
22 Amg::Vector2D localPos;
23 localPos[Trk::locX] = persObj->m_locX;
24 localPos[Trk::locY] = 0.0;
25
26 std::vector<Identifier> rdoList(1);
27 rdoList[0]=clusId;
28
29 auto cmat = Amg::MatrixX(1,1);
30 cmat(0,0) = static_cast<double>(persObj->m_errorMat);
31
32 Muon::CscPrepData data (clusId,
33 0, // idDE,
34 localPos,
35 std::move(rdoList),
36 std::move(cmat),
37 detEl,
38 persObj->m_charge,
39 persObj->m_time,
40 static_cast<Muon::CscClusterStatus>((persObj->m_status)&0xFF), // First 8 bits reserved for ClusterStatus.
41 static_cast<Muon::CscTimeStatus>((persObj->m_status)>>8)
42 );
43 return data;
44}
45
47persToTrans( const Muon::CscPrepData_p2 *persObj, Muon::CscPrepData *transObj,MsgStream & log )
48{
49 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "CscPrepDataCnv_p2::persToTrans" << endmsg;
50
51 *transObj = createCscPrepData (persObj,
52 transObj->identify(),
53 transObj->detectorElement(),
54 log);
55}
56
58transToPers( const Muon::CscPrepData *transObj, Muon::CscPrepData_p2 *persObj, MsgStream & log)
59{
60 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "CscPrepDataCnv_p2::transToPers" << endmsg;
61 persObj->m_locX = transObj->localPosition()[Trk::locX];
62 persObj->m_errorMat = transObj->localCovariance()(0,0);
63
64 //CscPrepData - specific
65 persObj->m_charge = transObj->charge();
66 persObj->m_time = transObj->time();
67 persObj->m_status = (transObj->timeStatus()<<8); // First 8 bits reserved for ClusterStatus.
68 persObj->m_status += transObj->status();
69}
70
71
#define endmsg
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
void transToPers(const Muon::CscPrepData *transObj, Muon::CscPrepData_p2 *persObj, MsgStream &log)
void persToTrans(const Muon::CscPrepData_p2 *persObj, Muon::CscPrepData *transObj, MsgStream &log)
static Muon::CscPrepData createCscPrepData(const Muon::CscPrepData_p2 *persObj, const Identifier &clusId, const MuonGM::CscReadoutElement *detEl, MsgStream &log)
We don't write out (from Trk::PrepRawData) m_indexAndHash (can be recomputed), m_clusId (can be recom...
float m_errorMat
1-d ErrorMatrix in the base class.
float m_locX
Equivalent to localPosition (locX) in the base class.
int m_status
in here we pack both the transient values m_status and m_timeStatus (introduced in MuonPrepRawData-03...
Class representing clusters from the CSC.
Definition CscPrepData.h:39
CscTimeStatus timeStatus() const
Returns the Csc time status flag.
virtual const MuonGM::CscReadoutElement * detectorElement() const override final
Return the detector element corresponding to this PRD.
double time() const
Returns the time.
int charge() const
Returns the charge.
CscClusterStatus status() const
Returns the Csc status (position measurement) flag.
const Amg::Vector2D & localPosition() const
return the local position reference
Identifier identify() const
return the identifier
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
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...
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37