8 (
const std::string& title ,
13 if ( !produceHistos() ) {
return 0 ; }
16 AIDA::IHistogram2D * hist = histo2D ( title ) ;
18 if ( NULL != hist ) {
return hist ; }
22 newHistoID( title, ID );
25 return this -> book2D ( ID, title, edgesX, edgesY );
30 template <
class PBASE>
33 const std::string& title ,
38 if ( !produceHistos() ) {
return 0 ; }
43 this->Error(
"Undefined Histogram ID : Title='"+title+
"'");
48 AIDA::IHistogram2D * hist = histo2D ( ID ) ;
50 if ( NULL != hist ) {
return hist ; }
53 const std::string &
htitle =
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 NULL; }
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 ,
103 const std::string& title ,
106 const double weight )
const
108 AIDA::IHistogram2D * h(NULL);
109 if ( produceHistos() )
112 h = histo2D ( title ) ;
113 if ( NULL == 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 ,
128 const std::string& title ,
131 const double weight )
const
133 AIDA::IHistogram2D * h(NULL);
134 if ( produceHistos() )
138 if ( NULL == 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
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
GaudiAlg::HistoBinEdges HistoBinEdges
Edges for variable binning.
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.