CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
Phase2ITPixelClusterShapeCache Class Reference

#include <Phase2ITPixelClusterShapeCache.h>

Classes

struct  Field
 

Public Types

typedef edm::Ref< edmNew::DetSetVector< Phase2ITPixelCluster >, Phase2ITPixelClusterClusterRef
 

Public Member Functions

Phase2ITPixelClusterShapeData 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
 
 Phase2ITPixelClusterShapeCache ()
 
 Phase2ITPixelClusterShapeCache (const edm::HandleBase &handle)
 
 Phase2ITPixelClusterShapeCache (const edm::ProductID &id)
 
void resize (size_t size)
 
void shrink_to_fit ()
 
void swap (Phase2ITPixelClusterShapeCache &other)
 
 ~Phase2ITPixelClusterShapeCache ()
 

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 39 of file Phase2ITPixelClusterShapeCache.h.

Member Typedef Documentation

Definition at line 41 of file Phase2ITPixelClusterShapeCache.h.

Constructor & Destructor Documentation

Phase2ITPixelClusterShapeCache::Phase2ITPixelClusterShapeCache ( )
inline

Definition at line 56 of file Phase2ITPixelClusterShapeCache.h.

56 {};
Phase2ITPixelClusterShapeCache::Phase2ITPixelClusterShapeCache ( const edm::HandleBase handle)
inlineexplicit

Definition at line 57 of file Phase2ITPixelClusterShapeCache.h.

57 : productId_(handle.id()) {}
ProductID id() const
Definition: HandleBase.cc:15
Phase2ITPixelClusterShapeCache::Phase2ITPixelClusterShapeCache ( const edm::ProductID id)
inlineexplicit

Definition at line 58 of file Phase2ITPixelClusterShapeCache.h.

Phase2ITPixelClusterShapeCache::~Phase2ITPixelClusterShapeCache ( )

Definition at line 6 of file Phase2ITPixelClusterShapeCache.cc.

6 {}

Member Function Documentation

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

Definition at line 8 of file Phase2ITPixelClusterShapeCache.cc.

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

8  {
9  if(ref.id() != productId_)
10  throw cms::Exception("InvalidReference") << "Phase2ITPixelClusterShapeCache caches values for Phase2ITPixelClusters with ProductID " << productId_ << ", got Phase2ITPixelClusterRef with ID " << ref.id();
11  if(ref.index() >= data_.size())
12  throw cms::Exception("InvalidReference") << "Phase2ITPixelClusterShapeCache caches values for Phase2ITPixelClusters with ProductID " << productId_ << " that has " << data_.size() << " clusters, got Phase2ITPixelClusterRef with index " << ref.index();
13 }
ProductIndex id() const
Definition: ProductID.h:38
Phase2ITPixelClusterShapeData Phase2ITPixelClusterShapeCache::get ( const ClusterRef cluster,
const PixelGeomDetUnit pixDet 
) const
inline

Definition at line 92 of file Phase2ITPixelClusterShapeCache.h.

References edm::helpers::checkRef(), Phase2ITPixelClusterShapeCache::Field::complete, end, f, Phase2ITPixelClusterShapeCache::Field::filled, Phase2ITPixelClusterShapeCache::Field::has, Phase2ITPixelClusterShapeCache::Field::offset, Phase2ITPixelClusterShapeData::Phase2ITPixelClusterShapeData(), Phase2ITPixelClusterShapeCache::Field::size, and Phase2ITPixelClusterShapeCache::Field::straight.

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

92  {
93  checkRef(cluster);
94  Field f = data_[cluster.index()];
95  assert(f.filled);
96 
97  auto beg = sizeData_.begin()+f.offset;
98  auto end = beg+f.size;
99 
100  return Phase2ITPixelClusterShapeData(beg, end, f.straight, f.complete, f.has);
101  }
double f[11][100]
#define end
Definition: vmac.h:39
void checkRef(const ClusterRef &cluster) const
std::vector< std::pair< int, int > > sizeData_
template<typename T >
void Phase2ITPixelClusterShapeCache::insert ( const ClusterRef cluster,
const T data 
)
inline

Definition at line 79 of file Phase2ITPixelClusterShapeCache.h.

References classname-blmflt::capacity, edm::helpers::checkRef(), popcon2dropbox::copy(), and edm::Ref< C, T, F >::index().

Referenced by BeautifulSoup.PageElement::append().

79  {
80  static_assert(T::ArrayType::capacity() <= 16, "T::ArrayType::capacity() more than 16, bit field too narrow");
81  checkRef(cluster);
82 
83  data_[cluster.index()] = Field(sizeData_.size(), data.size.size(), data.isStraight, data.isComplete, data.hasBigPixelsOnlyInside);
84  std::copy(data.size.begin(), data.size.end(), std::back_inserter(sizeData_));
85  }
def copy(args, dbName)
void checkRef(const ClusterRef &cluster) const
std::vector< std::pair< int, int > > sizeData_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
bool Phase2ITPixelClusterShapeCache::isFilled ( const ClusterRef cluster) const
inline

Definition at line 87 of file Phase2ITPixelClusterShapeCache.h.

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

87  {
88  checkRef(cluster);
89  return data_[cluster.index()].filled;
90  }
void checkRef(const ClusterRef &cluster) const
void Phase2ITPixelClusterShapeCache::resize ( size_t  size)
inline
void Phase2ITPixelClusterShapeCache::shrink_to_fit ( )
inline

Definition at line 73 of file Phase2ITPixelClusterShapeCache.h.

73  {
74  data_.shrink_to_fit();
75  sizeData_.shrink_to_fit();
76  }
std::vector< std::pair< int, int > > sizeData_
void Phase2ITPixelClusterShapeCache::swap ( Phase2ITPixelClusterShapeCache other)
inline

Definition at line 66 of file Phase2ITPixelClusterShapeCache.h.

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

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

Member Data Documentation

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

Definition at line 107 of file Phase2ITPixelClusterShapeCache.h.

Referenced by swap().

edm::ProductID Phase2ITPixelClusterShapeCache::productId_
private

Definition at line 109 of file Phase2ITPixelClusterShapeCache.h.

Referenced by swap().

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

Definition at line 108 of file Phase2ITPixelClusterShapeCache.h.

Referenced by swap().