Go to the documentation of this file.00001
00002
00003
00004
00005
00006 template <class PBASE>
00007 AIDA::IHistogram1D* GaudiHistos<PBASE>::book1D
00008 ( const std::string& title ,
00009 const HistoBinEdges& edges ) const
00010 {
00011
00012 if ( !produceHistos() ) { return 0 ; }
00013
00014
00015 AIDA::IHistogram1D* hist = histo1D ( title ) ;
00016
00017 if( NULL != hist ) { return hist ; }
00018
00019
00020 HistoID ID;
00021 newHistoID( title, ID );
00022
00023
00024 return this -> book1D ( ID, title, edges );
00025 }
00026
00027
00028
00029 template <class PBASE>
00030 AIDA::IHistogram1D* GaudiHistos<PBASE>::book1D
00031 ( const HistoID& ID ,
00032 const std::string& title ,
00033 const HistoBinEdges& edges ) const
00034 {
00035
00036 if ( !produceHistos() ) { return 0 ; }
00037
00038
00039 if (ID.undefined())
00040 {
00041 this->Error("Undefined Histogram ID : Title='"+title+"'");
00042 return NULL;
00043 }
00044
00045
00046 AIDA::IHistogram1D* hist = histo1D ( ID ) ;
00047
00048 if ( NULL != hist ) { return hist ; }
00049
00050
00051 const std::string & htitle =
00052 ( title.empty() ? "Unnamed 1D Histogram ID="+ID.idAsString() : title ) ;
00053
00054
00055 if ( ID.numeric() )
00056 {
00057 hist = this->histoSvc() -> book ( histoPath() ,
00058 ID.numericID() ,
00059 htitle ,
00060 edges ) ;
00061 }
00062 else if ( ID.literal() )
00063 {
00064 hist = this->histoSvc() -> book ( histoPath()+"/"+
00065 ID.literalID() ,
00066 htitle ,
00067 edges ) ;
00068 }
00069
00070
00071 if( NULL == hist )
00072 { this->Error( "IHistogram1D* points to NULL! ID='" + ID.idAsString() +
00073 "' title='"+htitle+"'" ) ; return NULL; }
00074
00075
00076 m_histo1DMapID [ ID ] = hist ;
00077 m_histo1DMapTitle [ title ] = hist ;
00078
00079
00080 monitorHisto( Gaudi::Utils::Histos::toBase ( hist ) , ID );
00081
00082
00083 if ( this->msgLevel(MSG::DEBUG) )
00084 { this->debug() << "Booked 1D Histogram : ID='" << ID
00085 << "' Path=" << histoPath()
00086 << " Title='"
00087 << Gaudi::Utils::Histos::htitle ( hist )
00088 << "'" << endmsg; }
00089 return hist ;
00090 }
00091
00092
00093
00094 template <class PBASE>
00095 AIDA::IHistogram1D*
00096 GaudiHistos<PBASE>::plot1D
00097 ( const double value ,
00098 const std::string& title ,
00099 const HistoBinEdges& edges ,
00100 const double weight ) const
00101 {
00102 AIDA::IHistogram1D * h(NULL);
00103 if ( produceHistos() )
00104 {
00105
00106 h = histo1D ( title ) ;
00107 if ( NULL == h ) { h = book1D ( title , edges ) ; }
00108
00109 h = fill ( h , value , weight , title );
00110 }
00111 return h;
00112 }
00113
00114
00115
00116 template <class PBASE>
00117 AIDA::IHistogram1D*
00118 GaudiHistos<PBASE>::plot1D
00119 ( const double value ,
00120 const HistoID& ID ,
00121 const std::string& title ,
00122 const HistoBinEdges& edges ,
00123 const double weight ) const
00124 {
00125 AIDA::IHistogram1D* h(NULL);
00126 if ( produceHistos() )
00127 {
00128
00129 h = histo1D ( ID ) ;
00130 if ( NULL == h ) { h = book1D ( ID , title , edges ) ; }
00131
00132 h = fill ( h , value , weight , title ) ;
00133 }
00134 return h;
00135 }
00136
00137
00138