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