8 (
const std::string& title ,
11 const unsigned long bins )
const
14 if ( !produceHistos() ) {
return 0 ; }
17 AIDA::IHistogram1D* hist = histo1D ( title ) ;
19 if( NULL != hist ) {
return hist ; }
23 newHistoID( title, ID );
26 return this -> book1D ( ID, title, low, high, bins );
31 template <
class PBASE>
34 const std::string& title ,
37 const unsigned long bins )
const
40 if ( !produceHistos() ) {
return 0 ; }
46 this->Error(
"Undefined Histogram ID : Title='"+title+
"'");
51 AIDA::IHistogram1D* hist = histo1D ( ID ) ;
53 if ( NULL != hist ) {
return hist ; }
56 const std::string &
htitle =
57 ( title.empty() ?
"Unnamed 1D Histogram ID="+ID.
idAsString() : title ) ;
62 hist = this->histoSvc() ->
book ( histoPath() ,
71 hist = this->histoSvc() ->
book ( histoPath()+
"/"+
81 { this->Error(
"IHistogram1D* points to NULL! ID='" + ID.
idAsString() +
82 "' title='"+htitle+
"'" ) ;
return NULL; }
85 m_histo1DMapID [ ID ] = hist ;
86 m_histo1DMapTitle [ title ] = hist ;
93 { this->debug() <<
"Booked 1D Histogram : ID='" << ID
94 <<
"' Path=" << histoPath()
103 template <
class PBASE>
105 ( AIDA::IHistogram1D* histo ,
107 const double weight ,
108 const std::string& title )
const
110 if ( 0 == histo ) {
return 0 ; }
112 if ( !checkForNaN() )
114 else if ( lfin ( value ) && lfin ( weight ) )
116 else if ( lnan ( value ) || lnan ( weight ) )
119 (
"fill():: 'NaN' value is skipped from the histogram '"
125 (
"fill():: 'Infinite' value is skipped from the histogram '"
134 template <
class PBASE>
137 (
const double value ,
138 const std::string& title ,
141 const unsigned long bins ,
142 const double weight )
const
144 AIDA::IHistogram1D * h(NULL);
145 if ( produceHistos() )
148 h = histo1D ( title ) ;
149 if ( NULL == h ) { h = book1D ( title , low , high , bins ) ; }
151 h =
fill ( h , value , weight , title );
158 template <
class PBASE>
161 (
const double value ,
163 const std::string& title ,
166 const unsigned long bins ,
167 const double weight )
const
169 AIDA::IHistogram1D* h(NULL);
170 if ( produceHistos() )
174 if ( NULL == h ) { h = book1D ( ID , title , low , high , bins ) ; }
176 h =
fill ( h , value , weight , title ) ;
183 template <
class PBASE>
188 return book1D ( hdef.
title () ,
196 template <
class PBASE>
211 template <
class PBASE>
214 (
const double value ,
216 const double weight )
const
226 template <
class PBASE>
229 (
const double value ,
232 const double weight )
const
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
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
double highEdge() const
get the high edge
double lowEdge() const
get the low edge
const std::string & title() const
get the title
NumericID numericID() const
Returns the numerical ID.
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
const LiteralID & literalID() const
Returns the ID as a LiteralID.
AIDA::IHistogram1D * book(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
int bins() const
get the number of bins
bool undefined() const
Is this ID undefined.
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)
AIDA::IHistogram1D * plot1D(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
fill the 1D histogram (book on demand)
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