Skip to content
Snippets Groups Projects

Add 2D constructor for Histogram to allow construction with make_unique etc

Closed Daniel Charles Craik requested to merge dcraik/Gaudi:dcraik_histogram_constructor into master

The current generic Histogram constructor Histogram(OWNER*, string, string, initializer_list<Axis>) isn't recognised by make_unique, etc so it's not currently possible to create a smart pointer to a >1D histogram (1D histograms having an alternative constructor already):

../GaudiKernel/tests/src/CounterHistosUnitTest.cpp:135:15: error: no matching function for call to 'make_unique'
  auto hist = std::make_unique<Histogram<2, atomicity::full, float>>(&algo, "Test2DHist", "Test 2D histogram", {{10, 0., 10.}, {10, 0., 10.}});
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This MR adds a 2D constructor analogous to the existing 1D case and a test to show that it can be used to create a unique_ptr.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading