test
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 
11 
12 namespace PhysicsTools {
13 
15  public:
17 
18  virtual const Calibration::MVAComputer &
19  find(const std::string &label) const
20  {
21  Map_t::const_iterator pos = trainCalibs.find(label);
22  if (pos != trainCalibs.end())
23  return *pos->second.get();
24 
26  }
27 
28  virtual bool
29  contains(const std::string &label) const
30  {
31  Map_t::const_iterator pos = trainCalibs.find(label);
32  if (pos != trainCalibs.end()) return true;
34  }
35 
36  void addTrainer(const std::string &label, const Value_t &calibration)
37  { trainCalibs[label] = calibration; }
38 
39  private:
40  typedef std::map<std::string, Value_t> Map_t;
41 
43 };
44 
45 } // namespace PhysicsTools
46 
47 #endif // PhysicsTools_MVATrainer_MVATrainerContainer_h
virtual const MVAComputer & find(const std::string &label) const
Definition: MVAComputer.cc:222
virtual bool contains(const std::string &label) const
virtual const Calibration::MVAComputer & find(const std::string &label) const
virtual bool contains(const std::string &label) const
Definition: MVAComputer.cc:236
void addTrainer(const std::string &label, const Value_t &calibration)
MVATrainerLooper::TrainObject Value_t
std::shared_ptr< Calibration::MVAComputer > TrainObject
std::map< std::string, Value_t > Map_t