#include <PhysicsTools/MVAComputer/interface/MVAComputerCache.h>
Public Member Functions | |
const MVAComputer * | get () const |
MVAComputer * | get () |
MVAComputerCache () | |
const MVAComputer & | operator * () const |
MVAComputer & | operator * () |
operator bool () const | |
const MVAComputer * | operator-> () const |
MVAComputer * | operator-> () |
std::auto_ptr< MVAComputer > | release () |
void | reset () |
template<class T> | |
bool | update (const char *label, const edm::EventSetup &es, const char *calib) |
template<class T> | |
bool | update (const char *label, const edm::EventSetup &es) |
template<class T> | |
bool | update (const edm::EventSetup &es, const char *calib) |
template<class T> | |
bool | update (const edm::EventSetup &es) |
bool | update (const Calibration::MVAComputerContainer *container, const char *calib) |
bool | update (const Calibration::MVAComputer *computer) |
~MVAComputerCache () | |
Private Attributes | |
std::auto_ptr< MVAComputer > | computer |
Calibration::MVAComputer::CacheId | computerCacheId |
Calibration::MVAComputerContainer::CacheId | containerCacheId |
Definition at line 29 of file MVAComputerCache.h.
PhysicsTools::MVAComputerCache::MVAComputerCache | ( | ) |
Definition at line 9 of file MVAComputerCache.cc.
00009 : 00010 containerCacheId(Calibration::MVAComputerContainer::CacheId()), 00011 computerCacheId(Calibration::MVAComputer::CacheId()) 00012 { 00013 }
PhysicsTools::MVAComputerCache::~MVAComputerCache | ( | ) |
const MVAComputer* PhysicsTools::MVAComputerCache::get | ( | void | ) | const [inline] |
MVAComputer* PhysicsTools::MVAComputerCache::get | ( | void | ) | [inline] |
const MVAComputer& PhysicsTools::MVAComputerCache::operator * | ( | void | ) | const [inline] |
MVAComputer& PhysicsTools::MVAComputerCache::operator * | ( | void | ) | [inline] |
const MVAComputer* PhysicsTools::MVAComputerCache::operator-> | ( | void | ) | const [inline] |
MVAComputer* PhysicsTools::MVAComputerCache::operator-> | ( | void | ) | [inline] |
std::auto_ptr< MVAComputer > PhysicsTools::MVAComputerCache::release | ( | void | ) |
Definition at line 62 of file MVAComputerCache.cc.
References computer, computerCacheId, and containerCacheId.
00063 { 00064 computerCacheId = Calibration::MVAComputer::CacheId(); 00065 containerCacheId = Calibration::MVAComputerContainer::CacheId(); 00066 return computer; 00067 }
bool PhysicsTools::MVAComputerCache::update | ( | const char * | label, | |
const edm::EventSetup & | es, | |||
const char * | calib | |||
) | [inline] |
Definition at line 63 of file MVAComputerCache.h.
References edm::EventSetup::get(), edm::ESHandle< T >::product(), and update().
00065 { 00066 edm::ESHandle<Calibration::MVAComputerContainer> handle; 00067 es.get<T>().get(label, handle); 00068 return update(handle.product(), calib); 00069 }
bool PhysicsTools::MVAComputerCache::update | ( | const char * | label, | |
const edm::EventSetup & | es | |||
) | [inline] |
Definition at line 55 of file MVAComputerCache.h.
References edm::EventSetup::get(), edm::ESHandle< T >::product(), and update().
00056 { 00057 edm::ESHandle<Calibration::MVAComputer> handle; 00058 es.get<T>().get(label, handle); 00059 return update(handle.product()); 00060 }
bool PhysicsTools::MVAComputerCache::update | ( | const edm::EventSetup & | es, | |
const char * | calib | |||
) | [inline] |
Definition at line 47 of file MVAComputerCache.h.
References edm::EventSetup::get(), edm::ESHandle< T >::product(), and update().
00048 { 00049 edm::ESHandle<Calibration::MVAComputerContainer> handle; 00050 es.get<T>().get(handle); 00051 return update(handle.product(), calib); 00052 }
bool PhysicsTools::MVAComputerCache::update | ( | const edm::EventSetup & | es | ) | [inline] |
Definition at line 39 of file MVAComputerCache.h.
References edm::EventSetup::get(), edm::ESHandle< T >::product(), and update().
00040 { 00041 edm::ESHandle<Calibration::MVAComputer> handle; 00042 es.get<T>().get(handle); 00043 return update(handle.product()); 00044 }
bool PhysicsTools::MVAComputerCache::update | ( | const Calibration::MVAComputerContainer * | container, | |
const char * | calib | |||
) |
Definition at line 38 of file MVAComputerCache.cc.
References PhysicsTools::Calibration::MVAComputerContainer::changed(), computer, computerCacheId, containerCacheId, PhysicsTools::Calibration::MVAComputerContainer::find(), PhysicsTools::Calibration::MVAComputerContainer::getCacheId(), HLT_VtxMuL3::result, and update().
00041 { 00042 if (!container && !*this) 00043 return false; 00044 if (container && !container->changed(containerCacheId)) 00045 return false; 00046 00047 if (container) { 00048 const Calibration::MVAComputer *computer = 00049 &container->find(calib); 00050 bool result = update(computer); 00051 containerCacheId = container->getCacheId(); 00052 return result; 00053 } 00054 00055 this->computer.reset(); 00056 00057 computerCacheId = Calibration::MVAComputer::CacheId(); 00058 containerCacheId = Calibration::MVAComputerContainer::CacheId(); 00059 return true; 00060 }
bool PhysicsTools::MVAComputerCache::update | ( | const Calibration::MVAComputer * | computer | ) |
Definition at line 19 of file MVAComputerCache.cc.
References PhysicsTools::Calibration::MVAComputer::changed(), computerCacheId, containerCacheId, and PhysicsTools::Calibration::MVAComputer::getCacheId().
Referenced by TtSemiLepSignalSelMVATrainer::analyze(), TtSemiLepJetCombMVATrainer::analyze(), TtSemiLepSignalSelMVAComputer::produce(), TtSemiLepJetCombMVAComputer::produce(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >::setEventSetup(), and update().
00020 { 00021 if (!computer && !*this) 00022 return false; 00023 if (computer && !computer->changed(computerCacheId)) 00024 return false; 00025 00026 if (computer) { 00027 this->computer.reset(new MVAComputer(computer)); 00028 computerCacheId = computer->getCacheId(); 00029 } else { 00030 this->computer.reset(); 00031 computerCacheId = Calibration::MVAComputer::CacheId(); 00032 } 00033 00034 containerCacheId = Calibration::MVAComputerContainer::CacheId(); 00035 return true; 00036 }
std::auto_ptr<MVAComputer> PhysicsTools::MVAComputerCache::computer [private] |