CMS 3D CMS Logo

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 >, SiPixelClusterClusterRef
 

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

◆ ClusterRef

Definition at line 45 of file SiPixelClusterShapeCache.h.

Constructor & Destructor Documentation

◆ SiPixelClusterShapeCache() [1/3]

SiPixelClusterShapeCache::SiPixelClusterShapeCache ( )
inline

Definition at line 60 of file SiPixelClusterShapeCache.h.

60 {};

◆ SiPixelClusterShapeCache() [2/3]

SiPixelClusterShapeCache::SiPixelClusterShapeCache ( const edm::HandleBase handle)
inlineexplicit

Definition at line 61 of file SiPixelClusterShapeCache.h.

61 : productId_(handle.id()) {}

◆ SiPixelClusterShapeCache() [3/3]

SiPixelClusterShapeCache::SiPixelClusterShapeCache ( const edm::ProductID id)
inlineexplicit

Definition at line 62 of file SiPixelClusterShapeCache.h.

62 : productId_(id) {}

◆ ~SiPixelClusterShapeCache()

SiPixelClusterShapeCache::~SiPixelClusterShapeCache ( )

Definition at line 6 of file SiPixelClusterShapeCache.cc.

6 {}

Member Function Documentation

◆ checkRef()

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

◆ get()

SiPixelClusterShapeData SiPixelClusterShapeCache::get ( const ClusterRef cluster,
const PixelGeomDetUnit pixDet 
) const
inline

Definition at line 97 of file SiPixelClusterShapeCache.h.

References cms::cuda::assert(), checkRef(), data_, mps_fire::end, f, and sizeData_.

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(), util.rrapi.RRApi::report(), rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), rrapi.RRApi::tables(), util.rrapi.RRApi::tables(), util.rrapi.RRApi::tags(), rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and 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_
assert(be >=bs)
double f[11][100]
void checkRef(const ClusterRef &cluster) const

◆ insert()

template<typename T >
void SiPixelClusterShapeCache::insert ( const ClusterRef cluster,
const T data 
)
inline

Definition at line 83 of file SiPixelClusterShapeCache.h.

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

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

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
size d for d tracks hist hist capacity()

◆ isFilled()

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

◆ resize()

void SiPixelClusterShapeCache::resize ( size_t  size)
inline

Definition at line 65 of file SiPixelClusterShapeCache.h.

References data_, findQualityFiles::size, and sizeData_.

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

◆ shrink_to_fit()

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_

◆ swap()

void SiPixelClusterShapeCache::swap ( SiPixelClusterShapeCache other)
inline

Definition at line 70 of file SiPixelClusterShapeCache.h.

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

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

Member Data Documentation

◆ data_

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

◆ productId_

edm::ProductID SiPixelClusterShapeCache::productId_
private

Definition at line 114 of file SiPixelClusterShapeCache.h.

Referenced by checkRef(), and swap().

◆ sizeData_

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