ATLAS Offline Software
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 
12 void 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 
LArFebErrorSummary::get_all_febs
const std::map< unsigned int, uint16_t > & get_all_febs() const
get all febs with error
Definition: LArFebErrorSummary.cxx:47
fitman.sz
sz
Definition: fitman.py:527
LArFebErrorSummary::set_feb_error
bool set_feb_error(unsigned int febid, uint16_t e)
Add another FEB error record, return true if added successfully.
Definition: LArFebErrorSummary.cxx:34
LArFebErrorSummary_p1::m_feb_errors
std::vector< uint16_t > m_feb_errors
Definition: LArFebErrorSummary_p1.h:27
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LArFebErrorSummaryCnv_p1::persToTrans
virtual void persToTrans(const LArFebErrorSummary_p1 *pers, LArFebErrorSummary *trans, MsgStream &log) const override
Definition: LArFebErrorSummaryCnv_p1.cxx:29
LArFebErrorSummary_p1::m_feb_ids
std::vector< unsigned int > m_feb_ids
Definition: LArFebErrorSummary_p1.h:26
LArFebErrorSummaryCnv_p1::transToPers
virtual void transToPers(const LArFebErrorSummary *trans, LArFebErrorSummary_p1 *pers, MsgStream &log) const override
Definition: LArFebErrorSummaryCnv_p1.cxx:12
LArFebErrorSummary
Holds information from the FEB Error Summary.
Definition: LArFebErrorSummary.h:23
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArFebErrorSummaryCnv_p1.h
LArFebErrorSummary.h
LArFebErrorSummary_p1
persistent class for LArFebErrorSummary, version p2.
Definition: LArFebErrorSummary_p1.h:15
CaloGain.h
LArFebErrorSummary::clear
void clear()
clear internal map
Definition: LArFebErrorSummary.cxx:52