// // This file primarly test the functionnality of the HepFileManagers. // // Zoom Histograms #include "TestManager.h" #include "HepTuple/HepHBookHist1D.h" #include "HepTuple/HepNtuple.h" ZM_USING_NAMESPACE( zmht ) #include "ZMutility/iostream" USING( namespace std ) #ifdef USE_ROOT #include "HepTuple/HepRootObj.h" #include "HepTuple/HepRootHist1D.h" #endif void directories(int argc, char**argv) { string filename = argv[1]; HepFileManager* manager = OPEN_FILE(filename); if (manager == NULL ) { cerr << "Could not open file: " << filename << "\n"; ::exit(-1); } cout << manager->fileName() << endl; cout << "ls:\n" << manager->ls("","r") << endl; cout << "Get a listing of ntuples\n"; HepFileManager::ItemList l = manager->list("","rN"); HepFileManager::ItemList::iterator i = l.begin(); while( i != l.end() ) { cout << "\"" << (*i).dir; cout << "\" has a ntuple named: \"" << (*i).title; cout << "\" with type " << (*i).type << endl; string pwd = manager->pwd(); manager->cd((*i).dir); HepNtuple& hep = manager->retrieveNtuple((*i).title); int k; int nCols = hep.nColumns(); cout << "Its " << nCols << " variables are:" << endl; for (k=0; kcd(pwd); i++; } delete manager; } int main(int argc, char** argv) { // get comandline arguments PARSE; directories(argc,argv); return 0; }