Commit b993f3e0 authored by Jens Dopke's avatar Jens Dopke
Browse files

Now with local filename retention where local filenames had been given

parent 4b8c68d4
......@@ -56,6 +56,7 @@ The following authors, in alphabetical order, have contributed to Corryvreckan:
* Matthew Daniel Buckland, University of Liverpool, @mbucklan
* Carsten Daniel Burgard, DESY, @cburgard
* Manuel Colocci, CERN, @mcolocci
* Jens Dopke, STFC RAL, @jdopke
* Nicolò Jacazio, CERN, @njacazio
* Chun Cheng, DESY, @chengc
* Dominik Dannheim, CERN, @dannheim
......
......@@ -369,7 +369,7 @@ namespace corryvreckan {
// List of masked channels
std::map<int, bool> m_masked;
std::string m_maskfile;
std::string m_maskfile, m_maskfile_name;
};
} // namespace corryvreckan
......
......@@ -61,7 +61,9 @@ void PixelDetector::build_axes(const Configuration& config) {
// region of interest:
m_roi = config.getMatrix<int>("roi", std::vector<std::vector<int>>());
m_maskfile_name = "";
if(config.has("mask_file")) {
m_maskfile_name = config.get<std::string>("mask_file");
std::string mask_file = config.getPath("mask_file", true);
LOG(DEBUG) << "Adding mask to detector \"" << config.getName() << "\", reading from " << mask_file;
maskFile(mask_file);
......@@ -191,7 +193,11 @@ void PixelDetector::configure_detector(Configuration& config) const {
// Pixel mask file:
if(!m_maskfile.empty()) {
config.set("mask_file", m_maskfile);
if(m_maskfile_name.empty()) {
config.set("mask_file", m_maskfile);
} else {
config.set("mask_file", m_maskfile_name);
}
}
// Region-of-interest:
......
......@@ -264,8 +264,9 @@ void MaskCreator::writeMaskFiles() {
}
}
LOG(STATUS) << m_detector->getName() << " mask written to: " << std::endl << maskfile_path;
if(m_writeNewConfig)
if(m_writeNewConfig) {
m_detector->maskFile(maskfile_path);
}
}
double MaskCreator::estimateDensityAtPosition(const TH2D* values, int i, int j, int bwi, int bwj) {
......
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