ATLAS Offline Software
LArBadChannelCont.h
Go to the documentation of this file.
1 //Dear emacs, this is -*-c++-*-
2 /*
3  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
4 */
5 
6 #ifndef LARRECCONDITIONS_LARBADCHANNELCONT_H
7 #define LARRECCONDITIONS_LARBADCHANNELCONT_H
8 
9 #include <vector>
10 #include <algorithm>
14 
27 template<class LArBC_t>
28 class LArBadXCont {
29  public:
30  typedef uint32_t ChanId_t;
31  typedef std::pair<ChanId_t,LArBC_t> BadChanEntry;
32  typedef std::vector<BadChanEntry> BadChanVec;
33  typedef typename BadChanVec::const_iterator const_iterator;
34  typedef typename BadChanVec::size_type size_type;
35 
36 public:
37 
39 
41 
44 
49  void add(const HWIdentifier channel, const LArBC_t stat);
50 
56  void sort();
57 
63  LArBC_t status(const HWIdentifier channel) const;
64 
70  LArBC_t offlineStatus(const Identifier id) const;
71 
73  const_iterator begin() const {return m_cont.begin();}
74 
76  const_iterator end() const {return m_cont.end();}
77 
79  size_type size() const {return m_cont.size();}
80 
82  void clear() {m_cont.clear(); m_oflCont.clear();}
83 
84  const BadChanVec& fullCont() const {return m_cont;}
85 
86  //Add offline vector
88 
89 private:
91  struct ChannelLess {
92  bool operator()(const BadChanEntry& a, const BadChanEntry& b) const {
93  return a.first < b.first;
94  }
95  };
96 
97  //The vector storing bad-channels
98  BadChanVec m_cont; //with their online id
99  BadChanVec m_oflCont; //with their offline id (only for channels, not FEBs)
100 };
101 
103 
104 
105 
106 //Template instantiation for LArBadChannel
108 #include "AthenaKernel/CLASS_DEF.h"
109 CLASS_DEF(LArBadChannelCont,64272230,1)
110 #include "AthenaKernel/CondCont.h"
112 
113 //Template instantiation for LArBadFeb
115 CLASS_DEF(LArBadFebCont,60500160,1)
116 CLASS_DEF(CondCont<LArBadFebCont>,18499682, 1)
117 
118 
119 #endif
LArBadXCont::ChanId_t
uint32_t ChanId_t
Definition: LArBadChannelCont.h:30
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
LArBadXCont::setOflVec
void setOflVec(BadChanVec &input)
LArBadXCont::m_cont
BadChanVec m_cont
Definition: LArBadChannelCont.h:98
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LArBadChannel.h
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
LArBadXCont::LArBadXCont
LArBadXCont(const BadChanVec &vec)
Constructor with payload.
LArBadXCont::LArBadXCont
LArBadXCont()
Default Constructor.
Definition: LArBadChannelCont.h:40
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
LArBadXCont::sort
void sort()
Sort and purge the list of bad channels The list of bad channels get sorted by channel-ID For channel...
LArBadXCont::BadChanVec
std::vector< BadChanEntry > BadChanVec
Definition: LArBadChannelCont.h:32
HWIdentifier
Definition: HWIdentifier.h:13
LArBadXCont::offlineStatus
LArBC_t offlineStatus(const Identifier id) const
Query the status of a particular channel by offline ID This is the main client access method.
LArBadXCont::status
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.
LArBadChannelCont
LArBadXCont< LArBadChannel > LArBadChannelCont
Definition: LArBadChannelCont.h:107
LArBadFebCont
LArBadXCont< LArBadFeb > LArBadFebCont
Definition: LArBadChannelCont.h:114
LArBadXCont::fullCont
const BadChanVec & fullCont() const
Definition: LArBadChannelCont.h:84
LArBadXCont::ChannelLess::operator()
bool operator()(const BadChanEntry &a, const BadChanEntry &b) const
Definition: LArBadChannelCont.h:92
LArBadFeb.h
CONDCONT_MIXED_DEF
CONDCONT_MIXED_DEF(LArBadChannelCont, 144954956)
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
LArBadXCont::BadChanEntry
std::pair< ChanId_t, LArBC_t > BadChanEntry
Definition: LArBadChannelCont.h:31
LArBadXCont::const_iterator
BadChanVec::const_iterator const_iterator
Definition: LArBadChannelCont.h:33
beamspotman.stat
stat
Definition: beamspotman.py:266
LArBadChannelCont.icc
LArBadXCont::size
size_type size() const
Number of known bad channels.
Definition: LArBadChannelCont.h:79
HWIdentifier.h
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
LArBadXCont::ChannelLess
Comparison functor for sorting and searching.
Definition: LArBadChannelCont.h:91
a
TList * a
Definition: liststreamerinfos.cxx:10
CondCont
Hold mapping of ranges to condition objects.
Definition: CondCont.h:811
LArBadXCont::size_type
BadChanVec::size_type size_type
Definition: LArBadChannelCont.h:34
LArBadXCont::m_oflCont
BadChanVec m_oflCont
Definition: LArBadChannelCont.h:99
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
LArBadXCont::add
void add(const HWIdentifier channel, const LArBC_t stat)
Add a channel/FEB to the list of bad channels.
LArBadXCont::begin
const_iterator begin() const
Access to the begin iterator of the underlying vector.
Definition: LArBadChannelCont.h:73
CLASS_DEF.h
macros to associate a CLID to a type
LArBadXCont::clear
void clear()
Deletes the contents and sets size to 0 (same as stl::vector<T>::clear())
Definition: LArBadChannelCont.h:82
LArBadXCont::end
const_iterator end() const
Access to the end iterator of the underlying vector.
Definition: LArBadChannelCont.h:76