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 17 of file CaloTTPpmRxIdMap.cxx.

17  {
18 }

◆ ~CaloTTPpmRxIdMap()

CaloTTPpmRxIdMap::~CaloTTPpmRxIdMap ( )

Definition at line 21 of file CaloTTPpmRxIdMap.cxx.

21  {
22 }

Member Function Documentation

◆ convert_to_D()

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

Definition at line 157 of file CaloTTPpmRxIdMap.cxx.

157  {
158 
159  std::vector<CaloTTPpmRxId_P::__t>::const_iterator it = p.m_v.begin();
160  std::vector<CaloTTPpmRxId_P::__t>::const_iterator it_e = p.m_v.end();
161 
162  d.clear();
163  for ( ;it!=it_e;++it){
164  const CaloTTPpmRxId_P::__t& t = *it;
166 
167  t2.ppm_crate = t.ppm_crate;
168  t2.ppm_module = t.ppm_module;
169  t2.ppm_subModule = t.ppm_subModule;
170  t2.ppm_channel = t.ppm_channel;
171 
172  t2.rx_crate = t.rx_crate ;
173  t2.rx_module = t.rx_module;
174  t2.rx_inputConn = t.rx_inputConn;
175  t2.rx_inputPair = t.rx_inputPair;
176  t2.rx_outputConn = t.rx_outputConn;
177  t2.rx_outputPair = t.rx_outputPair;
178 
179  d.push_back(t2);
180  }
181 }

◆ convert_to_P()

void CaloTTPpmRxIdMap::convert_to_P ( const CaloTTPpmRxId t)
private

Definition at line 131 of file CaloTTPpmRxIdMap.cxx.

131  {
132 
133  CaloTTPpmRxId::const_iterator it = d.begin();
134  CaloTTPpmRxId::const_iterator it_e = d.end();
135 
136  for ( ;it!=it_e;++it){
137  const CaloTTPpmRxId_t& t = *it;
139 
140  t2.ppm_crate = t.ppm_crate;
141  t2.ppm_module = t.ppm_module;
142  t2.ppm_subModule = t.ppm_subModule;
143  t2.ppm_channel = t.ppm_channel;
144 
145  t2.rx_crate = t.rx_crate ;
146  t2.rx_module = t.rx_module;
147  t2.rx_inputConn = t.rx_inputConn;
148  t2.rx_inputPair = t.rx_inputPair;
149  t2.rx_outputConn = t.rx_outputConn;
150  t2.rx_outputPair = t.rx_outputPair;
151 
152  m_persData.m_v.push_back(t2);
153  }
154 }

◆ getP()

CaloTTPpmRxId_P * CaloTTPpmRxIdMap::getP ( )

return the persistified map

Definition at line 127 of file CaloTTPpmRxIdMap.cxx.

127  {
128  return &m_persData;
129 }

◆ ppmToRxId()

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

return the corresponding Rx channels to the Ppm input one

Definition at line 84 of file CaloTTPpmRxIdMap.cxx.

84  {
85 
86  std::map<L1CaloCoolChannelId, std::vector<L1CaloRxCoolChannelId> >::const_iterator it = m_mPpmIdToRx.find(ppmChannelId);
87 
88  if(it!=m_mPpmIdToRx.end()){
89  return it->second;
90  }
91 
92  IMessageSvc *msgSvc;
93  StatusCode status = Gaudi::svcLocator()->service("MessageSvc",msgSvc);
94  if(status.isFailure()){
95  std::cout << "Cannot locate MessageSvc" << std::endl;
96  }
97 
98  MsgStream log( msgSvc, "CaloTTPpmRxIdMap");
99  log<<MSG::ERROR<<" Ppm channel ID not found, id= "<< ppmChannelId.id()<<" in Ppm to Rx map." <<endmsg;
100 
101  return std::vector<L1CaloRxCoolChannelId>();
102 }

◆ rxToPpmId()

L1CaloCoolChannelId CaloTTPpmRxIdMap::rxToPpmId ( const L1CaloRxCoolChannelId rxChannelId) const

return the corresponfing ppm channel to the Rx input one

Definition at line 106 of file CaloTTPpmRxIdMap.cxx.

106  {
107 
108  std::map<L1CaloRxCoolChannelId, L1CaloCoolChannelId >::const_iterator it=m_mRxIdToPpm.find(rxChannelId);
109 
110  if(it!=m_mRxIdToPpm.end()){
111  return it->second;
112  }
113 
114  // ERROR, can not find the id.
115  IMessageSvc *msgSvc;
116  StatusCode status =Gaudi::svcLocator()->service("MessageSvc",msgSvc);
117  if(status.isFailure()){
118  std::cout << "Cannot locate MessageSvc" << std::endl;
119  }
120 
121  MsgStream log( msgSvc, "CaloTTPpmRxIdMap");
122  log<<MSG::ERROR<<" Rx channel ID not found, id = " <<rxChannelId.id()<<" in Rx to Ppm map."<< endmsg;
123 
124  return L1CaloCoolChannelId(0) ;
125 }

◆ set() [1/2]

void CaloTTPpmRxIdMap::set ( const CaloTTPpmRxId_P t)

initialize from POOL

Definition at line 183 of file CaloTTPpmRxIdMap.cxx.

183  {
184 
186  convert_to_D(p,d);
187  set(d);
188  m_persData.m_version = p.m_version;
189  return;
190 }

◆ set() [2/2]

void CaloTTPpmRxIdMap::set ( const PDATA t)

initialize from Nova

Definition at line 25 of file CaloTTPpmRxIdMap.cxx.

25  {
26 
27  convert_to_P(m);
28 
29  IMessageSvc *msgSvc;
30  StatusCode status =Gaudi::svcLocator()->service("MessageSvc",msgSvc);
31  if(status.isFailure()){
32  std::cout << "Cannot locate MessageSvc" << std::endl;
33  }
34  MsgStream log( msgSvc, "CaloTTPpmRxIdMap");
35  bool dump=false;
36  if (log.level()<=MSG::VERBOSE) dump=true;
37  bool dump2=false;
38  if (log.level()<=MSG::DEBUG) dump2=true;
39 
40 
41  log<<MSG::DEBUG<<" CaloTTPpmRxId size = "<<m.size() <<endmsg;
43  status = Gaudi::svcLocator()->service("DetectorStore",detStore);
44  if(status.isFailure()){
45  log << MSG::ERROR << "Cannot locate DetectorStore" << endmsg;
46  }
47 
48  CaloTTPpmRxId::const_iterator it = m.begin();
49  CaloTTPpmRxId::const_iterator it_e = m.end();
50 
51  try {
52  for (; it!=it_e; ++it) {
53  const CaloTTPpmRxId_t& t = *it;
54 
55  L1CaloCoolChannelId ppmChannelId(t.ppm_crate, L1CaloModuleType::Ppm, t.ppm_module, t.ppm_subModule, t.ppm_channel);
56  L1CaloRxCoolChannelId rxChannelId(t.rx_crate, t.rx_module, t.rx_inputConn, t.rx_inputPair, t.rx_outputConn, t.rx_outputPair);
57 
58 /*
59  log<<MSG::VERBOSE
60  << " db struct= "
61  <<" pn="<<t.pn<<" sampling="<<t.sampling
62  <<" region="<<t.region
63  <<" eta="<<t.eta<<" phi="<<t.phi<<" layer="<<t.layer<<" | "
64  <<" crate="<<t.crate<<" module="<<t.module
65  <<" submodule="<<t.submodule
66  <<" channel="<<t.channel
67  << endmsg;
68 */
69  if (dump) log << MSG::VERBOSE << " ppm id = " << ppmChannelId.id() << " rx id =" << rxChannelId.id() <<endmsg;
70 
71  m_mPpmIdToRx[ppmChannelId].push_back(rxChannelId);
72  m_mRxIdToPpm[rxChannelId] = ppmChannelId;
73 
74  }
75  if (dump2) log<<MSG::DEBUG<<" CaloTTPpmRxIdMap::set : number of Ids="<<m_mPpmIdToRx.size()<<std::endl;
76  } catch (CaloID_Exception& except) {
77  log<<MSG::ERROR<<" Failed in CaloTTPpmRxIdMap::set " << endmsg;
78  log<<MSG::ERROR<< (std::string) except << endmsg ;
79  }
80  return;
81 }

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
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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:423
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:25
CaloTTPpmRxIdMap::convert_to_D
void convert_to_D(const CaloTTPpmRxId_P &t, CaloTTPpmRxId &d)
Definition: CaloTTPpmRxIdMap.cxx:157
CaloTTPpmRxId_t
Structure definition of the CaloTTPpmRxIdMap.
Definition: CaloTTPpmRxId.h:15
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
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
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
L1CaloCoolChannelId::id
unsigned int id() const
Definition: L1CaloCoolChannelId.h:32
CaloTTPpmRxId_P::m_version
int m_version
Definition: CaloTTPpmRxId_P.h:50
python.ChapPy.dump
def dump(buf, stdout=sys.stdout)
Definition: ChapPy.py:25
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
merge.status
status
Definition: merge.py:17
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:131
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