CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
PhysicsTools::Calibration::MVAComputerContainer Class Reference

#include <MVAComputer.h>

Public Types

typedef unsigned int CacheId
 
typedef std::pair< std::string, MVAComputerEntry
 

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 250 of file MVAComputer.h.

Member Typedef Documentation

◆ CacheId

Definition at line 262 of file MVAComputer.h.

◆ Entry

Definition at line 252 of file MVAComputer.h.

Constructor & Destructor Documentation

◆ MVAComputerContainer()

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

Definition at line 153 of file MVAComputer.cc.

◆ ~MVAComputerContainer()

virtual PhysicsTools::Calibration::MVAComputerContainer::~MVAComputerContainer ( )
inlinevirtual

Definition at line 255 of file MVAComputer.h.

255 {}

Member Function Documentation

◆ add()

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

Definition at line 155 of file MVAComputer.cc.

155  {
157 
158  entries.push_back(std::make_pair(label, MVAComputer()));
159  return entries.back().second;
160  }

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

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

◆ changed()

bool PhysicsTools::Calibration::MVAComputerContainer::changed ( CacheId  old) const
inline

Definition at line 264 of file MVAComputer.h.

264 { return old != cacheId; }

References cacheId.

Referenced by PhysicsTools::MVAComputerCache::update().

◆ contains()

bool PhysicsTools::Calibration::MVAComputerContainer::contains ( const std::string &  label) const
virtual

Definition at line 175 of file MVAComputer.cc.

175  {
176  std::vector<Entry>::const_iterator pos =
177  std::find_if(entries.begin(), entries.end(), [&label](const MVAComputerContainer::Entry &entry) {
178  return entry.first == label;
179  });
180  if (pos == entries.end())
181  return false;
182  return true;
183  }

References entries, mps_splice::entry, and label.

Referenced by LumiList.LumiList::__contains__().

◆ find()

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

Definition at line 162 of file MVAComputer.cc.

162  {
163  std::vector<Entry>::const_iterator pos =
164  std::find_if(entries.begin(), entries.end(), [&label](const MVAComputerContainer::Entry &entry) {
165  return entry.first == label;
166  });
167 
168  if (pos == entries.end())
169  throw cms::Exception("MVAComputerCalibration")
170  << "Calibration record " << label << " not found in MVAComputerContainer." << std::endl;
171 
172  return pos->second;
173  }

References entries, mps_splice::entry, and label.

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

◆ getCacheId()

CacheId PhysicsTools::Calibration::MVAComputerContainer::getCacheId ( ) const
inline

Definition at line 263 of file MVAComputer.h.

263 { return cacheId; }

References cacheId.

Referenced by PhysicsTools::MVAComputerCache::update().

◆ serialize()

template<class Archive >
void PhysicsTools::Calibration::MVAComputerContainer::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 271 of file MVAComputer.h.

◆ cond::serialization::access

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

Definition at line 271 of file MVAComputer.h.

Member Data Documentation

◆ cacheId

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

Definition at line 269 of file MVAComputer.h.

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

◆ entries

std::vector<Entry> PhysicsTools::Calibration::MVAComputerContainer::entries
private
PhysicsTools::Calibration::MVAComputerContainer::Entry
std::pair< std::string, MVAComputer > Entry
Definition: MVAComputer.h:252
PhysicsTools::Calibration::MVAComputerContainer::entries
std::vector< Entry > entries
Definition: MVAComputer.h:267
mps_splice.entry
entry
Definition: mps_splice.py:68
pos
Definition: PixelAliasList.h:18
PhysicsTools::Calibration::getNextMVAComputerContainerCacheId
static MVAComputerContainer::CacheId getNextMVAComputerContainerCacheId()
Definition: MVAComputer.cc:148
cms::Exception
Definition: Exception.h:70
PhysicsTools::Calibration::MVAComputerContainer::cacheId
CacheId cacheId
Definition: MVAComputer.h:269
label
const char * label
Definition: PFTauDecayModeTools.cc:11