CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::auto_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::auto_ptr< MVAComputercomputer
 
Calibration::MVAComputer::CacheId computerCacheId
 
Calibration::MVAComputerContainer::CacheId containerCacheId
 

Detailed Description

Creates and and MVAComputer from calibrations via EventSetup.

Definition at line 29 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 ( void  )
inline
const MVAComputer* PhysicsTools::MVAComputerCache::get ( void  ) const
inline
PhysicsTools::MVAComputerCache::operator bool ( ) const
inline

Definition at line 71 of file MVAComputerCache.h.

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

Definition at line 73 of file MVAComputerCache.h.

References computer.

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

Definition at line 74 of file MVAComputerCache.h.

References computer.

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

Definition at line 76 of file MVAComputerCache.h.

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

Definition at line 77 of file MVAComputerCache.h.

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

Definition at line 62 of file MVAComputerCache.cc.

References computer, computerCacheId, and containerCacheId.

63 {
66  return computer;
67 }
Calibration::MVAComputer::CacheId computerCacheId
Calibration::MVAComputerContainer::CacheId containerCacheId
std::auto_ptr< MVAComputer > computer
void PhysicsTools::MVAComputerCache::reset ( void  )
inline

Definition at line 84 of file MVAComputerCache.h.

84 { computer.reset(); }
std::auto_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__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), TtSemiLepJetCombMVATrainer::analyze(), TtFullHadSignalSelMVATrainer::analyze(), TtSemiLepSignalSelMVATrainer::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(), relval_steps.Steps::overwrite(), TtSemiLepJetCombMVAComputer::produce(), TtFullHadSignalSelMVAComputer::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(), reco::tau::RecoTauMVAHelper::setEvent(), 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::auto_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(), query::result, and update().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
tuple result
Definition: query.py:137
bool update(const Calibration::MVAComputer *computer)
std::auto_ptr< MVAComputer > computer
template<class T >
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< class >::product(), and update().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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().

40  {
42  es.get<T>().get(handle);
43  return update(handle.product());
44  }
tuple handle
Definition: patZpeak.py:22
bool update(const Calibration::MVAComputer *computer)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
long double T
template<class T >
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< class >::product(), and update().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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().

48  {
50  es.get<T>().get(handle);
51  return update(handle.product(), calib);
52  }
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
tuple handle
Definition: patZpeak.py:22
bool update(const Calibration::MVAComputer *computer)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
long double T
template<class T >
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< class >::product(), and update().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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().

56  {
58  es.get<T>().get(label, handle);
59  return update(handle.product());
60  }
tuple handle
Definition: patZpeak.py:22
bool update(const Calibration::MVAComputer *computer)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
long double T
template<class T >
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< class >::product(), and update().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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().

65  {
67  es.get<T>().get(label, handle);
68  return update(handle.product(), calib);
69  }
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
tuple handle
Definition: patZpeak.py:22
bool update(const Calibration::MVAComputer *computer)
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
long double T

Member Data Documentation

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

Definition at line 89 of file MVAComputerCache.h.

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

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

Definition at line 88 of file MVAComputerCache.h.

Referenced by release(), and update().

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

Definition at line 87 of file MVAComputerCache.h.

Referenced by release(), and update().