6 (
const std::string& title ,
9 const unsigned long bins ,
10 const std::string&
opt ,
12 const double highY )
const
15 if ( !produceHistos() ) {
return 0 ; }
18 AIDA::IProfile1D* hist = profile1D ( title ) ;
20 if( NULL != hist ) {
return hist ; }
24 newHistoID( title, ID );
27 return this -> bookProfile1D ( ID, title, low, high, bins , opt , lowY , highY );
32 template <
class PBASE>
35 const std::string& title ,
38 const unsigned long bins ,
39 const std::string& opt ,
41 const double highY )
const
44 if ( !produceHistos() ) {
return 0 ; }
49 this->Error(
"Undefined Histogram ID : Title='"+title+
"'");
54 AIDA::IProfile1D* hist = profile1D ( ID ) ;
56 if( NULL != hist ) {
return hist ; }
59 const std::string &
htitle =
61 "Unnamed 1D Profile Histogram ID="+ID.
idAsString() : title ) ;
66 hist = this->histoSvc() ->
bookProf ( histoPath() ,
78 hist = this->histoSvc() ->
bookProf ( histoPath()+
"/"+
91 { this->Error(
"IProfile1D* points to NULL! ID='" + ID.
idAsString() +
92 "' title='"+htitle+
"'" ) ;
return NULL; }
95 m_profile1DMapID [ ID ] = hist ;
96 m_profile1DMapTitle [ title ] = hist ;
103 { this->debug() <<
"Booked 1D Profile Histogram : ID='"
104 << ID <<
"' Path=" << histoPath()
113 template <
class PBASE>
115 ( AIDA::IProfile1D* histo ,
116 const double valueX ,
117 const double valueY ,
118 const double weight ,
119 const std::string& title )
const
122 if ( 0 == histo ) {
return 0 ; }
124 if ( !checkForNaN() )
126 else if ( lfin ( valueX ) && lfin ( valueY ) && lfin ( weight ) )
128 else if ( lnan ( valueX ) || lnan ( valueY ) || lnan ( weight ) )
131 (
"fill():: 'NaN' value is skipped from the histogram '"
137 (
"fill():: 'Infinite' value is skipped from the histogram '"
146 template <
class PBASE>
148 (
const double valueX ,
149 const double valueY ,
150 const std::string& title ,
153 const unsigned long binsX ,
154 const std::string& opt ,
157 const double weight )
const
159 AIDA::IProfile1D * h(NULL);
160 if ( produceHistos() )
163 h = profile1D ( title ) ;
165 { h = bookProfile1D ( title , lowX , highX , binsX , opt , lowY , highY ) ; }
167 h =
fill ( h , valueX , valueY , weight , title ) ;
174 template <
class PBASE>
176 (
const double valueX ,
177 const double valueY ,
179 const std::string& title ,
182 const unsigned long binsX ,
183 const std::string& opt ,
186 const double weight )
const
188 AIDA::IProfile1D * h(NULL);
189 if ( produceHistos() )
192 h = profile1D ( ID ) ;
194 { h = bookProfile1D ( ID , title , lowX , highX , binsX , opt , lowY , highY ) ; }
196 h =
fill ( h , valueX , valueY , weight , title ) ;
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
def bookProf(args, kwargs)
The trivial function to book 1D&2D profile histograms:
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
NumericID numericID() const
Returns the numerical ID.
const LiteralID & literalID() const
Returns the ID as a LiteralID.
string opt
print 'Summary: %32s [s] d d steps'%(summary.protocol,summary.type,summary.nevt,len(summary.data),)
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.
ID class for Histogram and Ntuples.
bool numeric() const
Is this ID numeric.
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
AIDA::IProfile1D * bookProfile1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max()) const
book the 1D profile 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