CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
const_reference_type get (ProductID id, size_t idx) const
 
reference_type get (ProductID id, size_t idx)
 
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 >
const_reference_type operator[] (const RefKey &r) const
 
template<typename RefKey >
reference_type operator[] (const RefKey &r)
 
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 104 of file ValueMap.h.

Member Typedef Documentation

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

Definition at line 111 of file ValueMap.h.

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

Definition at line 107 of file ValueMap.h.

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

Definition at line 170 of file ValueMap.h.

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

Definition at line 109 of file ValueMap.h.

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

Definition at line 108 of file ValueMap.h.

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

Definition at line 110 of file ValueMap.h.

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

Definition at line 106 of file ValueMap.h.

Constructor & Destructor Documentation

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

Definition at line 113 of file ValueMap.h.

113 { }

Member Function Documentation

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

Definition at line 209 of file ValueMap.h.

Referenced by PFCandIsolatorFromDeposits::produce(), CandIsolatorFromDeposits::produce(), PFElectronMaker::SetVars(), and PFCandidateMaker::SetVars().

209 { return const_iterator(ids_.begin(), ids_.end(), &values_); }
id_offset_vector ids_
Definition: ValueMap.h:222
container values_
Definition: ValueMap.h:221
template<typename T>
static short edm::ValueMap< T >::Class_Version ( )
inlinestatic

Definition at line 218 of file ValueMap.h.

220 :
std::vector< value_type > container
Definition: ValueMap.h:107
container values_
Definition: ValueMap.h:221
template<typename T>
void edm::ValueMap< T >::clear ( void  )
inline
template<typename T>
bool edm::ValueMap< T >::contains ( ProductID  id) const
inline

Definition at line 154 of file ValueMap.h.

Referenced by LumiList.LumiList::__contains__(), edm::Association< reco::FFTJPTJetCollection >::contains(), and pat::helper::RefHelper< T >::recursiveLookup().

154  {
155  return getIdOffset(id) != ids_.end();
156  }
id_offset_vector ids_
Definition: ValueMap.h:222
id_offset_vector::const_iterator getIdOffset(ProductID id) const
Definition: ValueMap.h:224
template<typename T>
bool edm::ValueMap< T >::empty ( ) const
inline
template<typename T>
const_iterator edm::ValueMap< T >::end ( void  ) const
inline

Definition at line 210 of file ValueMap.h.

Referenced by Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), CandIsolatorFromDeposits::produce(), and PFCandIsolatorFromDeposits::produce().

210 { return const_iterator(ids_.end(), ids_.end(), &values_); }
id_offset_vector ids_
Definition: ValueMap.h:222
container values_
Definition: ValueMap.h:221
template<typename T>
const_reference_type edm::ValueMap< T >::get ( ProductID  id,
size_t  idx 
) const
inline
template<typename T>
reference_type edm::ValueMap< T >::get ( ProductID  id,
size_t  idx 
)
inline
template<typename T>
const_reference_type edm::ValueMap< T >::get ( size_t  idx) const
inline
template<typename T>
id_offset_vector::const_iterator edm::ValueMap< T >::getIdOffset ( ProductID  id) const
inlineprotected

Definition at line 224 of file ValueMap.h.

Referenced by edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::contains(), and edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::rawIndexOf().

224  {
225  typename id_offset_vector::const_iterator i = std::lower_bound(ids_.begin(), ids_.end(), id, IDComparator());
226  if(i==ids_.end()) return i;
227  return i->first == id ? i : ids_.end();
228  }
int i
Definition: DBlmapReader.cc:9
id_offset_vector ids_
Definition: ValueMap.h:222
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 213 of file ValueMap.h.

213 { return ids_; }
id_offset_vector ids_
Definition: ValueMap.h:222
template<typename T>
size_t edm::ValueMap< T >::idSize ( ) const
inline

Definition at line 158 of file ValueMap.h.

158 { return ids_.size(); }
id_offset_vector ids_
Definition: ValueMap.h:222
template<typename T>
ValueMap<T>& edm::ValueMap< T >::operator+= ( const ValueMap< T > &  o)
inline

Definition at line 150 of file ValueMap.h.

150  {
151  add(o);
152  return *this;
153  }
void add(const ValueMap< T > &o)
Definition: ValueMap.h:244
template<typename T>
ValueMap& edm::ValueMap< T >::operator= ( ValueMap< T > const &  rhs)
inline

Definition at line 120 of file ValueMap.h.

120  {
121  ValueMap temp(rhs);
122  this->swap(temp);
123  return *this;
124  }
void swap(ValueMap &other)
Definition: ValueMap.h:115
template<typename T>
template<typename RefKey >
const_reference_type edm::ValueMap< T >::operator[] ( const RefKey &  r) const
inline

Definition at line 127 of file ValueMap.h.

127  {
128  return get(r.id(), r.key());
129  }
template<typename T>
template<typename RefKey >
reference_type edm::ValueMap< T >::operator[] ( const RefKey &  r)
inline

Definition at line 143 of file ValueMap.h.

143  {
144  return get(r.id(), r.key());
145  }
template<typename T>
size_t edm::ValueMap< T >::rawIndexOf ( ProductID  id,
size_t  idx 
) const
inline

Definition at line 131 of file ValueMap.h.

Referenced by edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::get().

131  {
132  typename id_offset_vector::const_iterator f = getIdOffset(id);
133  if(f==ids_.end()) throwNotExisting();
134  offset off = f->second;
135  size_t j = off+idx;
136  if(j >= values_.size()) throwIndexBound();
137  return j;
138  }
unsigned int offset
Definition: ValueMap.h:108
id_offset_vector ids_
Definition: ValueMap.h:222
void throwIndexBound() const
Definition: ValueMap.h:230
int j
Definition: DBlmapReader.cc:9
void throwNotExisting() const
Definition: ValueMap.h:240
double f[11][100]
id_offset_vector::const_iterator getIdOffset(ProductID id) const
Definition: ValueMap.h:224
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
container values_
Definition: ValueMap.h:221
template<typename T>
void edm::ValueMap< T >::shrink_to_fit ( )
inline

Definition at line 161 of file ValueMap.h.

161  {
162 #ifndef CMS_NOCXX11
163  ids_.shrink_to_fit();
164  values_.shrink_to_fit();
165 #endif
166  }
id_offset_vector ids_
Definition: ValueMap.h:222
container values_
Definition: ValueMap.h:221
template<typename T>
size_t edm::ValueMap< T >::size ( void  ) const
inline
template<typename T>
void edm::ValueMap< T >::swap ( ValueMap< T > &  other)
inline
template<typename T>
void edm::ValueMap< T >::throwIndexBound ( ) const
inlineprotected

Definition at line 230 of file ValueMap.h.

Referenced by edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::rawIndexOf().

230  {
231  Exception::throwThis(errors::InvalidReference, "ValueMap: index out of upper boundary\n");
232  }
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
template<typename T>
void edm::ValueMap< T >::throwNotExisting ( ) const
inlineprivate

Definition at line 240 of file ValueMap.h.

Referenced by edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::rawIndexOf().

240  {
241  Exception::throwThis(errors::InvalidReference, "ValueMap: no associated value for given product and index\n");
242  }
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")

Friends And Related Function Documentation

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

Definition at line 250 of file ValueMap.h.

Member Data Documentation

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

Definition at line 222 of file ValueMap.h.

Referenced by edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::begin(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::clear(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::contains(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::end(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::ids(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::idSize(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::rawIndexOf(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::shrink_to_fit(), and edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::swap().

template<typename T>
container edm::ValueMap< T >::values_
protected

Definition at line 221 of file ValueMap.h.

Referenced by edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::begin(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::clear(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::empty(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::end(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::get(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::rawIndexOf(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::shrink_to_fit(), edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::size(), and edm::ValueMap< edm::Ref< std::vector< reco::PFCandidate >, reco::PFCandidate, edm::refhelper::FindUsingAdvance< std::vector< reco::PFCandidate >, reco::PFCandidate > > >::swap().