CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
edm::ValueMap< T > Class Template Reference

#include <ValueMap.h>

Classes

struct  const_iterator
 
struct  IDComparator
 

Public Types

typedef container::const_reference const_reference_type
 
typedef std::vector< value_typecontainer
 
typedef helper::Filler< ValueMap< T > > Filler
 
typedef std::vector< std::pair< ProductID, offset > > id_offset_vector
 
typedef unsigned int offset
 
typedef container::reference reference_type
 
typedef T value_type
 

Public Member Functions

const_iterator begin () const
 
void clear ()
 
bool contains (ProductID id) const
 
bool empty () const
 
const_iterator end () const
 
reference_type get (ProductID id, size_t idx)
 
const_reference_type get (ProductID id, size_t idx) const
 
const_reference_type get (size_t idx) const
 meant to be used in AssociativeIterator, not by the ordinary user More...
 
const id_offset_vectorids () const
 meant to be used in AssociativeIterator, not by the ordinary user More...
 
size_t idSize () const
 
ValueMap< T > & operator+= (const ValueMap< T > &o)
 
ValueMapoperator= (ValueMap const &rhs)
 
template<typename RefKey >
reference_type operator[] (const RefKey &r)
 
template<typename RefKey >
const_reference_type operator[] (const RefKey &r) const
 
size_t rawIndexOf (ProductID id, size_t idx) const
 
void shrink_to_fit ()
 
size_t size () const
 
void swap (ValueMap &other)
 
 ValueMap ()
 

Static Public Member Functions

static short Class_Version ()
 

Protected Member Functions

id_offset_vector::const_iterator getIdOffset (ProductID id) const
 
void throwIndexBound () const
 

Protected Attributes

id_offset_vector ids_
 
container values_
 

Private Member Functions

void add (const ValueMap< T > &o)
 
void throwNotExisting () const
 

Friends

class helper::Filler< ValueMap< T > >
 

Detailed Description

template<typename T>
class edm::ValueMap< T >

Definition at line 107 of file ValueMap.h.

Member Typedef Documentation

◆ const_reference_type

template<typename T>
typedef container::const_reference edm::ValueMap< T >::const_reference_type

Definition at line 114 of file ValueMap.h.

◆ container

template<typename T>
typedef std::vector<value_type> edm::ValueMap< T >::container

Definition at line 110 of file ValueMap.h.

◆ Filler

template<typename T>
typedef helper::Filler<ValueMap<T> > edm::ValueMap< T >::Filler

Definition at line 168 of file ValueMap.h.

◆ id_offset_vector

template<typename T>
typedef std::vector<std::pair<ProductID, offset> > edm::ValueMap< T >::id_offset_vector

Definition at line 112 of file ValueMap.h.

◆ offset

template<typename T>
typedef unsigned int edm::ValueMap< T >::offset

Definition at line 111 of file ValueMap.h.

◆ reference_type

template<typename T>
typedef container::reference edm::ValueMap< T >::reference_type

Definition at line 113 of file ValueMap.h.

◆ value_type

template<typename T>
typedef T edm::ValueMap< T >::value_type

Definition at line 109 of file ValueMap.h.

Constructor & Destructor Documentation

◆ ValueMap()

template<typename T>
edm::ValueMap< T >::ValueMap ( )
inline

Definition at line 116 of file ValueMap.h.

116 {}

Member Function Documentation

◆ add()

template<typename T>
void edm::ValueMap< T >::add ( const ValueMap< T > &  o)
inlineprivate

◆ begin()

template<typename T>
const_iterator edm::ValueMap< T >::begin ( void  ) const
inline

◆ Class_Version()

template<typename T>
static short edm::ValueMap< T >::Class_Version ( )
inlinestatic

Definition at line 238 of file ValueMap.h.

240 :

◆ clear()

template<typename T>
void edm::ValueMap< T >::clear ( void  )
inline

Definition at line 159 of file ValueMap.h.

159  {
160  values_.clear();
161  ids_.clear();
162  }

Referenced by edm::Association< C >::clear(), and BeautifulSoup.Tag::setString().

◆ contains()

template<typename T>
bool edm::ValueMap< T >::contains ( ProductID  id) const
inline

◆ empty()

template<typename T>
bool edm::ValueMap< T >::empty ( ) const
inline

◆ end()

template<typename T>
const_iterator edm::ValueMap< T >::end ( void  ) const
inline

Definition at line 230 of file ValueMap.h.

230 { return const_iterator(ids_.end(), ids_.end(), &values_); }

Referenced by PhotonValidator::analyze(), ZToMuMuGammaAnalyzer::analyze(), Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

◆ get() [1/3]

template<typename T>
reference_type edm::ValueMap< T >::get ( ProductID  id,
size_t  idx 
)
inline

◆ get() [2/3]

template<typename T>
const_reference_type edm::ValueMap< T >::get ( ProductID  id,
size_t  idx 
) const
inline

◆ get() [3/3]

template<typename T>
const_reference_type edm::ValueMap< T >::get ( size_t  idx) const
inline

◆ getIdOffset()

template<typename T>
id_offset_vector::const_iterator edm::ValueMap< T >::getIdOffset ( ProductID  id) const
inlineprotected

Definition at line 244 of file ValueMap.h.

244  {
245  typename id_offset_vector::const_iterator i = std::lower_bound(ids_.begin(), ids_.end(), id, IDComparator());
246  if (i == ids_.end())
247  return i;
248  return i->first == id ? i : ids_.end();
249  }

Referenced by edm::ValueMap< math::XYZTLorentzVector >::contains(), and edm::ValueMap< math::XYZTLorentzVector >::rawIndexOf().

◆ ids()

template<typename T>
const id_offset_vector& edm::ValueMap< T >::ids ( ) const
inline

meant to be used in AssociativeIterator, not by the ordinary user

Definition at line 233 of file ValueMap.h.

233 { return ids_; }

◆ idSize()

template<typename T>
size_t edm::ValueMap< T >::idSize ( ) const
inline

◆ operator+=()

template<typename T>
ValueMap<T>& edm::ValueMap< T >::operator+= ( const ValueMap< T > &  o)
inline

Definition at line 151 of file ValueMap.h.

151  {
152  add(o);
153  return *this;
154  }

◆ operator=()

template<typename T>
ValueMap& edm::ValueMap< T >::operator= ( ValueMap< T > const &  rhs)
inline

Definition at line 123 of file ValueMap.h.

123  {
124  ValueMap temp(rhs);
125  this->swap(temp);
126  return *this;
127  }

◆ operator[]() [1/2]

template<typename T>
template<typename RefKey >
reference_type edm::ValueMap< T >::operator[] ( const RefKey &  r)
inline

Definition at line 146 of file ValueMap.h.

146  {
147  return get(r.id(), r.key());
148  }

◆ operator[]() [2/2]

template<typename T>
template<typename RefKey >
const_reference_type edm::ValueMap< T >::operator[] ( const RefKey &  r) const
inline

Definition at line 130 of file ValueMap.h.

130  {
131  return get(r.id(), r.key());
132  }

◆ rawIndexOf()

template<typename T>
size_t edm::ValueMap< T >::rawIndexOf ( ProductID  id,
size_t  idx 
) const
inline

Definition at line 134 of file ValueMap.h.

134  {
135  typename id_offset_vector::const_iterator f = getIdOffset(id);
136  if (f == ids_.end())
138  offset off = f->second;
139  size_t j = off + idx;
140  if (j >= values_.size())
141  throwIndexBound();
142  return j;
143  }

Referenced by edm::ValueMap< math::XYZTLorentzVector >::get().

◆ shrink_to_fit()

template<typename T>
void edm::ValueMap< T >::shrink_to_fit ( )
inline

Definition at line 163 of file ValueMap.h.

163  {
164  ids_.shrink_to_fit();
165  values_.shrink_to_fit();
166  }

◆ size()

template<typename T>
size_t edm::ValueMap< T >::size ( void  ) const
inline

◆ swap()

template<typename T>
void edm::ValueMap< T >::swap ( ValueMap< T > &  other)
inline

Definition at line 118 of file ValueMap.h.

118  {
119  values_.swap(other.values_);
120  ids_.swap(other.ids_);
121  }

Referenced by edm::ValueMap< math::XYZTLorentzVector >::operator=(), edm::Association< C >::swap(), and edm::swap().

◆ throwIndexBound()

template<typename T>
void edm::ValueMap< T >::throwIndexBound ( ) const
inlineprotected

Definition at line 251 of file ValueMap.h.

251  {
252  Exception::throwThis(errors::InvalidReference, "ValueMap: index out of upper boundary\n");
253  }

Referenced by edm::ValueMap< math::XYZTLorentzVector >::rawIndexOf().

◆ throwNotExisting()

template<typename T>
void edm::ValueMap< T >::throwNotExisting ( ) const
inlineprivate

Definition at line 259 of file ValueMap.h.

259  {
260  Exception::throwThis(errors::InvalidReference, "ValueMap: no associated value for given product and index\n");
261  }

Referenced by edm::ValueMap< math::XYZTLorentzVector >::rawIndexOf().

Friends And Related Function Documentation

◆ helper::Filler< ValueMap< T > >

template<typename T>
friend class helper::Filler< ValueMap< T > >
friend

Definition at line 269 of file ValueMap.h.

Member Data Documentation

◆ ids_

template<typename T>
id_offset_vector edm::ValueMap< T >::ids_
protected

◆ values_

template<typename T>
container edm::ValueMap< T >::values_
protected
edm::ValueMap::offset
unsigned int offset
Definition: ValueMap.h:111
mps_fire.i
i
Definition: mps_fire.py:428
edm::ValueMap::ValueMap
ValueMap()
Definition: ValueMap.h:116
edm::errors::InvalidReference
Definition: EDMException.h:39
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
edm::ValueMap::throwNotExisting
void throwNotExisting() const
Definition: ValueMap.h:259
edm::ValueMap::ids_
id_offset_vector ids_
Definition: ValueMap.h:242
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
edm::ValueMap::container
std::vector< value_type > container
Definition: ValueMap.h:110
trackingPlots.other
other
Definition: trackingPlots.py:1460
edm::ValueMap::values_
container values_
Definition: ValueMap.h:241
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
edm::ValueMap::swap
void swap(ValueMap &other)
Definition: ValueMap.h:118
edm::ValueMap::Filler
helper::Filler< ValueMap< T > > Filler
Definition: ValueMap.h:168
edm::ValueMap::throwIndexBound
void throwIndexBound() const
Definition: ValueMap.h:251
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::ValueMap::get
const_reference_type get(ProductID id, size_t idx) const
Definition: ValueMap.h:144
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
edm::Exception::throwThis
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83
edm::ValueMap::rawIndexOf
size_t rawIndexOf(ProductID id, size_t idx) const
Definition: ValueMap.h:134
edm::ValueMap::add
void add(const ValueMap< T > &o)
Definition: ValueMap.h:263
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::ValueMap::getIdOffset
id_offset_vector::const_iterator getIdOffset(ProductID id) const
Definition: ValueMap.h:244