14 # pragma warning( disable : 2259 )
20 # pragma warning( disable : 4996 )
33 double xup,
double ylow,
double yup,
35 auto _p =
new TProfile( title.
c_str(), title.
c_str(), nBins, xlow, xup, ylow, yup, opt.
c_str() );
36 auto p =
new Profile1D( _p );
42 const std::string& title,
const Edges& e,
double ylow,
45 new Profile1D(
new TProfile( title.
c_str(), title.
c_str(), e.size() - 1, &e.front(), ylow, yup, opt.
c_str() ) );
51 const AIDA::IProfile1D& hist ) {
52 TProfile*
h = getRepresentation<AIDA::IProfile1D, TProfile>( hist );
53 auto n = (
h ?
new Profile1D(
new TProfile( *
h ) ) :
nullptr );
61 return int( m_rep->GetBinEntries( rIndex( index ) ) + 0.5 );
66 return className ==
"AIDA::IProfile1D"
67 ?
const_cast<AIDA::IProfile1D*
>(
static_cast<const AIDA::IProfile1D*
>( this ) )
68 : className ==
"AIDA::IProfile" ?
const_cast<AIDA::IProfile*
>(
static_cast<const AIDA::IProfile*
>( this ) )
69 : className ==
"AIDA::IBaseHistogram"
70 ?
const_cast<AIDA::IBaseHistogram*
>(
static_cast<const AIDA::IBaseHistogram*
>( this ) )
76 TProfile* imp =
dynamic_cast<TProfile*
>( rep );
77 if ( !imp )
throw std::runtime_error(
"Cannot adopt native histogram representation." );
79 m_axis.initialize( m_rep->GetXaxis(),
true );
80 const TArrayD* a = m_rep->GetSumw2();
81 if ( !a || ( a && a->GetSize() == 0 ) ) m_rep->Sumw2();
82 setTitle( m_rep->GetTitle() );
91 m_classType =
"IProfile1D";
94 if ( initialize_axis ) { axis().initialize( m_rep->GetXaxis(),
false ); }
96 m_rep->SetDirectory(
nullptr );
102 m_rep->SetBinEntries( rIndex( i ), entries );
104 m_rep->SetBinContent( rIndex( i ), height * entries );
106 double sumwy2Bin = ( spread * spread + height * height ) * entries;
107 m_rep->SetBinError( rIndex( i ),
sqrt( sumwy2Bin ) );
108 m_sumEntries += entries;
110 m_rep->SetEntries( m_sumEntries );
116 auto guard = std::scoped_lock{ m_fillSerialization };
117 m_rep->Fill( x, y, weight );