CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MVATrainerContainer.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_MVATrainer_MVATrainerContainer_h
2 #define PhysicsTools_MVATrainer_MVATrainerContainer_h
3 
4 #include <vector>
5 #include <string>
6 #include <memory>
7 
8 #include <boost/shared_ptr.hpp>
9 
13 
14 namespace PhysicsTools {
15 
17  public:
19 
20  virtual const Calibration::MVAComputer &
21  find(const std::string &label) const
22  {
23  Map_t::const_iterator pos = trainCalibs.find(label);
24  if (pos != trainCalibs.end())
25  return *pos->second.get();
26 
28  }
29 
30  virtual bool
31  contains(const std::string &label) const
32  {
33  Map_t::const_iterator pos = trainCalibs.find(label);
34  if (pos != trainCalibs.end()) return true;
36  }
37 
38  void addTrainer(const std::string &label, const Value_t &calibration)
39  { trainCalibs[label] = calibration; }
40 
41  private:
42  typedef std::map<std::string, Value_t> Map_t;
43 
45 };
46 
47 } // namespace PhysicsTools
48 
49 #endif // PhysicsTools_MVATrainer_MVATrainerContainer_h
virtual const MVAComputer & find(const std::string &label) const
Definition: MVAComputer.cc:192
virtual bool contains(const std::string &label) const
virtual const Calibration::MVAComputer & find(const std::string &label) const
boost::shared_ptr< Calibration::MVAComputer > TrainObject
virtual bool contains(const std::string &label) const
Definition: MVAComputer.cc:206
void addTrainer(const std::string &label, const Value_t &calibration)
MVATrainerLooper::TrainObject Value_t
std::map< std::string, Value_t > Map_t