The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm Class Reference

Example of algorithm using root histograms accumulators. More...

Inheritance diagram for Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm:
Collaboration diagram for Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm:

Public Types

using Base = FSMCallbackHolder<Gaudi::Algorithm>
Public Types inherited from Gaudi::FSMCallbackHolder< Gaudi::Algorithm >
using Parent
Public Types inherited from extends< BASE, Interfaces >
using base_class = extends
 Typedef to this class.
using extend_interfaces_base = extend_interfaces<Interfaces...>
 Typedef to the base of this class.
Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...

Public Member Functions

StatusCode execute (const EventContext &) const override
Public Member Functions inherited from Gaudi::FSMCallbackHolder< Gaudi::Algorithm >
void registerCallBack (StateMachine::Transition s, IFSMCallbackHolder::CallBack c) override
StatusCode sysInitialize () override
StatusCode sysStart () override
StatusCode sysStop () override
StatusCode sysFinalize () override
Public Member Functions inherited from extends< BASE, Interfaces >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.

Private Attributes

Gaudi::Accumulators::Counter m_nCalls { this, "calls" }
Gaudi::Accumulators::StaticRootHistogram< 1 > m_gauss
Gaudi::Accumulators::StaticRootHistogram< 2 > m_gaussVflat
Gaudi::Accumulators::StaticRootHistogram< 3 > m_gaussVflatVgauss
Gaudi::Accumulators::StaticRootHistogram< 1 > m_gauss_buf
Gaudi::Accumulators::StaticRootHistogram< 2 > m_gaussVflat_buf
Gaudi::Accumulators::StaticRootHistogram< 3 > m_gaussVflatVgauss_buf
Gaudi::Accumulators::RootHistogram< 1 > m_custom_gauss
Gaudi::Accumulators::RootHistogram< 2 > m_custom_gaussVflat
Gaudi::Accumulators::RootHistogram< 3 > m_custom_gaussVflatVgauss

Detailed Description

Example of algorithm using root histograms accumulators.

Definition at line 343 of file CounterHistos.cpp.

Member Typedef Documentation

◆ Base

Member Function Documentation

◆ execute()

StatusCode Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm::execute ( const EventContext & ) const
inlineoverride

Definition at line 348 of file CounterHistos.cpp.

348 {
349 // some random number generators, just to provide numbers
350 static Rndm::Numbers Gauss( randSvc(), Rndm::Gauss( 0.0, 1.0 ) );
351 static Rndm::Numbers Flat( randSvc(), Rndm::Flat( -10.0, 10.0 ) );
352
353 // cache some numbers
354 const double gauss( Gauss() );
355 const double gauss2( Gauss() );
356 const double flat( Flat() );
357
358 // updating histograms
359 ++m_gauss[gauss];
360 ++m_gaussVflat[{ flat, gauss }];
361 ++m_gaussVflatVgauss[{ flat, gauss, gauss2 }];
362
363 // using buffers
364 auto gauss_buf = m_gauss_buf.buffer();
365 auto gaussVflat_buf = m_gaussVflat_buf.buffer();
366 auto gaussVflatVgauss_buf = m_gaussVflatVgauss_buf.buffer();
367 for ( unsigned int i = 0; i < 10; i++ ) {
368 ++gauss_buf[gauss];
369 ++gaussVflat_buf[{ flat, gauss }];
370 ++gaussVflatVgauss_buf[{ flat, gauss, gauss2 }];
371 }
372
373 // custom histograms, with title and axis defined in python
375 ++m_custom_gaussVflat[{ flat, gauss }];
376 ++m_custom_gaussVflatVgauss[{ flat, gauss, gauss2 }];
377
378 if ( m_nCalls.nEntries() == 0 ) always() << "Filling Histograms...... Please be patient !" << endmsg;
379 ++m_nCalls;
380 return StatusCode::SUCCESS;
381 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
Gaudi::Accumulators::StaticRootHistogram< 3 > m_gaussVflatVgauss
Gaudi::Accumulators::RootHistogram< 3 > m_custom_gaussVflatVgauss
Gaudi::Accumulators::StaticRootHistogram< 1 > m_gauss_buf
Gaudi::Accumulators::StaticRootHistogram< 3 > m_gaussVflatVgauss_buf
Gaudi::Accumulators::StaticRootHistogram< 1 > m_gauss
Gaudi::Accumulators::StaticRootHistogram< 2 > m_gaussVflat
Gaudi::Accumulators::RootHistogram< 2 > m_custom_gaussVflat
Gaudi::Accumulators::RootHistogram< 1 > m_custom_gauss
Gaudi::Accumulators::StaticRootHistogram< 2 > m_gaussVflat_buf
constexpr static const auto SUCCESS
Definition StatusCode.h:99
constexpr double gauss

Member Data Documentation

◆ m_custom_gauss

Gaudi::Accumulators::RootHistogram<1> Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm::m_custom_gauss
mutableprivate
Initial value:
{ this, "CustomGauss",
"Gaussian mean=0, sigma=1, atomic" }

Definition at line 411 of file CounterHistos.cpp.

411 { this, "CustomGauss",
412 "Gaussian mean=0, sigma=1, atomic" };

◆ m_custom_gaussVflat

Gaudi::Accumulators::RootHistogram<2> Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm::m_custom_gaussVflat
mutableprivate
Initial value:
{ this, "CustomGaussFlat",
"Gaussian V Flat, atomic" }

Definition at line 413 of file CounterHistos.cpp.

413 { this, "CustomGaussFlat",
414 "Gaussian V Flat, atomic" };

◆ m_custom_gaussVflatVgauss

Gaudi::Accumulators::RootHistogram<3> Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm::m_custom_gaussVflatVgauss
mutableprivate
Initial value:
{ this, "CustomGaussFlatGauss",
"Gaussian V Flat V Gaussian, atomic" }

Definition at line 415 of file CounterHistos.cpp.

415 { this, "CustomGaussFlatGauss",
416 "Gaussian V Flat V Gaussian, atomic" };

◆ m_gauss

Gaudi::Accumulators::StaticRootHistogram<1> Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm::m_gauss
mutableprivate
Initial value:
{
this, "Gauss", "Gaussian mean=0, sigma=1, atomic", { 100, -5, 5, "X" } }

Definition at line 389 of file CounterHistos.cpp.

389 {
390 this, "Gauss", "Gaussian mean=0, sigma=1, atomic", { 100, -5, 5, "X" } };

◆ m_gauss_buf

Gaudi::Accumulators::StaticRootHistogram<1> Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm::m_gauss_buf
mutableprivate
Initial value:
{
this, "GaussBuf", "Gaussian mean=0, sigma=1, buffered", { 100, -5, 5 } }

Definition at line 400 of file CounterHistos.cpp.

400 {
401 this, "GaussBuf", "Gaussian mean=0, sigma=1, buffered", { 100, -5, 5 } };

◆ m_gaussVflat

Gaudi::Accumulators::StaticRootHistogram<2> Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm::m_gaussVflat
mutableprivate
Initial value:
{
this, "GaussFlat", "Gaussian V Flat, atomic", { { 50, -5, 5, "X" }, { 50, -5, 5, "Y" } } }

Definition at line 391 of file CounterHistos.cpp.

391 {
392 this, "GaussFlat", "Gaussian V Flat, atomic", { { 50, -5, 5, "X" }, { 50, -5, 5, "Y" } } };

◆ m_gaussVflat_buf

Gaudi::Accumulators::StaticRootHistogram<2> Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm::m_gaussVflat_buf
mutableprivate
Initial value:
{
this, "GaussFlatBuf", "Gaussian V Flat, buffered", { { 50, -5, 5 }, { 50, -5, 5 } } }

Definition at line 402 of file CounterHistos.cpp.

402 {
403 this, "GaussFlatBuf", "Gaussian V Flat, buffered", { { 50, -5, 5 }, { 50, -5, 5 } } };

◆ m_gaussVflatVgauss

Gaudi::Accumulators::StaticRootHistogram<3> Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm::m_gaussVflatVgauss
mutableprivate
Initial value:
{
this,
"GaussFlatGauss",
"Gaussian V Flat V Gaussian, atomic",
{ { 10, -5, 5, "X" }, { 10, -5, 5, "Y" }, { 10, -5, 5, "Z" } } }

Definition at line 393 of file CounterHistos.cpp.

393 {
394 this,
395 "GaussFlatGauss",
396 "Gaussian V Flat V Gaussian, atomic",
397 { { 10, -5, 5, "X" }, { 10, -5, 5, "Y" }, { 10, -5, 5, "Z" } } };

◆ m_gaussVflatVgauss_buf

Gaudi::Accumulators::StaticRootHistogram<3> Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm::m_gaussVflatVgauss_buf
mutableprivate
Initial value:
{
this,
"GaussFlatGaussBuf",
"Gaussian V Flat V Gaussian, buffered",
{ { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } }

Definition at line 404 of file CounterHistos.cpp.

404 {
405 this,
406 "GaussFlatGaussBuf",
407 "Gaussian V Flat V Gaussian, buffered",
408 { { 10, -5, 5 }, { 10, -5, 5 }, { 10, -5, 5 } } };

◆ m_nCalls

Gaudi::Accumulators::Counter Gaudi::TestSuite::Counter::GaudiRootHistoAlgorithm::m_nCalls { this, "calls" }
mutableprivate

Definition at line 384 of file CounterHistos.cpp.

384{ this, "calls" };

The documentation for this class was generated from the following file: