ATLAS Offline Software
Loading...
Searching...
No Matches
RoIBResultCnv_p1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// Gaudi/Athena include(s):
7#include "GaudiKernel/MsgStream.h"
8
9// Local include(s):
11
19
25 MsgStream& log ) {
26
27 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converting ROIB::RoIBResult from persistent state..." << endmsg;
28
29 ROIB::MuCTPIResult muc (ROIB::Header (std::vector< uint32_t >(persObj->m_muctpi.m_header)),
30 ROIB::Trailer (std::vector< uint32_t >(persObj->m_muctpi.m_trailer)),
31 std::vector<ROIB::MuCTPIRoI> (persObj->m_muctpi.m_roiWords.begin(),
32 persObj->m_muctpi.m_roiWords.end()));
33
34 ROIB::CTPResult ctp (0,
35 ROIB::Header (std::vector< uint32_t >(persObj->m_ctp.m_header)),
36 ROIB::Trailer (std::vector< uint32_t >(persObj->m_ctp.m_trailer)),
37 persObj->m_ctp.m_roiWords);
38
39
40 std::vector< ROIB::JetEnergyResult > jetvec;
41 for (const SubSysResult_p1& jeten : persObj->m_jetenergy) {
42 jetvec.emplace_back ( ROIB::Header(std::vector< uint32_t >(jeten.m_header)),
43 ROIB::Trailer(std::vector< uint32_t >(jeten.m_trailer)),
44 std::vector<ROIB::JetEnergyRoI> (jeten.m_roiWords.begin(),
45 jeten.m_roiWords.end()) );
46 }
47
48 std::vector< ROIB::EMTauResult > emtauvec;
49 for (const SubSysResult_p1& emtau : persObj->m_emtau) {
50 emtauvec.emplace_back ( ROIB::Header(std::vector< uint32_t >(emtau.m_header)),
51 ROIB::Trailer(std::vector< uint32_t >(emtau.m_trailer)),
52 std::vector<ROIB::EMTauRoI> (emtau.m_roiWords.begin(),
53 emtau.m_roiWords.end()) );
54 }
55
56 *transObj = ROIB::RoIBResult (std::move(muc),
57 std::move(ctp),
58 std::move(jetvec),
59 std::move(emtauvec));
60
61 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Converting ROIB::RoIBResult from persistent state [OK]" << endmsg;
62
63 return;
64
65}
66
72 MsgStream& log ) {
73
74 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Creating persistent state of ROIB::RoIBResult..." << endmsg;
75
77 // //
78 // Transfer the MuCTPI information //
79 // //
81 persObj->m_muctpi.m_header = transObj->muCTPIResult().header().header();
82 persObj->m_muctpi.m_trailer = transObj->muCTPIResult().trailer().trailer();
83
84 persObj->m_muctpi.m_roiWords.clear();
85 for (const ROIB::MuCTPIRoI& r : transObj->muCTPIResult().roIVec())
86 persObj->m_muctpi.m_roiWords.push_back( r.roIWord() );
87
89 // //
90 // Transfer the CTP information //
91 // //
93 persObj->m_ctp.m_header = transObj->cTPResult().header().header();
94 persObj->m_ctp.m_trailer = transObj->cTPResult().trailer().trailer();
95
96 persObj->m_ctp.m_roiWords.clear();
97 for (const ROIB::CTPRoI& r : transObj->cTPResult().roIVec())
98 persObj->m_ctp.m_roiWords.push_back( r.roIWord() );
99
101 // //
102 // Transfer the Jet/Energy information //
103 // //
105 persObj->m_jetenergy.clear();
106 for (const ROIB::JetEnergyResult& jer : transObj->jetEnergyResult()) {
107
108 persObj->m_jetenergy.push_back( SubSysResult_p1() );
109
110 persObj->m_jetenergy.back().m_header = jer.header().header();
111 persObj->m_jetenergy.back().m_trailer = jer.trailer().trailer();
112 for (const ROIB::JetEnergyRoI& r : jer.roIVec())
113 persObj->m_jetenergy.back().m_roiWords.push_back( r.roIWord() );
114 }
115
117 // //
118 // Transfer the EM/Tau information //
119 // //
121 persObj->m_emtau.clear();
122 for (const ROIB::EMTauResult& emtau : transObj->eMTauResult()) {
123
124 persObj->m_emtau.push_back( SubSysResult_p1() );
125
126 persObj->m_emtau.back().m_header = emtau.header().header();
127 persObj->m_emtau.back().m_trailer = emtau.trailer().trailer();
128 for (const ROIB::EMTauRoI& r : emtau.roIVec())
129 persObj->m_emtau.back().m_roiWords.push_back( r.roIWord() );
130 }
131
132 if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "Creating persistent state of ROIB::RoIBResult [OK]" << endmsg;
133
134 return;
135
136}
#define endmsg
TPConverterBase< TRANS, PERS > T_AthenaPoolTPCnvBase
Class holding the LVL1 CTP result used by the RoIBuilder.
const Header & header() const
return header
const std::vector< CTPRoI > & roIVec() const
return the RoI vector *‍/
const Trailer & trailer() const
return trailer
ROIB::CTPRoI contains a RoI delivered by the CTP.
Definition CTPRoI.h:28
Header models the LVL1 ROD Header.
const std::vector< uint32_t > & header() const
get full header
Class holding the RoIs from the MuCTPI collected by the RoIB.
const Header & header() const
Member function returning the header.
const Trailer & trailer() const
Member function returning the trailer.
const std::vector< MuCTPIRoI > & roIVec() const
Member function returning the RoI vector.
Class for storing the 32-bit muon RoI word.
Definition MuCTPIRoI.h:39
Class holding the LVL1 RoIB result build by the RoIBuilder.
Definition RoIBResult.h:47
const std::vector< JetEnergyResult > & jetEnergyResult() const
Gets the jet/energy part of the L1 RDO.
const CTPResult & cTPResult() const
Gets the CTP part of the L1 RDO.
const std::vector< EMTauResult > & eMTauResult() const
Gets the egamma part of the L1 RDO.
const MuCTPIResult & muCTPIResult() const
Gets the MuCTPI part of the L1 RDO.
ROIB::Trailer models the LVL1 ROD Trailer.
Definition Trailer.h:37
const std::vector< uint32_t > & trailer() const
get full trailer
virtual void transToPers(const ROIB::RoIBResult *transObj, RoIBResult_p1 *persObj, MsgStream &log)
Function transferring the information from a transient ROIB::RoIBResult object to a persistent RoIBRe...
RoIBResultCnv_p1()
Default constructor.
virtual void persToTrans(const RoIBResult_p1 *persObj, ROIB::RoIBResult *transObj, MsgStream &log)
Function transferring the information from a persistent RoIBResult_p1 object to a transient ROIB::RoI...
Persistent representation of ROIB::RoIBResult.
SubSysResult_p1 m_muctpi
std::vector< SubSysResult_p1 > m_emtau
SubSysResult_p1 m_ctp
std::vector< SubSysResult_p1 > m_jetenergy
Persistent class used by RoIBResult_p1.
std::vector< uint32_t > m_header
std::vector< uint32_t > m_roiWords
std::vector< uint32_t > m_trailer
int r
Definition globals.cxx:22
Namespace of the LVL1 RoIB simulation.