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 HiBiasedCentrality_cfi.function, and print().

Referenced by EcalHitResponse.analogSignalAmplitude(), SiStripLAProfileBooker.analyze(), edm::ConcurrentHadronizerFilter< HAD, DEC >.beginStream(), ExternalGeneratorFilter.beginStream(), edm::VectorInputSource.clearEventPrincipal(), edm::ConcurrentHadronizerFilter< HAD, DEC >.filter(), ConvBremPFTrackFinder.foundConvBremPFRecTrack(), DTCalibrationMap.getConsts(), edm::RootTree.getEntry(), cms::cuda.getEventCache(), cms::cuda.getStreamCache(), DeepMETProducer.globalEndJob(), TrackstersMergeProducer.globalEndJob(), TrackstersProducer.globalEndJob(), RectangularEtaPhiTrackingRegion.hits(), CosmicTrackingRegion.hits_(), DeepMETProducer.initializeGlobalCache(), TrackstersMergeProducer.initializeGlobalCache(), TrackstersProducer.initializeGlobalCache(), edm::ConcurrentHadronizerFilter< HAD, DEC >.initLumi(), 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(), TrackstersMergeProducer.TrackstersMergeProducer(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >.train(), and edm::refcoreimpl.tryToSetCacheItemForFirstTime().

utilities.cache
def cache(function)
Definition: utilities.py:3
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
HiBiasedCentrality_cfi.function
function
Definition: HiBiasedCentrality_cfi.py:4