ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CaloTTPpmRxIdMap Class Reference

This is a StoreGate object holding the TT PPM to RX channels map. More...

#include <CaloTTPpmRxIdMap.h>

Collaboration diagram for CaloTTPpmRxIdMap:

Public Types

typedef CaloTTPpmRxId PDATA
 

Public Member Functions

 CaloTTPpmRxIdMap ()
 
 ~CaloTTPpmRxIdMap ()
 
void set (const PDATA &t)
 initialize from Nova More...
 
std::vector< L1CaloRxCoolChannelIdppmToRxId (const L1CaloCoolChannelId &ppmChannelId) const
 return the corresponding Rx channels to the Ppm input one More...
 
L1CaloCoolChannelId rxToPpmId (const L1CaloRxCoolChannelId &rxChannelId) const
 return the corresponfing ppm channel to the Rx input one More...
 
CaloTTPpmRxId_PgetP ()
 return the persistified map More...
 
void set (const CaloTTPpmRxId_P &t)
 initialize from POOL More...
 

Private Member Functions

void convert_to_P (const CaloTTPpmRxId &t)
 
void convert_to_D (const CaloTTPpmRxId_P &t, CaloTTPpmRxId &d)
 

Private Attributes

std::map< L1CaloCoolChannelId, std::vector< L1CaloRxCoolChannelId > > m_mPpmIdToRx
 
std::map< L1CaloRxCoolChannelId, L1CaloCoolChannelIdm_mRxIdToPpm
 
CaloTTPpmRxId_P m_persData
 

Detailed Description

This is a StoreGate object holding the TT PPM to RX channels map.

Its persistifiable version is the CaloTTPpmRxId_P class

Author
Damien Prieur
maintained by Damien Prieur

Definition at line 26 of file CaloTTPpmRxIdMap.h.

Member Typedef Documentation

◆ PDATA

Definition at line 30 of file CaloTTPpmRxIdMap.h.

Constructor & Destructor Documentation

◆ CaloTTPpmRxIdMap()

CaloTTPpmRxIdMap::CaloTTPpmRxIdMap ( )

Definition at line 18 of file CaloTTPpmRxIdMap.cxx.

18  {
19 }

◆ ~CaloTTPpmRxIdMap()

CaloTTPpmRxIdMap::~CaloTTPpmRxIdMap ( )

Definition at line 22 of file CaloTTPpmRxIdMap.cxx.

22  {
23 }

Member Function Documentation

◆ convert_to_D()

void CaloTTPpmRxIdMap::convert_to_D ( const CaloTTPpmRxId_P t,
CaloTTPpmRxId d 
)
private

Definition at line 133 of file CaloTTPpmRxIdMap.cxx.

133  {
134 
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();
137 
138  d.clear();
139  for ( ;it!=it_e;++it){
140  const CaloTTPpmRxId_P::__t& t = *it;
142 
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;
147 
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;
154 
155  d.push_back(t2);
156  }
157 }

◆ convert_to_P()

void CaloTTPpmRxIdMap::convert_to_P ( const CaloTTPpmRxId t)
private

Definition at line 107 of file CaloTTPpmRxIdMap.cxx.

107  {
108 
109  CaloTTPpmRxId::const_iterator it = d.begin();
110  CaloTTPpmRxId::const_iterator it_e = d.end();
111 
112  for ( ;it!=it_e;++it){
113  const CaloTTPpmRxId_t& t = *it;
115 
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;
120 
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;
127 
128  m_persData.m_v.push_back(t2);
129  }
130 }

◆ getP()

CaloTTPpmRxId_P * CaloTTPpmRxIdMap::getP ( )

return the persistified map

Definition at line 103 of file CaloTTPpmRxIdMap.cxx.

103  {
104  return &m_persData;
105 }

◆ ppmToRxId()

std::vector< L1CaloRxCoolChannelId > CaloTTPpmRxIdMap::ppmToRxId ( const L1CaloCoolChannelId ppmChannelId) const

return the corresponding Rx channels to the Ppm input one

Definition at line 72 of file CaloTTPpmRxIdMap.cxx.

72  {
73 
74  std::map<L1CaloCoolChannelId, std::vector<L1CaloRxCoolChannelId> >::const_iterator it = m_mPpmIdToRx.find(ppmChannelId);
75 
76  if(it!=m_mPpmIdToRx.end()){
77  return it->second;
78  }
79 
80  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "CaloTTPpmRxIdMap") <<
81  "Ppm channel ID not found, id= "<< ppmChannelId.id()<<" in Ppm to Rx map." <<endmsg;
82 
83  return std::vector<L1CaloRxCoolChannelId>();
84 }

◆ rxToPpmId()

L1CaloCoolChannelId CaloTTPpmRxIdMap::rxToPpmId ( const L1CaloRxCoolChannelId rxChannelId) const

return the corresponfing ppm channel to the Rx input one

Definition at line 88 of file CaloTTPpmRxIdMap.cxx.

88  {
89 
90  std::map<L1CaloRxCoolChannelId, L1CaloCoolChannelId >::const_iterator it=m_mRxIdToPpm.find(rxChannelId);
91 
92  if(it!=m_mRxIdToPpm.end()){
93  return it->second;
94  }
95 
96  // ERROR, can not find the id.
97  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "CaloTTPpmRxIdMap") <<
98  "Rx channel ID not found, id = " <<rxChannelId.id()<<" in Rx to Ppm map."<< endmsg;
99 
100  return L1CaloCoolChannelId(0) ;
101 }

◆ set() [1/2]

void CaloTTPpmRxIdMap::set ( const CaloTTPpmRxId_P t)

initialize from POOL

Definition at line 159 of file CaloTTPpmRxIdMap.cxx.

159  {
160 
162  convert_to_D(p,d);
163  set(d);
164  m_persData.m_version = p.m_version;
165  return;
166 }

◆ set() [2/2]

void CaloTTPpmRxIdMap::set ( const PDATA t)

initialize from Nova

Definition at line 26 of file CaloTTPpmRxIdMap.cxx.

26  {
27 
28  convert_to_P(m);
29 
30  SmartIF<IMessageSvc> msgSvc{Gaudi::svcLocator()->service("MessageSvc")};
31  if(!msgSvc){
32  throw std::runtime_error("Cannot locate MessageSvc");
33  }
34  MsgStream log( msgSvc, "CaloTTPpmRxIdMap");
35 
36  log<<MSG::DEBUG<<" CaloTTPpmRxId size = "<<m.size() <<endmsg;
37 
38  SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
39  if(!detStore){
40  log << MSG::ERROR << "Cannot locate DetectorStore" << endmsg;
41  }
42 
43  CaloTTPpmRxId::const_iterator it = m.begin();
44  CaloTTPpmRxId::const_iterator it_e = m.end();
45 
46  try {
47  for (; it!=it_e; ++it) {
48  const CaloTTPpmRxId_t& t = *it;
49 
50  L1CaloCoolChannelId ppmChannelId(t.ppm_crate, L1CaloModuleType::Ppm, t.ppm_module, t.ppm_subModule, t.ppm_channel);
51  L1CaloRxCoolChannelId rxChannelId(t.rx_crate, t.rx_module, t.rx_inputConn, t.rx_inputPair, t.rx_outputConn, t.rx_outputPair);
52 
53  if (log.level()<=MSG::VERBOSE) {
54  log << MSG::VERBOSE << " ppm id = " << ppmChannelId.id() << " rx id =" << rxChannelId.id() <<endmsg;
55  }
56 
57  m_mPpmIdToRx[ppmChannelId].push_back(rxChannelId);
58  m_mRxIdToPpm[rxChannelId] = ppmChannelId;
59 
60  }
61  if (log.level()<=MSG::DEBUG) {
62  log<<MSG::DEBUG<<" CaloTTPpmRxIdMap::set : number of Ids="<<m_mPpmIdToRx.size()<<std::endl;
63  }
64  } catch (CaloID_Exception& except) {
65  log<<MSG::ERROR<<" Failed in CaloTTPpmRxIdMap::set " << endmsg;
66  log<<MSG::ERROR<< (std::string) except << endmsg ;
67  }
68  return;
69 }

Member Data Documentation

◆ m_mPpmIdToRx

std::map<L1CaloCoolChannelId, std::vector<L1CaloRxCoolChannelId> > CaloTTPpmRxIdMap::m_mPpmIdToRx
private

Definition at line 61 of file CaloTTPpmRxIdMap.h.

◆ m_mRxIdToPpm

std::map<L1CaloRxCoolChannelId, L1CaloCoolChannelId > CaloTTPpmRxIdMap::m_mRxIdToPpm
private

Definition at line 62 of file CaloTTPpmRxIdMap.h.

◆ m_persData

CaloTTPpmRxId_P CaloTTPpmRxIdMap::m_persData
private

Definition at line 64 of file CaloTTPpmRxIdMap.h.


The documentation for this class was generated from the following files:
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
CaloID_Exception
Exception class for Calo Identifiers.
Definition: CaloID_Exception.h:20
CaloTTPpmRxId
std::vector< CaloTTPpmRxId_t > CaloTTPpmRxId
Definition: CaloTTPpmRxId.h:30
hist_file_dump.d
d
Definition: hist_file_dump.py:137
skel.it
it
Definition: skel.GENtoEVGEN.py:396
L1CaloRxCoolChannelId::id
unsigned int id() const
Definition: L1CaloRxCoolChannelId.h:27
CaloTTPpmRxId_P::CaloTTPpmRxId_P_t
Structure of the map.
Definition: CaloTTPpmRxId_P.h:27
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
CaloTTPpmRxId_P::m_v
std::vector< __t > m_v
Definition: CaloTTPpmRxId_P.h:48
CaloTTPpmRxIdMap::set
void set(const PDATA &t)
initialize from Nova
Definition: CaloTTPpmRxIdMap.cxx:26
CaloTTPpmRxIdMap::convert_to_D
void convert_to_D(const CaloTTPpmRxId_P &t, CaloTTPpmRxId &d)
Definition: CaloTTPpmRxIdMap.cxx:133
CaloTTPpmRxId_t
Structure definition of the CaloTTPpmRxIdMap.
Definition: CaloTTPpmRxId.h:15
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
L1CaloRxCoolChannelId
Definition: L1CaloRxCoolChannelId.h:10
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
CaloTTPpmRxIdMap::m_persData
CaloTTPpmRxId_P m_persData
Definition: CaloTTPpmRxIdMap.h:64
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
L1CaloCoolChannelId::id
unsigned int id() const
Definition: L1CaloCoolChannelId.h:32
CaloTTPpmRxId_P::m_version
int m_version
Definition: CaloTTPpmRxId_P.h:50
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:345
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
L1CaloCoolChannelId
Definition: L1CaloCoolChannelId.h:10
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
L1CaloModuleType::Ppm
@ Ppm
Definition: L1CaloModuleType.h:17
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
CaloTTPpmRxIdMap::convert_to_P
void convert_to_P(const CaloTTPpmRxId &t)
Definition: CaloTTPpmRxIdMap.cxx:107
CaloTTPpmRxIdMap::m_mPpmIdToRx
std::map< L1CaloCoolChannelId, std::vector< L1CaloRxCoolChannelId > > m_mPpmIdToRx
Definition: CaloTTPpmRxIdMap.h:61
CaloTTPpmRxIdMap::m_mRxIdToPpm
std::map< L1CaloRxCoolChannelId, L1CaloCoolChannelId > m_mRxIdToPpm
Definition: CaloTTPpmRxIdMap.h:62