ATLAS Offline Software
PixelCablingCondData.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PIXELCABLINGCONDDATA_H
6 #define PIXELCABLINGCONDDATA_H
7 
8 //#define PIXEL_DEBUG
11 
12 #include "Identifier/Identifier.h"
13 #include <map>
14 #include <deque>
15 #include <stdint.h>
16 #include <utility>
17 #include <string>
18 #include <unordered_map>
19 
20 struct idHasher {
21  std::size_t operator()(const Identifier& id) const {
22  return std::hash<Identifier::value_type>{}(id.get_compact());
23  }
24 };
25 
27  public:
32 
33  void add_entry_onoff(const uint64_t, const Identifier); // add entries to m_idMap_onoff
34  void add_entry_offon(const Identifier, const uint64_t); // add entries in m_idMap_offon
35  void add_entry_offrob(const Identifier, const uint32_t); // add entries in m_idMap_offrob
36  void add_entry_rodrob(int rodid, int robid); // add entries in m_idMap_rodrob
37  void add_entry_robrod(int robid, int rodid);
38  void add_entry_offlineList(const uint32_t, const Identifier); // add entries in m_offlineListVect
39  void add_entry_DCSoffline(const std::string&, const Identifier); // add entries in m_offlineListVect
40 
41  Identifier find_entry_onoff(const uint64_t) const; // search entry in the map m_idMap_onoff - get the offlineId from the onlineId
42  uint64_t find_entry_offon(const Identifier) const; // search entry in the map m_idMap_offon - get the onlineId from the offlineId
43  uint32_t find_entry_offrob(Identifier offlineId) const; // search entry in the map m_idMap_offrob - get the ROBId from the offlineId
44  int find_entry_rodrob(const int rodid) const;
45  int find_entry_robrod(const int robid) const;
46  std::deque<Identifier> find_entry_offlineList(uint32_t robid) const; // return entries from m_offlineListVect for a ROBId
47  Identifier find_entry_DCSoffline(const std::string& DCSname) const;
48  std::string find_entry_offlineDCS(const Identifier offlineId) const;
50 
51  const std::vector<uint32_t>& get_allRods() const;
52  const std::vector<uint32_t>& get_allRobs() const;
53 
54  unsigned int get_size_onoff() {return m_idMap_onoff.size();}
55 
56  void set_readout_map(std::map<uint32_t,bool> rodReadoutMap);
57 
58  const std::unordered_map<uint64_t, Identifier>& get_idMap_onoff() const;
59  const std::unordered_map<Identifier, uint64_t, idHasher>& get_idMap_offon() const;
60  const std::unordered_map<Identifier, uint32_t, idHasher>& get_idMap_offrob() const;
61  const std::unordered_map<int,int>& get_idMap_rodrob() const;
62  const std::unordered_map<int,int>& get_idMap_robrod() const;
63  const std::unordered_map<std::string, Identifier>& get_idMapDCSoff() const;
64 
65  void clear();
66 
67  private:
68 
69  std::unordered_map<uint64_t, Identifier> m_idMap_onoff;
70  std::unordered_map<Identifier, uint64_t, idHasher> m_idMap_offon;
71  std::unordered_map<Identifier, uint32_t, idHasher> m_idMap_offrob;
72  std::unordered_map<int,int> m_idMap_rodrob;
73  std::unordered_map<int,int> m_idMap_robrod;
74  std::map<uint32_t, std::deque<Identifier> > m_offlineListVect;
75  std::unordered_map<std::string, Identifier> m_idMapDCSoff;
76  std::map<uint32_t,bool> m_rodReadoutMap;
77 
78  std::vector<uint32_t> m_allRods; // vector containing all RODs in the m_idMap_rodrob
79  std::vector<uint32_t> m_allRobs; // vector containing all ROBs
80 };
81 
82 CLASS_DEF( PixelCablingCondData , 107566278 , 1 ) // class definition with CLID
83 
84 #include "AthenaKernel/CondCont.h"
86 
87 #endif
PixelCablingCondData::get_idMap_robrod
const std::unordered_map< int, int > & get_idMap_robrod() const
Definition: PixelCablingCondData.cxx:220
PixelCablingCondData::find_entry_robrod
int find_entry_robrod(const int robid) const
Definition: PixelCablingCondData.cxx:134
PixelCablingCondData::find_entry_onoff
Identifier find_entry_onoff(const uint64_t) const
Definition: PixelCablingCondData.cxx:68
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
PixelCablingCondData::clear
void clear()
Definition: PixelCablingCondData.cxx:228
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
PixelCablingCondData::PixelCablingCondData
PixelCablingCondData()
Definition: PixelCablingCondData.cxx:17
PixelCablingCondData::add_entry_offrob
void add_entry_offrob(const Identifier, const uint32_t)
Definition: PixelCablingCondData.cxx:40
PixelCablingCondData::add_entry_onoff
void add_entry_onoff(const uint64_t, const Identifier)
Definition: PixelCablingCondData.cxx:32
PixelCablingCondData::add_entry_DCSoffline
void add_entry_DCSoffline(const std::string &, const Identifier)
Definition: PixelCablingCondData.cxx:60
CONDCONT_DEF
#define CONDCONT_DEF(...)
Definition: CondCont.h:1413
PixelCablingCondData::find_entry_offlineDCS
std::string find_entry_offlineDCS(const Identifier offlineId) const
Definition: PixelCablingCondData.cxx:158
PixelCablingCondData::find_entry_offrob
uint32_t find_entry_offrob(Identifier offlineId) const
Definition: PixelCablingCondData.cxx:114
PixelCablingCondData::getOnlineIdFromRobId
uint64_t getOnlineIdFromRobId(uint32_t robid, uint32_t link) const
Definition: PixelCablingCondData.cxx:181
idHasher
Definition: PixelCablingCondData.h:20
PixelCablingCondData::m_idMap_offrob
std::unordered_map< Identifier, uint32_t, idHasher > m_idMap_offrob
offline identifier -> ROBId map
Definition: PixelCablingCondData.h:71
PixelCablingCondData::m_idMap_offon
std::unordered_map< Identifier, uint64_t, idHasher > m_idMap_offon
online identifier -> offline identifier map
Definition: PixelCablingCondData.h:70
PixelCablingCondData::add_entry_robrod
void add_entry_robrod(int robid, int rodid)
Definition: PixelCablingCondData.cxx:50
PixelCablingCondData::find_entry_DCSoffline
Identifier find_entry_DCSoffline(const std::string &DCSname) const
Definition: PixelCablingCondData.cxx:150
PixelCablingCondData::m_idMap_rodrob
std::unordered_map< int, int > m_idMap_rodrob
RODId -> ROBId map.
Definition: PixelCablingCondData.h:72
PixelCablingCondData::operator=
PixelCablingCondData & operator=(const PixelCablingCondData &other)=delete
PixelCablingCondData::m_idMap_onoff
std::unordered_map< uint64_t, Identifier > m_idMap_onoff
offline identifier -> online identifier map
Definition: PixelCablingCondData.h:69
PixelCablingCondData::find_entry_offon
uint64_t find_entry_offon(const Identifier) const
Definition: PixelCablingCondData.cxx:102
idHasher::operator()
std::size_t operator()(const Identifier &id) const
Definition: PixelCablingCondData.h:21
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
PixelCablingCondData
Definition: PixelCablingCondData.h:26
PixelCablingCondData::get_allRods
const std::vector< uint32_t > & get_allRods() const
Definition: PixelCablingCondData.cxx:167
PixelCablingCondData::get_idMap_onoff
const std::unordered_map< uint64_t, Identifier > & get_idMap_onoff() const
Definition: PixelCablingCondData.cxx:204
PixelCablingCondData::get_idMapDCSoff
const std::unordered_map< std::string, Identifier > & get_idMapDCSoff() const
Definition: PixelCablingCondData.cxx:224
PixelCablingCondData::get_idMap_offrob
const std::unordered_map< Identifier, uint32_t, idHasher > & get_idMap_offrob() const
Definition: PixelCablingCondData.cxx:212
PixelCablingCondData::m_rodReadoutMap
std::map< uint32_t, bool > m_rodReadoutMap
Readout speed for each ROD. false=40MBit, true=80MBit.
Definition: PixelCablingCondData.h:76
PixelCablingCondData::find_entry_rodrob
int find_entry_rodrob(const int rodid) const
Definition: PixelCablingCondData.cxx:125
PixelCablingCondData::get_allRobs
const std::vector< uint32_t > & get_allRobs() const
Definition: PixelCablingCondData.cxx:171
PixelCablingCondData::add_entry_rodrob
void add_entry_rodrob(int rodid, int robid)
Definition: PixelCablingCondData.cxx:44
PixelCablingCondData::m_idMap_robrod
std::unordered_map< int, int > m_idMap_robrod
ROBId -> RODId map (reverse of m_idMap_rodrob)
Definition: PixelCablingCondData.h:73
PixelCablingCondData::set_readout_map
void set_readout_map(std::map< uint32_t, bool > rodReadoutMap)
Definition: PixelCablingCondData.cxx:64
PixelCablingCondData::m_idMapDCSoff
std::unordered_map< std::string, Identifier > m_idMapDCSoff
DCS name -> offline identifier.
Definition: PixelCablingCondData.h:75
PixelCablingCondData::m_offlineListVect
std::map< uint32_t, std::deque< Identifier > > m_offlineListVect
ROBId -> offline identifier list.
Definition: PixelCablingCondData.h:74
PixelCablingCondData::get_idMap_rodrob
const std::unordered_map< int, int > & get_idMap_rodrob() const
Definition: PixelCablingCondData.cxx:216
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
PixelCablingCondData::get_size_onoff
unsigned int get_size_onoff()
Definition: PixelCablingCondData.h:54
PixelCablingCondData::m_allRods
std::vector< uint32_t > m_allRods
Definition: PixelCablingCondData.h:78
CLASS_DEF
CLASS_DEF(PixelCablingCondData, 107566278, 1) CONDCONT_DEF(PixelCablingCondData
PixelCablingCondData::find_entry_offlineList
std::deque< Identifier > find_entry_offlineList(uint32_t robid) const
Definition: PixelCablingCondData.cxx:140
PixelCablingCondData::~PixelCablingCondData
virtual ~PixelCablingCondData()
PixelCablingCondData::add_entry_offon
void add_entry_offon(const Identifier, const uint64_t)
Definition: PixelCablingCondData.cxx:36
PixelCablingCondData::m_allRobs
std::vector< uint32_t > m_allRobs
Definition: PixelCablingCondData.h:79
CLASS_DEF.h
macros to associate a CLID to a type
PixelCablingCondData::get_idMap_offon
const std::unordered_map< Identifier, uint64_t, idHasher > & get_idMap_offon() const
Definition: PixelCablingCondData.cxx:208
PixelCablingCondData::PixelCablingCondData
PixelCablingCondData(const PixelCablingCondData &other)=delete
PixelCablingCondData::add_entry_offlineList
void add_entry_offlineList(const uint32_t, const Identifier)
Definition: PixelCablingCondData.cxx:56
Identifier
Definition: IdentifierFieldParser.cxx:14