00001 #ifndef PhysicsTools_MVATrainer_MVATrainerFileSave_h 00002 #define PhysicsTools_MVATrainer_MVATrainerFileSave_h 00003 00004 #include <memory> 00005 #include <vector> 00006 #include <string> 00007 00008 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00009 #include "FWCore/Framework/interface/Event.h" 00010 #include "FWCore/Framework/interface/EventSetup.h" 00011 #include "FWCore/Framework/interface/EDAnalyzer.h" 00012 00013 #include "CondFormats/PhysicsToolsObjects/interface/MVAComputer.h" 00014 00015 namespace PhysicsTools { 00016 00017 class MVATrainerFileSave : public edm::EDAnalyzer { 00018 public: 00019 explicit MVATrainerFileSave(const edm::ParameterSet ¶ms); 00020 00021 virtual void analyze(const edm::Event& iEvent, 00022 const edm::EventSetup& iSetup); 00023 00024 virtual void endJob(); 00025 00026 protected: 00027 virtual const Calibration::MVAComputerContainer * 00028 getToPut(const edm::EventSetup& es) const = 0; 00029 00030 bool trained; 00031 00032 private: 00033 typedef std::map<std::string, std::string> LabelFileMap; 00034 00035 LabelFileMap toPut; 00036 std::auto_ptr<Calibration::MVAComputerContainer> calib; 00037 bool saved; 00038 }; 00039 00040 } // namespace PhysicsTools 00041 00042 #endif // PhysicsTools_MVATrainer_MVATrainerFileSave_h