ATLAS Offline Software
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 
54 persToTrans( 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 
63 transToPers( 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 
Identifier32::is_valid
bool is_valid() const
Check if id is in a valid state.
Definition: Identifier32.h:220
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Muon::RpcCoinData::overlap
unsigned short overlap() const
return the overlap flag
Definition: RpcCoinData.h:111
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
Trk::locX
@ locX
Definition: ParamDefs.h:43
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:44
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Muon::RpcCoinData::parentCmId
unsigned short parentCmId() const
parent ID (online-style) of CM, PAD and Sector
Definition: RpcCoinData.h:114
Trk::PrepRawData::localCovariance
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
MuonGM::RpcReadoutElement
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h:54
RpcCoinData.h
Muon::RpcCoinData_p1::m_time
float m_time
Definition: RpcCoinData_p1.h:40
x
#define x
Muon::RpcCoinData
Definition: RpcCoinData.h:25
Muon::RpcCoinData::ijk
unsigned short ijk() const
return ijk of the trigger hit (can be 6, 7 or 0)
Definition: RpcCoinData.h:105
Muon::RpcCoinData_p1
Persistent representation of the transient Muon::RpcCoinData class.
Definition: RpcCoinData_p1.h:24
RpcCoinDataCnv_p1::createRpcCoinData
static Muon::RpcCoinData createRpcCoinData(const Muon::RpcCoinData_p1 *persObj, const Identifier &id, const MuonGM::RpcReadoutElement *detEl, MsgStream &log)
Definition: RpcCoinDataCnv_p1.cxx:16
Muon::RpcPrepData::time
float time() const
Returns the time.
Definition: RpcPrepData.h:197
RpcCoinDataCnv_p1::persToTrans
void persToTrans(const Muon::RpcCoinData_p1 *persObj, Muon::RpcCoinData *transObj, MsgStream &log)
Definition: RpcCoinDataCnv_p1.cxx:54
Muon::RpcCoinData_p1::m_errorMat
float m_errorMat
1-d ErrorMatrix in the base class.
Definition: RpcCoinData_p1.h:34
Muon::RpcCoinData::parentSectorId
unsigned short parentSectorId() const
Definition: RpcCoinData.h:116
Identifier32::get_compact
value_type get_compact(void) const
Get the compact id.
Definition: Identifier32.h:171
Muon::RpcPrepData::detectorElement
virtual const MuonGM::RpcReadoutElement * detectorElement() const override final
Returns the detector element corresponding to this PRD.
Definition: RpcPrepData.h:202
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Muon::RpcCoinData_p1::m_lowPtCm
bool m_lowPtCm
Definition: RpcCoinData_p1.h:52
Muon::RpcCoinData_p1::m_parentCmId
unsigned short m_parentCmId
Definition: RpcCoinData_p1.h:49
Muon::RpcCoinData_p1::m_threshold
unsigned short m_threshold
Definition: RpcCoinData_p1.h:47
Muon::RpcCoinData::parentPadId
unsigned short parentPadId() const
Definition: RpcCoinData.h:115
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
Muon::RpcCoinData::threshold
unsigned short threshold() const
return highest threshold for the trigger pattern this hit is contributing
Definition: RpcCoinData.h:108
Muon::RpcCoinData_p1::m_ambiguityFlag
int m_ambiguityFlag
Definition: RpcCoinData_p1.h:41
Muon::RpcCoinData_p1::m_parentSectorId
unsigned short m_parentSectorId
Definition: RpcCoinData_p1.h:51
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
RpcCoinDataCnv_p1.h
Muon::RpcCoinData_p1::m_parentPadId
unsigned short m_parentPadId
Definition: RpcCoinData_p1.h:50
Identifier::get_identifier32
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
Muon::RpcPrepData::ambiguityFlag
int ambiguityFlag() const
Returns the number of ambiguities associated with this RpcPrepData.
Definition: RpcPrepData.h:212
Muon::RpcCoinData_p1::m_rdoList
std::vector< short > m_rdoList
delta of Identifiers of RDOs used to make PRD
Definition: RpcCoinData_p1.h:35
Muon::RpcCoinData::lowPtCm
bool lowPtCm() const
Definition: RpcCoinData.h:117
Muon::RpcCoinData_p1::m_localPos
float m_localPos
Equivalent to localPosition (locX) in the base class.
Definition: RpcCoinData_p1.h:33
Muon::RpcCoinData_p1::m_overlap
unsigned short m_overlap
Definition: RpcCoinData_p1.h:48
Muon::RpcCoinData_p1::m_ijk
unsigned short m_ijk
Definition: RpcCoinData_p1.h:46
RpcCoinDataCnv_p1::transToPers
void transToPers(const Muon::RpcCoinData *transObj, Muon::RpcCoinData_p1 *persObj, MsgStream &log)
Definition: RpcCoinDataCnv_p1.cxx:63