#include "PndConfigParametersIO.h" #include #include #include using boost::property_tree::ptree; PndConfigParameters PndConfigParametersIO::readConfigFromFile( const std::string &config_url) const { // Create an empty property tree object boost::property_tree::ptree pt; // read the config file read_xml(config_url, pt); // create the simulation and reconstruction parameter object PndConfigParameters sim_reco_params; sim_reco_params.setParameters(pt); return sim_reco_params; } void PndConfigParametersIO::writeConfigToFile( const PndConfigParameters &sim_reco_params, const std::string &output_file_url) const { std::fstream file(output_file_url.c_str(), std::ios_base::out); write_xml(file, sim_reco_params.getConfigParametersPropertyTree()); file.close(); }