CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edmNew::DetSet< T > Class Template Reference

#include <DetSetNew.h>

Public Types

typedef data_type const * const_iterator
 
typedef DetSetVector< TContainer
 
typedef T data_type
 
typedef std::vector< data_typeDataContainer
 
typedef unsigned int id_type
 
typedef data_typeiterator
 
typedef id_type key_type
 
typedef unsigned int size_type
 
typedef data_type value_type
 

Public Member Functions

iterator begin ()
 
const_iterator begin () const
 
id_type detId () const
 
 DetSet ()
 
 DetSet (id_type i, DataContainer const &idata, size_type ioffset, size_type isize)
 
 DetSet (Container const &icont, typename Container::Item const &item, bool update)
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
id_type id () const
 
bool isValid () const
 
unsigned int makeKeyOf (const_iterator ci) const
 
template<typename HandleT >
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo (HandleT const &handle, const_iterator ci) const
 
int offset () const
 
data_typeoperator[] (size_type i)
 
data_type operator[] (size_type i) const
 
size_type size () const
 

Private Member Functions

DataContainer const & container () const
 
data_type const * data () const
 
data_typedata ()
 
void set (Container const &icont, typename Container::Item const &item, bool update=true)
 

Private Attributes

DataContainer const * m_data
 
id_type m_id
 
int m_offset
 
size_type m_size
 

Detailed Description

template<typename T>
class edmNew::DetSet< T >

Definition at line 22 of file DetSetNew.h.

Member Typedef Documentation

◆ const_iterator

template<typename T>
typedef data_type const* edmNew::DetSet< T >::const_iterator

Definition at line 31 of file DetSetNew.h.

◆ Container

template<typename T>
typedef DetSetVector<T> edmNew::DetSet< T >::Container

Definition at line 24 of file DetSetNew.h.

◆ data_type

template<typename T>
typedef T edmNew::DetSet< T >::data_type

Definition at line 27 of file DetSetNew.h.

◆ DataContainer

template<typename T>
typedef std::vector<data_type> edmNew::DetSet< T >::DataContainer

Definition at line 29 of file DetSetNew.h.

◆ id_type

template<typename T>
typedef unsigned int edmNew::DetSet< T >::id_type

Definition at line 26 of file DetSetNew.h.

◆ iterator

template<typename T>
typedef data_type* edmNew::DetSet< T >::iterator

Definition at line 30 of file DetSetNew.h.

◆ key_type

template<typename T>
typedef id_type edmNew::DetSet< T >::key_type

Definition at line 34 of file DetSetNew.h.

◆ size_type

template<typename T>
typedef unsigned int edmNew::DetSet< T >::size_type

Definition at line 25 of file DetSetNew.h.

◆ value_type

template<typename T>
typedef data_type edmNew::DetSet< T >::value_type

Definition at line 33 of file DetSetNew.h.

Constructor & Destructor Documentation

◆ DetSet() [1/3]

template<typename T>
edmNew::DetSet< T >::DetSet ( )
inline

Definition at line 36 of file DetSetNew.h.

36 : m_id(0), m_data(nullptr), m_offset(-1), m_size(0) {}
size_type m_size
Definition: DetSetNew.h:98
DataContainer const * m_data
Definition: DetSetNew.h:96
id_type m_id
Definition: DetSetNew.h:95

◆ DetSet() [2/3]

template<typename T>
edmNew::DetSet< T >::DetSet ( id_type  i,
DataContainer const &  idata,
size_type  ioffset,
size_type  isize 
)
inline

Definition at line 37 of file DetSetNew.h.

38  : m_id(i), m_data(&idata), m_offset(ioffset), m_size(isize) {}
size_type m_size
Definition: DetSetNew.h:98
DataContainer const * m_data
Definition: DetSetNew.h:96
id_type m_id
Definition: DetSetNew.h:95

◆ DetSet() [3/3]

template<typename T>
edmNew::DetSet< T >::DetSet ( Container const &  icont,
typename Container::Item const &  item,
bool  update 
)
inline

Definition at line 40 of file DetSetNew.h.

41  : m_id(0), m_data(nullptr), m_offset(-1), m_size(0) {
42  set(icont, item, update);
43  }
size_type m_size
Definition: DetSetNew.h:98
DataContainer const * m_data
Definition: DetSetNew.h:96
id_type m_id
Definition: DetSetNew.h:95
#define update(a, b)

Member Function Documentation

◆ begin() [1/2]

template<typename T>
iterator edmNew::DetSet< T >::begin ( void  )
inline

◆ begin() [2/2]

template<typename T>
const_iterator edmNew::DetSet< T >::begin ( void  ) const
inline

Definition at line 55 of file DetSetNew.h.

55 { return data(); }
data_type const * data() const
Definition: DetSetNew.h:84

◆ container()

template<typename T>
DataContainer const& edmNew::DetSet< T >::container ( ) const
inlineprivate

Definition at line 82 of file DetSetNew.h.

Referenced by edmNew::DetSet< SiStripCluster >::makeKeyOf(), and edmNew::DetSet< SiStripCluster >::makeRefTo().

82 { return *m_data; }
DataContainer const * m_data
Definition: DetSetNew.h:96

◆ data() [1/2]

template<typename T>
data_type const* edmNew::DetSet< T >::data ( ) const
inlineprivate

Definition at line 84 of file DetSetNew.h.

Referenced by edmNew::DetSet< SiStripCluster >::begin(), edmNew::DetSet< SiStripCluster >::end(), and edmNew::DetSet< SiStripCluster >::operator[]().

84  {
85  if (isValid() || !empty())
86  assert(m_data);
87  return m_data ? (&((*m_data)[m_offset])) : nullptr;
88  }
bool isValid() const
Definition: DetSetNew.h:45
assert(be >=bs)
bool empty() const
Definition: DetSetNew.h:67
DataContainer const * m_data
Definition: DetSetNew.h:96

◆ data() [2/2]

template<typename T>
data_type* edmNew::DetSet< T >::data ( )
inlineprivate

Definition at line 90 of file DetSetNew.h.

90  {
91  assert(m_data);
92  return const_cast<data_type *>(&((*m_data)[m_offset]));
93  }
assert(be >=bs)
DataContainer const * m_data
Definition: DetSetNew.h:96

◆ detId()

template<typename T>
id_type edmNew::DetSet< T >::detId ( ) const
inline

◆ empty()

template<typename T>
bool edmNew::DetSet< T >::empty ( ) const
inline

◆ end() [1/2]

template<typename T>
iterator edmNew::DetSet< T >::end ( void  )
inline

Definition at line 53 of file DetSetNew.h.

Referenced by fireworks::addSiStripClusters(), SiPixelRecHitsValid::analyze(), SiPixelRecHitSource::analyze(), Phase2OTMonitorVectorHits::analyze(), SiStripMonitorCluster::analyze(), Phase2OTMonitorRecHit::analyze(), SiPixelErrorEstimation::analyze(), SiPixelTrackingRecHitsValid::analyze(), VectorHitBuilderAlgorithm::buildVectorHits(), VectorHitBuilderAlgorithm::checkClustersCompatibilityBeforeBuilding(), TkPixelMeasurementDet::compHits(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), TkStripMeasurementDet::empty(), edmNew::fillCollectionForThinning(), GlobalRecHitsAnalyzer::fillTrk(), GlobalRecHitsProducer::fillTrk(), NearbyPixelClustersProducer::findAllNearbyClusters(), SiPixelCalSingleMuonAnalyzer::findClosestCluster(), NearbyPixelClustersAnalyzer::findClosestCluster(), TkStripMeasurementDet::hitRange(), SiStripRecHitConverterAlgorithm::match(), edmNew::dstvdetails::ToRM< B >::operator()(), TopBottomClusterInfoProducer::produce(), reco::CentralityProducer::produce(), ClusterTPAssociationProducer::produce(), TTStubBuilder< T >::produce(), fireworks::pushNearbyPixelHits(), TkStackMeasurementDet::recHits(), TkDoubleSensMeasurementDet::recHits(), TkPhase2OTMeasurementDet::recHits(), TkStripMeasurementDet::recHits(), TkStripMeasurementDet::simpleRecHits(), and TTStubBuilder< T >::updateStubs().

53 { return data() + m_size; }
size_type m_size
Definition: DetSetNew.h:98
data_type const * data() const
Definition: DetSetNew.h:84

◆ end() [2/2]

template<typename T>
const_iterator edmNew::DetSet< T >::end ( void  ) const
inline

Definition at line 57 of file DetSetNew.h.

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

57 { return data() + m_size; }
size_type m_size
Definition: DetSetNew.h:98
data_type const * data() const
Definition: DetSetNew.h:84

◆ id()

template<typename T>
id_type edmNew::DetSet< T >::id ( ) const
inline

◆ isValid()

template<typename T>
bool edmNew::DetSet< T >::isValid ( void  ) const
inline

◆ makeKeyOf()

template<typename T>
unsigned int edmNew::DetSet< T >::makeKeyOf ( const_iterator  ci) const
inline

Definition at line 76 of file DetSetNew.h.

Referenced by TkStripMeasurementDet::simpleRecHits().

76 { return ci - &(container().front()); }
DataContainer const & container() const
Definition: DetSetNew.h:82

◆ makeRefTo()

template<typename T>
template<typename HandleT >
edm::Ref<typename HandleT::element_type, typename HandleT::element_type::value_type::value_type> edmNew::DetSet< T >::makeRefTo ( HandleT const &  handle,
const_iterator  ci 
) const
inline

◆ offset()

template<typename T>
int edmNew::DetSet< T >::offset ( ) const
inline

Definition at line 59 of file DetSetNew.h.

Referenced by TkStackMeasurementDet::recHits().

59 { return m_offset; }

◆ operator[]() [1/2]

template<typename T>
data_type& edmNew::DetSet< T >::operator[] ( size_type  i)
inline

Definition at line 47 of file DetSetNew.h.

47 { return data()[i]; }
data_type const * data() const
Definition: DetSetNew.h:84

◆ operator[]() [2/2]

template<typename T>
data_type edmNew::DetSet< T >::operator[] ( size_type  i) const
inline

Definition at line 49 of file DetSetNew.h.

49 { return data()[i]; }
data_type const * data() const
Definition: DetSetNew.h:84

◆ set()

template<typename T>
void edmNew::DetSet< T >::set ( Container const &  icont,
typename Container::Item const &  item,
bool  update = true 
)
inlineprivate

Definition at line 648 of file DetSetVectorNew.h.

648  {
649  // if an item is being updated we wait
650  if (update)
651  icont.update(item);
652  while (item.initializing())
653  nanosleep(nullptr, nullptr);
654  m_data = &icont.data();
655  m_id = item.id;
656  m_offset = item.offset;
657  m_size = item.size;
658  }
size_type m_size
Definition: DetSetNew.h:98
DataContainer const * m_data
Definition: DetSetNew.h:96
id_type m_id
Definition: DetSetNew.h:95
#define update(a, b)

◆ size()

template<typename T>
size_type edmNew::DetSet< T >::size ( void  ) const
inline

Member Data Documentation

◆ m_data

template<typename T>
DataContainer const* edmNew::DetSet< T >::m_data
private

◆ m_id

template<typename T>
id_type edmNew::DetSet< T >::m_id
private

◆ m_offset

template<typename T>
int edmNew::DetSet< T >::m_offset
private

◆ m_size

template<typename T>
size_type edmNew::DetSet< T >::m_size
private