ATLAS Offline Software
Loading...
Searching...
No Matches
LArFebErrorSummaryCnv_p1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9// LArFebErrorSummaryCnv_p1, used for T/P separation
10// author H.Ma
11
12void LArFebErrorSummaryCnv_p1::transToPers(const LArFebErrorSummary* trans, LArFebErrorSummary_p1* pers, MsgStream &/*log*/) const
13{
14 unsigned int sz = trans->get_all_febs().size();
15
16 pers->m_feb_errors.clear();
17 pers->m_feb_ids.clear();
18 pers->m_feb_errors.reserve(sz);
19 pers->m_feb_ids.reserve(sz);
20
21 for (const std::pair<const unsigned int, uint16_t>& p :
22 trans->get_all_febs())
23 {
24 pers->m_feb_ids.push_back (p.first);
25 pers->m_feb_errors.push_back (p.second);
26 }
27}
28
30{
31
32 if( pers->m_feb_errors.size()!= pers->m_feb_ids.size() )
33 {
34 log<<MSG::ERROR<<" In LArFebErrorSummaryCnv_p1::persToTrans, size of ids and errors are not the same "<<endmsg;
35 return ;
36 }
37
38 unsigned int sz = pers->m_feb_ids.size();
39
40 // clear the internal map
41 trans->clear();
42
43 for (unsigned int i = 0;i<sz;++i){
44 if ( ! trans->set_feb_error(pers->m_feb_ids[i],pers->m_feb_errors[i]) )
45 {
46 log<<MSG::ERROR<<" In LArFebErrorSummaryCnv_p1::persToTrans, failed to add a feb_id, and error "<<pers->m_feb_ids[i]
47 <<" " << pers->m_feb_errors[i] <<endmsg;
48 }
49 }
50
51
52}
53
#define endmsg
static Double_t sz
virtual void persToTrans(const LArFebErrorSummary_p1 *pers, LArFebErrorSummary *trans, MsgStream &log) const override
virtual void transToPers(const LArFebErrorSummary *trans, LArFebErrorSummary_p1 *pers, MsgStream &log) const override
persistent class for LArFebErrorSummary, version p2.
std::vector< unsigned int > m_feb_ids
std::vector< uint16_t > m_feb_errors
Holds information from the FEB Error Summary.
bool set_feb_error(unsigned int febid, uint16_t e)
Add another FEB error record, return true if added successfully.
void clear()
clear internal map
const std::map< unsigned int, uint16_t > & get_all_febs() const
get all febs with error