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.

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

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  }
Ref< C, DetSet< T >, refhelper::FindDetSetForDetSetVector< T, C > > ref_type
assert(be >=bs)
collection_type sets_
uint32_t det_id_type
Definition: DetSet.h:20

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

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

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  }
Ref< C, DetSet< T >, refhelper::FindDetSetForDetSetVector< T, C > > ref_type
assert(be >=bs)
collection_type sets_
uint32_t det_id_type
Definition: DetSet.h:20

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

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

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  }
Ref< C, DetSet< T >, refhelper::FindDetSetForDetSetVector< T, C > > ref_type
assert(be >=bs)
collection_type sets_
uint32_t det_id_type
Definition: DetSet.h:20

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.

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

242  {
243  return sets_.begin();
244  }
collection_type 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 :
std::vector< ref_type > collection_type
collection_type sets_

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

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

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

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

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

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

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

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

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

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

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

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  }
assert(be >=bs)
collection_type sets_
bool empty() const
Return true if we contain no DetSets.

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

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

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

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

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

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  }
const_iterator end() const
Return the off-the-end iterator.
void _throw_range(det_id_type i)
const_iterator find(det_id_type id) const
boost::indirect_iterator< typename collection_type::const_iterator > const_iterator

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

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

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

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

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

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

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

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

Member Data Documentation

◆ sets_

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