Creates and and MVAComputer from calibrations via EventSetup. More...
#include <MVAComputerCache.h>
Public Member Functions | |
MVAComputer * | get () |
const MVAComputer * | get () const |
MVAComputerCache () | |
operator bool () const | |
MVAComputer & | operator* () |
const MVAComputer & | operator* () const |
const MVAComputer * | operator-> () const |
MVAComputer * | operator-> () |
std::auto_ptr< MVAComputer > | release () |
void | reset () |
bool | update (const Calibration::MVAComputer *computer) |
template<class T > | |
bool | update (const char *label, const edm::EventSetup &es, const char *calib) |
template<class T > | |
bool | update (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) |
bool | update (const Calibration::MVAComputerContainer *container, const char *calib) |
~MVAComputerCache () | |
Private Attributes | |
std::auto_ptr< MVAComputer > | computer |
Calibration::MVAComputer::CacheId | computerCacheId |
Calibration::MVAComputerContainer::CacheId | containerCacheId |
Creates and and MVAComputer from calibrations via EventSetup.
Definition at line 29 of file MVAComputerCache.h.
PhysicsTools::MVAComputerCache::MVAComputerCache | ( | ) |
Definition at line 9 of file MVAComputerCache.cc.
PhysicsTools::MVAComputerCache::~MVAComputerCache | ( | ) |
Definition at line 15 of file MVAComputerCache.cc.
{ }
MVAComputer* PhysicsTools::MVAComputerCache::get | ( | void | ) | [inline] |
Definition at line 79 of file MVAComputerCache.h.
Referenced by reco::tau::RecoTauMVAHelper::setEvent().
{ return computer.get(); }
const MVAComputer* PhysicsTools::MVAComputerCache::get | ( | void | ) | const [inline] |
Definition at line 80 of file MVAComputerCache.h.
{ return computer.get(); }
PhysicsTools::MVAComputerCache::operator bool | ( | ) | const [inline] |
Definition at line 71 of file MVAComputerCache.h.
{ return computer.get(); }
MVAComputer& PhysicsTools::MVAComputerCache::operator* | ( | void | ) | [inline] |
const MVAComputer& PhysicsTools::MVAComputerCache::operator* | ( | void | ) | const [inline] |
MVAComputer* PhysicsTools::MVAComputerCache::operator-> | ( | ) | [inline] |
Definition at line 76 of file MVAComputerCache.h.
{ return computer.get(); }
const MVAComputer* PhysicsTools::MVAComputerCache::operator-> | ( | ) | const [inline] |
Definition at line 77 of file MVAComputerCache.h.
{ return computer.get(); }
std::auto_ptr< MVAComputer > PhysicsTools::MVAComputerCache::release | ( | ) |
Definition at line 62 of file MVAComputerCache.cc.
References computer, computerCacheId, and containerCacheId.
void PhysicsTools::MVAComputerCache::reset | ( | void | ) | [inline] |
Definition at line 84 of file MVAComputerCache.h.
{ computer.reset(); }
bool PhysicsTools::MVAComputerCache::update | ( | const edm::EventSetup & | es | ) | [inline] |
Definition at line 39 of file MVAComputerCache.h.
References edm::EventSetup::get(), patZpeak::handle, edm::ESHandle< T >::product(), and update().
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(), query::result, and update().
{ if (!container && !*this) return false; if (container && !container->changed(containerCacheId)) return false; if (container) { const Calibration::MVAComputer *computer = &container->find(calib); bool result = update(computer); containerCacheId = container->getCacheId(); return result; } this->computer.reset(); computerCacheId = Calibration::MVAComputer::CacheId(); containerCacheId = Calibration::MVAComputerContainer::CacheId(); return true; }
bool PhysicsTools::MVAComputerCache::update | ( | const char * | label, |
const edm::EventSetup & | es, | ||
const char * | calib | ||
) | [inline] |
Definition at line 63 of file MVAComputerCache.h.
References calib, edm::EventSetup::get(), patZpeak::handle, edm::ESHandle< T >::product(), and update().
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(), TtFullHadSignalSelMVATrainer::analyze(), TtSemiLepSignalSelMVAComputer::produce(), TtSemiLepJetCombMVAComputer::produce(), TtFullHadSignalSelMVAComputer::produce(), reco::tau::RecoTauMVAHelper::setEvent(), and update().
{ if (!computer && !*this) return false; if (computer && !computer->changed(computerCacheId)) return false; if (computer) { this->computer.reset(new MVAComputer(computer)); computerCacheId = computer->getCacheId(); } else { this->computer.reset(); computerCacheId = Calibration::MVAComputer::CacheId(); } containerCacheId = Calibration::MVAComputerContainer::CacheId(); return true; }
bool PhysicsTools::MVAComputerCache::update | ( | const edm::EventSetup & | es, |
const char * | calib | ||
) | [inline] |
Definition at line 47 of file MVAComputerCache.h.
References calib, edm::EventSetup::get(), patZpeak::handle, edm::ESHandle< T >::product(), and update().
bool PhysicsTools::MVAComputerCache::update | ( | const char * | label, |
const edm::EventSetup & | es | ||
) | [inline] |
Definition at line 55 of file MVAComputerCache.h.
References edm::EventSetup::get(), patZpeak::handle, edm::ESHandle< T >::product(), and update().
std::auto_ptr<MVAComputer> PhysicsTools::MVAComputerCache::computer [private] |
Definition at line 89 of file MVAComputerCache.h.
Referenced by PFTauMVADiscriminator::discriminate(), operator*(), release(), and update().
Definition at line 88 of file MVAComputerCache.h.
Calibration::MVAComputerContainer::CacheId PhysicsTools::MVAComputerCache::containerCacheId [private] |
Definition at line 87 of file MVAComputerCache.h.