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::DetSetVector< T > Class Template Reference

#include <DetSetVector.h>

Inheritance diagram for edm::DetSetVector< T >:

Public Types

typedef std::vector< detsetcollection_type
 
typedef
collection_type::const_iterator 
const_iterator
 
typedef detset const & const_reference
 
typedef DetSet< Tdetset
 
typedef collection_type::iterator iterator
 
typedef detsetreference
 
typedef collection_type::size_type size_type
 
typedef detset value_type
 

Public Member Functions

iterator begin ()
 Return an iterator to the first DetSet. More...
 
const_iterator begin () const
 
 DetSetVector ()
 Create an empty DetSetVector. More...
 
 DetSetVector (std::vector< DetSet< T > > &input, bool alreadySorted=false)
 
bool empty () const
 Return true if we contain no DetSets. More...
 
iterator end ()
 Return the off-the-end iterator. More...
 
const_iterator end () const
 
void fillView (ProductID const &id, std::vector< void const * > &pointers, FillViewHelperVector &helpers) const
 
iterator find (det_id_type id)
 
const_iterator find (det_id_type id) const
 
reference find_or_insert (det_id_type id)
 
void getIds (std::vector< det_id_type > &result) const
 
void insert (detset const &s)
 Insert the given DetSet. More...
 
DetSetVectoroperator= (DetSetVector const &other)
 
reference operator[] (det_id_type i)
 
const_reference operator[] (det_id_type i) const
 
void post_insert ()
 
void reserve (size_t s)
 
size_type size () const
 Return the number of contained DetSets. More...
 
void swap (DetSetVector &other)
 

Static Public Member Functions

static short Class_Version ()
 

Private Member Functions

void _sort ()
 Sort the DetSet in order of increasing DetId. More...
 
 BOOST_CLASS_REQUIRE (T, boost, LessThanComparableConcept)
 

Private Attributes

edm::BoolCache _alreadySorted
 
collection_type _sets
 

Detailed Description

template<class T>
class edm::DetSetVector< T >

Definition at line 64 of file DetSetVector.h.

Member Typedef Documentation

template<class T>
typedef std::vector<detset> edm::DetSetVector< T >::collection_type

Definition at line 102 of file DetSetVector.h.

template<class T>
typedef collection_type::const_iterator edm::DetSetVector< T >::const_iterator

Definition at line 108 of file DetSetVector.h.

template<class T>
typedef detset const& edm::DetSetVector< T >::const_reference

Definition at line 105 of file DetSetVector.h.

template<class T>
typedef DetSet<T> edm::DetSetVector< T >::detset

Definition at line 100 of file DetSetVector.h.

template<class T>
typedef collection_type::iterator edm::DetSetVector< T >::iterator

Definition at line 107 of file DetSetVector.h.

template<class T>
typedef detset& edm::DetSetVector< T >::reference

Definition at line 104 of file DetSetVector.h.

template<class T>
typedef collection_type::size_type edm::DetSetVector< T >::size_type

Definition at line 109 of file DetSetVector.h.

template<class T>
typedef detset edm::DetSetVector< T >::value_type

Definition at line 101 of file DetSetVector.h.

Constructor & Destructor Documentation

template<class T >
edm::DetSetVector< T >::DetSetVector ( )
inline

Create an empty DetSetVector.

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

Definition at line 205 of file DetSetVector.h.

205  :
206  _sets()
207  { }
collection_type _sets
Definition: DetSetVector.h:195
template<class T>
edm::DetSetVector< T >::DetSetVector ( std::vector< DetSet< T > > &  input,
bool  alreadySorted = false 
)
inlineexplicit

Create a DetSetVector by copying swapping in the given vector, and then sorting the contents. N.B.: Swapping in the vector destructively modifies the input. Using swap here allows us to avoid copying the data. N.B. 2: if you set alreadySorted to true, data must be sorted, (the vector<DetSet<T>> must be ordered by detid, and each DetSet must be ordered according to the natural "strict weak ordering" of Ts. You must not modify the contents after this DSV after creation, or you might get an undefined behavior / a core dump. (there are some checks to assure alreadySorted is resetted if you try to modify the DSV, but you should not count on them)

Definition at line 211 of file DetSetVector.h.

References edm::DetSetVector< T >::_sets, edm::DetSetVector< T >::_sort(), and input.

211  :
212  _sets(), _alreadySorted(alreadySorted)
213  {
214  _sets.swap(input);
215  if (!alreadySorted) _sort();
216  }
collection_type _sets
Definition: DetSetVector.h:195
static std::string const input
Definition: EdmProvDump.cc:43
edm::BoolCache _alreadySorted
Definition: DetSetVector.h:196
void _sort()
Sort the DetSet in order of increasing DetId.
Definition: DetSetVector.h:415

Member Function Documentation

template<class T >
void edm::DetSetVector< T >::_sort ( )
inlineprivate

Sort the DetSet in order of increasing DetId.

Definition at line 415 of file DetSetVector.h.

References python.multivaluedict::sort().

Referenced by edm::DetSetVector< T >::DetSetVector().

415  {
416  std::sort(_sets.begin(), _sets.end());
417  }
collection_type _sets
Definition: DetSetVector.h:195
template<class T >
DetSetVector< T >::iterator edm::DetSetVector< T >::begin ( void  )
inline

Return an iterator to the first DetSet.

Definition at line 350 of file DetSetVector.h.

Referenced by edm::DataMixingSiPixelWorker::addSiPixelPileups(), edm::DataMixingSiPixelMCDigiWorker::addSiPixelPileups(), edm::DataMixingSiStripWorker::addSiStripPileups(), edm::DataMixingSiStripMCDigiWorker::addSiStripPileups(), SiStripQualityHotStripIdentifier::algoAnalyze(), SiPixelDigiValid::analyze(), SiStripDigiValid::analyze(), SiStripBaselineValidator::analyze(), SiPixelHLTSource::analyze(), SiStripBaselineAnalyzer::analyze(), FWSiStripDigiProxyBuilder::build(), FWSiPixelDigiProxyBuilder::build(), SiStripFineDelayHit::closestCluster(), SiStripMeanCMExtractor::CMExtractorFromPedestals(), APVShotFinder::computeShots(), SiStripAPVRestorer::CreateCMMapCMstored(), SiStripAPVRestorer::CreateCMMapRealPed(), sistrip::SpyDigiConverter::extractPayloadDigis(), SiPixelRawDataErrorModule::fill(), SiPixelCalibDigiProducer::fill(), SiPixelDigiModule::fill(), LaserAlignment::fillDataProfiles(), SiPixelRawDataErrorModule::fillFED(), LaserAlignmentT0ProducerDQM::FillFromProcessedDigis(), LaserAlignmentT0ProducerDQM::FillFromRawDigis(), sistrip::FEDEmulator::fillNoises(), sistrip::FEDEmulator::fillPeds(), GlobalDigisProducer::fillTrk(), GlobalDigisAnalyzer::fillTrk(), cms::MTCCHLTrigger::filter(), RPCHitAssociator::findRPCDigiSimLink(), SiStripZeroSuppression::formatRawDigis(), RawDataConverter::GetDigis(), sistrip::SpyUtilities::getMajorityHeader(), RBCProcessRPCSimDigis::next(), SiStripProcessedRawDigiProducer::pr_process(), SiStripZeroSuppression::processRaw(), sistrip::FEDEmulatorModule::produce(), edm::DataMixingSiStripRawWorker::putSiStrip(), sistrip::SpyDigiConverter::reorderDigis(), SiPixelClusterProducer::run(), SiStripMeanCMExtractor::StoreMean(), sistrip::FEDEmulator::subtractPedestals(), SiStripProcessedRawDigiProducer::vr_process(), and SiStripProcessedRawDigiProducer::zs_process().

350  {
351  _alreadySorted = false; // it's non const
352  return _sets.begin();
353  }
collection_type _sets
Definition: DetSetVector.h:195
edm::BoolCache _alreadySorted
Definition: DetSetVector.h:196
template<class T >
DetSetVector< T >::const_iterator edm::DetSetVector< T >::begin ( void  ) const
inline

Definition at line 358 of file DetSetVector.h.

358  {
359  return _sets.begin();
360  }
collection_type _sets
Definition: DetSetVector.h:195
template<class T>
edm::DetSetVector< T >::BOOST_CLASS_REQUIRE ( T  ,
boost  ,
LessThanComparableConcept   
)
private

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

template<class T>
static short edm::DetSetVector< T >::Class_Version ( )
inlinestatic

Definition at line 192 of file DetSetVector.h.

194 :
collection_type _sets
Definition: DetSetVector.h:195
std::vector< detset > collection_type
Definition: DetSetVector.h:102
template<class T >
bool edm::DetSetVector< T >::empty ( ) const
inline

Return true if we contain no DetSets.

Definition at line 280 of file DetSetVector.h.

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

280  {
281  return _sets.empty();
282  }
collection_type _sets
Definition: DetSetVector.h:195
template<class T >
DetSetVector< T >::iterator edm::DetSetVector< T >::end ( void  )
inline

Return the off-the-end iterator.

Definition at line 365 of file DetSetVector.h.

Referenced by edm::DataMixingSiPixelWorker::addSiPixelPileups(), edm::DataMixingSiPixelMCDigiWorker::addSiPixelPileups(), edm::DataMixingSiStripWorker::addSiStripPileups(), edm::DataMixingSiStripMCDigiWorker::addSiStripPileups(), SiStripQualityHotStripIdentifier::algoAnalyze(), SiPixelDigiValid::analyze(), SiStripDigiValid::analyze(), MuonTruth::analyze(), SiStripBaselineValidator::analyze(), SiPixelHLTSource::analyze(), SiStripSpyMonitorModule::analyze(), SiStripBaselineAnalyzer::analyze(), CSCHitAssociator::associateCSCHitId(), CSCHitAssociator::associateHitId(), FWSiStripDigiProxyBuilder::build(), FWSiPixelDigiProxyBuilder::build(), SiStripFineDelayHit::closestCluster(), SiStripMeanCMExtractor::CMExtractorFromPedestals(), APVShotFinder::computeShots(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), SiStripAPVRestorer::CreateCMMapCMstored(), SiStripAPVRestorer::CreateCMMapRealPed(), sistrip::SpyDigiConverter::extractPayloadDigis(), SiPixelRawDataErrorModule::fill(), SiPixelCalibDigiProducer::fill(), SiPixelDigiModule::fill(), SiStripCommissioningSource::fillCablingHistos(), LaserAlignment::fillDataProfiles(), SiPixelRawDataErrorModule::fillFED(), LaserAlignmentT0ProducerDQM::FillFromProcessedDigis(), LaserAlignmentT0ProducerDQM::FillFromRawDigis(), SiStripCommissioningSource::fillHistos(), sistrip::FEDEmulator::fillNoises(), sistrip::FEDEmulator::fillPeds(), GlobalDigisProducer::fillTrk(), GlobalDigisAnalyzer::fillTrk(), RPCHitAssociator::findRPCDigiSimLink(), SiStripZeroSuppression::formatRawDigis(), RawDataConverter::GetDigis(), sistrip::SpyUtilities::getMajorityHeader(), sistrip::SpyEventMatcher::mergeMatchingData(), sistrip::SpyDigiConverter::mergeModuleChannels(), ShallowClustersProducer::NearDigis::NearDigis(), RBCProcessRPCSimDigis::next(), SiStripProcessedRawDigiProducer::pr_process(), SiStripZeroSuppression::processRaw(), sistrip::FEDEmulatorModule::produce(), edm::DataMixingSiStripRawWorker::putSiStrip(), sistrip::SpyDigiConverter::reorderDigis(), SiPixelClusterProducer::run(), SiStripMeanCMExtractor::StoreMean(), sistrip::FEDEmulator::subtractPedestals(), SiStripProcessedRawDigiProducer::vr_process(), and SiStripProcessedRawDigiProducer::zs_process().

365  {
366  _alreadySorted = false; // it's non const
367  return _sets.end();
368  }
collection_type _sets
Definition: DetSetVector.h:195
edm::BoolCache _alreadySorted
Definition: DetSetVector.h:196
template<class T >
DetSetVector< T >::const_iterator edm::DetSetVector< T >::end ( void  ) const
inline

Definition at line 373 of file DetSetVector.h.

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

373  {
374  return _sets.end();
375  }
collection_type _sets
Definition: DetSetVector.h:195
template<class T >
void edm::DetSetVector< T >::fillView ( ProductID const &  id,
std::vector< void const * > &  pointers,
FillViewHelperVector helpers 
) const

Definition at line 420 of file DetSetVector.h.

References edm::detail::reallyFillView().

423  {
424  detail::reallyFillView(*this, id, pointers, helpers);
425  }
void reallyFillView(COLLECTION const &coll, ProductID const &id, std::vector< void const * > &ptrs, FillViewHelperVector &helpers)
Definition: FillView.h:28
template<class T >
DetSetVector< T >::iterator edm::DetSetVector< T >::find ( det_id_type  id)
inline

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

Definition at line 294 of file DetSetVector.h.

References assert(), HLT_25ns14e33_v1_cff::distance, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by BeautifulSoup.Tag::__getattr__(), MuonTruth::analyze(), SiStripSpyMonitorModule::analyze(), CSCHitAssociator::associateCSCHitId(), CSCHitAssociator::associateHitId(), SiPixelRawDataErrorModule::fill(), SiPixelDigiModule::fill(), SiStripCommissioningSource::fillCablingHistos(), SiPixelRawDataErrorModule::fillFED(), LaserAlignmentT0ProducerDQM::FillFromProcessedDigis(), LaserAlignmentT0ProducerDQM::FillFromRawDigis(), SiStripCommissioningSource::fillHistos(), BeautifulSoup.Tag::firstText(), sistrip::SpyEventMatcher::mergeMatchingData(), sistrip::SpyDigiConverter::mergeModuleChannels(), and ShallowClustersProducer::NearDigis::NearDigis().

294  {
295  _alreadySorted = false; // it's non const
296  std::pair<iterator,iterator> p =
297  std::equal_range(_sets.begin(), _sets.end(), id);
298  if (p.first == p.second) return _sets.end();
299 
300  // The range indicated by [p.first, p.second) should be exactly of
301  // length 1. It seems likely we don't want to take the time hit of
302  // checking this, but here is the appropriate test... We can turn
303  // it on if we need the debugging aid.
304  #if 0
305  assert(std::distance(p.first, p.second) == 1);
306  #endif
307 
308  return p.first;
309  }
collection_type _sets
Definition: DetSetVector.h:195
assert(m_qm.get())
edm::BoolCache _alreadySorted
Definition: DetSetVector.h:196
template<class T >
DetSetVector< T >::const_iterator edm::DetSetVector< T >::find ( det_id_type  id) const
inline

Definition at line 314 of file DetSetVector.h.

References assert(), HLT_25ns14e33_v1_cff::distance, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by BeautifulSoup.Tag::__getattr__(), and BeautifulSoup.Tag::firstText().

314  {
315  std::pair<const_iterator,const_iterator> p =
316  std::equal_range(_sets.begin(), _sets.end(), id);
317  if (p.first == p.second) return _sets.end();
318  // The range indicated by [p.first, p.second) should be exactly of
319  // length 1.
320  assert(std::distance(p.first, p.second) == 1);
321  return p.first;
322  }
collection_type _sets
Definition: DetSetVector.h:195
assert(m_qm.get())
template<class T >
DetSetVector< T >::reference edm::DetSetVector< T >::find_or_insert ( det_id_type  id)
inline

Find the DetSet with the given DetId, and return a reference to it. If there is none, create one with the right DetId, and an empty vector, and return a reference to the new one.

Definition at line 258 of file DetSetVector.h.

References AlCaHLTBitMon_ParallelJobs::p.

Referenced by PixelDataFormatter::interpretRawData().

258  {
259  // NOTE: we don't have to clear _alreadySorted: the new DS is empty,
260  // and gets inserted in the correct place
261  std::pair<iterator,iterator> p =
262  std::equal_range(_sets.begin(), _sets.end(), id);
263 
264  // If the range isn't empty, we already have the right thing;
265  // return a reference to it...
266  if (p.first != p.second) return *p.first;
267 
268  // Insert the right thing, in the right place, and return a
269  // reference to the newly inserted thing.
270 #if defined( __GXX_EXPERIMENTAL_CXX0X__)
271  return *(_sets.emplace(p.first, id));
272 #else
273  return *(_sets.insert(p.first, detset(id)));
274 #endif
275  }
collection_type _sets
Definition: DetSetVector.h:195
DetSet< T > detset
Definition: DetSetVector.h:100
template<class T >
void edm::DetSetVector< T >::getIds ( std::vector< det_id_type > &  result) const
inline

Push all the id for each DetSet stored in this DetSetVector into the given vector 'result'.

Definition at line 381 of file DetSetVector.h.

References begin, end, and create_public_lumi_plots::transform.

382  {
383  std::transform(this->begin(), this->end(),
384  std::back_inserter(result),
385 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
386  std::bind(&DetSet<T>::id,std::placeholders::_1));
387 #else
388  boost::bind(&DetSet<T>::id,_1));
389 #endif
390  }
tuple result
Definition: query.py:137
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:365
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:350
template<class T >
void edm::DetSetVector< T >::insert ( detset const &  s)
inline

Insert the given DetSet.

Definition at line 239 of file DetSetVector.h.

References lumiQTWidget::t.

Referenced by BeautifulSoup.PageElement::_invert(), edm::DataMixingSiStripWorker::addSiStripPileups(), edm::DataMixingSiStripMCDigiWorker::addSiStripPileups(), SiStripProcessedRawDigiProducer::common_process(), RPCDigitizer::doAction(), and CSCDigitizer::doAction().

239  {
240  _alreadySorted = false; // we don't know if the DetSet we're adding is already sorted
241  // Implementation provided by the Performance Task Force.
242  _sets.insert(std::lower_bound(_sets.begin(),
243  _sets.end(),
244  t),
245  t);
246 #if 0
247  // It seems we have to sort on each insertion, because we may
248  // perform lookups during construction.
249  _sets.push_back(t);
250 
251  _sort();
252 #endif
253  }
collection_type _sets
Definition: DetSetVector.h:195
edm::BoolCache _alreadySorted
Definition: DetSetVector.h:196
void _sort()
Sort the DetSet in order of increasing DetId.
Definition: DetSetVector.h:415
template<class T>
DetSetVector< T > & edm::DetSetVector< T >::operator= ( DetSetVector< T > const &  other)
inline

Definition at line 229 of file DetSetVector.h.

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

230  {
231  DetSetVector<T> temp(other);
232  swap(temp);
233  return *this;
234  }
void swap(DetSetVector &other)
template<class T >
DetSetVector< T >::reference edm::DetSetVector< T >::operator[] ( det_id_type  i)
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 327 of file DetSetVector.h.

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

327  {
328  _alreadySorted = false; // it's non const
329  // Find the right DetSet, and return a reference to it. Throw if
330  // there is none.
331  iterator it = this->find(i);
332  if (it == this->end()) detail::_throw_range(i);
333  return *it;
334  }
int i
Definition: DBlmapReader.cc:9
void _throw_range(det_id_type i)
Definition: DetSetVector.h:73
iterator find(det_id_type id)
Definition: DetSetVector.h:294
collection_type::iterator iterator
Definition: DetSetVector.h:107
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:365
edm::BoolCache _alreadySorted
Definition: DetSetVector.h:196
template<class T >
DetSetVector< T >::const_reference edm::DetSetVector< T >::operator[] ( det_id_type  i) const
inline

Definition at line 339 of file DetSetVector.h.

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

339  {
340  // Find the right DetSet, and return a reference to it. Throw if
341  // there is none.
342  const_iterator it = this->find(i);
343  if (it == this->end()) detail::_throw_range(i);
344  return *it;
345  }
int i
Definition: DBlmapReader.cc:9
void _throw_range(det_id_type i)
Definition: DetSetVector.h:73
iterator find(det_id_type id)
Definition: DetSetVector.h:294
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:365
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:108
template<class T >
void edm::DetSetVector< T >::post_insert ( )
inline

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

Definition at line 395 of file DetSetVector.h.

References alignCSCRings::e, i, and python.multivaluedict::sort().

395  {
396 #ifndef CMS_NOCXX11
397  _sets.shrink_to_fit();
398 #endif
399  if (_alreadySorted) return;
400  typename collection_type::iterator i = _sets.begin();
401  typename collection_type::iterator e = _sets.end();
402  // For each DetSet...
403  for (; i != e; ++i) {
404 #ifndef CMS_NOCXX11
405  i->data.shrink_to_fit();
406 #endif
407  // sort the Detset pointed to by
408  std::sort(i->data.begin(), i->data.end());
409  }
410  }
collection_type _sets
Definition: DetSetVector.h:195
int i
Definition: DBlmapReader.cc:9
edm::BoolCache _alreadySorted
Definition: DetSetVector.h:196
template<class T>
void edm::DetSetVector< T >::reserve ( size_t  s)
inline
template<class T >
DetSetVector< T >::size_type edm::DetSetVector< T >::size ( void  ) const
inline
template<class T>
void edm::DetSetVector< T >::swap ( DetSetVector< T > &  other)

Member Data Documentation

template<class T>
edm::BoolCache edm::DetSetVector< T >::_alreadySorted
private

Definition at line 196 of file DetSetVector.h.

template<class T>
collection_type edm::DetSetVector< T >::_sets
private