32 using namespace hippodraw;
77 ifstream test ( name.c_str (), std::ios::in );
78 if ( test.is_open () == false ) {
79 string what (
"RootController: File `" );
81 what +=
"' was not found.";
83 throw std::runtime_error ( what );
85 file =
new TFile ( name.c_str() );
89 file = first -> second;
101 TFile * file = where -> second;
110 const vector < string > &
116 TFile * file =
openFile ( file_name );
119 TList * keys = file -> GetListOfKeys ();
120 Int_t
size = keys -> GetSize ();
122 for ( Int_t i = 0; i <
size; i++ ) {
123 TObject * obj = keys -> At ( i );
124 TKey * key = dynamic_cast < TKey * > ( obj );
125 const string class_name = key -> GetClassName ();
126 if ( class_name ==
"TTree" ||
127 class_name ==
"TNtuple" ||
128 class_name ==
"TNtupleD" ) {
129 const string name = key -> GetName ();
142 const std::string & treename )
144 TFile * file =
openFile ( filename );
145 if ( file == NULL )
return NULL;
147 TObject *
object = file -> Get ( treename.c_str() );
148 TTree * tree = dynamic_cast <
TTree * > ( object );
155 createNTuple (
const std::string & filename,
const std::string & treename )
158 if ( tree == NULL )
return NULL;
162 return initNTuple ( ntuple, filename, treename );
168 const std::string & treename )
170 string ds_name = filename;
174 ntuple -> setTitle ( treename );
175 ntuple -> setName ( ds_name );
177 controller -> registerNTuple ( ds_name, ntuple );
178 controller -> registerDataSourceFile ( ntuple );
181 ntuple -> addObserver (
this );
192 string::size_type pos = name.find_last_of (
':' );
193 if ( pos == string::npos ) {
198 const string filename = name.substr ( 0, pos );
199 string tree_name = name.substr ( pos + 1 );
200 pos = tree_name.find_first_not_of (
' ' );
201 tree_name.erase ( 0, pos );
212 const std::string &
column )
218 int index = rtuple -> indexOf ( column );
219 vector < int >
shape;
220 rtuple -> fillShape ( shape, index );
221 for (
unsigned int i = 1; i < shape.size(); i++ ) {
222 dims.push_back ( shape [ i] );
258 TupleToFileMap_t::iterator first =
m_tuple_map.find ( tuple );
261 const string & filename = first -> second;
266 const string & name = first -> second;
267 if ( name == filename ) {