#include <PhysicsTools/MVATrainer/interface/TrainerMonitoring.h>
Public Member Functions | |
Module * | book (const std::string &name) |
void | close () |
TrainerMonitoring (const std::string &fileName) | |
void | write () |
~TrainerMonitoring () | |
Private Attributes | |
std::map< std::string, boost::shared_ptr< Module > > | modules |
std::auto_ptr< TFile > | rootFile |
Friends | |
class | Module |
Classes | |
class | Module |
class | Object |
class | RootObject |
Definition at line 22 of file TrainerMonitoring.h.
PhysicsTools::TrainerMonitoring::TrainerMonitoring | ( | const std::string & | fileName | ) |
Definition at line 32 of file TrainerMonitoring.cc.
References rootFile.
00033 { 00034 ROOTContextSentinel ctx; 00035 00036 rootFile.reset(TFile::Open(fileName.c_str(), "RECREATE")); 00037 }
PhysicsTools::TrainerMonitoring::~TrainerMonitoring | ( | ) |
TrainerMonitoring::Module * PhysicsTools::TrainerMonitoring::book | ( | const std::string & | name | ) |
Definition at line 82 of file TrainerMonitoring.cc.
References lat::endl(), module(), and modules.
00083 { 00084 boost::shared_ptr<Module> module(new Module); 00085 if (!modules.insert(std::make_pair(name, module)).second) 00086 throw cms::Exception("DuplicateModule") 00087 << "Module \"" << name << "\" already" 00088 " exists." << std::endl; 00089 00090 return module.get(); 00091 }
void PhysicsTools::TrainerMonitoring::close | ( | ) |
Definition at line 43 of file TrainerMonitoring.cc.
References dir, iter, modules, and rootFile.
00044 { 00045 ROOTContextSentinel ctx; 00046 00047 typedef std::map<std::string, boost::shared_ptr<Module> > Map; 00048 for(Map::const_iterator iter = modules.begin(); 00049 iter != modules.end(); ++iter) { 00050 rootFile->cd(); 00051 TDirectory *dir = rootFile->mkdir(iter->first.c_str()); 00052 dir->cd(); 00053 iter->second->write(dir); 00054 } 00055 }
friend class Module [friend] |
Definition at line 31 of file TrainerMonitoring.h.
std::map<std::string, boost::shared_ptr<Module> > PhysicsTools::TrainerMonitoring::modules [private] |
std::auto_ptr<TFile> PhysicsTools::TrainerMonitoring::rootFile [private] |