ATLAS Offline Software
Loading...
Searching...
No Matches
RpcCoinDataCnv_p1.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: RpcCoinDataCnv_p1.cxx
8//* Takashi Kubota - June 30, 2008 */
9//-----------------------------------------------------------------------------
10
13
17 const Identifier& id,
18 const MuonGM::RpcReadoutElement* detEl,
19 MsgStream &/*log*/ )
20{
21 Amg::Vector2D localPos;
22 localPos[Trk::locX] = persObj->m_localPos;
23 localPos[Trk::locY] = 0.0;
24
25 std::vector<Identifier> rdoList;
26 rdoList.reserve(persObj->m_rdoList.size());
27 unsigned int id32 = id.get_identifier32().get_compact(); // identify is filled in RpcCoinContainerCnv
28 for (short x : persObj->m_rdoList)
29 rdoList.emplace_back ((unsigned int) x+id32);
30
31 auto cmat = Amg::MatrixX(1,1);
32 cmat(0,0) = static_cast<double>(persObj->m_errorMat);
33
35 0, // collectionHash
36 localPos,
37 rdoList,
38 cmat,
39 detEl,
40 persObj->m_time,
41 persObj->m_ambiguityFlag,
42 persObj->m_ijk,
43 persObj->m_threshold,
44 persObj->m_overlap,
45 persObj->m_parentCmId,
46 persObj->m_parentPadId,
47 persObj->m_parentSectorId,
48 persObj->m_lowPtCm
49 );
50 return data;
51}
52
54persToTrans( const Muon::RpcCoinData_p1 *persObj, Muon::RpcCoinData *transObj,MsgStream &log )
55{
56 *transObj = createRpcCoinData (persObj,
57 transObj->identify(),
58 transObj->detectorElement(),
59 log);
60}
61
63transToPers( const Muon::RpcCoinData *transObj, Muon::RpcCoinData_p1 *persObj, MsgStream & log)
64{
65 //log << MSG::DEBUG << "RpcCoinDataCnv_p1::transToPers" << endmsg;
66 persObj->m_localPos = transObj->localPosition()[Trk::locX];
67 persObj->m_errorMat = transObj->localCovariance()(0,0);
68
69 // List of Id of the cluster
70 persObj->m_rdoList.resize( transObj->rdoList().size() );
71 if (!transObj->identify().get_identifier32().is_valid()) log << MSG::ERROR << "RpcCoinDataCnv_p1::transToPers - invalid trans id!!" << endmsg;
72 unsigned int id32 = transObj->identify().get_identifier32().get_compact();
73 // convert the list of ID saved for the cluster
74 persObj->m_rdoList.clear();
75 persObj->m_rdoList.reserve(transObj->rdoList().size() );
76 for (const Identifier& id : transObj->rdoList())
77 persObj->m_rdoList.push_back (id.get_identifier32().get_compact() - id32);
78
79 // Data from Muon::RpcPrepData
80 persObj->m_time = transObj->time();
81 persObj->m_ambiguityFlag = transObj->ambiguityFlag();
82
83 // Data from RpcCoinData
84 persObj->m_ijk = transObj->ijk();
85 persObj->m_threshold = transObj->threshold();
86 persObj->m_overlap = transObj->overlap();
87 persObj->m_parentCmId = transObj->parentCmId();
88 persObj->m_parentPadId = transObj->parentPadId();
89 persObj->m_parentSectorId = transObj->parentSectorId();
90 persObj->m_lowPtCm = transObj->lowPtCm();
91}
92
93
#define endmsg
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
#define x
bool is_valid() const
Check if id is in a valid state.
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Persistent representation of the transient Muon::RpcCoinData class.
unsigned short m_parentSectorId
std::vector< short > m_rdoList
delta of Identifiers of RDOs used to make PRD
unsigned short m_threshold
unsigned short m_parentCmId
float m_errorMat
1-d ErrorMatrix in the base class.
float m_localPos
Equivalent to localPosition (locX) in the base class.
unsigned short m_ijk
unsigned short m_parentPadId
unsigned short m_overlap
unsigned short ijk() const
return ijk of the trigger hit (can be 6, 7 or 0)
unsigned short threshold() const
return highest threshold for the trigger pattern this hit is contributing
bool lowPtCm() const
unsigned short parentPadId() const
unsigned short parentCmId() const
parent ID (online-style) of CM, PAD and Sector
unsigned short parentSectorId() const
unsigned short overlap() const
return the overlap flag
virtual const MuonGM::RpcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD.
int ambiguityFlag() const
Returns the number of ambiguities associated with this RpcPrepData.
float time() const
Returns the time.
void transToPers(const Muon::RpcCoinData *transObj, Muon::RpcCoinData_p1 *persObj, MsgStream &log)
static Muon::RpcCoinData createRpcCoinData(const Muon::RpcCoinData_p1 *persObj, const Identifier &id, const MuonGM::RpcReadoutElement *detEl, MsgStream &log)
void persToTrans(const Muon::RpcCoinData_p1 *persObj, Muon::RpcCoinData *transObj, MsgStream &log)
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
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Matrix< double, 2, 1 > Vector2D
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37