ATLAS Offline Software
Loading...
Searching...
No Matches
LArBadChannelState::CoolChannelData Class Reference

#include <LArBadChannelState.h>

Collaboration diagram for LArBadChannelState::CoolChannelData:

Public Types

typedef std::vector< BadChanEntryBadChanVec

Public Member Functions

 CoolChannelData (CoolChannelEnum cc, const BadChanVec &entries)
 Construct with bad channel data.
 CoolChannelData (CoolChannelEnum cc)
 Construct an empty CoolChannelData.
void reset ()
void add (const BadChanEntry &e)
 the entry is assumed to belong to the cool channel and is not checked.
void setFromDB (const BadChanVec &stateVec)
void addFromDB (const BadChanVec &stateVec)
void addUpdate (const BadChanVec &stateVec)
void resolveDuplicateEntries ()
CoolChannelEnum number () const
bool changed () const
BadChanVec::const_iterator begin () const
BadChanVec::iterator begin ()
BadChanVec::const_iterator end () const
BadChanVec::iterator end ()
BadChanVec::size_type size () const
bool empty () const
const BadChanVecstateVector () const

Private Attributes

CoolChannelEnum m_number
BadChanVec m_entries
bool m_changed

Detailed Description

Definition at line 25 of file LArBadChannelState.h.

Member Typedef Documentation

◆ BadChanVec

Definition at line 28 of file LArBadChannelState.h.

Constructor & Destructor Documentation

◆ CoolChannelData() [1/2]

LArBadChannelState::CoolChannelData::CoolChannelData ( CoolChannelEnum cc,
const BadChanVec & entries )
inline

Construct with bad channel data.

Definition at line 31 of file LArBadChannelState.h.

◆ CoolChannelData() [2/2]

LArBadChannelState::CoolChannelData::CoolChannelData ( CoolChannelEnum cc)
inlineexplicit

Construct an empty CoolChannelData.

Definition at line 35 of file LArBadChannelState.h.

35 :
36 m_number(cc), m_entries(), m_changed(false) {}

Member Function Documentation

◆ add()

void LArBadChannelState::CoolChannelData::add ( const BadChanEntry & e)
inline

the entry is assumed to belong to the cool channel and is not checked.

Duplicate entries for the same channel may exist after this call

Definition at line 45 of file LArBadChannelState.h.

45 {
46 m_entries.push_back(e);
47 m_changed = true;
48 }

◆ addFromDB()

void LArBadChannelState::CoolChannelData::addFromDB ( const BadChanVec & stateVec)

Definition at line 73 of file LArBadChannelState.cxx.

74{
75 m_entries.insert( m_entries.end(), stateVec.begin(), stateVec.end());
77 //sort( m_entries.begin(), m_entries.end())
78 m_changed = false;
79}

◆ addUpdate()

void LArBadChannelState::CoolChannelData::addUpdate ( const BadChanVec & stateVec)
inline

Definition at line 57 of file LArBadChannelState.h.

57 {
58 m_entries.insert( m_entries.end(), stateVec.begin(), stateVec.end());
59 m_changed = true;
60 }

◆ begin() [1/2]

BadChanVec::iterator LArBadChannelState::CoolChannelData::begin ( )
inline

Definition at line 71 of file LArBadChannelState.h.

71 {
72 return m_entries.begin();
73 }

◆ begin() [2/2]

BadChanVec::const_iterator LArBadChannelState::CoolChannelData::begin ( ) const
inline

Definition at line 68 of file LArBadChannelState.h.

68 {
69 return m_entries.begin();
70 }

◆ changed()

bool LArBadChannelState::CoolChannelData::changed ( ) const
inline

Definition at line 66 of file LArBadChannelState.h.

66{ return m_changed;}

◆ empty()

bool LArBadChannelState::CoolChannelData::empty ( ) const
inline

Definition at line 86 of file LArBadChannelState.h.

86 {
87 return m_entries.empty();
88 }

◆ end() [1/2]

BadChanVec::iterator LArBadChannelState::CoolChannelData::end ( )
inline

Definition at line 78 of file LArBadChannelState.h.

78 {
79 return m_entries.end();
80 }

◆ end() [2/2]

BadChanVec::const_iterator LArBadChannelState::CoolChannelData::end ( ) const
inline

Definition at line 75 of file LArBadChannelState.h.

75 {
76 return m_entries.end();
77 }

◆ number()

CoolChannelEnum LArBadChannelState::CoolChannelData::number ( ) const
inline

Definition at line 64 of file LArBadChannelState.h.

64{ return m_number;}

◆ reset()

void LArBadChannelState::CoolChannelData::reset ( )
inline

Definition at line 38 of file LArBadChannelState.h.

38 {
39 m_entries.clear();
40 m_changed = false;
41 }

◆ resolveDuplicateEntries()

void LArBadChannelState::CoolChannelData::resolveDuplicateEntries ( )

Definition at line 81 of file LArBadChannelState.cxx.

82{
83 // using namespace std;
84 typedef std::vector<BadChanEntry>::iterator Iter;
85
86 std::multiset<Iter> toDelete;
87 for (Iter i = m_entries.begin(); i != m_entries.end(); ++i) {
88 for (Iter j = i+1; j != m_entries.end(); ++j) {
89 if (i->first == j->first) {
90 mergeFlags( *i, *j); // j's flags are added to i's flags
91 toDelete.insert(j);
92 }
93 }
94 }
95
96 // We make a copy of the vector to avoid erasing elements
97 std::vector<BadChanEntry> tmp;
98 tmp.reserve( m_entries.size() - toDelete.size());
99 for (Iter i = m_entries.begin(); i != m_entries.end(); ++i) {
100 if (toDelete.find(i) == toDelete.end()) {
101 tmp.push_back(*i); // not one of the duplicates
102 }
103 }
104
105 m_entries.swap( tmp);
106}
static void mergeFlags(BadChanEntry &a, const BadChanEntry &b)

◆ setFromDB()

void LArBadChannelState::CoolChannelData::setFromDB ( const BadChanVec & stateVec)
inline

Definition at line 50 of file LArBadChannelState.h.

50 {
51 m_entries = stateVec;
52 m_changed = false;
53 }

◆ size()

BadChanVec::size_type LArBadChannelState::CoolChannelData::size ( ) const
inline

Definition at line 82 of file LArBadChannelState.h.

82 {
83 return m_entries.size();
84 }

◆ stateVector()

const BadChanVec & LArBadChannelState::CoolChannelData::stateVector ( ) const
inline

Definition at line 90 of file LArBadChannelState.h.

90{ return m_entries;}

Member Data Documentation

◆ m_changed

bool LArBadChannelState::CoolChannelData::m_changed
private

Definition at line 95 of file LArBadChannelState.h.

◆ m_entries

BadChanVec LArBadChannelState::CoolChannelData::m_entries
private

Definition at line 94 of file LArBadChannelState.h.

◆ m_number

CoolChannelEnum LArBadChannelState::CoolChannelData::m_number
private

Definition at line 93 of file LArBadChannelState.h.


The documentation for this class was generated from the following files: