14 # pragma warning( disable : 2259 )
20 # pragma warning( disable : 4996 )
35 double xup,
double ylow,
double yup,
37 auto _p =
new TProfile( title.
c_str(), title.
c_str(), nBins, xlow, xup, ylow, yup, opt.
c_str() );
38 auto p =
new Profile1D( _p );
44 const std::string& title,
const Edges& e,
double ylow,
47 new Profile1D(
new TProfile( title.
c_str(), title.
c_str(), e.size() - 1, &e.front(), ylow, yup, opt.
c_str() ) );
53 const AIDA::IProfile1D& hist ) {
54 TProfile*
h = getRepresentation<AIDA::IProfile1D, TProfile>( hist );
55 auto n = (
h ?
new Profile1D(
new TProfile( *
h ) ) :
nullptr );
63 return int( m_rep->GetBinEntries( rIndex( index ) ) + 0.5 );
68 return className ==
"AIDA::IProfile1D"
69 ?
const_cast<AIDA::IProfile1D*
>(
static_cast<const AIDA::IProfile1D*
>( this ) )
70 : className ==
"AIDA::IProfile" ?
const_cast<AIDA::IProfile*
>(
static_cast<const AIDA::IProfile*
>( this ) )
71 : className ==
"AIDA::IBaseHistogram"
72 ?
const_cast<AIDA::IBaseHistogram*
>(
static_cast<const AIDA::IBaseHistogram*
>( this ) )
78 TProfile* imp =
dynamic_cast<TProfile*
>( rep );
79 if ( !imp )
throw std::runtime_error(
"Cannot adopt native histogram representation." );
81 m_axis.initialize( m_rep->GetXaxis(),
true );
82 const TArrayD* a = m_rep->GetSumw2();
83 if ( !a || ( a && a->GetSize() == 0 ) ) m_rep->Sumw2();
84 setTitle( m_rep->GetTitle() );
93 m_classType =
"IProfile1D";
96 if ( initialize_axis ) { axis().initialize( m_rep->GetXaxis(),
false ); }
98 m_rep->SetDirectory(
nullptr );
104 m_rep->SetBinEntries( rIndex( i ), entries );
106 m_rep->SetBinContent( rIndex( i ), height * entries );
108 double sumwy2Bin = ( spread * spread + height * height ) * entries;
109 m_rep->SetBinError( rIndex( i ),
sqrt( sumwy2Bin ) );
110 m_sumEntries += entries;
112 m_rep->SetEntries( m_sumEntries );
119 # pragma warning( disable : 1572 )
123 auto guard = std::scoped_lock{ m_fillSerialization };
124 ( weight == 1. ) ? m_rep->Fill( x, y ) : m_rep->Fill( x, y, weight );