ATLAS Offline Software
MdtPrepDataCnv_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: MdtPrepDataCnv_p2.cxx
8 //
9 //-----------------------------------------------------------------------------
10 
13 
17  const Identifier& id,
18  const MuonGM::MdtReadoutElement* detEl,
19  MsgStream & )
20 {
21  Amg::Vector2D localPos;
22  localPos[Trk::locX] = persObj->m_driftRadius;
23  localPos[Trk::locY] = 0.0;
24 
25  std::vector<Identifier> rdoList(1);
26  rdoList[0] = id;
27 
28  auto cmat = Amg::MatrixX(1,1);
29  cmat(0,0) = static_cast<double>(persObj->m_errorMat);
30 
32  0, // collectionHash
33  localPos,
34  std::move(cmat),
35  std::move(rdoList),
36  detEl,
37  persObj->m_tdc,
38  persObj->m_adc,
39  static_cast<Muon::MdtDriftCircleStatus>(persObj->m_status));
40 
41  return data;
42 }
43 
45 persToTrans( const Muon::MdtPrepData_p2 *persObj, Muon::MdtPrepData *transObj,MsgStream & log )
46 {
47  *transObj = createMdtPrepData (persObj,
48  transObj->identify(),
49  transObj->detectorElement(),
50  log);
51 }
52 
54 transToPers( const Muon::MdtPrepData *transObj, Muon::MdtPrepData_p2 *persObj, MsgStream & )
55 {
56  //log << MSG::DEBUG << "MdtPrepDataCnv_p2::transToPers" << endmsg;
57  persObj->m_driftRadius = transObj->localPosition()[Trk::locX];
58  persObj->m_errorMat = transObj->localCovariance()(0,0);
59  persObj->m_tdc = transObj->tdc();
60  persObj->m_adc = transObj->adc();
61  persObj->m_status = transObj->status();
62 }
63 
64 
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
MdtPrepDataCnv_p2.h
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
Trk::PrepRawData::localCovariance
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Muon::MdtPrepData_p2::m_status
int m_status
Corresponds to Muon::MdtDriftCircleStatus, which currently has only two defined values.
Definition: MdtPrepData_p2.h:38
MdtPrepDataCnv_p2::persToTrans
void persToTrans(const Muon::MdtPrepData_p2 *persObj, Muon::MdtPrepData *transObj, MsgStream &log)
Definition: MdtPrepDataCnv_p2.cxx:45
Muon::MdtDriftCircleStatus
MdtDriftCircleStatus
Enum to represent the 'status' of Mdt measurements e.g.
Definition: MdtDriftCircleStatus.h:25
Muon::MdtPrepData_p2::m_adc
int m_adc
Definition: MdtPrepData_p2.h:36
MdtPrepData.h
Muon::MdtPrepData::adc
int adc() const
Returns the ADC (typically range is 0 to 250)
Definition: MdtPrepData.h:166
Muon::MdtPrepData_p2::m_tdc
int m_tdc
Definition: MdtPrepData_p2.h:35
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:50
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
Muon::MdtPrepData_p2
Persistent representation of the transient Muon::MdtPrepData class.
Definition: MdtPrepData_p2.h:24
MdtPrepDataCnv_p2::createMdtPrepData
static Muon::MdtPrepData createMdtPrepData(const Muon::MdtPrepData_p2 *persObj, const Identifier &id, const MuonGM::MdtReadoutElement *detEl, MsgStream &log)
Definition: MdtPrepDataCnv_p2.cxx:16
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Muon::MdtPrepData::tdc
int tdc() const
Returns the TDC (typically range is 0 to 2500).
Definition: MdtPrepData.h:161
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtPrepData.h:37
MdtPrepDataCnv_p2::transToPers
void transToPers(const Muon::MdtPrepData *transObj, Muon::MdtPrepData_p2 *persObj, MsgStream &log)
Definition: MdtPrepDataCnv_p2.cxx:54
Muon::MdtPrepData_p2::m_errorMat
float m_errorMat
1-d ErrorMatrix in the base class.
Definition: MdtPrepData_p2.h:30
Muon::MdtPrepData_p2::m_driftRadius
float m_driftRadius
Equivalent to localPosition (locX) in the base class.
Definition: MdtPrepData_p2.h:29
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Muon::MdtPrepData::status
MdtDriftCircleStatus status() const
Returns the status of the measurement.
Definition: MdtPrepData.h:171
Muon::MdtPrepData::detectorElement
virtual const MuonGM::MdtReadoutElement * detectorElement() const override
Returns the detector element corresponding to this PRD.
Definition: MdtPrepData.h:156