CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
PhysicsTools::Calibration::MVAComputerContainer Class Reference

#include <MVAComputer.h>

Inheritance diagram for PhysicsTools::Calibration::MVAComputerContainer:
PhysicsTools::MVATrainerContainer PhysicsTools::MVATrainerLooper::UntrainedMVAComputerContainer

Public Types

typedef unsigned int CacheId
 
typedef std::pair< std::string,
MVAComputer
Entry
 

Public Member Functions

MVAComputeradd (const std::string &label)
 
bool changed (CacheId old) const
 
virtual bool contains (const std::string &label) const
 
virtual const MVAComputerfind (const std::string &label) const
 
CacheId getCacheId () const
 
 MVAComputerContainer ()
 
virtual ~MVAComputerContainer ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

CacheId cacheId
 
std::vector< Entryentries
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 230 of file MVAComputer.h.

Member Typedef Documentation

Definition at line 242 of file MVAComputer.h.

Definition at line 232 of file MVAComputer.h.

Constructor & Destructor Documentation

PhysicsTools::Calibration::MVAComputerContainer::MVAComputerContainer ( )

Definition at line 165 of file MVAComputer.cc.

165  :
167 {
168 }
static MVAComputerContainer::CacheId getNextMVAComputerContainerCacheId()
Definition: MVAComputer.cc:159
virtual PhysicsTools::Calibration::MVAComputerContainer::~MVAComputerContainer ( )
inlinevirtual

Definition at line 235 of file MVAComputer.h.

235 {}

Member Function Documentation

MVAComputer & PhysicsTools::Calibration::MVAComputerContainer::add ( const std::string &  label)

Definition at line 170 of file MVAComputer.cc.

References cacheId, entries, and PhysicsTools::Calibration::getNextMVAComputerContainerCacheId().

171 {
173 
174  entries.push_back(std::make_pair(label, MVAComputer()));
175  return entries.back().second;
176 }
static MVAComputerContainer::CacheId getNextMVAComputerContainerCacheId()
Definition: MVAComputer.cc:159
bool PhysicsTools::Calibration::MVAComputerContainer::changed ( CacheId  old) const
inline

Definition at line 244 of file MVAComputer.h.

References cacheId.

Referenced by GenericMVAComputerCache::update(), and PhysicsTools::MVAComputerCache::update().

244 { return old != cacheId; }
bool PhysicsTools::Calibration::MVAComputerContainer::contains ( const std::string &  label) const
virtual

Reimplemented in PhysicsTools::MVATrainerContainer.

Definition at line 206 of file MVAComputer.cc.

References entries.

Referenced by LumiList.LumiList::__contains__(), PhysicsTools::MVATrainerContainer::contains(), and GenericMVAComputerCache::update().

207 {
208  std::vector<Entry>::const_iterator pos =
209  std::find_if(entries.begin(), entries.end(),
210  Comparator(label));
211  if (pos == entries.end()) return false;
212  return true;
213 }
const MVAComputer & PhysicsTools::Calibration::MVAComputerContainer::find ( const std::string &  label) const
virtual

Reimplemented in PhysicsTools::MVATrainerContainer.

Definition at line 192 of file MVAComputer.cc.

References entries.

Referenced by BeautifulSoup.Tag::__getattr__(), PhysicsTools::MVATrainerContainerSave::analyze(), PhysicsTools::MVATrainerContainer::find(), BeautifulSoup.Tag::firstText(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >::init(), GenericMVAComputerCache::update(), and PhysicsTools::MVAComputerCache::update().

193 {
194  std::vector<Entry>::const_iterator pos =
195  std::find_if(entries.begin(), entries.end(),
196  Comparator(label));
197 
198  if (pos == entries.end())
199  throw cms::Exception("MVAComputerCalibration")
200  << "Calibration record " << label
201  << " not found in MVAComputerContainer." << std::endl;
202 
203  return pos->second;
204 }
CacheId PhysicsTools::Calibration::MVAComputerContainer::getCacheId ( ) const
inline
template<class Archive >
void PhysicsTools::Calibration::MVAComputerContainer::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 251 of file MVAComputer.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 251 of file MVAComputer.h.

Member Data Documentation

CacheId PhysicsTools::Calibration::MVAComputerContainer::cacheId
private

Definition at line 249 of file MVAComputer.h.

Referenced by add(), changed(), and getCacheId().

std::vector<Entry> PhysicsTools::Calibration::MVAComputerContainer::entries
private