4 # pragma warning( disable : 2259 ) 10 # pragma warning( disable : 4996 ) 20 double xup,
double ylow,
double yup,
22 auto _p =
new TProfile( title.
c_str(), title.
c_str(), nBins, xlow, xup, ylow, yup, opt.
c_str() );
23 auto p =
new Profile1D( _p );
30 new Profile1D(
new TProfile( title.
c_str(), title.
c_str(), e.size() - 1, &e.front(), ylow, yup, opt.
c_str() ) );
35 TProfile* h = getRepresentation<AIDA::IProfile1D, TProfile>( hist );
36 auto n = ( h ?
new Profile1D(
new TProfile( *h ) ) : nullptr );
43 return int( m_rep->GetBinEntries( rIndex( index ) ) + 0.5 );
48 return className ==
"AIDA::IProfile1D" 49 ?
const_cast<AIDA::IProfile1D*
>(
static_cast<const AIDA::IProfile1D*
>( this ) )
50 : className ==
"AIDA::IProfile" 51 ?
const_cast<AIDA::IProfile*
>(
static_cast<const AIDA::IProfile*
>( this ) )
52 : className ==
"AIDA::IBaseHistogram" 53 ?
const_cast<AIDA::IBaseHistogram*
>(
static_cast<const AIDA::IBaseHistogram*
>( this ) )
59 TProfile* imp =
dynamic_cast<TProfile*
>( rep );
60 if ( !imp )
throw std::runtime_error(
"Cannot adopt native histogram representation." );
62 m_axis.initialize( m_rep->GetXaxis(), true );
63 const TArrayD* a = m_rep->GetSumw2();
64 if ( !a || ( a && a->GetSize() == 0 ) ) m_rep->Sumw2();
65 setTitle( m_rep->GetTitle() );
79 m_rep->SetDirectory(
nullptr );
87 m_rep->SetBinContent(
rIndex( i ), height * entries );
89 double sumwy2Bin = ( spread * spread + height * height ) * entries;
90 m_rep->SetBinError(
rIndex( i ), sqrt( sumwy2Bin ) );
100 # pragma warning( disable : 1572 ) 105 ( weight == 1. ) ?
m_rep->Fill( x, y ) :
m_rep->Fill( x, y, weight );
void * cast(const std::string &cl) const override
Manual cast by class name.
int entries() const override
Get the number or all the entries.
std::vector< double > Edges
virtual bool setBinContents(int i, int entries, double height, double error, double spread, double centre)
void adoptRepresentation(TObject *rep) override
Adopt ROOT histogram representation.
Axis & axis()
Access to axis object.
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
bool setTitle(const std::string &title) override
Set the title of the object.
int binEntries(int index) const override
Number of entries in the corresponding bin (ie the number of times fill was called for this bin)...
Profile1D()
Default Constructor.
void initialize(TAxis *itaxi, bool)
std::mutex m_fillSerialization
bool fill(double x, double y, double weight=1.) override
Fill the Profile1D with a value and the corresponding weight.
virtual int rIndex(int index) const
operator methods
void init(const std::string &title, bool initialize_axis=true)
Helper functions to set/get the application return code.
std::pair< DataObject *, AIDA::IProfile1D * > createProf1D(const AIDA::IProfile1D &hist)
Copy constructor.
bool setName(const std::string &newName)
Set the name of the object.
Common AIDA implementation stuff for histograms and profiles using ROOT implementations.