CMS 3D CMS Logo

PhysicsTools::TrainerMonitoring Class Reference

#include <PhysicsTools/MVATrainer/interface/TrainerMonitoring.h>

List of all members.

Public Member Functions

Modulebook (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


Detailed Description

Definition at line 22 of file TrainerMonitoring.h.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 39 of file TrainerMonitoring.cc.

00040 {
00041 }


Member Function Documentation

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 (  ) 

void PhysicsTools::TrainerMonitoring::write ( void   ) 

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 }


Friends And Related Function Documentation

friend class Module [friend]

Definition at line 31 of file TrainerMonitoring.h.


Member Data Documentation

std::map<std::string, boost::shared_ptr<Module> > PhysicsTools::TrainerMonitoring::modules [private]

Definition at line 181 of file TrainerMonitoring.h.

Referenced by book(), and write().

std::auto_ptr<TFile> PhysicsTools::TrainerMonitoring::rootFile [private]

Definition at line 180 of file TrainerMonitoring.h.

Referenced by TrainerMonitoring(), and write().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:50:15 2009 for CMSSW by  doxygen 1.5.4