8 (
const std::string& title ,
11 const unsigned long binsX ,
14 const unsigned long binsY )
const
17 if ( !produceHistos() ) {
return 0 ; }
20 AIDA::IHistogram2D* hist = histo2D ( title ) ;
22 if( NULL != hist ) {
return hist ; }
26 newHistoID( title, ID );
29 return this -> book2D ( ID, title, lowX, highX, binsX, lowY, highY, binsY );
34 template <
class PBASE>
37 const std::string& title ,
40 const unsigned long binsX ,
43 const unsigned long binsY )
const
46 if ( !produceHistos() ) {
return 0 ; }
51 this->Error(
"Undefined Histogram ID : Title='"+title+
"'");
56 AIDA::IHistogram2D* hist = histo2D( ID ) ;
58 if( NULL != hist ) {
return hist ; }
61 const std::string &
htitle =
62 ( title.empty() ?
"Unnamed 2D Histogram ID="+ID.
idAsString() : title ) ;
67 hist = this->histoSvc() ->
book ( histoPath() ,
79 hist = this->histoSvc() ->
book ( histoPath()+
"/"+
92 { this->Error(
"IHistogram2D* points to NULL! ID='" + ID.
idAsString() +
93 "' title='"+htitle+
"'" ) ;
return NULL; }
96 m_histo2DMapID [ ID ] = hist ;
97 m_histo2DMapTitle [ title ] = hist ;
104 { this->debug() <<
"Booked 2D Histogram : ID='"
105 << ID <<
"' Path=" << histoPath()
115 template <
class PBASE>
117 ( AIDA::IHistogram2D* histo ,
118 const double valueX ,
119 const double valueY ,
120 const double weight ,
121 const std::string& title )
const
124 if ( NULL == histo ) {
return 0 ; }
126 if ( !checkForNaN() )
128 else if ( lfin ( valueX ) && lfin ( valueY ) && lfin ( weight ) )
130 else if ( lnan ( valueX ) || lnan ( valueY ) || lnan ( weight ) )
133 (
"fill():: 'NaN' value is skipped from the histogram '"
139 (
"fill():: 'Infinite' value is skipped from the histogram '"
148 template <
class PBASE>
150 (
const double valueX ,
151 const double valueY ,
152 const std::string& title ,
157 const unsigned long binsX ,
158 const unsigned long binsY ,
159 const double weight )
const
161 AIDA::IHistogram2D * h(NULL);
162 if ( produceHistos() )
165 h = histo2D ( title ) ;
167 { h = book2D ( title , lowX , highX , binsX , lowY , highY , binsY ) ; }
169 h =
fill ( h , valueX , valueY , weight , title ) ;
176 template <
class PBASE>
178 (
const double valueX ,
179 const double valueY ,
181 const std::string& title ,
186 const unsigned long binsX ,
187 const unsigned long binsY ,
188 const double weight )
const
190 AIDA::IHistogram2D * h(NULL);
192 if ( produceHistos() )
196 if ( NULL == h ) { h = book2D ( ID , title ,
197 lowX , highX , binsX ,
198 lowY , highY , binsY ) ; }
200 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
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.
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
const LiteralID & literalID() const
Returns the ID as a LiteralID.
bool undefined() const
Is this ID undefined.
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)
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)
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.
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