CMS 3D CMS Logo

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

#include <LayerHitMapCache.h>

Classes

class  SimpleCache
 

Public Member Functions

RecHitsSortedInPhiadd (const SeedingLayerSetsHits::SeedingLayer &layer, std::unique_ptr< RecHitsSortedInPhi > hits)
 
void clear ()
 
void extend (const LayerHitMapCache &other)
 
 LayerHitMapCache (unsigned int initSize=50)
 
 LayerHitMapCache (LayerHitMapCache &&)=default
 
const RecHitsSortedInPhioperator() (const SeedingLayerSetsHits::SeedingLayer &layer, const TrackingRegion &region)
 
LayerHitMapCacheoperator= (LayerHitMapCache &&)=default
 

Private Types

typedef SimpleCache Cache
 

Private Attributes

Cache theCache
 

Detailed Description

A cache adressable by DetLayer* and TrackingRegion* . Used to cache all the hits of a DetLayer.

Definition at line 14 of file LayerHitMapCache.h.

Member Typedef Documentation

Definition at line 62 of file LayerHitMapCache.h.

Constructor & Destructor Documentation

LayerHitMapCache::LayerHitMapCache ( unsigned int  initSize = 50)
inline

Definition at line 65 of file LayerHitMapCache.h.

65 : theCache(initSize) {}
LayerHitMapCache::LayerHitMapCache ( LayerHitMapCache &&  )
default

Member Function Documentation

RecHitsSortedInPhi* LayerHitMapCache::add ( const SeedingLayerSetsHits::SeedingLayer layer,
std::unique_ptr< RecHitsSortedInPhi hits 
)
inline

Definition at line 74 of file LayerHitMapCache.h.

References LayerHitMapCache::SimpleCache::add(), SeedingLayerSetsHits::SeedingLayer::index(), and theCache.

Referenced by operator()(), and counter.Counter::register().

74  {
75  RecHitsSortedInPhi* ptr = hits.get();
76  theCache.add(layer.index(), hits.release());
77  return ptr;
78  }
void add(KeyType key, ValueType *value)
add object to cache. It is caller responsibility to check that object is not yet there.
void LayerHitMapCache::clear ( void  )
inline
void LayerHitMapCache::extend ( const LayerHitMapCache other)
inline
const RecHitsSortedInPhi& LayerHitMapCache::operator() ( const SeedingLayerSetsHits::SeedingLayer layer,
const TrackingRegion region 
)
inline

Definition at line 80 of file LayerHitMapCache.h.

References add(), RecHitsSortedInPhi::all(), cms::cuda::assert(), SeedingLayerSetsHits::SeedingLayer::detLayer(), LayerHitMapCache::SimpleCache::get(), TrackingRegion::hits(), SeedingLayerSetsHits::SeedingLayer::index(), submitPVResolutionJobs::key, LogDebug, TrackingRegion::origin(), theCache, and createJobs::tmp.

80  {
81  int key = layer.index();
82  assert(key >= 0);
83  const RecHitsSortedInPhi* lhm = theCache.get(key);
84  if (lhm == nullptr) {
85  auto tmp =
86  add(layer, std::make_unique<RecHitsSortedInPhi>(region.hits(layer), region.origin(), layer.detLayer()));
87  tmp->theOrigin = region.origin();
88  lhm = tmp;
89  LogDebug("LayerHitMapCache") << " I got" << lhm->all().second - lhm->all().first
90  << " hits in the cache for: " << layer.detLayer();
91  } else {
92  // std::cout << region.origin() << " " << lhm->theOrigin << std::endl;
93  LogDebug("LayerHitMapCache") << " I got" << lhm->all().second - lhm->all().first
94  << " hits FROM THE cache for: " << layer.detLayer();
95  }
96  return *lhm;
97  }
GlobalPoint const & origin() const
virtual Hits hits(const SeedingLayerSetsHits::SeedingLayer &layer) const =0
get hits from layer compatible with region constraints
assert(be >=bs)
tuple key
prepare the HTCondor submission files and eventually submit them
RecHitsSortedInPhi * add(const SeedingLayerSetsHits::SeedingLayer &layer, std::unique_ptr< RecHitsSortedInPhi > hits)
const DetLayer * detLayer() const
const ValueType * get(KeyType key) const
tmp
align.sh
Definition: createJobs.py:716
#define LogDebug(id)
LayerHitMapCache& LayerHitMapCache::operator= ( LayerHitMapCache &&  )
default

Member Data Documentation

Cache LayerHitMapCache::theCache
private

Definition at line 100 of file LayerHitMapCache.h.

Referenced by add(), clear(), extend(), and operator()().