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 | Static 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< Tdetset
 
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)
 

Static Public Member Functions

static short Class_Version ()
 

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 49 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 101 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 106 of file DetSetRefVector.h.

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

Definition at line 103 of file DetSetRefVector.h.

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

Definition at line 98 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 100 of file DetSetRefVector.h.

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

Definition at line 107 of file DetSetRefVector.h.

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

Definition at line 99 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 116 of file DetSetRefVector.h.

116 {}
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 118 of file DetSetRefVector.h.

118  : sets_() {
119  sets_.reserve(iDets.size());
120  det_id_type sanityCheck = 0;
121  for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(),
122  itDetIdEnd = iDets.end();
123  itDetId != itDetIdEnd;
124  ++itDetId) {
125  assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
126  sanityCheck = *itDetId;
127  //the last 'false' says to not get the data right now
128  sets_.push_back(ref_type(iHandle, *itDetId, false));
129  }
130  }
assert(m_qm.get())
Ref< C, DetSet< T >, refhelper::FindDetSetForDetSetVector< T, C > > ref_type
collection_type sets_
uint32_t det_id_type
Definition: DetSet.h:21
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 132 of file DetSetRefVector.h.

132  : sets_() {
133  sets_.reserve(iDets.size());
134  det_id_type sanityCheck = 0;
135  for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(),
136  itDetIdEnd = iDets.end();
137  itDetId != itDetIdEnd;
138  ++itDetId) {
139  assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
140  sanityCheck = *itDetId;
141  //the last 'false' says to not get the data right now
142  sets_.push_back(ref_type(iHandle, *itDetId, false));
143  }
144  }
assert(m_qm.get())
Ref< C, DetSet< T >, refhelper::FindDetSetForDetSetVector< T, C > > ref_type
collection_type sets_
uint32_t det_id_type
Definition: DetSet.h:21
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 146 of file DetSetRefVector.h.

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

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 265 of file DetSetRefVector.h.

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

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

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

template<typename T, typename C>
static short edm::DetSetRefVector< T, C >::Class_Version ( )
inlinestatic

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

Definition at line 194 of file DetSetRefVector.h.

196 :
std::vector< ref_type > collection_type
collection_type sets_
template<typename T , typename C >
bool edm::DetSetRefVector< T, C >::empty ( ) const
inline

Return true if we contain no DetSets.

Definition at line 220 of file DetSetRefVector.h.

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

Referenced by edm::DetSetRefVector< T, C >::find(), Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().

221  {
222  return sets_.empty();
223  }
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 273 of file DetSetRefVector.h.

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

Referenced by Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), and edm::DetSetRefVector< T, C >::operator[]().

274  {
275  return sets_.end();
276  }
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 236 of file DetSetRefVector.h.

References assert(), HLT_25ns14e33_v1_cff::distance, edm::DetSetRefVector< T, C >::empty(), AlCaHLTBitMon_ParallelJobs::p, and edm::DetSetRefVector< T, C >::sets_.

Referenced by BeautifulSoup.Tag::__getattr__(), BeautifulSoup.Tag::firstText(), and edm::DetSetRefVector< T, C >::operator[]().

237  {
238  if(empty()) {
239  return sets_.end();
240  }
241  std::pair<typename collection_type::const_iterator,typename collection_type::const_iterator> p =
242  std::equal_range(sets_.begin(), sets_.end(), id, CompareRefDetSet<T,C>());
243  if (p.first == p.second) return sets_.end();
244  // The range indicated by [p.first, p.second) should be exactly of
245  // length 1.
246  assert(std::distance(p.first, p.second) == 1);
247  return p.first;
248  }
assert(m_qm.get())
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 211 of file DetSetRefVector.h.

References edm::DetSetRefVector< T, C >::swap(), and groupFilesInBlocks::temp.

211  {
212  DetSetRefVector<T, C> temp(rhs);
213  this->swap(temp);
214  return *this;
215  }
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 253 of file DetSetRefVector.h.

References edm::dsrvdetail::_throw_range(), edm::DetSetRefVector< T, C >::end(), and edm::DetSetRefVector< T, C >::find().

254  {
255  // Find the right DetSet, and return a reference to it. Throw if
256  // there is none.
257  const_iterator it = this->find(i);
258  if (it == this->end()) dsrvdetail::_throw_range(i);
259  return *it;
260  }
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 228 of file DetSetRefVector.h.

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

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

Definition at line 204 of file DetSetRefVector.h.

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

204  {
205  sets_.swap(other.sets_);
206  }
collection_type sets_

Member Data Documentation

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