New (counter based) histograms
Depends on !1112 (merged).
This adds new types of Counters, namely (Profile)?(Weighted)?Histogram with the following features :
- can be any number of dimensions. The dimension is its first template parameter
- at construction, you give a triplet of values per dimension : nbins, minValue, maxValue.
- operator+= takes either an array of values (one per dimension) or a tuple<array of values, weight> for weighted histograms. The size of the array of value has to match the dimension, or dimension + 1 for profile histograms.
- the prefered syntax is to avoid operator+= and use operator[] to get a buffer on the bin you're updating. Syntax becomes : ++counter[{x,y}] or wcounter[{x,y]] += w
- the internal counter type is templated, allowing to choose floats or even int while default is double
- the counters can be atomic or not and supports buffering. Note that the atomicity is classical eventual consistency. So each bin is atomically updated but bins are not garranted to be coherent when reading all of them back
Typical usage :
Histogram<2, atomicity::full, double>
counter{owner, "CounterName", {nBins1, minVal1, maxVal1}, {nBins2, minVal2, maxVal2}};
++counter[{val1, val2}];
Of course shortcuts are possible :
Histogram<1> myHisto{...}; // will be atomic by default, storing doubles
Histogram<1, atomicity::none> myFastHisto; // non atomic, storing doubles
This also adds a new Sink (see !1112 (merged) for details on the new monitoring) that saves histograms to ROOT files. This is only a toy Sink with hardcoded file name, but demonstrates how one can convert these new histograms to ROOT.
Merge request reports
Activity
Everything can be done. Profiling histograms being particularly easy if I understand them properly, as it only consists in replacing the internal atomic in the
HistogramingValueHandler
by a templated Counter, that would be the defaultCounter
for regular histograms and anAveragingCounter
for profile histograms. I should actually have done that from the beginning...Now, before going further into this, I'd like to make it usable, in the sense that we can save/display histograms. It also will allow to validate that they work properly in realistic applications. My intention here is to first solve !1112 (merged) (and I'm on it) so that I disentangle the printing/I/O from the counters themselves and things get easier. In particular, I'd like to avoid a dependency on ROOT/Boost or whatever else in the core code of the
HistogramingCounter
.added 19 commits
-
4788a2ff...569f81cf - 6 commits from branch
master
- 68108ea1 - temporary! embed nlohmann/json.hpp
- 7ab5cb50 - First prototype of a new monitoring framework
- 5c5d8240 - Fixed printing of counter in MessageSvc
- f328b08a - Cleanup of counter examples and test. Moved to modern counters
- ad4c0ef7 - Simplified MessageSvc code related to json handling of counters
- c1534cb7 - Improvements in Accumulators to increase genericity
- 0ae7b9d8 - Moved Monitoring entity's type to the Entity itself
- 7f494431 - Wrote json serializers for all counters
- 52ee2046 - implemented printing of counters in MessageSvc from json representation
- 6ddecad4 - Made printing of counters in MessageSvc backward compatible
- 2a371f45 - Removed old counter priting code
- 0102572f - Implementation of an HistogramingCounter
- e62f6a34 - Implemented a toy ROOT histogram Sink for new monitoring
Toggle commit list-
4788a2ff...569f81cf - 6 commits from branch
added 1 commit
- f888f15c - Implemented a toy ROOT histogram Sink for new monitoring
added 9 commits
- 73737a35 - Improvements in Accumulators to increase genericity
- 4b481b0c - Moved Monitoring entity's type to the Entity itself
- 7cb40217 - Wrote json serializers for all counters
- 99816137 - implemented printing of counters in MessageSvc from json representation
- 7e522e1c - Made printing of counters in MessageSvc backward compatible
- 75492f0c - Removed old counter priting code
- fefe3845 - Increased genericity of AccumulatorSet in view of implementing ProfileHitogramingCounters
- 0874867e - Implementation of histograming counters
- 6e3238f4 - Implemented a toy ROOT histogram Sink for new monitoring
Toggle commit listadded 19 commits
- 7794bd6a - First prototype of a new monitoring framework
- ba3135b0 - Fixed printing of counter in MessageSvc
- 257fcc59 - Cleanup of counter examples and test. Moved to modern counters
- 3b620abe - Simplified MessageSvc code related to json handling of counters
- d647c8fa - Improvements in Accumulators to increase genericity
- 43d4b0e2 - Moved Monitoring entity's type to the Entity itself
- dcf0a1cb - Implemented printing of counters through the Monitoring::Hub
- 7b1b9389 - handle properly INTERFACE libraries in GaudiProjectConfig.cmake
- 970c6f11 - Added dependency on nlohmann_json, taking it from LCG
- aa41a79a - Dropped unused Arithmetic template argument in Counter
- 91847c8d - Merged subtype and type
- 65d73962 - Added fromJSON method to counters
- 84a717ef - Slight rework of MsgCounter
- 1546d50d - Fixed formatting
- ae924292 - Increased genericity of AccumulatorSet in view of implementing ProfileHitogramingCounters
- b80e4157 - Implementation of histograming counters
- 9da71d42 - Implemented a toy ROOT histogram Sink for new monitoring
- 6e67d711 - Removed ROOT and Boost histogram prototypes
- d4e58839 - Addressed comments after first code review of Histogram counters
Toggle commit listadded 1 commit
- 74e548fc - Addressed comments after first code review of Histogram counters
- Resolved by Sebastien Ponce
- Resolved by Sebastien Ponce
- Resolved by Sebastien Ponce
- Resolved by Sebastien Ponce