From bcac128bc2b3154e4bcb7cfa137061d4bac368db Mon Sep 17 00:00:00 2001 From: redford_s Date: Wed, 27 Feb 2019 15:06:45 +0100 Subject: [PATCH] Now that gain filenames contain a date, better to check if the data directory exists. --- JFMC_BadPixels.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/JFMC_BadPixels.cpp b/JFMC_BadPixels.cpp index 4d079ea..84a31ca 100644 --- a/JFMC_BadPixels.cpp +++ b/JFMC_BadPixels.cpp @@ -4,6 +4,7 @@ #include "../sls_detector_calibration/jungfrauCommonFunctions.h" #include +#include #include "TCanvas.h" #include "TFile.h" @@ -30,14 +31,12 @@ int main(int argc, char* argv[]) { for (int j = 0; j < 300; j++) { - // first check if a gain map exists - fstream infile; - sprintf(savename,"data/M%3.3d/gainMaps_M%3.3d.bin", j, j); - infile.open((char*)savename, ios::in | ios::binary); - if (not infile.is_open()) { + // check if directory exists + sprintf(savename,"data/M%3.3d", j); + DIR* dir = opendir(savename); + if (not dir) { continue; } - infile.close(); int this_hg0_missing = 0; int this_hg0_crazy = 0;