10 if ( !produceHistos() ) {
return nullptr; }
13 auto hist = histo2D( title );
15 if ( hist ) {
return hist; }
19 newHistoID( title, ID );
22 return this->book2D( ID, title, edgesX, edgesY );
27 template <
class PBASE>
31 if ( !produceHistos() ) {
return nullptr; }
35 this->Error(
"Undefined Histogram ID : Title='" + title +
"'" ).ignore();
40 auto hist = histo2D( ID );
42 if ( hist ) {
return hist; }
49 hist = this->histoSvc()->book( histoPath(), ID.
numericID(),
htitle, edgesX, edgesY );
51 hist = this->histoSvc()->book( histoPath() +
"/" + ID.
literalID(),
htitle, edgesX, edgesY );
56 this->Error(
"IHistogram2D* points to NULL! ID='" + ID.
idAsString() +
"' title='" + htitle +
"'" ).ignore();
61 m_histo2DMapID[ID] = hist;
62 m_histo2DMapTitle[title] = hist;
69 this->debug() <<
"Booked 2D Histogram : ID='" << ID <<
"' Path=" << histoPath() <<
" Title='" 77 template <
class PBASE>
80 const double weight )
const {
81 AIDA::IHistogram2D* h(
nullptr );
82 if ( produceHistos() ) {
85 if ( !h ) { h = book2D( title, edgesX, edgesY ); }
87 h =
fill( h, valueX, valueY, weight, title );
94 template <
class PBASE>
98 AIDA::IHistogram2D* h(
nullptr );
99 if ( produceHistos() ) {
102 if ( !h ) { h = book2D( ID, title, edgesX, edgesY ); }
104 h =
fill( h, valueX, valueY, weight, title );
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
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.