12 if ( !produceHistos() ) {
return nullptr ; }
15 auto hist = histo1D ( title ) ;
17 if( hist ) {
return hist ; }
21 newHistoID( title, ID );
24 return this -> book1D ( ID, title, edges );
29 template <
class PBASE>
36 if ( !produceHistos() ) {
return nullptr ; }
41 this->Error(
"Undefined Histogram ID : Title='"+title+
"'");
46 auto hist = histo1D ( ID ) ;
48 if ( hist ) {
return hist ; }
52 ( title.
empty() ?
"Unnamed 1D Histogram ID="+ID.
idAsString() : title ) ;
57 hist = this->histoSvc() ->
book ( histoPath() ,
64 hist = this->histoSvc() ->
book ( histoPath()+
"/"+
72 { this->Error(
"IHistogram1D* points to NULL! ID='" + ID.
idAsString() +
73 "' title='"+htitle+
"'" ) ;
return nullptr; }
76 m_histo1DMapID [ ID ] = hist ;
77 m_histo1DMapTitle [ title ] = hist ;
84 { this->debug() <<
"Booked 1D Histogram : ID='" << ID
85 <<
"' Path=" << histoPath()
94 template <
class PBASE>
97 (
const double value ,
100 const double weight )
const 102 AIDA::IHistogram1D *
h(
nullptr);
103 if ( produceHistos() )
106 h = histo1D ( title ) ;
107 if ( !h ) { h = book1D ( title , edges ) ; }
109 h =
fill ( h , value , weight , title );
116 template <
class PBASE>
119 (
const double value ,
123 const double weight )
const 125 AIDA::IHistogram1D*
h(
nullptr);
126 if ( produceHistos() )
130 if ( !h ) { h = book1D ( ID , title , edges ) ; }
132 h =
fill ( h , value , weight , title ) ;
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
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
NumericID numericID() const
Returns the numerical ID.
const LiteralID & literalID() const
Returns the ID as a LiteralID.
bool undefined() const
Is this ID undefined.
GAUDI_API LiteralID idAsString() const
Return ID as string, for both numeric and literal IDs.
bool literal() const
Is this ID numeric.
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
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.
bool numeric() const
Is this ID numeric.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.