RootController.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 
00014 #ifndef RootController_H
00015 #define RootController_H
00016 
00017 #include "pattern/Observer.h"
00018 
00019 #include <map>
00020 #include <string>
00021 #include <vector>
00022 
00023 class TFile;
00024 class TTree;
00025 
00026 namespace hippodraw {
00027 
00028   class DataSource;
00029   class RootNTuple;
00030 
00042   class MDL_HIPPOPLOT_API RootController : private Observer
00043 {
00044 
00045  private:
00046 
00048   std::map < std::string, TFile * > m_file_map;
00049 
00050   /* The type of container to map RootNTuple to its ROOT file.
00051    */
00052   typedef std::map < const DataSource *, std::string > TupleToFileMap_t;
00053 
00056   TupleToFileMap_t m_tuple_map;
00057 
00060   std::vector < std::string > m_ntuple_names;
00061 
00063   mutable std::string m_version;
00064 
00067   static RootController * s_instance;
00068 
00072   TFile * openFile ( const std::string & name );
00073 
00076   void closeFile ( const std::string & name );
00077 
00078  public:
00079 
00082   static RootController * instance ();
00083 
00086   virtual ~RootController();
00087 
00088 
00091   const std::string & version () const;
00092 
00099   const std::vector < std::string > & getNTupleNames ( const std::string & );
00100 
00107   DataSource * createNTuple ( const std::string & name );
00108 
00112   DataSource * createNTuple ( const std::string & filename,
00113                               const std::string & treename );
00114 
00117   DataSource * initNTuple ( DataSource * source,
00118                             const std::string & filename,
00119                             const std::string & treename );
00120 
00123   TTree * getTree ( const std::string & file,
00124                     const std::string & tree );
00125 
00130   void fillDimSize ( std::vector < int > & dims,
00131                      const DataSource * source,
00132                      const std::string & column );
00133 
00138   bool smartExpandRootNTuple ( DataSource * source, std::string & column );
00139 
00142   virtual void update ( const Observable * );
00143 
00148   virtual void willDelete ( const Observable * obs );
00149 
00150 };
00151 
00152 } // namespace hippodraw
00153 
00154 #endif // RootController_H

Generated for HippoDraw Class Library by doxygen