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.

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 }

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

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

◆ get()

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

◆ insert()

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

Definition at line 83 of file SiPixelClusterShapeCache.h.

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  }

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

Referenced by BeautifulSoup.PageElement::append().

◆ isFilled()

bool SiPixelClusterShapeCache::isFilled ( const ClusterRef cluster) const
inline

Definition at line 92 of file SiPixelClusterShapeCache.h.

92  {
93  checkRef(cluster);
94  return data_[cluster.index()].filled;
95  }

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

◆ resize()

void SiPixelClusterShapeCache::resize ( size_t  size)
inline

Definition at line 65 of file SiPixelClusterShapeCache.h.

65  {
66  data_.resize(size);
67  sizeData_.reserve(size);
68  }

References data_, findQualityFiles::size, and sizeData_.

◆ shrink_to_fit()

void SiPixelClusterShapeCache::shrink_to_fit ( )
inline

Definition at line 77 of file SiPixelClusterShapeCache.h.

77  {
78  data_.shrink_to_fit();
79  sizeData_.shrink_to_fit();
80  }

References data_, and sizeData_.

◆ swap()

void SiPixelClusterShapeCache::swap ( SiPixelClusterShapeCache other)
inline

Definition at line 70 of file SiPixelClusterShapeCache.h.

70  {
71  data_.swap(other.data_);
72  sizeData_.swap(other.sizeData_);
73  std::swap(productId_, other.productId_);
74  }

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

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

filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
patZpeak.handle
handle
Definition: patZpeak.py:23
cms::cuda::assert
assert(be >=bs)
SiPixelClusterShapeCache::sizeData_
std::vector< std::pair< int, int > > sizeData_
Definition: SiPixelClusterShapeCache.h:113
end
#define end
Definition: vmac.h:39
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
trackingPlots.other
other
Definition: trackingPlots.py:1465
SiPixelClusterShapeCache::productId_
edm::ProductID productId_
Definition: SiPixelClusterShapeCache.h:114
SiPixelClusterShapeCache::checkRef
void checkRef(const ClusterRef &cluster) const
Definition: SiPixelClusterShapeCache.cc:8
SiPixelClusterShapeCache::data_
std::vector< Field > data_
Definition: SiPixelClusterShapeCache.h:112
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
cms::Exception
Definition: Exception.h:70
SiPixelClusterShapeData
Definition: SiPixelClusterShapeCache.h:19
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
edm::ProductID::id
ProductIndex id() const
Definition: ProductID.h:35