test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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:
28  virtual const Calibration::MVAComputer *
29  getToPut(const edm::EventSetup& es) const
30  {
32  es.get<Record_t>().get("trained", handle);
33  return handle.product();
34  }
35 
36  virtual std::string getRecordName() const
37  { return Record_t::keyForClass().type().name(); }
38 };
39 
40 template<typename Record_t>
42  public:
44  MVATrainerContainerSave(params) {}
45 
46  protected:
47  virtual const Calibration::MVAComputerContainer *
48  getToPut(const edm::EventSetup& es) const
49  {
51  es.get<Record_t>().get("trained", handle);
52  return handle.product();
53  }
54 
55  virtual const Calibration::MVAComputerContainer *
56  getToCopy(const edm::EventSetup& es) const
57  {
59  es.get<Record_t>().get(handle);
60  return handle.product();
61  }
62 
63  virtual std::string getRecordName() const
64  { return Record_t::keyForClass().type().name(); }
65 };
66 
67 } // namespace PhysicsTools
68 
69 #endif // PhysicsTools_MVATrainer_MVATrainerSaveImpl_h
MVATrainerSaveImpl(const edm::ParameterSet &params)
MVATrainerContainerSaveImpl(const edm::ParameterSet &params)
virtual const Calibration::MVAComputerContainer * getToPut(const edm::EventSetup &es) const
tuple handle
Definition: patZpeak.py:22
virtual const Calibration::MVAComputerContainer * getToCopy(const edm::EventSetup &es) const
virtual std::string getRecordName() const
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
virtual std::string getRecordName() const
virtual const Calibration::MVAComputer * getToPut(const edm::EventSetup &es) const