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.

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

References edm.print().

Referenced by EcalHitResponse.analogSignalAmplitude(), SiStripLAProfileBooker.analyze(), edm::ConcurrentHadronizerFilter< HAD, DEC >.beginStream(), ExternalGeneratorFilter.beginStream(), BoostedJetMXNetJetTagsProducer.BoostedJetMXNetJetTagsProducer(), edm::VectorInputSource.clearEventPrincipal(), DeepVertexTFJetTagsProducer.DeepVertexTFJetTagsProducer(), edm::ConcurrentHadronizerFilter< HAD, DEC >.filter(), ConvBremPFTrackFinder.foundConvBremPFRecTrack(), DTCalibrationMap.getConsts(), edm::RootTree.getEntry(), cms::cuda.getEventCache(), cms::cuda.getStreamCache(), DeepMETProducer.globalEndJob(), L1NNTauProducer.globalEndJob(), TrackstersMergeProducer.globalEndJob(), TrackstersProducer.globalEndJob(), DeepVertexTFJetTagsProducer.globalEndJob(), BoostedJetMXNetJetTagsProducer.globalEndJob(), RectangularEtaPhiTrackingRegion.hits(), CosmicTrackingRegion.hits_(), DeepMETProducer.initializeGlobalCache(), L1NNTauProducer.initializeGlobalCache(), TrackstersMergeProducer.initializeGlobalCache(), TrackstersProducer.initializeGlobalCache(), DeepVertexTFJetTagsProducer.initializeGlobalCache(), BoostedJetMXNetJetTagsProducer.initializeGlobalCache(), edm::ConcurrentHadronizerFilter< HAD, DEC >.initLumi(), L1NNTauProducer.L1NNTauProducer(), edm::VectorInputSource.loopOverEvents(), edm::VectorInputSource.loopSpecified(), trackMVAClassifierImpl::ComputeMVA< EventCache >.operator()(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >.operator()(), ticl::PatternRecognitionbyCA< TILES >.PatternRecognitionbyCA(), 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::service::RandomNumberGeneratorService.restoreFromCache(), ConvBremPFTrackFinder.runConvBremFinder(), ClusterShapeTrajectoryFilter.setEvent(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >.setEventSetup(), edm::service::RandomNumberGeneratorService.snapShot(), ExternalGeneratorFilter.streamBeginLuminosityBlock(), edm::ConcurrentHadronizerFilter< HAD, DEC >.streamEndRun(), TauNNId.TauNNId(), TrackstersMergeProducer.TrackstersMergeProducer(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >.train(), and edm::refcoreimpl.tryToSetCacheItemForFirstTime().

utilities.cache
def cache(function)
Definition: utilities.py:3
edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
function
Definition: vlib.h:246