8 const unsigned long bins )
const {
10 if ( !produceHistos() ) {
return nullptr; }
13 auto hist = histo1D( title );
15 if ( hist ) {
return hist; }
19 newHistoID( title, ID );
22 return this->book1D( ID, title, low, high, bins );
27 template <
class PBASE>
29 const double high,
const unsigned long bins )
const {
31 if ( !produceHistos() ) {
return nullptr; }
36 this->Error(
"Undefined Histogram ID : Title='" + title +
"'" ).ignore();
41 auto* hist = histo1D( ID );
43 if ( hist ) {
return hist; }
50 hist = this->histoSvc()->book( histoPath(), ID.
numericID(),
htitle, bins, low, high );
52 hist = this->histoSvc()->book( histoPath() +
"/" + ID.
literalID(),
htitle, bins, low, high );
57 this->Error(
"IHistogram1D* points to NULL! ID='" + ID.
idAsString() +
"' title='" + htitle +
"'" ).ignore();
62 m_histo1DMapID[ID] = hist;
63 m_histo1DMapTitle[title] = hist;
70 this->debug() <<
"Booked 1D Histogram : ID='" << ID <<
"' Path=" << histoPath() <<
" Title='" 78 template <
class PBASE>
81 if ( !histo ) {
return nullptr; }
83 if ( !checkForNaN() ) {
88 this->Warning(
"fill():: 'NaN' value is skipped from the histogram '" +
92 this->Warning(
"fill():: 'Infinite' value is skipped from the histogram '" +
102 template <
class PBASE>
104 const double high,
const unsigned long bins,
105 const double weight )
const {
106 AIDA::IHistogram1D* h(
nullptr );
107 if ( produceHistos() ) {
109 h = histo1D( title );
110 if ( !h ) { h = book1D( title, low, high, bins ); }
112 h =
fill( h, value, weight, title );
119 template <
class PBASE>
121 const double low,
const double high,
const unsigned long bins,
122 const double weight )
const {
123 AIDA::IHistogram1D* h(
nullptr );
124 if ( produceHistos() ) {
127 if ( !h ) { h = book1D( ID, title, low, high, bins ); }
129 h =
fill( h, value, weight, title );
136 template <
class PBASE>
143 template <
class PBASE>
150 template <
class PBASE>
152 const double weight )
const {
158 template <
class PBASE>
160 const double weight )
const {
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
NumericID numericID() const noexcept
Returns the numerical ID.
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
double highEdge() const
get the high edge
double lowEdge() const
get the low edge
const std::string & title() const
get the title
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
bool literal() const noexcept
Is this ID numeric.
AIDA::IHistogram1D * book(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
int bins() const
get the number of bins
const LiteralID & literalID() const noexcept
Returns the ID as a LiteralID.
GAUDI_API LiteralID idAsString() const
Return ID as string, for both numeric and literal IDs.
bool numeric() const noexcept
Is this ID numeric.
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
bool undefined() const noexcept
Is this ID undefined.
AIDA::IHistogram1D * plot1D(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
fill the 1D histogram (book on demand)
ID class for Histogram and Ntuples.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight