14 # pragma warning( disable : 2259 )
20 # pragma warning( disable : 4996 )
30 #include <TProfile2D.h>
35 return className ==
"AIDA::IProfile2D"
36 ?
const_cast<AIDA::IProfile2D*
>(
static_cast<const AIDA::IProfile2D*
>( this ) )
37 : className ==
"AIDA::IProfile" ?
const_cast<AIDA::IProfile*
>(
static_cast<const AIDA::IProfile*
>( this ) )
38 : className ==
"AIDA::IBaseHistogram"
39 ?
const_cast<AIDA::IBaseHistogram*
>(
static_cast<const AIDA::IBaseHistogram*
>( this ) )
45 int rBin = m_rep->GetBin( rIndexX( idX ), rIndexY( idY ) );
46 return int( m_rep->GetBinEntries( rBin ) + 0.5 );
51 TProfile2D* imp =
dynamic_cast<TProfile2D*
>( rep );
52 if ( !imp )
throw std::runtime_error(
"Cannot adopt native histogram representation." );
54 m_xAxis.initialize( m_rep->GetXaxis(),
true );
55 m_yAxis.initialize( m_rep->GetYaxis(),
true );
56 setTitle( m_rep->GetTitle() );
62 const Edges& eY,
double ,
double ) {
64 auto p =
new Profile2D(
new TProfile2D( title.
c_str(), title.
c_str(), eX.size() - 1, &eX.front(), eY.size() - 1,
72 double xup,
int binsY,
double ylow,
double yup,
73 double zlow,
double zup ) {
75 new Profile2D(
new TProfile2D( title.
c_str(), title.
c_str(), binsX, xlow, xup, binsY, ylow, yup, zlow, zup ) );
81 const AIDA::IProfile2D& hist ) {
82 auto h = getRepresentation<AIDA::IProfile2D, TProfile2D>( hist );
83 auto n = (
h ?
new Profile2D(
new TProfile2D( *
h ) ) :
nullptr );
90 rep->SetDirectory(
nullptr );