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,
std::shared_ptr< Module > > 
modules
 
std::auto_ptr< TFile > rootFile
 

Friends

class Module
 

Detailed Description

Definition at line 21 of file TrainerMonitoring.h.

Constructor & Destructor Documentation

PhysicsTools::TrainerMonitoring::TrainerMonitoring ( const std::string &  fileName)

Definition at line 30 of file TrainerMonitoring.cc.

References rootFile.

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

Definition at line 37 of file TrainerMonitoring.cc.

38 {
39 }

Member Function Documentation

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

Definition at line 80 of file TrainerMonitoring.cc.

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

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

Definition at line 41 of file TrainerMonitoring.cc.

References dir, modules, and rootFile.

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

Friends And Related Function Documentation

friend class Module
friend

Definition at line 30 of file TrainerMonitoring.h.

Member Data Documentation

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

Definition at line 180 of file TrainerMonitoring.h.

Referenced by book(), and write().

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

Definition at line 179 of file TrainerMonitoring.h.

Referenced by TrainerMonitoring(), and write().