Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RootController Class Reference

#include <LdfController.h>

Collaboration diagram for RootController:

Collaboration graph
[legend]
List of all members.

Detailed Description

A Controller class for ROOT files.

Bug:
@@ When changing DataSource for plot that is using a array from a column, the variable does not get expanded in the new DataSource.

Requests:
Read TH1 and TH2 histograms in ROOT file and convert to corresponding static histograms.

Author:
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Definition at line 39 of file LdfController.h.

Public Member Functions

DataSourcecreateNTuple (const std::string &filename, const std::string &treename)
 Creates a RootNTuple from the file filename and TTree named treename.
DataSourcecreateNTuple (const std::string &name)
DataSourcecreateNTuple (const std::string &filename, const std::string &treename)
 Creates a RootNTuple from the file filename and TTree named treename.
DataSourcecreateNTuple (const std::string &name)
void fillDimSize (std::vector< int > &dims, const DataSource *source, const std::string &column)
 Fills the vector dims.
void fillDimSize (std::vector< int > &dims, const DataSource *source, const std::string &column)
 Fills the vector dims.
const std::vector< std::string > & getNTupleNames (const std::string &)
 Returns the names of the NTuple objects contained in the file name.
const std::vector< std::string > & getNTupleNames (const std::string &)
 Returns the names of the NTuple objects contained in the file name.
TTreegetTree (const std::string &file, const std::string &tree)
 Returns the named tree from file in the ROOT file.
TTreegetTree (const std::string &file, const std::string &tree)
 Returns the named tree from file in the ROOT file.
bool smartExpandRootNTuple (DataSource *source, std::string &column)
 Expands the array column.
bool smartExpandRootNTuple (DataSource *source, std::string &column)
 Expands the array column.
const std::stringversion () const
 Returns the version of ROOT being used.
const std::stringversion () const
 Returns the version of ROOT being used.
virtual ~RootController ()
 The destructor.
virtual ~RootController ()
 The destructor.

Static Public Member Functions

static RootControllerinstance ()
 Returns the singleton instance of the RootController.
static RootControllerinstance ()
 Returns the singleton instance of the RootController.

Private Member Functions

void closeFile (const std::string &name)
 Closed the named file, if found in list of opened files.
void closeFile (const std::string &name)
 Closed the named file, if found in list of opened files.
TFile * openFile (const std::string &name)
 Opens the named file, if not already opened.
TFile * openFile (const std::string &name)
 Opens the named file, if not already opened.

Private Attributes

std::map< std::string, TFile * > m_file_map
 The list of opened ROOT files.
std::vector< std::stringm_ntuple_names
 Temporary list of NTuple names in the file.
std::string m_version
 The version of ROOT being used.

Static Private Attributes

static RootControllers_instance
 The singleton instance of the RootController.
static RootControllers_instance = 0
 The singleton instance of the RootController.


Constructor & Destructor Documentation

RootController::~RootController  )  [virtual]
 

The destructor.

Definition at line 48 of file LdfController.cxx.

virtual RootController::~RootController  )  [virtual]
 

The destructor.


Member Function Documentation

void RootController::closeFile const std::string name  )  [private]
 

Closed the named file, if found in list of opened files.

void RootController::closeFile const std::string name  )  [private]
 

Closed the named file, if found in list of opened files.

Definition at line 87 of file LdfController.cxx.

References m_file_map.

DataSource* RootController::createNTuple const std::string filename,
const std::string treename
 

Creates a RootNTuple from the file filename and TTree named treename.

DataSource* RootController::createNTuple const std::string name  ) 
 

DataSource * RootController::createNTuple const std::string filename,
const std::string treename
 

Creates a RootNTuple from the file filename and TTree named treename.

Definition at line 137 of file LdfController.cxx.

References getTree(), and DataSourceController::instance().

DataSource * RootController::createNTuple const std::string name  ) 
 

Definition at line 161 of file LdfController.cxx.

References getNTupleNames().

void RootController::fillDimSize std::vector< int > &  dims,
const DataSource source,
const std::string column
 

Fills the vector dims.

If the DataSource is a RootNTuple, fills the vector dim with the dimension of he column labeled column, otherwise does nothing.

void RootController::fillDimSize std::vector< int > &  dims,
const DataSource source,
const std::string column
 

Fills the vector dims.

If the DataSource is a RootNTuple, fills the vector dim with the dimension of he column labeled column, otherwise does nothing.

Definition at line 183 of file LdfController.cxx.

const std::vector< std::string >& RootController::getNTupleNames const std::string  ) 
 

Returns the names of the NTuple objects contained in the file name.

Bug:
Returns all top level names instead of only the ones that could be an NTuple.

const vector< string > & RootController::getNTupleNames const std::string  ) 
 

Returns the names of the NTuple objects contained in the file name.

Bug:
Returns all top level names instead of only the ones that could be an NTuple.

Definition at line 99 of file LdfController.cxx.

References m_ntuple_names, openFile(), and num_util::size().

Referenced by createNTuple().

TTree* RootController::getTree const std::string file,
const std::string tree
 

Returns the named tree from file in the ROOT file.

TTree * RootController::getTree const std::string file,
const std::string tree
 

Returns the named tree from file in the ROOT file.

Definition at line 125 of file LdfController.cxx.

References openFile().

Referenced by createNTuple().

static RootController* RootController::instance  )  [static]
 

Returns the singleton instance of the RootController.

RootController * RootController::instance  )  [static]
 

Returns the singleton instance of the RootController.

Definition at line 35 of file LdfController.cxx.

References s_instance.

Referenced by Inspector::addDataRepButton_clicked(), Inspector::getArrayTupleLabel(), HiNTupleXML::getObject(), CanvasView::helpAbout(), QtRootController::instance(), Inspector::newPlotButton_clicked(), and QtFileDialog::openRootTuple().

TFile* RootController::openFile const std::string name  )  [private]
 

Opens the named file, if not already opened.

TFile * RootController::openFile const std::string name  )  [private]
 

Opens the named file, if not already opened.

Definition at line 62 of file LdfController.cxx.

References m_file_map.

Referenced by getNTupleNames(), and getTree().

bool RootController::smartExpandRootNTuple DataSource source,
std::string column
 

Expands the array column.

If the DataSource is a RootNTuple, expands the column with array TLeaf and returns true, otherwise returns false.

bool RootController::smartExpandRootNTuple DataSource source,
std::string column
 

Expands the array column.

If the DataSource is a RootNTuple, expands the column with array TLeaf and returns true, otherwise returns false.

Definition at line 195 of file LdfController.cxx.

const std::string& RootController::version  )  const
 

Returns the version of ROOT being used.

const std::string & RootController::version  )  const
 

Returns the version of ROOT being used.

Definition at line 54 of file LdfController.cxx.

References m_version.


Member Data Documentation

std::map< std::string, TFile * > RootController::m_file_map [private]
 

The list of opened ROOT files.

Definition at line 45 of file RootController.h.

Referenced by closeFile(), and openFile().

std::vector< std::string > RootController::m_ntuple_names [private]
 

Temporary list of NTuple names in the file.

Definition at line 49 of file RootController.h.

Referenced by getNTupleNames().

std::string RootController::m_version [mutable, private]
 

The version of ROOT being used.

Definition at line 52 of file RootController.h.

Referenced by version().

RootController* RootController::s_instance [static, private]
 

The singleton instance of the RootController.

Definition at line 56 of file RootController.h.

RootController * RootController::s_instance = 0 [static, private]
 

The singleton instance of the RootController.

Definition at line 31 of file RootController.cxx.

Referenced by instance().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3