| # Gaudi Framework, version v23r0 |

Home |  | Generated: Mon Jan 30 2012

# HistoTool.h

Go to the documentation of this file.

    00001 // $Id: HistoTool.h,v 1.4 2006/11/30 10:16:12 mato Exp $
    00002 // ============================================================================
    00003 #ifndef GAUDIALG_HISTOTOOL_H
    00004 #define GAUDIALG_HISTOTOOL_H 1
    00005 // ============================================================================
    00006 // Include files
    00007 // ============================================================================
    00008 // Gaudi
    00009 // ============================================================================
    00010 #include "GaudiAlg/GaudiHistoTool.h"
    00011 #include "GaudiAlg/IHistoTool.h"
    00012 // ============================================================================
    00013
    00030 class HistoTool : virtual public GaudiHistoTool ,
    00031                   virtual public     IHistoTool
    00032 {
    00033 public:
    00034   typedef IHistoTool::HistoID HistoID ;
    00035
    00044   HistoTool ( const std::string& type,
    00045               const std::string& name,
    00046               const IInterface* parent);
    00047
    00048   // protected virtual destructor
    00049   virtual ~HistoTool( );
    00050
    00051 public:
    00052
    00053   // ================================= 1D Histograms ========================================
    00054
    00055   // fill the histogram (book on demand)
    00056   virtual AIDA::IHistogram1D*  plot1D
    00057   ( const double        value        ,
    00058     const std::string&  title        ,
    00059     const double        low          ,
    00060     const double        high         ,
    00061     const unsigned long bins   = 100 ,
    00062     const double        weight = 1.0 ) const
    00063
    00064   {
    00065     return GaudiHistoTool::plot1D
    00066       ( value , title , low , high , bins , weight ) ;
    00067   };
    00068
    00069   // fill the histogram with forced ID assignement (book on demand)
    00070   virtual AIDA::IHistogram1D*  plot1D
    00071   ( const double        value        ,
    00072     const HistoID&      ID           ,
    00073     const std::string&  title        ,
    00074     const double        low          ,
    00075     const double        high         ,
    00076     const unsigned long bins   = 100 ,
    00077     const double        weight = 1.0 ) const
    00078   {
    00079     return GaudiHistoTool::plot1D
    00080       ( value , ID , title , low , high , bins , weight ) ;
    00081   };
    00082
    00083   // ================================= 2D Histograms ========================================
    00084
    00085   // fill the histogram (book on demand)
    00086   virtual AIDA::IHistogram2D*  plot2D
    00087   ( const double        valueX       ,
    00088     const double        valueY       ,
    00089     const std::string&  title        ,
    00090     const double        lowX         ,
    00091     const double        highX        ,
    00092     const double        lowY         ,
    00093     const double        highY        ,
    00094     const unsigned long binsX  = 50  ,
    00095     const unsigned long binsY  = 50  ,
    00096     const double        weight = 1.0 ) const
    00097   {
    00098     return GaudiHistoTool::plot2D
    00099       ( valueX, valueY, title, lowX, highX, lowY, highY, binsX, binsY, weight ) ;
    00100   };
    00101
    00102   // fill the histogram (book on demand)
    00103   virtual AIDA::IHistogram2D*  plot2D
    00104   ( const double        valueX       ,
    00105     const double        valueY       ,
    00106     const HistoID&      ID           ,
    00107     const std::string&  title        ,
    00108     const double        lowX         ,
    00109     const double        highX        ,
    00110     const double        lowY         ,
    00111     const double        highY        ,
    00112     const unsigned long binsX  = 50  ,
    00113     const unsigned long binsY  = 50  ,
    00114     const double        weight = 1.0 ) const
    00115   {
    00116     return GaudiHistoTool::plot2D
    00117       ( valueX, valueY, ID, title, lowX, highX, lowY, highY, binsX, binsY, weight ) ;
    00118   };
    00119
    00120   // ================================= 3D Histograms ========================================
    00121
    00122   // fill the histogram (book on demand)
    00123   virtual AIDA::IHistogram3D*  plot3D
    00124   ( const double        valueX       ,
    00125     const double        valueY       ,
    00126     const double        valueZ       ,
    00127     const std::string&  title        ,
    00128     const double        lowX         ,
    00129     const double        highX        ,
    00130     const double        lowY         ,
    00131     const double        highY        ,
    00132     const double        lowZ         ,
    00133     const double        highZ        ,
    00134     const unsigned long binsX  = 10  ,
    00135     const unsigned long binsY  = 10  ,
    00136     const unsigned long binsZ  = 10  ,
    00137     const double        weight = 1.0 ) const
    00138   {
    00139     return GaudiHistoTool::plot3D
    00140       ( valueX, valueY, valueZ, title,
    00141         lowX, highX, lowY, highY, lowZ, highZ, binsX, binsY, binsZ, weight ) ;
    00142   };
    00143
    00144   // fill the histogram (book on demand)
    00145   virtual AIDA::IHistogram3D*  plot3D
    00146   ( const double        valueX       ,
    00147     const double        valueY       ,
    00148     const double        valueZ       ,
    00149     const HistoID&      ID           ,
    00150     const std::string&  title        ,
    00151     const double        lowX         ,
    00152     const double        highX        ,
    00153     const double        lowY         ,
    00154     const double        highY        ,
    00155     const double        lowZ         ,
    00156     const double        highZ        ,
    00157     const unsigned long binsX  = 10  ,
    00158     const unsigned long binsY  = 10  ,
    00159     const unsigned long binsZ  = 10  ,
    00160     const double        weight = 1.0 ) const
    00161   {
    00162     return GaudiHistoTool::plot3D
    00163       ( valueX, valueY, valueZ, ID, title,
    00164         lowX, highX, lowY, highY, lowZ, highZ, binsX, binsY, binsZ, weight ) ;
    00165   };
    00166
    00167 public:
    00168
    00169   // book the 1D histogram
    00170   virtual AIDA::IHistogram1D*  book1D
    00171   ( const std::string&  title        ,
    00172     const double        low    =   0 ,
    00173     const double        high   = 100 ,
    00174     const unsigned long bins   = 100 ) const
    00175   {
    00176     return GaudiHistoTool::book1D ( title , low , high , bins ) ;
    00177   };
    00178
    00179   // book the 2D histogram
    00180   virtual AIDA::IHistogram2D*  book2D
    00181   ( const std::string&  title         ,
    00182     const double        lowX    =   0 ,
    00183     const double        highX   = 100 ,
    00184     const unsigned long binsX   =  50 ,
    00185     const double        lowY    =   0 ,
    00186     const double        highY   = 100 ,
    00187     const unsigned long binsY   =  50 ) const
    00188   {
    00189     return GaudiHistoTool::book2D ( title, lowX, highX, binsX, lowY, highY, binsY ) ;
    00190   }
    00191
    00192   // book the 3D histogram
    00193   virtual AIDA::IHistogram3D*  book3D
    00194   ( const std::string&  title         ,
    00195     const double        lowX    =   0 ,
    00196     const double        highX   = 100 ,
    00197     const unsigned long binsX   =  10 ,
    00198     const double        lowY    =   0 ,
    00199     const double        highY   = 100 ,
    00200     const unsigned long binsY   =  10 ,
    00201     const double        lowZ    =   0 ,
    00202     const double        highZ   = 100 ,
    00203     const unsigned long binsZ   =  10 ) const
    00204   {
    00205     return GaudiHistoTool::book3D ( title,
    00206                                     lowX, highX, binsX,
    00207                                     lowY, highY, binsY,
    00208                                     lowZ, highZ, binsZ ) ;
    00209   }
    00210
    00211   // book the 1D histogram with forced ID
    00212   virtual AIDA::IHistogram1D*  book1D
    00213   ( const HistoID&      ID           ,
    00214     const std::string&  title  = ""  ,
    00215     const double        low    =   0 ,
    00216     const double        high   = 100 ,
    00217     const unsigned long bins   = 100 ) const
    00218   {
    00219     return GaudiHistoTool::book1D ( ID , title , low , high , bins ) ;
    00220   };
    00221
    00222   // book the 2D histogram with forced ID
    00223   virtual AIDA::IHistogram2D*  book2D
    00224   ( const HistoID&      ID            ,
    00225     const std::string&  title         ,
    00226     const double        lowX    =   0 ,
    00227     const double        highX   = 100 ,
    00228     const unsigned long binsX   =  50 ,
    00229     const double        lowY    =   0 ,
    00230     const double        highY   = 100 ,
    00231     const unsigned long binsY   =  50 ) const
    00232   {
    00233     return GaudiHistoTool::book2D ( ID, title, lowX, highX, binsX, lowY, highY, binsY ) ;
    00234   }
    00235
    00236   // book the 3D histogram with forced ID
    00237   virtual AIDA::IHistogram3D*  book3D
    00238   ( const HistoID&      ID            ,
    00239     const std::string&  title         ,
    00240     const double        lowX    =   0 ,
    00241     const double        highX   = 100 ,
    00242     const unsigned long binsX   =  10 ,
    00243     const double        lowY    =   0 ,
    00244     const double        highY   = 100 ,
    00245     const unsigned long binsY   =  10 ,
    00246     const double        lowZ    =   0 ,
    00247     const double        highZ   = 100 ,
    00248     const unsigned long binsZ   =  10 ) const
    00249   {
    00250     return GaudiHistoTool::book3D ( ID, title,
    00251                                     lowX, highX, binsX,
    00252                                     lowY, highY, binsY,
    00253                                     lowZ, highZ, binsZ ) ;
    00254   }
    00255
    00256   // fill the histo with the value and weight
    00257   virtual AIDA::IHistogram1D* fill
    00258   ( AIDA::IHistogram1D* histo  ,
    00259     const double        value  ,
    00260     const double        weight ,
    00261     const std::string&  title  = "") const
    00262   {
    00263     return GaudiHistoTool::fill ( histo , value , weight , title ) ;
    00264   };
    00265
    00266   // fill the 2D histo with the value and weight
    00267   virtual AIDA::IHistogram2D* fill
    00268   ( AIDA::IHistogram2D* histo  ,
    00269     const double        valueX ,
    00270     const double        valueY ,
    00271     const double        weight ,
    00272     const std::string&  title  = "" ) const
    00273   {
    00274     return GaudiHistoTool::fill ( histo , valueX , valueY , weight , title ) ;
    00275   };
    00276
    00277   // fill the 3D histo with the value and weight
    00278   virtual AIDA::IHistogram3D* fill
    00279   ( AIDA::IHistogram3D* histo  ,
    00280     const double        valueX ,
    00281     const double        valueY ,
    00282     const double        valueZ ,
    00283     const double        weight ,
    00284     const std::string&  title  = "" ) const
    00285   {
    00286     return GaudiHistoTool::fill ( histo , valueX , valueY , valueZ, weight , title ) ;
    00287   };
    00288
    00289   // access the EXISTING 1D histogram by title
    00290   virtual AIDA::IHistogram1D*  histo1D ( const std::string& title  )  const
    00291   { return GaudiHistoTool::histo1D ( title ) ; }
    00292
    00293   // access the EXISTING 1D histogram by ID
    00294   virtual AIDA::IHistogram1D*  histo1D ( const HistoID&     ID     )  const
    00295   { return GaudiHistoTool::histo1D ( ID ) ; }
    00296
    00297   // access the EXISTING 2D histogram by title
    00298   virtual AIDA::IHistogram2D*  histo2D ( const std::string& title  )  const
    00299   { return GaudiHistoTool::histo2D ( title ) ; }
    00300
    00301   // access the EXISTING 2D histogram by ID
    00302   virtual AIDA::IHistogram2D*  histo2D ( const HistoID&     ID     )  const
    00303   { return GaudiHistoTool::histo2D ( ID ) ; }
    00304
    00305   // access the EXISTING 3D histogram by title
    00306   virtual AIDA::IHistogram3D*  histo3D ( const std::string& title  )  const
    00307   { return GaudiHistoTool::histo3D ( title ) ; }
    00308
    00309   // access the EXISTING 3D histogram by ID
    00310   virtual AIDA::IHistogram3D*  histo3D ( const HistoID&     ID     )  const
    00311   { return GaudiHistoTool::histo3D ( ID ) ; }
    00312
    00313   // check the existence AND validity of the histogram with given title
    00314   virtual bool histoExists ( const std::string& title  )  const
    00315   { return GaudiHistoTool::histoExists ( title ) ; }
    00316
    00317   // check the existence AND validity of the histogram with given title
    00318   virtual bool histoExists ( const HistoID&     ID     )  const
    00319   { return GaudiHistoTool::histoExists ( ID ) ; }
    00320
    00321 private:
    00322
    00323   HistoTool() ;
    00324   HistoTool           ( const HistoTool& ) ;
    00325   HistoTool& operator=( const HistoTool& ) ;
    00326
    00327 };
    00328
    00329 #endif // GAUDIALG_HISTOTOOL_H

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines