00001 /* -*- c++ -*- */ 00002 00014 #ifndef RootController_H 00015 #define RootController_H 00016 00017 #include "pattern/libhippo.h" 00018 00019 #include <map> 00020 #include <string> 00021 #include <vector> 00022 00023 class DataSource; 00024 class RootNTuple; 00025 class TFile; 00026 class TTree; 00027 00039 class MDL_HIPPOPLOT_API RootController 00040 { 00041 00042 private: 00043 00045 std::map < std::string, TFile * > m_file_map; 00046 00049 std::vector < std::string > m_ntuple_names; 00050 00052 mutable std::string m_version; 00053 00056 static RootController * s_instance; 00057 00060 TFile * openFile ( const std::string & name ); 00061 00064 void closeFile ( const std::string & name ); 00065 00066 public: 00067 00070 static RootController * instance (); 00071 00074 virtual ~RootController(); 00075 00076 00079 const std::string & version () const; 00080 00087 const std::vector < std::string > & getNTupleNames ( const std::string & ); 00088 00095 DataSource * createNTuple ( const std::string & name ); 00096 00100 DataSource * createNTuple ( const std::string & filename, 00101 const std::string & treename ); 00102 00105 TTree * getTree ( const std::string & file, 00106 const std::string & tree ); 00107 00112 void fillDimSize ( std::vector < int > & dims, 00113 const DataSource * source, 00114 const std::string & column ); 00115 00120 bool smartExpandRootNTuple ( DataSource * source, std::string & column ); 00121 00122 }; 00123 00124 #endif // RootController_H