8#include "GaudiKernel/ISvcLocator.h"
9#include "GaudiKernel/Bootstrap.h"
10#include "GaudiKernel/MsgStream.h"
11#include "GaudiKernel/IMessageSvc.h"
30 SmartIF<IMessageSvc> msgSvc{Gaudi::svcLocator()->service(
"MessageSvc")};
32 throw std::runtime_error(
"Cannot locate MessageSvc");
34 MsgStream log( msgSvc,
"CaloTTPpmRxIdMap");
36 log<<MSG::DEBUG<<
" CaloTTPpmRxId size = "<<m.size() <<
endmsg;
38 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
40 log << MSG::ERROR <<
"Cannot locate DetectorStore" <<
endmsg;
43 CaloTTPpmRxId::const_iterator it = m.begin();
44 CaloTTPpmRxId::const_iterator it_e = m.end();
47 for (; it!=it_e; ++it) {
51 L1CaloRxCoolChannelId rxChannelId(t.rx_crate, t.rx_module, t.rx_inputConn, t.rx_inputPair, t.rx_outputConn, t.rx_outputPair);
53 if (log.level()<=MSG::VERBOSE) {
54 log << MSG::VERBOSE <<
" ppm id = " << ppmChannelId.
id() <<
" rx id =" << rxChannelId.
id() <<
endmsg;
61 if (log.level()<=MSG::DEBUG) {
62 log<<MSG::DEBUG<<
" CaloTTPpmRxIdMap::set : number of Ids="<<
m_mPpmIdToRx.size()<<std::endl;
65 log<<MSG::ERROR<<
" Failed in CaloTTPpmRxIdMap::set " <<
endmsg;
66 log<<MSG::ERROR<< (std::string) except <<
endmsg ;
81 "Ppm channel ID not found, id= "<< ppmChannelId.
id()<<
" in Ppm to Rx map." <<
endmsg;
83 return std::vector<L1CaloRxCoolChannelId>();
90 std::map<L1CaloRxCoolChannelId, L1CaloCoolChannelId >::const_iterator it=
m_mRxIdToPpm.find(rxChannelId);
98 "Rx channel ID not found, id = " <<rxChannelId.
id()<<
" in Rx to Ppm map."<<
endmsg;
109 CaloTTPpmRxId::const_iterator it = d.begin();
110 CaloTTPpmRxId::const_iterator it_e = d.end();
112 for ( ;it!=it_e;++it){
116 t2.ppm_crate = t.ppm_crate;
117 t2.ppm_module = t.ppm_module;
118 t2.ppm_subModule = t.ppm_subModule;
119 t2.ppm_channel = t.ppm_channel;
121 t2.rx_crate = t.rx_crate ;
122 t2.rx_module = t.rx_module;
123 t2.rx_inputConn = t.rx_inputConn;
124 t2.rx_inputPair = t.rx_inputPair;
125 t2.rx_outputConn = t.rx_outputConn;
126 t2.rx_outputPair = t.rx_outputPair;
135 std::vector<CaloTTPpmRxId_P::__t>::const_iterator it = p.m_v.begin();
136 std::vector<CaloTTPpmRxId_P::__t>::const_iterator it_e = p.m_v.end();
139 for ( ;it!=it_e;++it){
143 t2.ppm_crate = t.ppm_crate;
144 t2.ppm_module = t.ppm_module;
145 t2.ppm_subModule = t.ppm_subModule;
146 t2.ppm_channel = t.ppm_channel;
148 t2.rx_crate = t.rx_crate ;
149 t2.rx_module = t.rx_module;
150 t2.rx_inputConn = t.rx_inputConn;
151 t2.rx_inputPair = t.rx_inputPair;
152 t2.rx_outputConn = t.rx_outputConn;
153 t2.rx_outputPair = t.rx_outputPair;
std::vector< CaloTTPpmRxId_t > CaloTTPpmRxId
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Exception class for Calo Identifiers.
L1CaloCoolChannelId rxToPpmId(const L1CaloRxCoolChannelId &rxChannelId) const
return the corresponfing ppm channel to the Rx input one
void convert_to_P(const CaloTTPpmRxId &t)
std::map< L1CaloRxCoolChannelId, L1CaloCoolChannelId > m_mRxIdToPpm
std::vector< L1CaloRxCoolChannelId > ppmToRxId(const L1CaloCoolChannelId &ppmChannelId) const
return the corresponding Rx channels to the Ppm input one
std::map< L1CaloCoolChannelId, std::vector< L1CaloRxCoolChannelId > > m_mPpmIdToRx
void set(const PDATA &t)
initialize from Nova
void convert_to_D(const CaloTTPpmRxId_P &t, CaloTTPpmRxId &d)
CaloTTPpmRxId_P m_persData
CaloTTPpmRxId_P * getP()
return the persistified map
This is a database object holding the TT PPM to RX channels map.
Encapsulates the ID of one channel of conditions data in COOL, ie the ID of a row in a table.
Encapsulates the ID of one Rx channel of conditions data in COOL, ie the ID of a row in a table.
Structure definition of the CaloTTPpmRxIdMap.