13 if ( !produceHistos() ) {
return nullptr; }
16 auto hist = histo2D ( title ) ;
18 if ( hist ) {
return hist ; }
22 newHistoID( title, ID );
25 return this -> book2D ( ID, title, edgesX, edgesY );
30 template <
class PBASE>
38 if ( !produceHistos() ) {
return nullptr; }
43 this->Error(
"Undefined Histogram ID : Title='"+title+
"'");
48 auto hist = histo2D ( ID ) ;
50 if ( hist ) {
return hist ; }
54 ( title.
empty() ?
"Unnamed 2D Histogram ID="+ID.
idAsString() : title ) ;
59 hist = this->histoSvc() ->
book ( histoPath() ,
67 hist = this->histoSvc() ->
book ( histoPath()+
"/"+
76 { this->Error(
"IHistogram2D* points to NULL! ID='" + ID.
idAsString() +
77 "' title='"+htitle+
"'" ) ;
return nullptr; }
80 m_histo2DMapID [ ID ] = hist ;
81 m_histo2DMapTitle [ title ] = hist ;
88 { this->debug() <<
"Booked 2D Histogram : ID='" << ID
89 <<
"' Path=" << histoPath()
98 template <
class PBASE>
101 (
const double valueX ,
102 const double valueY ,
106 const double weight )
const 108 AIDA::IHistogram2D *
h(
nullptr);
109 if ( produceHistos() )
112 h = histo2D ( title ) ;
113 if ( !h ) { h = book2D ( title , edgesX , edgesY ) ; }
115 h =
fill ( h , valueX , valueY , weight , title );
122 template <
class PBASE>
125 (
const double valueX ,
126 const double valueY ,
131 const double weight )
const 133 AIDA::IHistogram2D *
h(
nullptr);
134 if ( produceHistos() )
138 if ( !h ) { h = book2D ( ID , title , edgesX , edgesY ) ; }
140 h =
fill ( h , valueX , valueY , 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
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
AIDA::IHistogram2D * book2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D histogram
bool literal() const noexcept
Is this ID numeric.
AIDA::IHistogram2D * plot2D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D histogram (book on demand)
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.
ID class for Histogram and Ntuples.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.