RootController.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 
14 #ifndef RootController_H
15 #define RootController_H
16 
17 #include "pattern/Observer.h"
18 
19 #include <map>
20 #include <string>
21 #include <vector>
22 
23 class TFile;
24 class TTree;
25 
26 namespace hippodraw {
27 
28  class DataSource;
29  class RootNTuple;
30 
43 {
44 
45  private:
46 
48  std::map < std::string, TFile * > m_file_map;
49 
50  /* The type of container to map RootNTuple to its ROOT file.
51  */
52  typedef std::map < const DataSource *, std::string > TupleToFileMap_t;
53 
57 
60  std::vector < std::string > m_ntuple_names;
61 
63  mutable std::string m_version;
64 
68 
72  TFile * openFile ( const std::string & name );
73 
76  void closeFile ( const std::string & name );
77 
78  public:
79 
82  static RootController * instance ();
83 
86  virtual ~RootController();
87 
88 
91  const std::string & version () const;
92 
99  const std::vector < std::string > & getNTupleNames ( const std::string & );
100 
107  DataSource * createNTuple ( const std::string & name );
108 
112  DataSource * createNTuple ( const std::string & filename,
113  const std::string & treename );
114 
117  DataSource * initNTuple ( DataSource * source,
118  const std::string & filename,
119  const std::string & treename );
120 
123  TTree * getTree ( const std::string & file,
124  const std::string & tree );
125 
130  void fillDimSize ( std::vector < int > & dims,
131  const DataSource * source,
132  const std::string & column );
133 
138  bool smartExpandRootNTuple ( DataSource * source, std::string & column );
139 
142  virtual void update ( const Observable * );
143 
148  virtual void willDelete ( const Observable * obs );
149 
150 };
151 
152 } // namespace hippodraw
153 
154 #endif // RootController_H

Generated for HippoDraw Class Library by doxygen