CMS 3D CMS Logo

Functions
utilities Namespace Reference

Functions

def cache (function)
 

Function Documentation

◆ cache()

def utilities.cache (   function)

Definition at line 3 of file utilities.py.

References HiBiasedCentrality_cfi.function, and print().

Referenced by EcalHitResponse.analogSignalAmplitude(), SiStripLAProfileBooker.analyze(), edm::RepeatingCachedRootSource.beginJob(), edm::ConcurrentGeneratorFilter< HAD, DEC >.beginStream(), edm::ConcurrentHadronizerFilter< HAD, DEC >.beginStream(), ExternalGeneratorFilter.beginStream(), edm::VectorInputSource.clearEventPrincipal(), edm::ConcurrentGeneratorFilter< HAD, DEC >.filter(), edm::ConcurrentHadronizerFilter< HAD, DEC >.filter(), ConvBremPFTrackFinder.foundConvBremPFRecTrack(), DTCalibrationMap.getConsts(), edm::RootTree.getEntry(), cms::cuda.getEventCache(), cms::cuda.getStreamCache(), EcalPhiSymRecHitProducerLumi.globalBeginLuminosityBlock(), EcalPhiSymRecHitProducerLumi.globalBeginLuminosityBlockSummary(), EcalPhiSymRecHitProducerRun.globalBeginRun(), EcalPhiSymRecHitProducerRun.globalBeginRunSummary(), DeepMETProducer.globalEndJob(), L1NNTauProducer.globalEndJob(), DeepCoreSeedGenerator.globalEndJob(), EcalPhiSymRecHitProducerLumi.globalEndLuminosityBlockProduce(), EcalPhiSymRecHitProducerRun.globalEndRunProduce(), RectangularEtaPhiTrackingRegion.hits(), CosmicTrackingRegion.hits_(), EcalPhiSymRecHitProducerBase.initializeConfigCache(), DeepMETProducer.initializeGlobalCache(), L1NNTauProducer.initializeGlobalCache(), DeepCoreSeedGenerator.initializeGlobalCache(), EcalPhiSymRecHitProducerBase.initializePhiSymCache(), EcalPhiSymRecHitProducerBase.initializeStreamCache(), edm::ConcurrentGeneratorFilter< HAD, DEC >.initLumi(), edm::ConcurrentHadronizerFilter< HAD, DEC >.initLumi(), L1NNTauProducer.L1NNTauProducer(), edm::VectorInputSource.loopOverEvents(), edm::VectorInputSource.loopSpecified(), trackMVAClassifierImpl::ComputeMVA< EventCache >.operator()(), ClusterShapeTrackFilterProducer.produce(), HIPixelTrackFilterProducer.produce(), SiPixelDigiToRaw.produce(), edm::PtrVectorBase.PtrVectorBase(), edm::service::RandomNumberGeneratorService.readEngineState(), edm::service::RandomNumberGeneratorService.readEventStatesFromTextFile(), edm::service::RandomNumberGeneratorService.readLumiStatesFromTextFile(), edm::RootEmbeddedFileSequence.readOneEvent(), edm::EmbeddedRootSource.readOneEvent(), edm::RootEmbeddedFileSequence.readOneRandom(), edm::RootEmbeddedFileSequence.readOneRandomWithID(), edm::RootEmbeddedFileSequence.readOneSequential(), edm::RootEmbeddedFileSequence.readOneSequentialWithID(), edm::RootEmbeddedFileSequence.readOneSpecified(), edm::EmbeddedRootSource.readOneSpecified(), edm::VectorInputSource.readOneSpecified(), edm::service::RandomNumberGeneratorService.readStatesFromFile(), edm::RepeatingCachedRootSource.RepeatingCachedRootSource(), edm::service::RandomNumberGeneratorService.restoreFromCache(), ConvBremPFTrackFinder.runConvBremFinder(), edm::service::RandomNumberGeneratorService.snapShot(), ExternalGeneratorFilter.streamBeginLuminosityBlock(), edm::ConcurrentGeneratorFilter< HAD, DEC >.streamEndLuminosityBlockSummary(), edm::ConcurrentHadronizerFilter< HAD, DEC >.streamEndRun(), edm::ConcurrentGeneratorFilter< HAD, DEC >.streamEndRun(), TauNNId.TauNNId(), and edm::refcoreimpl.tryToSetCacheItemForFirstTime().

3 def cache(function):
4  cache = {}
5  def newfunction(*args, **kwargs):
6  try:
7  return cache[args, tuple(sorted(kwargs.iteritems()))]
8  except TypeError:
9  print(args, tuple(sorted(kwargs.iteritems())))
10  raise
11  except KeyError:
12  cache[args, tuple(sorted(kwargs.iteritems()))] = function(*args, **kwargs)
13  return newfunction(*args, **kwargs)
14  newfunction.__name__ = function.__name__
15  return newfunction
16 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def cache(function)
Definition: utilities.py:3