CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PhysicsTools::MVAComputerCache Class Reference

Creates and and MVAComputer from calibrations via EventSetup. More...

#include <MVAComputerCache.h>

Public Member Functions

MVAComputerget ()
 
const MVAComputerget () const
 
 MVAComputerCache ()
 
 operator bool () const
 
MVAComputeroperator* ()
 
const MVAComputeroperator* () const
 
MVAComputeroperator-> ()
 
const MVAComputeroperator-> () const
 
std::unique_ptr< MVAComputerrelease ()
 
void reset ()
 
bool update (const Calibration::MVAComputer *computer)
 
bool update (const Calibration::MVAComputerContainer *container, const char *calib)
 
template<class T >
bool update (const edm::EventSetup &es)
 
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 char *label, const edm::EventSetup &es, const char *calib)
 
 ~MVAComputerCache ()
 

Private Attributes

std::unique_ptr< MVAComputercomputer
 
Calibration::MVAComputer::CacheId computerCacheId
 
Calibration::MVAComputerContainer::CacheId containerCacheId
 

Detailed Description

Creates and and MVAComputer from calibrations via EventSetup.

Definition at line 28 of file MVAComputerCache.h.

Constructor & Destructor Documentation

PhysicsTools::MVAComputerCache::MVAComputerCache ( )

Definition at line 9 of file MVAComputerCache.cc.

PhysicsTools::MVAComputerCache::~MVAComputerCache ( )

Definition at line 15 of file MVAComputerCache.cc.

16 {
17 }

Member Function Documentation

MVAComputer* PhysicsTools::MVAComputerCache::get ( )
inline
const MVAComputer* PhysicsTools::MVAComputerCache::get ( ) const
inline
PhysicsTools::MVAComputerCache::operator bool ( ) const
inline

Definition at line 70 of file MVAComputerCache.h.

70 { return computer.get(); }
std::unique_ptr< MVAComputer > computer
MVAComputer& PhysicsTools::MVAComputerCache::operator* ( void  )
inline

Definition at line 72 of file MVAComputerCache.h.

References computer.

72 { return *computer; }
std::unique_ptr< MVAComputer > computer
const MVAComputer& PhysicsTools::MVAComputerCache::operator* ( void  ) const
inline

Definition at line 73 of file MVAComputerCache.h.

References computer.

73 { return *computer; }
std::unique_ptr< MVAComputer > computer
MVAComputer* PhysicsTools::MVAComputerCache::operator-> ( )
inline

Definition at line 75 of file MVAComputerCache.h.

75 { return computer.get(); }
std::unique_ptr< MVAComputer > computer
const MVAComputer* PhysicsTools::MVAComputerCache::operator-> ( ) const
inline

Definition at line 76 of file MVAComputerCache.h.

76 { return computer.get(); }
std::unique_ptr< MVAComputer > computer
std::unique_ptr< MVAComputer > PhysicsTools::MVAComputerCache::release ( )

Definition at line 62 of file MVAComputerCache.cc.

References computer, computerCacheId, containerCacheId, and eostools::move().

Referenced by get().

63 {
66  return std::move(computer);
67 }
Calibration::MVAComputer::CacheId computerCacheId
Calibration::MVAComputerContainer::CacheId containerCacheId
std::unique_ptr< MVAComputer > computer
def move(src, dest)
Definition: eostools.py:511
void PhysicsTools::MVAComputerCache::reset ( void  )
inline

Definition at line 83 of file MVAComputerCache.h.

83 { computer.reset(); }
std::unique_ptr< MVAComputer > computer
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 progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), TtFullHadSignalSelMVATrainer::analyze(), TtSemiLepSignalSelMVATrainer::analyze(), TtSemiLepJetCombMVATrainer::analyze(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), TtFullHadSignalSelMVAComputer::produce(), TtSemiLepJetCombMVAComputer::produce(), TtSemiLepSignalSelMVAComputer::produce(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), update(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

20 {
21  if (!computer && !*this)
22  return false;
23  if (computer && !computer->changed(computerCacheId))
24  return false;
25 
26  if (computer) {
27  this->computer.reset(new MVAComputer(computer));
28  computerCacheId = computer->getCacheId();
29  } else {
30  this->computer.reset();
32  }
33 
35  return true;
36 }
Calibration::MVAComputer::CacheId computerCacheId
Calibration::MVAComputerContainer::CacheId containerCacheId
std::unique_ptr< MVAComputer > computer
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(), mps_fire::result, and update().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

41 {
42  if (!container && !*this)
43  return false;
44  if (container && !container->changed(containerCacheId))
45  return false;
46 
47  if (container) {
48  const Calibration::MVAComputer *computer =
49  &container->find(calib);
50  bool result = update(computer);
51  containerCacheId = container->getCacheId();
52  return result;
53  }
54 
55  this->computer.reset();
56 
59  return true;
60 }
Calibration::MVAComputer::CacheId computerCacheId
Calibration::MVAComputerContainer::CacheId containerCacheId
std::unique_ptr< MVAComputer > computer
bool update(const Calibration::MVAComputer *computer)
template<class T >
bool PhysicsTools::MVAComputerCache::update ( const edm::EventSetup es)
inline

Definition at line 38 of file MVAComputerCache.h.

References edm::EventSetup::get(), cmsBatch::handle, edm::ESHandle< T >::product(), and update().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

39  {
41  es.get<T>().get(handle);
42  return update(handle.product());
43  }
bool update(const Calibration::MVAComputer *computer)
T get() const
Definition: EventSetup.h:71
long double T
T const * product() const
Definition: ESHandle.h:86
template<class T >
bool PhysicsTools::MVAComputerCache::update ( const edm::EventSetup es,
const char *  calib 
)
inline

Definition at line 46 of file MVAComputerCache.h.

References calib, edm::EventSetup::get(), cmsBatch::handle, edm::ESHandle< T >::product(), and update().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

47  {
49  es.get<T>().get(handle);
50  return update(handle.product(), calib);
51  }
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
bool update(const Calibration::MVAComputer *computer)
T get() const
Definition: EventSetup.h:71
long double T
T const * product() const
Definition: ESHandle.h:86
template<class T >
bool PhysicsTools::MVAComputerCache::update ( const char *  label,
const edm::EventSetup es 
)
inline

Definition at line 54 of file MVAComputerCache.h.

References edm::EventSetup::get(), cmsBatch::handle, edm::ESHandle< T >::product(), and update().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

55  {
57  es.get<T>().get(label, handle);
58  return update(handle.product());
59  }
char const * label
bool update(const Calibration::MVAComputer *computer)
T get() const
Definition: EventSetup.h:71
long double T
T const * product() const
Definition: ESHandle.h:86
template<class T >
bool PhysicsTools::MVAComputerCache::update ( const char *  label,
const edm::EventSetup es,
const char *  calib 
)
inline

Definition at line 62 of file MVAComputerCache.h.

References calib, edm::EventSetup::get(), cmsBatch::handle, edm::ESHandle< T >::product(), and update().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

64  {
66  es.get<T>().get(label, handle);
67  return update(handle.product(), calib);
68  }
char const * label
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
bool update(const Calibration::MVAComputer *computer)
T get() const
Definition: EventSetup.h:71
long double T
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

std::unique_ptr<MVAComputer> PhysicsTools::MVAComputerCache::computer
private

Definition at line 88 of file MVAComputerCache.h.

Referenced by operator*(), release(), and update().

Calibration::MVAComputer::CacheId PhysicsTools::MVAComputerCache::computerCacheId
private

Definition at line 87 of file MVAComputerCache.h.

Referenced by release(), and update().

Calibration::MVAComputerContainer::CacheId PhysicsTools::MVAComputerCache::containerCacheId
private

Definition at line 86 of file MVAComputerCache.h.

Referenced by release(), and update().