CMS 3D CMS Logo

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 = DetSetVector<T>>
class edm::DetSetRefVector< T, C >

Definition at line 49 of file DetSetRefVector.h.

Member Typedef Documentation

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

Definition at line 105 of file DetSetRefVector.h.

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

Definition at line 110 of file DetSetRefVector.h.

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

Definition at line 107 of file DetSetRefVector.h.

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

Definition at line 102 of file DetSetRefVector.h.

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

Definition at line 104 of file DetSetRefVector.h.

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

Definition at line 111 of file DetSetRefVector.h.

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

Definition at line 103 of file DetSetRefVector.h.

Constructor & Destructor Documentation

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

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

Definition at line 120 of file DetSetRefVector.h.

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

Definition at line 122 of file DetSetRefVector.h.

122  : sets_() {
123  sets_.reserve(iDets.size());
124  det_id_type sanityCheck = 0;
125  for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(),
126  itDetIdEnd = iDets.end();
127  itDetId != itDetIdEnd;
128  ++itDetId) {
129  assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
130  sanityCheck = *itDetId;
131  //the last 'false' says to not get the data right now
132  sets_.push_back(ref_type(iHandle, *itDetId, false));
133  }
134  }
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 = DetSetVector<T>>
edm::DetSetRefVector< T, C >::DetSetRefVector ( const OrphanHandle< C > &  iHandle,
const std::vector< det_id_type > &  iDets 
)
inline

Definition at line 136 of file DetSetRefVector.h.

136  : sets_() {
137  sets_.reserve(iDets.size());
138  det_id_type sanityCheck = 0;
139  for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(),
140  itDetIdEnd = iDets.end();
141  itDetId != itDetIdEnd;
142  ++itDetId) {
143  assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
144  sanityCheck = *itDetId;
145  //the last 'false' says to not get the data right now
146  sets_.push_back(ref_type(iHandle, *itDetId, false));
147  }
148  }
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 = DetSetVector<T>>
edm::DetSetRefVector< T, C >::DetSetRefVector ( const TestHandle< C > &  iHandle,
const std::vector< det_id_type > &  iDets 
)
inline

Definition at line 150 of file DetSetRefVector.h.

150  : sets_() {
151  sets_.reserve(iDets.size());
152  det_id_type sanityCheck = 0;
153  for(std::vector<det_id_type>::const_iterator itDetId = iDets.begin(),
154  itDetIdEnd = iDets.end();
155  itDetId != itDetIdEnd;
156  ++itDetId) {
157  assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
158  sanityCheck = *itDetId;
159  //the last 'false' says to not get the data right now
160  sets_.push_back(ref_type(iHandle, *itDetId, false));
161  }
162  }
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 269 of file DetSetRefVector.h.

270  {
271  return sets_.begin();
272  }
collection_type sets_
template<typename T, typename C = DetSetVector<T>>
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 = DetSetVector<T>>
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 198 of file DetSetRefVector.h.

200 :
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 224 of file DetSetRefVector.h.

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

225  {
226  return sets_.empty();
227  }
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 277 of file DetSetRefVector.h.

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

278  {
279  return sets_.end();
280  }
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 240 of file DetSetRefVector.h.

References SoftLeptonByDistance_cfi::distance, relativeConstraints::empty, triggerObjects_cff::id, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by BeautifulSoup.Tag::__getattr__(), BeautifulSoup.Tag::firstText(), and edm::refhelper::FindForDetSetRefVector< T, C >::operator()().

241  {
242  if(empty()) {
243  return sets_.end();
244  }
245  std::pair<typename collection_type::const_iterator,typename collection_type::const_iterator> p =
246  std::equal_range(sets_.begin(), sets_.end(), id, CompareRefDetSet<T,C>());
247  if (p.first == p.second) return sets_.end();
248  // The range indicated by [p.first, p.second) should be exactly of
249  // length 1.
250  assert(std::distance(p.first, p.second) == 1);
251  return p.first;
252  }
collection_type sets_
bool empty() const
Return true if we contain no DetSets.
template<typename T, typename C = DetSetVector<T>>
DetSetRefVector< T,C > & edm::DetSetRefVector< T, C >::operator= ( DetSetRefVector< T, C > const &  rhs)
inline

Definition at line 215 of file DetSetRefVector.h.

References edm::swap(), and groupFilesInBlocks::temp.

215  {
216  DetSetRefVector<T, C> temp(rhs);
217  this->swap(temp);
218  return *this;
219  }
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 257 of file DetSetRefVector.h.

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

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

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

233  {
234  return sets_.size();
235  }
collection_type sets_
template<typename T, typename C = DetSetVector<T>>
void edm::DetSetRefVector< T, C >::swap ( DetSetRefVector< T, C > &  other)
inline

Definition at line 208 of file DetSetRefVector.h.

Referenced by edm::swap().

208  {
209  sets_.swap(other.sets_);
210  }
collection_type sets_

Member Data Documentation

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

Definition at line 201 of file DetSetRefVector.h.