CMS 3D CMS Logo

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 
19  find(const std::string &label) const override
20  {
21  Map_t::const_iterator pos = trainCalibs.find(label);
22  if (pos != trainCalibs.end())
23  return *pos->second.get();
24 
26  }
27 
28  bool
29  contains(const std::string &label) const override
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 
42  Map_t trainCalibs;
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
const Calibration::MVAComputer & find(const std::string &label) const override
bool contains(const std::string &label) const override
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