14 # pragma warning( disable : 2259 )
20 # pragma warning( disable : 4996 )
30 double xup,
double ylow,
double yup,
32 auto _p =
new TProfile( title.
c_str(), title.
c_str(), nBins, xlow, xup, ylow, yup, opt.
c_str() );
33 auto p =
new Profile1D( _p );
40 new Profile1D(
new TProfile( title.
c_str(), title.
c_str(), e.size() - 1, &e.front(), ylow, yup, opt.
c_str() ) );
45 TProfile*
h = getRepresentation<AIDA::IProfile1D, TProfile>( hist );
46 auto n = (
h ?
new Profile1D(
new TProfile( *
h ) ) :
nullptr );
53 return int( m_rep->GetBinEntries( rIndex( index ) ) + 0.5 );
58 return className ==
"AIDA::IProfile1D"
59 ?
const_cast<AIDA::IProfile1D*
>(
static_cast<const AIDA::IProfile1D*
>( this ) )
60 : className ==
"AIDA::IProfile" ?
const_cast<AIDA::IProfile*
>(
static_cast<const AIDA::IProfile*
>( this ) )
61 : className ==
"AIDA::IBaseHistogram"
62 ?
const_cast<AIDA::IBaseHistogram*
>(
static_cast<const AIDA::IBaseHistogram*
>( this ) )
68 TProfile* imp =
dynamic_cast<TProfile*
>( rep );
69 if ( !imp )
throw std::runtime_error(
"Cannot adopt native histogram representation." );
71 m_axis.initialize( m_rep->GetXaxis(),
true );
72 const TArrayD* a = m_rep->GetSumw2();
73 if ( !a || ( a && a->GetSize() == 0 ) ) m_rep->Sumw2();
74 setTitle( m_rep->GetTitle() );
83 m_classType =
"IProfile1D";
86 if ( initialize_axis ) { axis().initialize( m_rep->GetXaxis(),
false ); }
88 m_rep->SetDirectory(
nullptr );
94 m_rep->SetBinEntries( rIndex( i ), entries );
96 m_rep->SetBinContent( rIndex( i ), height * entries );
98 double sumwy2Bin = ( spread * spread + height * height ) * entries;
99 m_rep->SetBinError( rIndex( i ),
sqrt( sumwy2Bin ) );
100 m_sumEntries += entries;
102 m_rep->SetEntries( m_sumEntries );
109 # pragma warning( disable : 1572 )
113 auto guard = std::scoped_lock{ m_fillSerialization };
114 ( weight == 1. ) ? m_rep->Fill( x, y ) : m_rep->Fill( x, y, weight );