CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes | Friends
PhysicsTools::TrainerMonitoring Class Reference

#include <TrainerMonitoring.h>

Classes

class  Module
 
class  Object
 
class  RootObject
 

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
 

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.

33 {
34  ROOTContextSentinel ctx;
35 
36  rootFile.reset(TFile::Open(fileName.c_str(), "RECREATE"));
37 }
std::auto_ptr< TFile > rootFile
PhysicsTools::TrainerMonitoring::~TrainerMonitoring ( )

Definition at line 39 of file TrainerMonitoring.cc.

40 {
41 }

Member Function Documentation

TrainerMonitoring::Module * PhysicsTools::TrainerMonitoring::book ( const std::string &  name)

Definition at line 82 of file TrainerMonitoring.cc.

References python.rootplot.argparse::module, and modules.

83 {
84  boost::shared_ptr<Module> module(new Module);
85  if (!modules.insert(std::make_pair(name, module)).second)
86  throw cms::Exception("DuplicateModule")
87  << "Module \"" << name << "\" already"
88  " exists." << std::endl;
89 
90  return module.get();
91 }
std::map< std::string, boost::shared_ptr< Module > > modules
Definition: vlib.h:208
void PhysicsTools::TrainerMonitoring::close ( )
void PhysicsTools::TrainerMonitoring::write ( )

Definition at line 43 of file TrainerMonitoring.cc.

References dir, modules, and rootFile.

44 {
45  ROOTContextSentinel ctx;
46 
47  typedef std::map<std::string, boost::shared_ptr<Module> > Map;
48  for(Map::const_iterator iter = modules.begin();
49  iter != modules.end(); ++iter) {
50  rootFile->cd();
51  TDirectory *dir = rootFile->mkdir(iter->first.c_str());
52  dir->cd();
53  iter->second->write(dir);
54  }
55 }
std::map< std::string, boost::shared_ptr< Module > > modules
std::auto_ptr< TFile > rootFile
dbl *** dir
Definition: mlp_gen.cc:35

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