ATLAS Offline Software
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 
47 persToTrans( 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 
58 transToPers( 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 
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Muon::CscPrepData_p2::m_time
float m_time
Definition: CscPrepData_p2.h:40
Muon::CscPrepData_p2::m_locX
float m_locX
Equivalent to localPosition (locX) in the base class.
Definition: CscPrepData_p2.h:33
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
Trk::locX
@ locX
Definition: ParamDefs.h:37
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
CscPrepDataCnv_p2::transToPers
void transToPers(const Muon::CscPrepData *transObj, Muon::CscPrepData_p2 *persObj, MsgStream &log)
Definition: CscPrepDataCnv_p2.cxx:58
Muon::CscPrepData::charge
int charge() const
Returns the charge.
Definition: CscPrepData.h:153
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
CscPrepDataCnv_p2::persToTrans
void persToTrans(const Muon::CscPrepData_p2 *persObj, Muon::CscPrepData *transObj, MsgStream &log)
Definition: CscPrepDataCnv_p2.cxx:47
MuonGM::CscReadoutElement
Definition: CscReadoutElement.h:56
Muon::CscPrepData_p2::m_status
int m_status
in here we pack both the transient values m_status and m_timeStatus (introduced in MuonPrepRawData-03...
Definition: CscPrepData_p2.h:41
Muon::CscPrepData::timeStatus
CscTimeStatus timeStatus() const
Returns the Csc time status flag.
Definition: CscPrepData.h:168
Muon::CscPrepData_p2::m_charge
int m_charge
Definition: CscPrepData_p2.h:39
Muon::CscPrepData_p2::m_errorMat
float m_errorMat
1-d ErrorMatrix in the base class.
Definition: CscPrepData_p2.h:34
CscPrepData.h
Muon::CscPrepData
Class representing clusters from the CSC.
Definition: CscPrepData.h:39
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Muon::CscPrepData::status
CscClusterStatus status() const
Returns the Csc status (position measurement) flag.
Definition: CscPrepData.h:163
Muon::CscPrepData::time
double time() const
Returns the time.
Definition: CscPrepData.h:158
Muon::CscPrepData::detectorElement
virtual const MuonGM::CscReadoutElement * detectorElement() const override final
Return the detector element corresponding to this PRD.
Definition: CscPrepData.h:148
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
CscPrepDataCnv_p2::createCscPrepData
static Muon::CscPrepData createCscPrepData(const Muon::CscPrepData_p2 *persObj, const Identifier &clusId, const MuonGM::CscReadoutElement *detEl, MsgStream &log)
Definition: CscPrepDataCnv_p2.cxx:15
Muon::CscPrepData_p2
We don't write out (from Trk::PrepRawData) m_indexAndHash (can be recomputed), m_clusId (can be recom...
Definition: CscPrepData_p2.h:25
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
CscPrepDataCnv_p2.h
Muon::CscClusterStatus
CscClusterStatus
Enum to represent the cluster status - see the specific enum values for more details.
Definition: CscClusterStatus.h:23
Muon::CscTimeStatus
CscTimeStatus
Enum to represent the cluster time measurement status - see the specific enum values for more details...
Definition: CscTimeStatus.h:24
Identifier
Definition: IdentifierFieldParser.cxx:14