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 <fstream>
#include <dirent.h>
#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;