44 unsigned int numBins()
const {
return 4; }
48 std::string
title{
"Category" };
50 std::vector<std::string>
labels{
"Simple",
"Complex",
"Bad",
"Wrong" };
52 unsigned int index(
Category value )
const {
return static_cast<unsigned int>( value ) + 1; }
58 j = nlohmann::json{ {
"nBins", axis.
numBins() },
61 {
"title", axis.
title } };
76 mutable MyHist_t m_hist3{
this,
"Group/SubGroup/Third",
"Third title", { 1, 0, 1 } };
94 mutable MyHist_t m_hist3{
this,
"Group/SubGroup/Third",
"Third title", { 1, 0, 1 } };
116 this,
"hist",
"Histogram title", { 5, 0, 5,
"axis title", {
"a",
"b",
"c",
"d",
"e" } } };
119 for (
int i : { 1, 2, 3, 4, 5 } )
m_hist[i - 1] += i;
124 namespace CustomAxis {
130 std::tuple<Gaudi::Accumulators::CustomAxis>>
151 { 10, 0, 10 }, { 10, 0, 10 }, { 10, 0, 10 } };
156 for (
double x = -0.5; x < 11; x += 1.0 ) {
158 for (
double y = -0.5; y < 11; y += 1.0 ) {
159 m_h2[{ x, y }] += ++value;
160 for (
double z = -0.5; z < 11; z += 1.0 ) {
m_h3[{ x, y, z }] += ++value; }
#define DECLARE_COMPONENT(type)
Efficient counter implementations for Gaudi.
void to_json(nlohmann::json &j, const Axis< Arithmetic > &axis)
automatic conversion of the Axis type to json
HistogramingCounterBase< ND, Atomicity, Arithmetic, naming::histogramString, HistogramingAccumulator, AxisTupleType > StaticHistogram
standard static histograming counter. See HistogramingCounterBase for details
details::Consumer< Signature, Traits_, details::isLegacy< Traits_ > > Consumer
std::ostream & operator<<(std::ostream &o, Category v)
Gaudi::Accumulators::StaticHistogram< 1 > MyHist_t
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
std::underlying_type_t< Category > minValue
min and max values on this axis
std::underlying_type_t< Category > maxValue
unsigned int index(Category value) const
friend std::ostream & operator<<(std::ostream &o, CustomAxis const &axis)
std::string title
title of this axis
std::vector< std::string > labels
labels for the bins
Gaudi::Tests::Histograms::CustomAxis::Category Category
unsigned int numBins() const
number of bins for this Axis
Gaudi::Accumulators::StaticHistogram< 1, Gaudi::Accumulators::atomicity::full, int > MyHist_t
void operator()() const override
Gaudi::Functional::Consumer< void()> Base
Gaudi::Functional::Consumer< void()> Base
Gaudi::Accumulators::StaticHistogram< 1, Gaudi::Accumulators::atomicity::full, Category, std::tuple< Gaudi::Accumulators::CustomAxis > > m_hist
void operator()() const override
ToolHandle< HistoGroupsTool > m_tool
Gaudi::Functional::Consumer< void()> Base
void operator()() const override
Gaudi::Accumulators::StaticHistogram< 2 > m_h2
void operator()() const override
Gaudi::Accumulators::StaticHistogram< 1 > m_h1
Gaudi::Functional::Consumer< void()> Base
Gaudi::Accumulators::StaticHistogram< 3 > m_h3
Simple algorithm useful as base class for tests.