CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
SiPixelClusterShapeCache Class Reference

#include <SiPixelClusterShapeCache.h>

Classes

struct  Field
 

Public Types

typedef edm::Ref
< edmNew::DetSetVector
< SiPixelCluster >
, SiPixelCluster
ClusterRef
 

Public Member Functions

SiPixelClusterShapeData get (const ClusterRef &cluster, const PixelGeomDetUnit *pixDet) const
 
template<typename T >
void insert (const ClusterRef &cluster, const T &data)
 
bool isFilled (const ClusterRef &cluster) const
 
void resize (size_t size)
 
void shrink_to_fit ()
 
 SiPixelClusterShapeCache ()
 
 SiPixelClusterShapeCache (const edm::HandleBase &handle)
 
 SiPixelClusterShapeCache (const edm::ProductID &id)
 
void swap (SiPixelClusterShapeCache &other)
 
 ~SiPixelClusterShapeCache ()
 

Private Member Functions

void checkRef (const ClusterRef &cluster) const
 

Private Attributes

std::vector< Fielddata_
 
edm::ProductID productId_
 
std::vector< std::pair< int,
int > > 
sizeData_
 

Detailed Description

Definition at line 43 of file SiPixelClusterShapeCache.h.

Member Typedef Documentation

Definition at line 45 of file SiPixelClusterShapeCache.h.

Constructor & Destructor Documentation

SiPixelClusterShapeCache::SiPixelClusterShapeCache ( )
inline

Definition at line 60 of file SiPixelClusterShapeCache.h.

60 {};
SiPixelClusterShapeCache::SiPixelClusterShapeCache ( const edm::HandleBase handle)
inlineexplicit

Definition at line 61 of file SiPixelClusterShapeCache.h.

61 : productId_(handle.id()) {}
ProductID id() const
Definition: HandleBase.cc:29
SiPixelClusterShapeCache::SiPixelClusterShapeCache ( const edm::ProductID id)
inlineexplicit

Definition at line 62 of file SiPixelClusterShapeCache.h.

62 : productId_(id) {}
SiPixelClusterShapeCache::~SiPixelClusterShapeCache ( )

Definition at line 6 of file SiPixelClusterShapeCache.cc.

6 {}

Member Function Documentation

void SiPixelClusterShapeCache::checkRef ( const ClusterRef cluster) const
private

Definition at line 8 of file SiPixelClusterShapeCache.cc.

References data_, edm::Ref< C, T, F >::id(), edm::Ref< C, T, F >::index(), and productId_.

Referenced by get(), insert(), and isFilled().

8  {
9  if (ref.id() != productId_)
10  throw cms::Exception("InvalidReference")
11  << "SiPixelClusterShapeCache caches values for SiPixelClusters with ProductID " << productId_
12  << ", got SiPixelClusterRef with ID " << ref.id();
13  if (ref.index() >= data_.size())
14  throw cms::Exception("InvalidReference")
15  << "SiPixelClusterShapeCache caches values for SiPixelClusters with ProductID " << productId_ << " that has "
16  << data_.size() << " clusters, got SiPixelClusterRef with index " << ref.index();
17 }
ProductIndex id() const
Definition: ProductID.h:35
SiPixelClusterShapeData SiPixelClusterShapeCache::get ( const ClusterRef cluster,
const PixelGeomDetUnit pixDet 
) const
inline

Definition at line 97 of file SiPixelClusterShapeCache.h.

References cms::cuda::assert(), checkRef(), SiPixelClusterShapeCache::Field::complete, data_, dataset::end, validate-o2o-wbm::f, SiPixelClusterShapeCache::Field::filled, SiPixelClusterShapeCache::Field::has, SiPixelClusterShapeCache::Field::offset, SiPixelClusterShapeCache::Field::size, sizeData_, and SiPixelClusterShapeCache::Field::straight.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), submitPVValidationJobs.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), rrapi.RRApi::count(), util.rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), submitPVValidationJobs.BetterConfigParser::getResultingSection(), ClusterShapeHitFilter::getSizes(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), rrapi.RRApi::tags(), util.rrapi.RRApi::tags(), util.rrapi.RRApi::templates(), rrapi.RRApi::templates(), rrapi.RRApi::workspaces(), and util.rrapi.RRApi::workspaces().

97  {
98  checkRef(cluster);
99  Field f = data_[cluster.index()];
100  assert(f.filled);
101 
102  auto beg = sizeData_.begin() + f.offset;
103  auto end = beg + f.size;
104 
105  return SiPixelClusterShapeData(beg, end, f.straight, f.complete, f.has);
106  }
std::vector< std::pair< int, int > > sizeData_
void checkRef(const ClusterRef &cluster) const
assert(be >=bs)
string end
Definition: dataset.py:937
template<typename T >
void SiPixelClusterShapeCache::insert ( const ClusterRef cluster,
const T data 
)
inline

Definition at line 83 of file SiPixelClusterShapeCache.h.

References checkRef(), filterCSVwithJSON::copy, data_, edm::Ref< C, T, F >::index(), and sizeData_.

Referenced by BeautifulSoup.PageElement::_invert(), and SequenceTypes.Schedule::_replaceIfHeldDirectly().

83  {
84  static_assert(T::ArrayType::capacity() <= 15, "T::ArrayType::capacity() more than 15, bit field too narrow");
85  checkRef(cluster);
86 
87  data_[cluster.index()] =
88  Field(sizeData_.size(), data.size.size(), data.isStraight, data.isComplete, data.hasBigPixelsOnlyInside);
89  std::copy(data.size.begin(), data.size.end(), std::back_inserter(sizeData_));
90  }
std::vector< std::pair< int, int > > sizeData_
void checkRef(const ClusterRef &cluster) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
bool SiPixelClusterShapeCache::isFilled ( const ClusterRef cluster) const
inline

Definition at line 92 of file SiPixelClusterShapeCache.h.

References checkRef(), data_, and edm::Ref< C, T, F >::index().

92  {
93  checkRef(cluster);
94  return data_[cluster.index()].filled;
95  }
void checkRef(const ClusterRef &cluster) const
void SiPixelClusterShapeCache::resize ( size_t  size)
inline

Definition at line 65 of file SiPixelClusterShapeCache.h.

References data_, and sizeData_.

65  {
66  data_.resize(size);
67  sizeData_.reserve(size);
68  }
std::vector< std::pair< int, int > > sizeData_
tuple size
Write out results.
void SiPixelClusterShapeCache::shrink_to_fit ( )
inline

Definition at line 77 of file SiPixelClusterShapeCache.h.

References data_, and sizeData_.

77  {
78  data_.shrink_to_fit();
79  sizeData_.shrink_to_fit();
80  }
std::vector< std::pair< int, int > > sizeData_
void SiPixelClusterShapeCache::swap ( SiPixelClusterShapeCache other)
inline

Definition at line 70 of file SiPixelClusterShapeCache.h.

References data_, productId_, sizeData_, and std::swap().

70  {
71  data_.swap(other.data_);
72  sizeData_.swap(other.sizeData_);
74  }
std::vector< std::pair< int, int > > sizeData_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)

Member Data Documentation

std::vector<Field> SiPixelClusterShapeCache::data_
private

Definition at line 112 of file SiPixelClusterShapeCache.h.

Referenced by checkRef(), get(), insert(), isFilled(), resize(), shrink_to_fit(), and swap().

edm::ProductID SiPixelClusterShapeCache::productId_
private

Definition at line 114 of file SiPixelClusterShapeCache.h.

Referenced by checkRef(), and swap().

std::vector<std::pair<int, int> > SiPixelClusterShapeCache::sizeData_
private

Definition at line 113 of file SiPixelClusterShapeCache.h.

Referenced by get(), insert(), resize(), shrink_to_fit(), and swap().