Now that gain filenames contain a date, better to check if the data directory exists.

This commit is contained in:
redford_s
2019-02-27 15:06:45 +01:00
parent fb1d930127
commit bcac128bc2

View File

@ -4,6 +4,7 @@
#include "../sls_detector_calibration/jungfrauCommonFunctions.h" #include "../sls_detector_calibration/jungfrauCommonFunctions.h"
#include <fstream> #include <fstream>
#include <dirent.h>
#include "TCanvas.h" #include "TCanvas.h"
#include "TFile.h" #include "TFile.h"
@ -30,14 +31,12 @@ int main(int argc, char* argv[]) {
for (int j = 0; j < 300; j++) { for (int j = 0; j < 300; j++) {
// first check if a gain map exists // check if directory exists
fstream infile; sprintf(savename,"data/M%3.3d", j);
sprintf(savename,"data/M%3.3d/gainMaps_M%3.3d.bin", j, j); DIR* dir = opendir(savename);
infile.open((char*)savename, ios::in | ios::binary); if (not dir) {
if (not infile.is_open()) {
continue; continue;
} }
infile.close();
int this_hg0_missing = 0; int this_hg0_missing = 0;
int this_hg0_crazy = 0; int this_hg0_crazy = 0;