11 const unsigned long bins )
const 14 if ( !produceHistos() ) {
return nullptr ; }
17 auto hist = histo1D ( title ) ;
19 if( hist ) {
return hist ; }
23 newHistoID( title, ID );
26 return this -> book1D ( ID, title, low, high, bins );
31 template <
class PBASE>
37 const unsigned long bins )
const 40 if ( !produceHistos() ) {
return nullptr ; }
46 this->Error(
"Undefined Histogram ID : Title='"+title+
"'");
51 auto* hist = histo1D ( ID ) ;
53 if ( hist ) {
return hist ; }
57 ( title.
empty() ?
"Unnamed 1D Histogram ID="+ID.
idAsString() : title ) ;
62 hist = this->histoSvc() ->
book ( histoPath() ,
71 hist = this->histoSvc() ->
book ( histoPath()+
"/"+
81 { this->Error(
"IHistogram1D* points to NULL! ID='" + ID.
idAsString() +
82 "' title='"+htitle+
"'" ) ;
return nullptr; }
85 m_histo1DMapID [ ID ] = hist ;
86 m_histo1DMapTitle [ title ] = hist ;
93 { this->debug() <<
"Booked 1D Histogram : ID='" << ID
94 <<
"' Path=" << histoPath()
103 template <
class PBASE>
105 ( AIDA::IHistogram1D* histo ,
107 const double weight ,
110 if ( !histo ) {
return nullptr ; }
112 if ( !checkForNaN() )
119 (
"fill():: 'NaN' value is skipped from the histogram '" 125 (
"fill():: 'Infinite' value is skipped from the histogram '" 134 template <
class PBASE>
137 (
const double value ,
141 const unsigned long bins ,
142 const double weight )
const 144 AIDA::IHistogram1D *
h(
nullptr);
145 if ( produceHistos() )
148 h = histo1D ( title ) ;
149 if ( !h ) { h = book1D ( title , low , high , bins ) ; }
151 h =
fill ( h , value , weight , title );
158 template <
class PBASE>
161 (
const double value ,
166 const unsigned long bins ,
167 const double weight )
const 169 AIDA::IHistogram1D*
h(
nullptr);
170 if ( produceHistos() )
174 if ( !h ) { h = book1D ( ID , title , low , high , bins ) ; }
176 h =
fill ( h , value , weight , title ) ;
183 template <
class PBASE>
188 return book1D ( hdef.
title () ,
196 template <
class PBASE>
211 template <
class PBASE>
214 (
const double value ,
216 const double weight )
const 226 template <
class PBASE>
229 (
const double value ,
232 const double weight )
const GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
GAUDI_API AIDA::IHistogram1D * book(IHistogramSvc *svc, const std::string &path, const Gaudi::Histo1DDef &hist)
helper function to book 1D-histogram
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