From 55f4a4949e231fdb1ef06eee39df0a520be2d935 Mon Sep 17 00:00:00 2001 From: redford_s Date: Mon, 29 May 2017 14:59:22 +0200 Subject: [PATCH] Added a frame number check. --- JFMC_BackplanePulsing.cpp | 55 +++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/JFMC_BackplanePulsing.cpp b/JFMC_BackplanePulsing.cpp index 1e84171..17def15 100644 --- a/JFMC_BackplanePulsing.cpp +++ b/JFMC_BackplanePulsing.cpp @@ -53,6 +53,7 @@ int main(int argc, char* argv[]) { TH2F* avg_adcG1er_map [220]; char savename[128]; + char filename[128]; double xs[220]; for (int i = 0; i < 100; i++) { @@ -118,25 +119,47 @@ int main(int argc, char* argv[]) { avg_adcG1er_map[j] = new TH2F(savename,"",NC,-0.5,NC-0.5,NR,-0.5,NR-0.5); } + // data file + if (module_str == "006") { + sprintf(filename,"/mnt/pcmoench_jungfrau_data/Module_006_vbackpulse/scan4_170217_%%6.6d.dat"); + } else if (module_str == "021") { + sprintf(filename,"/data_pool/Module_021_vbackpulse/bpp_scan1_20170303_%%6.6d.dat"); + } else if (module_str == "022") { + sprintf(filename,"/data_pool/Module_022_vbackpulse/bpp_scan1_20170303_%%6.6d.dat"); + } else if (module_str == "027") { + sprintf(filename,"/data_pool/Module_027_Calib/BP_180322_scan4_%%6.6d.dat"); + } else if (module_str == "040") { + sprintf(filename,"/data_pool/Module_040_Calib/BP_240322_scan_%%6.6d.dat"); + } else if (module_str == "044") { + sprintf(filename,"/data_pool/Module_044_vbackpulse/bpp_scan2_20170303_%%6.6d.dat"); + } + int framecounter = 0; for (int filei = 0; filei < 3; filei++) { - - // open data file - if (module_str == "006") { - sprintf(savename,"/mnt/pcmoench_jungfrau_data/Module_006_vbackpulse/scan4_170217_%%6.6d.dat"); - } else if (module_str == "021") { - sprintf(savename,"/data_pool/Module_021_vbackpulse/bpp_scan1_20170303_%%6.6d.dat"); - } else if (module_str == "022") { - sprintf(savename,"/data_pool/Module_022_vbackpulse/bpp_scan1_20170303_%%6.6d.dat"); - } else if (module_str == "027") { - sprintf(savename,"/data_pool/Module_027_Calib/BP_180322_scan4_%%6.6d.dat"); - } else if (module_str == "040") { - sprintf(savename,"/data_pool/Module_040_Calib/BP_240322_scan_%%6.6d.dat"); - } else if (module_str == "044") { - sprintf(savename,"/data_pool/Module_044_vbackpulse/bpp_scan2_20170303_%%6.6d.dat"); + + thisfile->open((char*)filename, filei); + + while(thisfile->readNextFrame()) { + framecounter++; } - thisfile->open((char*)savename, filei); + + thisfile->close(); + } + + cout << "framecounter " << framecounter << endl; + // ok for 006 021 022 044 + // 027: 21799, 040: 21899 + if (framecounter != 21999) { + cout << "WARNING unexpected number of frames" << endl; + cout << "WARNING code expected 21999 frames" << endl; + } + + framecounter = 0; + + for (int filei = 0; filei < 3; filei++) { + + thisfile->open((char*)filename, filei); while(thisfile->readNextFrame()) { @@ -201,8 +224,6 @@ int main(int argc, char* argv[]) { } thisfile->close(); } // end of files - - cout << "nframes " << framecounter << endl; // save histograms sprintf(savename,"/mnt/pcmoench_jungfrau_data/jungfrau_ana_sophie/M%s_CalibAna/BP_histos_M%s.root", module_str.c_str(), module_str.c_str());