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

Member Typedef Documentation

◆ collection_type

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

Definition at line 98 of file DetSetRefVector.h.

◆ const_iterator

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

◆ const_reference

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

Definition at line 100 of file DetSetRefVector.h.

◆ detset

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

Definition at line 95 of file DetSetRefVector.h.

◆ ref_type

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

◆ size_type

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

Definition at line 104 of file DetSetRefVector.h.

◆ value_type

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

Definition at line 96 of file DetSetRefVector.h.

Constructor & Destructor Documentation

◆ DetSetRefVector() [1/4]

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

113 {}

◆ DetSetRefVector() [2/4]

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

115  : sets_() {
116  sets_.reserve(iDets.size());
117  det_id_type sanityCheck = 0;
118  for (std::vector<det_id_type>::const_iterator itDetId = iDets.begin(), itDetIdEnd = iDets.end();
119  itDetId != itDetIdEnd;
120  ++itDetId) {
121  assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
122  sanityCheck = *itDetId;
123  //the last 'false' says to not get the data right now
124  sets_.push_back(ref_type(iHandle, *itDetId, false));
125  }
126  }

References cms::cuda::assert(), and edm::DetSetRefVector< T, C >::sets_.

◆ DetSetRefVector() [3/4]

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

128  : sets_() {
129  sets_.reserve(iDets.size());
130  det_id_type sanityCheck = 0;
131  for (std::vector<det_id_type>::const_iterator itDetId = iDets.begin(), itDetIdEnd = iDets.end();
132  itDetId != itDetIdEnd;
133  ++itDetId) {
134  assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
135  sanityCheck = *itDetId;
136  //the last 'false' says to not get the data right now
137  sets_.push_back(ref_type(iHandle, *itDetId, false));
138  }
139  }

References cms::cuda::assert(), and edm::DetSetRefVector< T, C >::sets_.

◆ DetSetRefVector() [4/4]

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

141  : sets_() {
142  sets_.reserve(iDets.size());
143  det_id_type sanityCheck = 0;
144  for (std::vector<det_id_type>::const_iterator itDetId = iDets.begin(), itDetIdEnd = iDets.end();
145  itDetId != itDetIdEnd;
146  ++itDetId) {
147  assert(sanityCheck <= *itDetId && "vector of det_id_type was not ordered");
148  sanityCheck = *itDetId;
149  //the last 'false' says to not get the data right now
150  sets_.push_back(ref_type(iHandle, *itDetId, false));
151  }
152  }

References cms::cuda::assert(), and edm::DetSetRefVector< T, C >::sets_.

Member Function Documentation

◆ begin()

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

242  {
243  return sets_.begin();
244  }

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

◆ BOOST_CLASS_REQUIRE()

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<.

◆ Class_Version()

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

190 :

◆ empty()

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

Return true if we contain no DetSets.

Definition at line 207 of file DetSetRefVector.h.

207  {
208  return sets_.empty();
209  }

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

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

◆ end()

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

247  {
248  return sets_.end();
249  }

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

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

◆ find()

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

217  {
218  if (empty()) {
219  return sets_.end();
220  }
221  std::pair<typename collection_type::const_iterator, typename collection_type::const_iterator> p =
222  std::equal_range(sets_.begin(), sets_.end(), id, CompareRefDetSet<T, C>());
223  if (p.first == p.second)
224  return sets_.end();
225  // The range indicated by [p.first, p.second) should be exactly of
226  // length 1.
227  assert(std::distance(p.first, p.second) == 1);
228  return p.first;
229  }

References cms::cuda::assert(), HLT_FULL_cff::distance, edm::DetSetRefVector< T, C >::empty(), triggerObjects_cff::id, AlCaHLTBitMon_ParallelJobs::p, and edm::DetSetRefVector< T, C >::sets_.

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

◆ operator=()

template<typename T, typename C = DetSetVector<T>>
DetSetRefVector< T, C > & edm::DetSetRefVector< T, C >::operator= ( DetSetRefVector< T, C > const &  rhs)
inline

Definition at line 200 of file DetSetRefVector.h.

200  {
201  DetSetRefVector<T, C> temp(rhs);
202  this->swap(temp);
203  return *this;
204  }

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

◆ operator[]()

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

232  {
233  // Find the right DetSet, and return a reference to it. Throw if
234  // there is none.
235  const_iterator it = this->find(i);
236  if (it == this->end())
238  return *it;
239  }

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

◆ size()

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

212  {
213  return sets_.size();
214  }

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

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

◆ swap()

template<typename T, typename C = DetSetVector<T>>
void edm::DetSetRefVector< T, C >::swap ( DetSetRefVector< T, C > &  other)
inline

Definition at line 195 of file DetSetRefVector.h.

195  {
196  sets_.swap(other.sets_);
197  }

References trackingPlots::other, and edm::DetSetRefVector< T, C >::sets_.

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

Member Data Documentation

◆ sets_

template<typename T, typename C = DetSetVector<T>>
collection_type edm::DetSetRefVector< T, C >::sets_
private
mps_fire.i
i
Definition: mps_fire.py:428
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::DetSetRefVector::empty
bool empty() const
Return true if we contain no DetSets.
Definition: DetSetRefVector.h:207
cms::cuda::assert
assert(be >=bs)
edm::DetSetRefVector::swap
void swap(DetSetRefVector &other)
Definition: DetSetRefVector.h:195
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::DetSetRefVector::const_iterator
boost::indirect_iterator< typename collection_type::const_iterator > const_iterator
Definition: DetSetRefVector.h:103
trackingPlots.other
other
Definition: trackingPlots.py:1460
edm::dsrvdetail::_throw_range
void _throw_range(det_id_type i)
Definition: DetSetRefVector.h:58
edm::DetSetRefVector::ref_type
Ref< C, DetSet< T >, refhelper::FindDetSetForDetSetVector< T, C > > ref_type
Definition: DetSetRefVector.h:97
edm::DetSetRefVector::end
const_iterator end() const
Return the off-the-end iterator.
Definition: DetSetRefVector.h:247
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
edm::det_id_type
uint32_t det_id_type
Definition: DetSet.h:20
edm::DetSetRefVector::find
const_iterator find(det_id_type id) const
Definition: DetSetRefVector.h:217
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7733
edm::DetSetRefVector::collection_type
std::vector< ref_type > collection_type
Definition: DetSetRefVector.h:98
edm::DetSetRefVector::sets_
collection_type sets_
Definition: DetSetRefVector.h:191