Commit ecf82e0e authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Make file paths read from the config relative to the config, not to the execution folder

parent 0eb03d97
......@@ -9,8 +9,8 @@ EventLoaderATLASpix::EventLoaderATLASpix(Configuration config, std::shared_ptr<D
m_timewalkCorrectionFactors = m_config.getArray<double>("timewalkCorrectionFactors", std::vector<double>());
m_inputDirectory = m_config.get<std::string>("inputDirectory");
m_calibrationFile = m_config.get<std::string>("calibrationFile", std::string());
m_inputDirectory = m_config.getPath("inputDirectory");
m_calibrationFile = m_config.getPath("calibrationFile");
m_clockCycle = m_config.get<double>("clockCycle", static_cast<double>(Units::convert(6.25, "ns")));
......
......@@ -13,7 +13,7 @@ void EventLoaderCLICpix::initialise() {
// File structure is RunX/CLICpix/RunX.dat
// Take input directory from global parameters
string inputDirectory = m_config.get<std::string>("inputDirectory") + "/CLICpix";
string inputDirectory = m_config.getPath("inputDirectory") + "/CLICpix";
// Open the root directory
DIR* directory = opendir(inputDirectory.c_str());
......
......@@ -17,7 +17,7 @@ EventLoaderCLICpix2::EventLoaderCLICpix2(Configuration config, std::shared_ptr<D
void EventLoaderCLICpix2::initialise() {
// Take input directory from global parameters
string inputDirectory = m_config.get<std::string>("inputDirectory");
string inputDirectory = m_config.getPath("inputDirectory");
// Open the root directory
DIR* directory = opendir(inputDirectory.c_str());
......
......@@ -34,7 +34,7 @@ bool EventLoaderTimepix1::sortByTime(string filename1, string filename2) {
void EventLoaderTimepix1::initialise() {
// Take input directory from global parameters
m_inputDirectory = m_config.get<std::string>("inputDirectory");
m_inputDirectory = m_config.getPath("inputDirectory");
// Each input directory contains a series of .txt files. Each of these
// contains several events (frames) with different times
......
......@@ -18,7 +18,7 @@ EventLoaderTimepix3::EventLoaderTimepix3(Configuration config, std::shared_ptr<D
m_shutterOpen(false) {
// Take input directory from global parameters
m_inputDirectory = m_config.get<std::string>("inputDirectory");
m_inputDirectory = m_config.getPath("inputDirectory");
m_triggerLatency = m_config.get<double>("triggerLatency", 0.0);
m_minNumberOfPlanes = m_config.get<int>("minNumerOfPlanes", 1);
......@@ -26,7 +26,7 @@ EventLoaderTimepix3::EventLoaderTimepix3(Configuration config, std::shared_ptr<D
m_numberPixelHits = m_config.get<size_t>("number_of_pixelhits", 2000);
// Calibration parameters
calibrationPath = m_config.get<std::string>("calibrationPath", "");
calibrationPath = m_config.getPath("calibrationPath", "");
threshold = m_config.get<std::string>("threshold", "");
}
......
......@@ -9,7 +9,7 @@ FileReader::FileReader(Configuration config, std::vector<std::shared_ptr<Detecto
m_readPixels = m_config.get<bool>("readPixels", true);
m_readClusters = m_config.get<bool>("readClusters", false);
m_readTracks = m_config.get<bool>("readTracks", false);
m_fileName = m_config.get<std::string>("fileName", "outputTuples.root");
m_fileName = m_config.getPath("fileName", "outputTuples.root");
m_timeWindow = m_config.get<double>("timeWindow", static_cast<double>(Units::convert(1., "s")));
m_readMCParticles = m_config.get<bool>("readMCParticles", false);
// checking if DUT parameter is in the configuration file, if so then check if should only output the DUT
......
Supports Markdown
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