// // This file test the functionalities of the Block class. // Interectly it also test the functionalities of the ColumnAttribs class. // #include "HepTuple/HepHBookNtuple.h" #include "HepTuple/HepNtuple.h" #include "HepTuple/Column.h" #include "HepTuple/Block.h" ZM_USING_NAMESPACE( zmht ) #include "ZMutility/iostream" #include #include "ZMutility/fstream" USING( namespace std ) int main(int argc, char* argv[]) { string rwnFile (argv[1]); string cwnFile = rwnFile + ".cwn"; cerr << "In - " << rwnFile << "; out " << cwnFile << endl; // // Input rwn // HepFileManager* rwnmanager = new HepHBookFileManager(rwnFile.c_str()); // cerr << "ls:\n" << manager->ls("","") << endl; HepFileManager::ItemList myItemList = rwnmanager->list("","N"); HepFileManager::ItemList::iterator myIter = myItemList.begin(); if ( myIter == myItemList.end() ) { cerr << "!!!! List begin = List end !!!!" << endl; return 1; } cerr << "\"" << (*myIter).dir; cerr << "\" has a Histogram 1D named: \"" << (*myIter).title; cerr << "\" with type " << (*myIter).type << endl; if ( (*myIter).type != 'N' ) { cerr << "Error: We expected a ntuple!" << endl; ::exit(-1); } HepNtuple& rwn = rwnmanager->retrieveNtuple(((*myIter).title).c_str(),0); // // Output cwn // HepFileManager* cwnmanager = new HepHBookFileManager(cwnFile.c_str()); HepNtuple& cwn = cwnmanager->ntuple(((*myIter).title).c_str(),0); cwn.setColumnWise(); int nVar = rwn.nColumns(); float *dataPtr = new float[nVar]; int i; for (i=0;i