14# pragma warning( disable : 2259 )
25#include <TProfile2D.h>
30 return className ==
"AIDA::IProfile2D"
31 ?
const_cast<AIDA::IProfile2D*
>(
static_cast<const AIDA::IProfile2D*
>( this ) )
32 : className ==
"AIDA::IProfile" ?
const_cast<AIDA::IProfile*
>(
static_cast<const AIDA::IProfile*
>( this ) )
33 : className ==
"AIDA::IBaseHistogram"
34 ?
const_cast<AIDA::IBaseHistogram*
>(
static_cast<const AIDA::IBaseHistogram*
>( this ) )
41 return int(
m_rep->GetBinEntries( rBin ) + 0.5 );
46 TProfile2D* imp =
dynamic_cast<TProfile2D*
>( rep );
47 if ( !imp )
throw std::runtime_error(
"Cannot adopt native histogram representation." );
56 const std::string& title,
const Edges& eX,
57 const Edges& eY,
double ,
double ) {
59 auto p =
new Profile2D(
new TProfile2D( title.c_str(), title.c_str(), eX.size() - 1, &eX.front(), eY.size() - 1,
66 const std::string& title,
int binsX,
double xlow,
67 double xup,
int binsY,
double ylow,
double yup,
68 double zlow,
double zup ) {
70 new Profile2D(
new TProfile2D( title.c_str(), title.c_str(), binsX, xlow, xup, binsY, ylow, yup, zlow, zup ) );
71 svcLocator->monitoringHub().registerEntity(
"", path,
"histogram:ProfileHistogram:double", *p );
76 const AIDA::IProfile2D& hist ) {
79 if ( n ) {
svcLocator->monitoringHub().registerEntity(
"", path,
"histogram:ProfileHistogram:double", *n ); }
85 rep->SetDirectory(
nullptr );
virtual int rIndexX(int index) const
void adoptRepresentation(TObject *rep) override
Adopt ROOT histogram representation.
void adoptRepresentation(TObject *rep)
std::unique_ptr< TH2D > m_rep
int binEntries(int indexX, int indexY) const override
The number of entries (ie the number of times fill was called for this bin).
virtual int rIndexY(int index) const
void * cast(const std::string &className) const override
Introspection method.
bool setTitle(const std::string &title) override
AIDA implementation for 2 D profiles using ROOT TProfile2D.
Profile2D()
Default Constructor.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Gaudi::Monitoring::Hub & monitoringHub()
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
GAUDI_API ISvcLocator * svcLocator()
std::pair< DataObject *, AIDA::IProfile2D * > createProf2D(ISvcLocator *svcLocator, const std::string &path, const AIDA::IProfile2D &hist)
Copy constructor.
T * getRepresentation(const Q &hist)
void registerEntity(std::string c, std::string n, std::string t, T &ent)