CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::DetSetRefVector< T, C > Class Template Reference

#include <DetSetRefVector.h>

Public Types

typedef std::vector< ref_typecollection_type
 
typedef
boost::indirect_iterator
< typename
collection_type::const_iterator > 
const_iterator
 
typedef detset const & const_reference
 
typedef DetSet< T > detset
 
typedef Ref< C, DetSet< T >
, refhelper::FindDetSetForDetSetVector
< T, C > > 
ref_type
 
typedef collection_type::size_type size_type
 
typedef detset value_type
 

Public Member Functions

const_iterator begin () const
 Return an iterator to the first DetSet. More...
 
 DetSetRefVector ()
 
 DetSetRefVector (const Handle< C > &iHandle, const std::vector< det_id_type > &iDets)
 
 DetSetRefVector (const OrphanHandle< C > &iHandle, const std::vector< det_id_type > &iDets)
 
 DetSetRefVector (const TestHandle< C > &iHandle, const std::vector< det_id_type > &iDets)
 
bool empty () const
 Return true if we contain no DetSets. More...
 
const_iterator end () const
 Return the off-the-end iterator. More...
 
const_iterator find (det_id_type id) const
 
DetSetRefVectoroperator= (DetSetRefVector const &rhs)
 
const_reference operator[] (det_id_type i) const
 
size_type size () const
 Return the number of contained DetSets. More...
 
void swap (DetSetRefVector &other)
 

Private Member Functions

 BOOST_CLASS_REQUIRE (T, boost, LessThanComparableConcept)
 

Private Attributes

collection_type sets_
 

Detailed Description

template<typename T, typename C>
class edm::DetSetRefVector< T, C >

Definition at line 48 of file DetSetRefVector.h.

Member Typedef Documentation

template<typename T, typename C>
typedef std::vector<ref_type> edm::DetSetRefVector< T, C >::collection_type

Definition at line 100 of file DetSetRefVector.h.

template<typename T, typename C>
typedef boost::indirect_iterator<typename collection_type::const_iterator> edm::DetSetRefVector< T, C >::const_iterator

Definition at line 105 of file DetSetRefVector.h.

template<typename T, typename C>
typedef detset const& edm::DetSetRefVector< T, C >::const_reference

Definition at line 102 of file DetSetRefVector.h.

template<typename T, typename C>
typedef DetSet<T> edm::DetSetRefVector< T, C >::detset

Definition at line 97 of file DetSetRefVector.h.

template<typename T, typename C>
typedef Ref<C, DetSet<T>, refhelper::FindDetSetForDetSetVector<T,C> > edm::DetSetRefVector< T, C >::ref_type

Definition at line 99 of file DetSetRefVector.h.

template<typename T, typename C>
typedef collection_type::size_type edm::DetSetRefVector< T, C >::size_type

Definition at line 106 of file DetSetRefVector.h.

template<typename T, typename C>
typedef detset edm::DetSetRefVector< T, C >::value_type

Definition at line 98 of file DetSetRefVector.h.

Constructor & Destructor Documentation

template<typename T, typename C>
edm::DetSetRefVector< T, C >::DetSetRefVector ( )
inline

Compiler-generated default c'tor, copy c'tor, d'tor and assignment are correct.

Definition at line 115 of file DetSetRefVector.h.

115 {}
template<typename T, typename C>
edm::DetSetRefVector< T, C >::DetSetRefVector ( const Handle< C > &  iHandle,
const std::vector< det_id_type > &  iDets 
)
inline

Definition at line 117 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::sets_.

117  : sets_() {
118  sets_.reserve(iDets.size());
119  det_id_type sanityCheck = 0;
120  for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(),
121  itDetIdEnd = iDets.end();
122  itDetId != itDetIdEnd;
123  ++itDetId) {
124  assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
125  sanityCheck = *itDetId;
126  //the last 'false' says to not get the data right now
127  sets_.push_back(ref_type(iHandle, *itDetId, false));
128  }
129  }
Ref< C, DetSet< T >, refhelper::FindDetSetForDetSetVector< T, C > > ref_type
collection_type sets_
uint32_t det_id_type
Definition: DetSet.h:19
template<typename T, typename C>
edm::DetSetRefVector< T, C >::DetSetRefVector ( const OrphanHandle< C > &  iHandle,
const std::vector< det_id_type > &  iDets 
)
inline

Definition at line 131 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::sets_.

131  : sets_() {
132  sets_.reserve(iDets.size());
133  det_id_type sanityCheck = 0;
134  for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(),
135  itDetIdEnd = iDets.end();
136  itDetId != itDetIdEnd;
137  ++itDetId) {
138  assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
139  sanityCheck = *itDetId;
140  //the last 'false' says to not get the data right now
141  sets_.push_back(ref_type(iHandle, *itDetId, false));
142  }
143  }
Ref< C, DetSet< T >, refhelper::FindDetSetForDetSetVector< T, C > > ref_type
collection_type sets_
uint32_t det_id_type
Definition: DetSet.h:19
template<typename T, typename C>
edm::DetSetRefVector< T, C >::DetSetRefVector ( const TestHandle< C > &  iHandle,
const std::vector< det_id_type > &  iDets 
)
inline

Definition at line 145 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::sets_.

145  : sets_() {
146  sets_.reserve(iDets.size());
147  det_id_type sanityCheck = 0;
148  for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(),
149  itDetIdEnd = iDets.end();
150  itDetId != itDetIdEnd;
151  ++itDetId) {
152  assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
153  sanityCheck = *itDetId;
154  //the last 'false' says to not get the data right now
155  sets_.push_back(ref_type(iHandle, *itDetId, false));
156  }
157  }
Ref< C, DetSet< T >, refhelper::FindDetSetForDetSetVector< T, C > > ref_type
collection_type sets_
uint32_t det_id_type
Definition: DetSet.h:19

Member Function Documentation

template<typename T , typename C >
DetSetRefVector< T, C >::const_iterator edm::DetSetRefVector< T, C >::begin ( void  ) const
inline

Return an iterator to the first DetSet.

Definition at line 261 of file DetSetRefVector.h.

262  {
263  return sets_.begin();
264  }
collection_type sets_
template<typename T, typename C>
edm::DetSetRefVector< T, C >::BOOST_CLASS_REQUIRE ( ,
boost  ,
LessThanComparableConcept   
)
private

DetSetVector requires that T objects can be compared with operator<.

template<typename T , typename C >
bool edm::DetSetRefVector< T, C >::empty ( ) const
inline

Return true if we contain no DetSets.

Definition at line 216 of file DetSetRefVector.h.

Referenced by python.Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and python.Vispa.Gui.VispaWidget.TextField::setAutotruncate().

217  {
218  return sets_.empty();
219  }
collection_type sets_
template<typename T , typename C >
DetSetRefVector< T, C >::const_iterator edm::DetSetRefVector< T, C >::end ( void  ) const
inline

Return the off-the-end iterator.

Definition at line 269 of file DetSetRefVector.h.

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

270  {
271  return sets_.end();
272  }
collection_type sets_
template<typename T , typename C >
DetSetRefVector< T, C >::const_iterator edm::DetSetRefVector< T, C >::find ( det_id_type  id) const
inline

Return an iterator to the DetSet with the given id, or end() if there is no such DetSet.

Definition at line 232 of file DetSetRefVector.h.

References relativeConstraints::empty, ExpressReco_HICollisions_FallBack::id, and L1TEmulatorMonitor_cff::p.

Referenced by BeautifulSoup.Tag::_invert(), and BeautifulSoup.PageElement::insert().

233  {
234  if(empty()) {
235  return sets_.end();
236  }
237  std::pair<typename collection_type::const_iterator,typename collection_type::const_iterator> p =
238  std::equal_range(sets_.begin(), sets_.end(), id, CompareRefDetSet<T,C>());
239  if (p.first == p.second) return sets_.end();
240  // The range indicated by [p.first, p.second) should be exactly of
241  // length 1.
242  assert(std::distance(p.first, p.second) == 1);
243  return p.first;
244  }
collection_type sets_
bool empty() const
Return true if we contain no DetSets.
template<typename T , typename C >
DetSetRefVector< T,C > & edm::DetSetRefVector< T, C >::operator= ( DetSetRefVector< T, C > const &  rhs)
inline

Definition at line 207 of file DetSetRefVector.h.

References edm::swap(), and cond::rpcobtemp::temp.

207  {
208  DetSetRefVector<T, C> temp(rhs);
209  this->swap(temp);
210  return *this;
211  }
void swap(DetSetRefVector &other)
template<typename T , typename C >
DetSetRefVector< T, C >::const_reference edm::DetSetRefVector< T, C >::operator[] ( det_id_type  i) const
inline

Return a reference to the DetSet with the given detector ID. If there is no such DetSet, we throw an edm::Exception. DO NOT MODIFY THE id DATA MEMBER OF THE REFERENCED DetSet!

Definition at line 249 of file DetSetRefVector.h.

References edm::dsrvdetail::_throw_range(), end, and spr::find().

250  {
251  // Find the right DetSet, and return a reference to it. Throw if
252  // there is none.
253  const_iterator it = this->find(i);
254  if (it == this->end()) dsrvdetail::_throw_range(i);
255  return *it;
256  }
int i
Definition: DBlmapReader.cc:9
const_iterator find(det_id_type id) const
void _throw_range(det_id_type i)
boost::indirect_iterator< typename collection_type::const_iterator > const_iterator
const_iterator end() const
Return the off-the-end iterator.
template<typename T , typename C >
DetSetRefVector< T, C >::size_type edm::DetSetRefVector< T, C >::size ( void  ) const
inline

Return the number of contained DetSets.

Definition at line 224 of file DetSetRefVector.h.

225  {
226  return sets_.size();
227  }
collection_type sets_
template<typename T , typename C >
void edm::DetSetRefVector< T, C >::swap ( DetSetRefVector< T, C > &  other)
inline

Definition at line 200 of file DetSetRefVector.h.

200  {
201  sets_.swap(other.sets_);
202  }
collection_type sets_

Member Data Documentation

template<typename T, typename C>
collection_type edm::DetSetRefVector< T, C >::sets_
private

This function will be called by the edm::Event after the DetSetVector has been inserted into the Event.

Definition at line 193 of file DetSetRefVector.h.

Referenced by edm::DetSetRefVector< T, C >::DetSetRefVector().