adding compilable version of the CM analysis because it is slow otherwise!
re-structuring code... need to see how to integrate read_histos.h in latency_scan
some debugging done!