CMS 3D CMS Logo

MVATrainerSaveImpl.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_MVATrainer_MVATrainerSaveImpl_h
2 #define PhysicsTools_MVATrainer_MVATrainerSaveImpl_h
3 
4 #include <iostream>
5 #include <memory>
6 #include <vector>
7 #include <string>
8 
13 
15 
18 
19 namespace PhysicsTools {
20 
21 template<typename Record_t>
23  public:
24  explicit MVATrainerSaveImpl(const edm::ParameterSet &params) :
25  MVATrainerSave(params) {}
26 
27  protected:
29  getToPut(const edm::EventSetup& es) const override
30  {
32  es.get<Record_t>().get("trained", handle);
33  return handle.product();
34  }
35 
36  std::string getRecordName() const override
37  { return Record_t::keyForClass().type().name(); }
38 };
39 
40 template<typename Record_t>
42  public:
44  MVATrainerContainerSave(params) {}
45 
46  protected:
48  getToPut(const edm::EventSetup& es) const override
49  {
51  es.get<Record_t>().get("trained", handle);
52  return handle.product();
53  }
54 
56  getToCopy(const edm::EventSetup& es) const override
57  {
59  es.get<Record_t>().get(handle);
60  return handle.product();
61  }
62 
63  std::string getRecordName() const override
64  { return Record_t::keyForClass().type().name(); }
65 };
66 
67 } // namespace PhysicsTools
68 
69 #endif // PhysicsTools_MVATrainer_MVATrainerSaveImpl_h
MVATrainerSaveImpl(const edm::ParameterSet &params)
const Calibration::MVAComputerContainer * getToCopy(const edm::EventSetup &es) const override
const Calibration::MVAComputer * getToPut(const edm::EventSetup &es) const override
MVATrainerContainerSaveImpl(const edm::ParameterSet &params)
const Calibration::MVAComputerContainer * getToPut(const edm::EventSetup &es) const override
std::string getRecordName() const override
T get() const
Definition: EventSetup.h:68
std::string getRecordName() const override
T const * product() const
Definition: ESHandle.h:84