ATLAS Offline Software
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 
16  : T_AthenaPoolTPCnvBase< ROIB::RoIBResult, RoIBResult_p1 >() {
17 
18 }
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 
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 }
ROIB::CTPRoI
ROIB::CTPRoI contains a RoI delivered by the CTP.
Definition: CTPRoI.h:28
beamspotman.r
def r
Definition: beamspotman.py:676
ROIB::EMTauResult
Definition: EMTauResult.h:25
ROIB::RoIBResult
Class holding the LVL1 RoIB result build by the RoIBuilder.
Definition: RoIBResult.h:47
ROIB::RoIBResult::jetEnergyResult
const std::vector< JetEnergyResult > & jetEnergyResult() const
Gets the jet/energy part of the L1 RDO.
Definition: RoIBResult.cxx:64
ROIB::CTPResult::trailer
const Trailer & trailer() const
return trailer
RoIBResultCnv_p1::transToPers
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...
Definition: RoIBResultCnv_p1.cxx:71
ROIB::CTPResult::header
const Header & header() const
return header
SubSysResult_p1::m_trailer
std::vector< uint32_t > m_trailer
Definition: SubSysResult_p1.h:37
ROIB::RoIBResult::eMTauResult
const std::vector< EMTauResult > & eMTauResult() const
Gets the egamma part of the L1 RDO.
Definition: RoIBResult.cxx:68
TPConverterBase
Definition: TPConverter.h:738
RoIBResult_p1
Persistent representation of ROIB::RoIBResult.
Definition: RoIBResult_p1.h:30
ROIB::MuCTPIResult::header
const Header & header() const
Member function returning the header.
Definition: MuCTPIResult.cxx:51
ROIB::MuCTPIRoI
Class for storing the 32-bit muon RoI word.
Definition: MuCTPIRoI.h:39
ROIB::Header::header
const std::vector< uint32_t > & header() const
get full header
ROIB::CTPResult
Class holding the LVL1 CTP result used by the RoIBuilder.
Definition: CTPResult.h:52
ROIB::JetEnergyRoI
Definition: JetEnergyRoI.h:20
SubSysResult_p1::m_roiWords
std::vector< uint32_t > m_roiWords
Definition: SubSysResult_p1.h:36
ROIB::Trailer::trailer
const std::vector< uint32_t > & trailer() const
get full trailer
ROIB
Namespace of the LVL1 RoIB simulation.
Definition: ILvl1ResultAccessTool.h:19
ROIB::JetEnergyResult
Definition: JetEnergyResult.h:24
RoIBResult_p1::m_ctp
SubSysResult_p1 m_ctp
Definition: RoIBResult_p1.h:39
ROIB::MuCTPIResult::trailer
const Trailer & trailer() const
Member function returning the trailer.
Definition: MuCTPIResult.cxx:60
SubSysResult_p1::m_header
std::vector< uint32_t > m_header
Definition: SubSysResult_p1.h:35
RoIBResultCnv_p1::RoIBResultCnv_p1
RoIBResultCnv_p1()
Default constructor.
Definition: RoIBResultCnv_p1.cxx:15
ROIB::Header
Header models the LVL1 ROD Header.
Definition: TrigT1Result/TrigT1Result/Header.h:37
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
RoIBResultCnv_p1.h
RoIBResultCnv_p1::persToTrans
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...
Definition: RoIBResultCnv_p1.cxx:24
ROIB::MuCTPIResult
Class holding the RoIs from the MuCTPI collected by the RoIB.
Definition: MuCTPIResult.h:44
ROIB::RoIBResult::cTPResult
const CTPResult & cTPResult() const
Gets the CTP part of the L1 RDO.
Definition: RoIBResult.cxx:60
ROIB::Trailer
ROIB::Trailer models the LVL1 ROD Trailer.
Definition: Trailer.h:37
TriggerTest.ctp
ctp
Retrieve trigger EDM objects.
Definition: TriggerTest.py:14
SubSysResult_p1
Persistent class used by RoIBResult_p1.
Definition: SubSysResult_p1.h:27
ROIB::EMTauRoI
Definition: EMTauRoI.h:20
ROIB::CTPResult::roIVec
const std::vector< CTPRoI > & roIVec() const
return the RoI vector *‍/
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
ROIB::MuCTPIResult::roIVec
const std::vector< MuCTPIRoI > & roIVec() const
Member function returning the RoI vector.
Definition: MuCTPIResult.cxx:69
ROIB::RoIBResult::muCTPIResult
const MuCTPIResult & muCTPIResult() const
Gets the MuCTPI part of the L1 RDO.
Definition: RoIBResult.cxx:56
RoIBResult_p1::m_muctpi
SubSysResult_p1 m_muctpi
Definition: RoIBResult_p1.h:38
RoIBResult_p1::m_emtau
std::vector< SubSysResult_p1 > m_emtau
Definition: RoIBResult_p1.h:41
RoIBResult_p1::m_jetenergy
std::vector< SubSysResult_p1 > m_jetenergy
Definition: RoIBResult_p1.h:40