ATLAS Offline Software
TgcRdoCnv_p2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MuonRDO/TgcRdo.h"
6 #include "GaudiKernel/MsgStream.h"
8 #include "TgcRdoCnv_p2.h"
9 #include "TgcRawDataCnv_p2.h"
10 
11 namespace {
12 
13 union Errors_u {
15  uint32_t i;
16 };
17 
18 union RodStatus_u {
19  TgcRdo::RodStatus rodStatus;
20  uint32_t i;
21 };
22 
23 union LocalStatus_u {
24  TgcRdo::LocalStatus localStatus;
25  uint32_t i;
26 };
27 
28 }
29 
30 void
31 TgcRdoCnv_p2::transToPers(const TgcRdo* transColl, TgcRdo_p2* persColl, MsgStream &log)
32 {
33  if (log.level() <= MSG::DEBUG)
34  log << MSG::DEBUG << " *** Writing out TgcRdo P2" << endmsg;
35 
36  // Invoke vector converter from the base template
37  TgcRdoCnv_p2_basetype::transToPers(transColl, persColl, log);
38 
39  persColl->m_version = transColl->version();
40  persColl->m_id = transColl->identify();
41  persColl->m_subDetectorId = transColl->subDetectorId();
42  persColl->m_rodId = transColl->rodId();
43  persColl->m_triggerType = transColl->triggerType();
44  persColl->m_bcId = transColl->bcId();
45  persColl->m_l1Id = transColl->l1Id();
46 
47  Errors_u errors_u{};
48  errors_u.errors = transColl->errors();
49  persColl->m_errors = errors_u.i;
50 
51  RodStatus_u rodStatus_u{};
52  rodStatus_u.rodStatus = transColl->rodStatus();
53  persColl->m_rodStatus = rodStatus_u.i;
54 
55  LocalStatus_u localStatus_u{};
56  localStatus_u.localStatus = transColl->localStatus();
57  persColl->m_localStatus = localStatus_u.i;
58 
59  persColl->m_orbit = transColl->orbit();
60 }
61 
62 void
63 TgcRdoCnv_p2::persToTrans(const TgcRdo_p2* persColl, TgcRdo* transColl, MsgStream &log)
64 {
65  if (log.level() <= MSG::DEBUG)
66  log << MSG::DEBUG << " *** Reading TgcRdo P2" << endmsg;
67 
68  // Invoke vector converter from the base template
69  TgcRdoCnv_p2_basetype::persToTrans(persColl, transColl, log);
70 
71  transColl->setVersion (persColl->m_version);
72  transColl->setOnlineId(persColl->m_subDetectorId,
73  persColl->m_rodId);
74  transColl->setTriggerType (persColl->m_triggerType);
75  transColl->setBcId (persColl->m_bcId);
76  transColl->setL1Id (persColl->m_l1Id);
77  transColl->setOrbit (persColl->m_orbit);
78 
79  transColl->setErrors (persColl->m_errors);
80  transColl->setRodStatus (persColl->m_rodStatus);
81  transColl->setLocalStatus (persColl->m_localStatus);
82 }
83 
TgcRdo::identify
uint16_t identify() const
Definition: TgcRdo.h:107
TgcRdoCnv_p2.h
TgcRdo_p2
Definition: TgcRdo_p2.h:21
TgcRdo_p2::m_triggerType
uint16_t m_triggerType
Definition: TgcRdo_p2.h:58
TgcRdo_p2::m_version
uint16_t m_version
Definition: TgcRdo_p2.h:45
TgcRdo::setL1Id
void setL1Id(uint32_t v)
Definition: TgcRdo.h:119
TgcRdo::setRodStatus
void setRodStatus(uint32_t data)
Definition: TgcRdo.h:178
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TgcRdo_p2::m_rodId
uint16_t m_rodId
Definition: TgcRdo_p2.h:55
TgcRdo::localStatus
const LocalStatus & localStatus() const
Definition: TgcRdo.h:190
TgcRdo_p2::m_orbit
uint32_t m_orbit
Definition: TgcRdo_p2.h:68
TPCnvVector::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log)
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
TgcRdo::rodStatus
const RodStatus & rodStatus() const
Definition: TgcRdo.h:174
TgcRdo::setTriggerType
void setTriggerType(uint16_t v)
Definition: TgcRdo.h:127
TgcRdo::triggerType
uint16_t triggerType() const
Definition: TgcRdo.h:142
TgcRdo::l1Id
uint16_t l1Id() const
Definition: TgcRdo.h:150
TgcRdo_p2::m_subDetectorId
uint16_t m_subDetectorId
Definition: TgcRdo_p2.h:54
TgcRdo::LocalStatus
Definition: TgcRdo.h:77
TgcRdo::setErrors
void setErrors(uint16_t data)
Definition: TgcRdo.h:162
TgcRdo::orbit
uint32_t orbit() const
Definition: TgcRdo.h:206
TgcRdo_p2::m_errors
uint32_t m_errors
Definition: TgcRdo_p2.h:65
TgcRdo::subDetectorId
uint16_t subDetectorId() const
Definition: TgcRdo.h:134
TgcRdo::setOrbit
void setOrbit(uint32_t orbit)
Definition: TgcRdo.h:210
lumiFormat.i
int i
Definition: lumiFormat.py:85
TPCnvVector::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TgcRawDataCnv_p2.h
TgcRdo_p2::m_localStatus
uint32_t m_localStatus
Definition: TgcRdo_p2.h:67
TgcRdo_p2::m_bcId
uint16_t m_bcId
Definition: TgcRdo_p2.h:61
TgcRdoCnv_p2::persToTrans
virtual void persToTrans(const TgcRdo_p2 *persColl, TgcRdo *transColl, MsgStream &log)
Definition: TgcRdoCnv_p2.cxx:63
TgcRdo.h
TgcRdo::bcId
uint16_t bcId() const
Definition: TgcRdo.h:146
TgcRdo_p2::m_rodStatus
uint32_t m_rodStatus
Definition: TgcRdo_p2.h:66
mergePhysValFiles.errors
list errors
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:43
TgcRdo::RodStatus
Definition: TgcRdo.h:45
TgcRdo::errors
const Errors & errors() const
Definition: TgcRdo.h:158
TgcRdo_p2.h
TgcRdo_p2::m_id
uint16_t m_id
Definition: TgcRdo_p2.h:48
TgcRdo::setOnlineId
void setOnlineId(uint16_t subDetectorId, uint16_t rodId)
Definition: TgcRdo.cxx:35
TgcRdo::version
uint16_t version() const
Definition: TgcRdo.h:215
TgcRdoCnv_p2::transToPers
virtual void transToPers(const TgcRdo *transColl, TgcRdo_p2 *persColl, MsgStream &log)
Definition: TgcRdoCnv_p2.cxx:31
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TgcRdo::setVersion
void setVersion(uint16_t version)
Definition: TgcRdo.h:220
TgcRdo::setBcId
void setBcId(uint16_t v)
Definition: TgcRdo.h:123
TgcRdo::setLocalStatus
void setLocalStatus(uint32_t data)
Definition: TgcRdo.h:194
TgcRdo_p2::m_l1Id
uint16_t m_l1Id
Definition: TgcRdo_p2.h:62
TgcRdo
Definition: TgcRdo.h:22
TgcRdo::rodId
uint16_t rodId() const
Definition: TgcRdo.h:138
TgcRdo::Errors
Definition: TgcRdo.h:36