8 const unsigned long binsX,
const double lowY,
const double highY,
9 const unsigned long binsY )
const {
11 if ( !produceHistos() ) {
return nullptr; }
14 auto hist = histo2D( title );
16 if ( hist ) {
return hist; }
20 newHistoID( title, ID );
23 return this->book2D( ID, title, lowX, highX, binsX, lowY, highY, binsY );
28 template <
class PBASE>
30 const double highX,
const unsigned long binsX,
const double lowY,
31 const double highY,
const unsigned long binsY )
const {
33 if ( !produceHistos() ) {
return nullptr; }
37 this->Error(
"Undefined Histogram ID : Title='" + title +
"'" ).ignore();
42 auto hist = histo2D( ID );
44 if ( hist ) {
return hist; }
51 hist = this->histoSvc()->book( histoPath(), ID.
numericID(),
htitle, binsX, lowX, highX, binsY, lowY, highY );
53 hist = this->histoSvc()->book( histoPath() +
"/" + ID.
literalID(),
htitle, binsX, lowX, highX, binsY, lowY, highY );
58 this->Error(
"IHistogram2D* points to NULL! ID='" + ID.
idAsString() +
"' title='" +
htitle +
"'" ).ignore();
63 m_histo2DMapID[ID] = hist;
64 m_histo2DMapTitle[title] = hist;
71 this->debug() <<
"Booked 2D Histogram : ID='" << ID <<
"' Path=" << histoPath() <<
" Title='" 80 template <
class PBASE>
82 const double weight,
const std::string& title )
const {
84 if ( !histo ) {
return nullptr; }
86 if ( !checkForNaN() ) {
91 this->Warning(
"fill():: 'NaN' value is skipped from the histogram '" +
95 this->Warning(
"fill():: 'Infinite' value is skipped from the histogram '" +
105 template <
class PBASE>
107 const double lowX,
const double highX,
const double lowY,
108 const double highY,
const unsigned long binsX,
109 const unsigned long binsY,
const double weight )
const {
110 AIDA::IHistogram2D* h(
nullptr );
111 if ( produceHistos() ) {
113 h = histo2D( title );
114 if ( !h ) { h = book2D( title, lowX, highX, binsX, lowY, highY, binsY ); }
116 h =
fill( h, valueX, valueY, weight, title );
123 template <
class PBASE>
125 const std::string& title,
const double lowX,
const double highX,
126 const double lowY,
const double highY,
const unsigned long binsX,
127 const unsigned long binsY,
const double weight )
const {
128 AIDA::IHistogram2D* h(
nullptr );
130 if ( produceHistos() ) {
133 if ( !h ) { h = book2D( ID, title, lowX, highX, binsX, lowY, highY, binsY ); }
135 h =
fill( h, valueX, valueY, weight, title );
const LiteralID & literalID() const noexcept
Returns the ID as a LiteralID.
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
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 noexcept
Returns the numerical ID.
GAUDI_API LiteralID idAsString() const
Return ID as string, for both numeric and literal IDs.
bool undefined() const noexcept
Is this ID undefined.
bool literal() const noexcept
Is this ID numeric.
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
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
bool numeric() const noexcept
Is this ID numeric.
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
ID class for Histogram and Ntuples.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
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)