1- #define PROG_SIZE 100
2- #define DEFAULT_BINS 50
3-
4- #define MINMAX 1e10
5-
61#include < cstdlib>
72#include < ctime>
83#include < fstream>
2722#include " PandaTree/RelVal/interface/EnumerateBranches.h"
2823#include " PandaTree/RelVal/interface/TemplateMagic.h"
2924
25+ // Constants
26+
27+ namespace {
28+ constexpr int PROG_SIZE = 100 ;
29+ constexpr int DEFAULT_BINS = 50 ;
30+
31+ constexpr float MINMAX = 1e10 ;
32+ }
33+
3034using namespace testpanda ;
3135
3236bool exists (const char * path) {
@@ -48,6 +52,7 @@ void draw_progress(int percent) {
4852 std::cout << ' ' ;
4953 }
5054 std::cout << " ] " << percent * 100 /PROG_SIZE << ' %' ;
55+ std::flush (std::cout);
5156}
5257
5358
@@ -373,11 +378,19 @@ int main(int argc, char** argv) {
373378
374379 // Check if only a single value was filled, and flag as potential bad filling.
375380 if (maximums[index].first == minimums[index].first ) {
376- std::ofstream flag_file (( output_dir + " /" + branch_name + " _FLAG.txt" ) );
381+ std::ofstream flag_file (output_dir + " /" + branch_name + " _FLAG.txt" );
377382 flag_file << maximums[index].first ;
378383 flag_file.close ();
379384 }
380385
386+ // Dump stats for some other diff tool to compare two directories
387+ std::ofstream stat_file (output_dir + " /" + branch_name + " _STATS.txt" );
388+ stat_file << " Entries : " << histograms[index].GetEntries () << std::endl;
389+ stat_file << " Mean : " << histograms[index].GetMean () << std::endl;
390+ stat_file << " Std Dev : " << histograms[index].GetStdDev () << std::endl;
391+ stat_file << " Max : " << maximums[index].first << std::endl;
392+ stat_file << " Min : " << minimums[index].first << std::endl;
393+ stat_file.close ();
381394 }
382395 };
383396
0 commit comments