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 m_histo3DMapID [ ID ] = hist ;
00079 m_histo3DMapTitle [ title ] = hist ;
00080
00081
00082 monitorHisto( Gaudi::Utils::Histos::toBase ( hist ) , ID );
00083
00084
00085 if ( this->msgLevel(MSG::DEBUG) )
00086 { this->debug() << "Booked 3D Histogram : ID='" << ID
00087 << "' Path=" << histoPath()
00088 << " Title='"
00089 << Gaudi::Utils::Histos::htitle ( hist )
00090 << "'" << endmsg; }
00091 return hist ;
00092 }
00093
00094
00095
00096 template <class PBASE>
00097 AIDA::IHistogram3D*
00098 GaudiHistos<PBASE>::plot3D
00099 ( const double valueX ,
00100 const double valueY ,
00101 const double valueZ ,
00102 const std::string& title ,
00103 const HistoBinEdges& edgesX ,
00104 const HistoBinEdges& edgesY ,
00105 const HistoBinEdges& edgesZ ,
00106 const double weight ) const
00107 {
00108 AIDA::IHistogram3D * h(NULL);
00109 if ( produceHistos() )
00110 {
00111
00112 h = histo3D ( title ) ;
00113 if ( NULL == h ) { h = book3D ( title , edgesX , edgesY , edgesZ ) ; }
00114
00115 h = fill ( h , valueX , valueY , valueZ , weight , title );
00116 }
00117 return h;
00118 }
00119
00120
00121
00122 template <class PBASE>
00123 AIDA::IHistogram3D*
00124 GaudiHistos<PBASE>::plot3D
00125 ( const double valueX ,
00126 const double valueY ,
00127 const double valueZ ,
00128 const HistoID& ID ,
00129 const std::string& title ,
00130 const HistoBinEdges& edgesX ,
00131 const HistoBinEdges& edgesY ,
00132 const HistoBinEdges& edgesZ ,
00133 const double weight ) const
00134 {
00135 AIDA::IHistogram3D * h(NULL);
00136 if ( produceHistos() )
00137 {
00138
00139 h = histo3D ( ID ) ;
00140 if ( NULL == h ) { h = book3D ( ID , title , edgesX , edgesY , edgesZ ) ; }
00141
00142 h = fill ( h , valueX , valueY , valueZ , weight , title ) ;
00143 }
00144 return h;
00145 }