ATLAS Offline Software
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
LArConditionsChannelSet< T > Class Template Reference

template class for use for I/O of conditions data correction sets More...

#include <LArConditionsChannelSet.h>

Collaboration diagram for LArConditionsChannelSet< T >:

Classes

class  PairSort
 

Public Types

typedef unsigned int ChannelId
 Public typedefs. More...
 
typedef std::pair< ChannelId, T > ChanIdTPair
 
typedef std::vector< ChanIdTPairChannelVector
 
typedef ChannelVector::const_iterator ConstChannelIt
 
typedef ChannelVector::iterator ChannelIt
 

Public Member Functions

 LArConditionsChannelSet ()
 Default constructor. More...
 
virtual ~LArConditionsChannelSet ()
 destructor More...
 
ConstChannelIt find (ChannelId id) const
 Access to a conditions object pair for a given channel id. More...
 
ConstChannelIt begin () const
 Iterators over channel set. More...
 
ConstChannelIt end () const
 
size_t size () const
 Size of channel set. More...
 
void insert (ChannelId id, const T &cond)
 Insert a new channel id / T pair. More...
 

Private Attributes

ChannelVector m_channelVec
 

Detailed Description

template<class T>
class LArConditionsChannelSet< T >

template class for use for I/O of conditions data correction sets

This class contains a vector of pairs of hardware channels ids and a conditions object T. This class allows to store the conditions for a subset of channels. It's original purpose is to allow correction sets to be saved with corrections on a channel by channel basis. The LArConditionsSubset is the corresponding primary conditions container which is more optimal on space.

Definition at line 36 of file LArConditionsChannelSet.h.

Member Typedef Documentation

◆ ChanIdTPair

template<class T >
typedef std::pair<ChannelId, T> LArConditionsChannelSet< T >::ChanIdTPair

Definition at line 42 of file LArConditionsChannelSet.h.

◆ ChannelId

template<class T >
typedef unsigned int LArConditionsChannelSet< T >::ChannelId

Public typedefs.

Definition at line 41 of file LArConditionsChannelSet.h.

◆ ChannelIt

template<class T >
typedef ChannelVector::iterator LArConditionsChannelSet< T >::ChannelIt

Definition at line 45 of file LArConditionsChannelSet.h.

◆ ChannelVector

template<class T >
typedef std::vector<ChanIdTPair> LArConditionsChannelSet< T >::ChannelVector

Definition at line 43 of file LArConditionsChannelSet.h.

◆ ConstChannelIt

template<class T >
typedef ChannelVector::const_iterator LArConditionsChannelSet< T >::ConstChannelIt

Definition at line 44 of file LArConditionsChannelSet.h.

Constructor & Destructor Documentation

◆ LArConditionsChannelSet()

template<class T >
LArConditionsChannelSet< T >::LArConditionsChannelSet
inline

Default constructor.

Definition at line 92 of file LArConditionsChannelSet.h.

93 {}

◆ ~LArConditionsChannelSet()

template<class T >
LArConditionsChannelSet< T >::~LArConditionsChannelSet
inlinevirtual

destructor

Definition at line 98 of file LArConditionsChannelSet.h.

99 {}

Member Function Documentation

◆ begin()

template<class T >
LArConditionsChannelSet< T >::ConstChannelIt LArConditionsChannelSet< T >::begin
inline

Iterators over channel set.

Definition at line 125 of file LArConditionsChannelSet.h.

126 {
127  return (m_channelVec.begin());
128 }

◆ end()

template<class T >
LArConditionsChannelSet< T >::ConstChannelIt LArConditionsChannelSet< T >::end
inline

Definition at line 133 of file LArConditionsChannelSet.h.

134 {
135  return (m_channelVec.end());
136 }

◆ find()

template<class T >
LArConditionsChannelSet< T >::ConstChannelIt LArConditionsChannelSet< T >::find ( ChannelId  id) const
inline

Access to a conditions object pair for a given channel id.

Definition at line 105 of file LArConditionsChannelSet.h.

106 {
107  ConstChannelIt result = std::lower_bound(m_channelVec.begin(),
108  m_channelVec.end(),
109  id,
110  PairSort());
111 
112  if (result == m_channelVec.end()) return (result);
113  if ((*result).first == id) {
114  return (result);
115  } else {
116  return m_channelVec.end() ;
117  }
118 }

◆ insert()

template<class T >
void LArConditionsChannelSet< T >::insert ( ChannelId  id,
const T &  cond 
)
inline

Insert a new channel id / T pair.

If new channel id is the same as an existing one, the new T replaces the old T

Definition at line 151 of file LArConditionsChannelSet.h.

152 {
153  m_channelVec.push_back(ChanIdTPair(id,cond));
154  std::sort(m_channelVec.begin(), m_channelVec.end(), PairSort());
155 }

◆ size()

template<class T >
size_t LArConditionsChannelSet< T >::size
inline

Size of channel set.

Definition at line 143 of file LArConditionsChannelSet.h.

144 {
145  return (m_channelVec.size());
146 }

Member Data Documentation

◆ m_channelVec

template<class T >
ChannelVector LArConditionsChannelSet< T >::m_channelVec
private

Definition at line 83 of file LArConditionsChannelSet.h.


The documentation for this class was generated from the following file:
get_generator_info.result
result
Definition: get_generator_info.py:21
LArConditionsChannelSet::ConstChannelIt
ChannelVector::const_iterator ConstChannelIt
Definition: LArConditionsChannelSet.h:44
LArConditionsChannelSet::ChanIdTPair
std::pair< ChannelId, T > ChanIdTPair
Definition: LArConditionsChannelSet.h:42
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
LArConditionsChannelSet::m_channelVec
ChannelVector m_channelVec
Definition: LArConditionsChannelSet.h:83