15#include <AIDA/IProfile1D.h>
24# pragma clang diagnostic push
25# pragma clang diagnostic ignored "-Wsuggest-override"
26# pragma clang diagnostic ignored "-Winconsistent-missing-override"
27#elif defined( __GNUC__ )
28# pragma GCC diagnostic push
29# pragma GCC diagnostic ignored "-Wsuggest-override"
44 template <
class INTERFACE,
class IMPLEMENTATION>
59 void*
cast(
const std::string& cl )
const override;
71 bool setName(
const std::string& newName );
90 virtual double binRms(
int index )
const;
106 virtual bool scale(
double scaleFactor );
110 bool add(
const INTERFACE& profile )
override;
112 virtual int rIndex(
int index )
const {
return m_axis.rIndex( index ); }
120 double mean()
const override {
return m_rep->GetMean(); }
122 double rms()
const override {
return m_rep->GetRMS(); }
128 std::ostream&
print( std::ostream& s )
const override;
130 std::ostream&
write( std::ostream& s )
const override;
132 int write(
const char* file_name )
const override;
140 std::unique_ptr<IMPLEMENTATION>
m_rep;
147 template <
class INTERFACE,
class IMPLEMENTATION>
155 template <
class INTERFACE,
class IMPLEMENTATION>
157 m_rep->SetName( newName.c_str() );
162 template <
class INTERFACE,
class IMPLEMENTATION>
167 template <
class INTERFACE,
class IMPLEMENTATION>
172 template <
class INTERFACE,
class IMPLEMENTATION>
177 template <
class INTERFACE,
class IMPLEMENTATION>
182 template <
class INTERFACE,
class IMPLEMENTATION>
186 template <
class INTERFACE,
class IMPLEMENTATION>
193 template <
class INTERFACE,
class IMPLEMENTATION>
197 m_rep->GetStats( stats );
198 return stats[0] * stats[0] / stats[1];
201 template <
class INTERFACE,
class IMPLEMENTATION>
203 m_rep->Scale( scaleFactor );
207 template <
class INTERFACE,
class IMPLEMENTATION>
214 throw std::runtime_error(
"Cannot add profile histograms of different implementations." );
217 template <
class INTERFACE,
class IMPLEMENTATION>
220 m_rep->Print(
"all" );
225 template <
class INTERFACE,
class IMPLEMENTATION>
227 s <<
"\n1D Histogram Table: " << std::endl;
228 s <<
"Bin, Height, Error " << std::endl;
229 for (
int i = 0; i <
axis().bins(); ++i )
236 template <
class INTERFACE,
class IMPLEMENTATION>
238 TFile* f = TFile::Open( file_name,
"RECREATE" );
239 Int_t nbytes =
m_rep->Write();
246# pragma clang diagnostic pop
247#elif defined( __GNUC__ )
248# pragma GCC diagnostic pop
Implementation of the AIDA IAnnotation interface class.
An IAxis represents a binned histogram axis.
double minBinHeight() const override
Get the minimum height of the in-range bins.
AIDA::IAnnotation & annotation() override
Access annotation object.
virtual double binRms(int index) const
AIDA::Annotation m_annotation
Object annotations.
virtual bool scale(double scaleFactor)
Scale the weights and the errors of all the IHistogram's bins (in-range and out-of-range ones) by a g...
double binMean(int index) const override
The weighted mean of a bin.
int write(const char *file_name) const override
Write (ASCII) the histogram table into a file.
int allEntries() const override
Get the number or all the entries, both in range and underflow/overflow bins of the IProfile.
int binEntries(int index) const override
Number of entries in the corresponding bin (ie the number of times fill was called for this bin).
std::string name() const
object name
int extraEntries() const override
Get the number of entries in the underflow and overflow bins.
Axis & axis()
Access to axis object.
Generic1D(IMPLEMENTATION *p)
constructor
std::string title() const override
Get the title of the object.
virtual const std::string & userLevelClassType() const
The AIDA user-level unterface leaf class type.
bool add(const INTERFACE &profile) override
Modifies this IProfile1D by adding the contents of profile to it.
std::ostream & write(std::ostream &s) const override
Write (ASCII) the histogram table into the output stream.
int dimension() const override
Get the Histogram's dimension.
bool reset() override
Reset the Histogram; as if just created.
double binHeight(int index) const override
Total height of the corresponding bin (ie the sum of the weights in this bin).
Generic1D()=default
Default constructor.
const AIDA::IAnnotation & annotation() const override
Access annotation object (cons)
const Axis & axis() const override
Get the x axis of the IHistogram1D.
int coordToIndex(double coord) const override
Get the bin number corresponding to a given coordinate along the x axis.
virtual double equivalentBinEntries() const
Number of equivalent entries, i.e. SUM[ weight ] ^ 2 / SUM[ weight^2 ]
void adoptRepresentation(TObject *rep) override
Adopt ROOT histogram representation.
void * cast(const std::string &cl) const override
Manual cast by class name.
TObject * representation() const override
ROOT object implementation.
bool setTitle(const std::string &title) override
Set the title of the object.
double sumBinHeights() const override
Get the sum of in range bin heights in the IProfile.
Generic1D< INTERFACE, IMPLEMENTATION > Base
double rms() const override
The RMS of the whole IHistogram1D.
double binError(int index) const override
The error of a given bin.
double sumAllBinHeights() const override
Get the sum of all the bins heights (including underflow and overflow bin).
virtual int rIndex(int index) const
operator methods
std::unique_ptr< IMPLEMENTATION > m_rep
Reference to underlying implementation.
double maxBinHeight() const override
Get the maximum height of the in-range bins.
int entries() const override
Get the number or all the entries.
double mean() const override
The mean of the whole IHistogram1D.
double sumExtraBinHeights() const override
Get the sum of the underflow and overflow bin height.
std::ostream & print(std::ostream &s) const override
Print (ASCII) the histogram into the output stream.
bool setName(const std::string &newName)
Set the name of the object.
Common base class for all histograms Use is solely functional to minimize dynamic_casts inside Histog...
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...