Commit 739a98e1 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Analysis: write out new detector config if "detectors_file_updated" is set to file name

This fixes #1
parent 19865ad9
......@@ -412,6 +412,24 @@ void Analysis::finaliseAll() {
m_directory->Write();
m_histogramFile->Close();
// Write out update detectors file:
if(global_config.has("detectors_file_updated")) {
std::string file_name = global_config.getPath("detectors_file_updated");
// Check if the file exists
std::ofstream file(file_name);
if(!file) {
throw ConfigFileUnavailableError(file_name);
}
ConfigReader final_detectors;
for(auto& detector : detectors) {
final_detectors.addConfiguration(detector->getConfiguration());
}
final_detectors.write(file);
LOG(STATUS) << "Wrote updated detector configuration to " << file_name;
}
// Check the timing for all events
timing();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment