// process_cbnt_t.cxx #include "dataset_CBNT/process_cbnt.h" #include #include #include "dataset_util/getcwd.h" #include "dataset_util/FileFinder.h" #include "dataset_CBNT/CbntDataset.h" #include "dataset_CBNT/process_cbnt_t.h" using std::cout; using std::endl; using std::string; using dset::Url; using dset::CbntDataset; //********************************************************************** namespace { void msg(string txt) { cout << "*** "; cout << txt; cout << endl; } } //********************************************************************** int process_cbnt() { int verbose = 10; msg("Find hbook file"); string infile = "cbnt.hbook"; int height = 5; FileFinder finder(getcwd(), height); infile = finder.find(infile); cout << infile << endl; assert( infile.size() != 0 ); msg("Create logical file."); Url file("file:" + infile); assert(file.is_valid()); msg("Create dataset"); CbntDataset ds(file, false); //ds.select_events(EventIdList(EventIdRange(2001,301,500))); ds.lock(); cout << ds << endl; assert( ds.is_valid() ); assert( ds.is_locked() ); msg("Create initialization"); Text init; init.append("1dhisto 1 'Run number' 100 0 10000"); init.append("1dhisto 2 'Event number' 100 0 1000"); msg("Create code"); Text code = run_event_code();; cout << code << endl; assert( code.size() > 0 ); msg("Process dataset"); int stat = process_cbnt(ds, init, code, "result.hbook", verbose); return stat; } //********************************************************************** #ifdef CTEST_MAIN int main() { return process_cbnt(); } #endif //**********************************************************************