4 #pragma warning( disable : 2259 ) 10 #pragma warning( disable : 4996 ) 18 #include <TProfile2D.h> 25 if ( className ==
"AIDA::IProfile2D" )
26 return const_cast<AIDA::IProfile2D*
>( (AIDA::IProfile2D*)
this );
27 else if ( className ==
"AIDA::IProfile" )
28 return const_cast<AIDA::IProfile*
>( (AIDA::IProfile*)
this );
29 else if ( className ==
"AIDA::IBaseHistogram" )
30 return const_cast<AIDA::IBaseHistogram*
>( (AIDA::IBaseHistogram*)
this );
37 int rBin = m_rep->GetBin( rIndexX( idX ), rIndexY( idY ) );
38 return int( m_rep->GetBinEntries( rBin ) + 0.5 );
44 TProfile2D* imp =
dynamic_cast<TProfile2D*
>( rep );
45 if ( !imp )
throw std::runtime_error(
"Cannot adopt native histogram representation." );
47 m_xAxis.initialize( m_rep->GetXaxis(), true );
48 m_yAxis.initialize( m_rep->GetYaxis(), true );
49 setTitle( m_rep->GetTitle() );
54 const Edges& eY,
double ,
double )
57 auto p =
new Profile2D(
new TProfile2D( title.
c_str(), title.
c_str(), eX.size() - 1, &eX.front(), eY.size() - 1,
63 double xup,
int binsY,
double ylow,
double yup,
64 double zlow,
double zup )
67 new Profile2D(
new TProfile2D( title.
c_str(), title.
c_str(), binsX, xlow, xup, binsY, ylow, yup, zlow, zup ) );
73 auto h = getRepresentation<AIDA::IProfile2D, TProfile2D>( hist );
74 auto n = ( h ?
new Profile2D(
new TProfile2D( *h ) ) : nullptr );
80 m_classType =
"IProfile2D";
81 rep->SetDirectory(
nullptr );
82 adoptRepresentation( rep );
AIDA implementation for 2 D profiles using ROOT TProfile2D.
std::vector< double > Edges
void adoptRepresentation(TObject *rep) override
Adopt ROOT histogram representation.
int binEntries(int indexX, int indexY) const override
The number of entries (ie the number of times fill was called for this bin).
std::pair< DataObject *, AIDA::IProfile2D * > createProf2D(const AIDA::IProfile2D &hist)
Copy constructor.
void * cast(const std::string &className) const override
Introspection method.
Profile2D()
Default Constructor.
Helper functions to set/get the application return code.