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