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