diff --git a/example_h5.cpp b/example_h5.cpp index 8614ceb53b9e509203883b736898700ce42ead43..7c337204bf5b1788a0ced2175f249df94a344388 100644 --- a/example_h5.cpp +++ b/example_h5.cpp @@ -38,23 +38,24 @@ int main(int argc, char** argv) } print_execution_time(); - // save data to txt files - std::ofstream outfile_LG("timestamps.txt"); - if(!outfile_LG){// file couldn't be opened - std::cerr << "Error: timestamps.txt could not be opened" << std::endl; - exit(1); - } - for (int i=0; i<newEvents.size();i++) - { - for (int j=0; j<32; j++) - { - outfile_LG << newEvents[i].chargeLG[j] << ' '; // separated by space - } - outfile_LG << '\n'; - } - outfile_LG.close(); - print_execution_time(); + // // save data to txt files + // std::ofstream outfile_LG("timestamps.txt"); + // if(!outfile_LG){// file couldn't be opened + // std::cerr << "Error: timestamps.txt could not be opened" << std::endl; + // exit(1); + // } + // for (int i=0; i<newEvents.size();i++) + // { + // for (int j=0; j<32; j++) + // { + // outfile_LG << newEvents[i].chargeLG[j] << ' '; // separated by space + // } + // outfile_LG << '\n'; + // } + // outfile_LG.close(); + // print_execution_time(); + // save data to HDF5 std::vector<std::vector<uint16_t>> LG_charges(newEvents.size(), std::vector<uint16_t>(32, 0)); std::vector<uint64_t> timestamps(newEvents.size(), 0); for (int i=0; i<newEvents.size();i++) @@ -65,7 +66,6 @@ int main(int argc, char** argv) { timestamps[i] = newEvents[i].RunEventTimecode; } - const std::string FILE_NAME("newEvents.h5"); try { // Create a new file using the default property lists. HighFive::File file("newEvents.h5", HighFive::File::ReadWrite | HighFive::File::Create | HighFive::File::Overwrite);