CMS 3D CMS Logo

Classes | Public Member Functions | Private Types | Private Attributes

LayerHitMapCache Class Reference

#include <LayerHitMapCache.h>

List of all members.

Classes

class  SimpleCache

Public Member Functions

void clear ()
 LayerHitMapCache (const LayerHitMapCache &)
 LayerHitMapCache (int initSize=50)
const RecHitsSortedInPhioperator() (const ctfseeding::SeedingLayer *layer, const TrackingRegion &region, const edm::Event &iEvent, const edm::EventSetup &iSetup)
 ~LayerHitMapCache ()

Private Types

typedef SimpleCache
< LayerRegionKey,
RecHitsSortedInPhi
Cache
typedef const DetLayerLayerRegionKey

Private Attributes

CachetheCache

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 48 of file LayerHitMapCache.h.

typedef const DetLayer* LayerHitMapCache::LayerRegionKey [private]

Definition at line 47 of file LayerHitMapCache.h.


Constructor & Destructor Documentation

LayerHitMapCache::LayerHitMapCache ( int  initSize = 50) [inline]

Definition at line 50 of file LayerHitMapCache.h.

References theCache.

{ theCache = new Cache(initSize); }
LayerHitMapCache::~LayerHitMapCache ( ) [inline]

Definition at line 52 of file LayerHitMapCache.h.

References theCache.

{ delete theCache; }
LayerHitMapCache::LayerHitMapCache ( const LayerHitMapCache ) [inline]

Definition at line 73 of file LayerHitMapCache.h.

{ }

Member Function Documentation

void LayerHitMapCache::clear ( void  ) [inline]
const RecHitsSortedInPhi& LayerHitMapCache::operator() ( const ctfseeding::SeedingLayer layer,
const TrackingRegion region,
const edm::Event iEvent,
const edm::EventSetup iSetup 
) [inline]

Definition at line 56 of file LayerHitMapCache.h.

References LayerHitMapCache::SimpleCache< KeyType, ValueType >::add(), ctfseeding::SeedingLayer::detLayer(), LayerHitMapCache::SimpleCache< KeyType, ValueType >::get(), TrackingRegion::hits(), combine::key, LogDebug, and theCache.

                                                             {
    LayerRegionKey key(layer->detLayer());
    const RecHitsSortedInPhi * lhm = theCache->get(key);
    if (lhm==0) {
      lhm=new RecHitsSortedInPhi (region.hits(iEvent,iSetup,layer));
      LogDebug("LayerHitMapCache")<<" I got"<< lhm->all().second-lhm->all().first<<" hits in the cache for: "<<layer->detLayer();
      theCache->add( key, lhm); 
    }
    else{
      LogDebug("LayerHitMapCache")<<" I got"<< lhm->all().second-lhm->all().first<<" hits FROM THE cache for: "<<layer->detLayer();
    }
    return *lhm;
  }

Member Data Documentation

Definition at line 76 of file LayerHitMapCache.h.

Referenced by clear(), LayerHitMapCache(), operator()(), and ~LayerHitMapCache().