Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

IHistogramSvc.h

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/GaudiKernel/GaudiKernel/IHistogramSvc.h,v 1.1.1.1 2001/04/18 18:14:18 tlindner Exp $
00002 #ifndef GAUDIKERNEL_IHISTOGRAMSVC_H
00003 #define GAUDIKERNEL_IHISTOGRAMSVC_H
00004 
00005 
00006 // Include files
00007 #include <string>
00008 #include <vector>
00009 #include "GaudiKernel/Kernel.h"
00010 #include "GaudiKernel/IDataProviderSvc.h"
00011 
00012 
00013 // Forward declarations
00014 class DataObject;
00015 class IHistogram;
00016 class IHistogram1D;
00017 class IHistogram2D;
00018 
00019 // Declaration of the interface ID ( interface id, major version, minor version) 
00020 static const InterfaceID IID_IHistogramSvc(60, 1 , 0); 
00021 
00022 
00029 class IHistogramSvc : virtual public IDataProviderSvc {
00030 
00031 public:
00032 
00034   static const InterfaceID& interfaceID() { return IID_IHistogramSvc; }
00035 
00052   // ==========================================================================
00053   // Book 1D histogram with fixed binning
00054   // ==========================================================================
00055 
00056   virtual IHistogram1D* book( const std::string& fullPath,
00057                               const std::string& title,
00058                               int binsX, double lowX, double highX )          = 0;
00059   virtual IHistogram1D* book( const std::string& dirPath,
00060                               const std::string& relPath,
00061                               const std::string& title,
00062                               int binsX, double lowX, double highX )          = 0;
00063   virtual IHistogram1D* book( const std::string& dirPath,
00064                               int hID,
00065                               const std::string& title,
00066                               int binsX, double lowX, double highX )          = 0;
00067   virtual IHistogram1D* book( DataObject* pParent,
00068                               const std::string& relPath,
00069                               const std::string& title,
00070                               int binsX, double lowX, double highX )          = 0;
00071   virtual IHistogram1D* book( DataObject* pParent,
00072                               int hID,
00073                               const std::string& title,
00074                               int binsX, double lowX, double highX )          = 0;
00075 
00076   // ==========================================================================
00077   // Book 1D histogram with variable binning
00078   // ==========================================================================
00079 
00080   virtual IHistogram1D* book( const std::string& fullPath,
00081                               const std::string& title,
00082                               std::vector<double> edges )                   = 0;
00083   virtual IHistogram1D* book( const std::string& dirPath,
00084                               const std::string& relPath,
00085                               const std::string& title,
00086                               std::vector<double> edges )                   = 0;
00087   virtual IHistogram1D* book( const std::string& dirPath,
00088                               int hID,
00089                               const std::string& title,
00090                               std::vector<double> edges )                   = 0;
00091   virtual IHistogram1D* book( DataObject* pParent,
00092                               const std::string& relPath,
00093                               const std::string& title,
00094                               std::vector<double> edges )                   = 0;
00095   virtual IHistogram1D* book( DataObject* pParent,
00096                               int hID,
00097                               const std::string& title,
00098                               std::vector<double> edges )                   = 0;
00099 
00100   // ==========================================================================
00101   // Book 2D histogram with fixed binning
00102   // ==========================================================================
00103 
00104   virtual IHistogram2D* book( const std::string& fullPath,
00105                               const std::string& title,
00106                               int binsX, double lowX, double highX,
00107                               int binsY, double lowY, double highY )          = 0;
00108   virtual IHistogram2D* book( const std::string& dirPath,
00109                               const std::string& relPath,
00110                               const std::string& title,
00111                               int binsX, double lowX, double highX,
00112                               int binsY, double lowY, double highY )          = 0;
00113   virtual IHistogram2D* book( const std::string& dirPath,
00114                               int hID,
00115                               const std::string& title,
00116                               int binsX, double lowX, double highX,
00117                               int binsY, double lowY, double highY )          = 0;
00118   virtual IHistogram2D* book( DataObject* pParent,
00119                               const std::string& relPath,
00120                               const std::string& title,
00121                               int binsX, double lowX, double highX,
00122                               int binsY, double lowY, double highY )          = 0;
00123   virtual IHistogram2D* book( DataObject* pParent,
00124                               int hID,
00125                               const std::string& title,
00126                               int binsX, double lowX, double highX,
00127                               int binsY, double lowY, double highY )          = 0;
00128 
00129 
00130   // ==========================================================================
00131   // Register histogram with the data store
00132   // ==========================================================================
00133 
00134   virtual StatusCode registerObject( const std::string& fullPath,
00135                                      IHistogram* hObj )                     = 0;
00136   // ---------------------------
00137   virtual StatusCode registerObject( const std::string& parentPath,
00138                                      const std::string& objPath,
00139                                      IHistogram* hObj )                     = 0;
00140   // ---------------------------
00141   virtual StatusCode registerObject( const std::string& parentPath,
00142                                      int item, IHistogram* hObj )           = 0;
00143   // ---------------------------
00144   virtual StatusCode registerObject( DataObject* parentObj,
00145                                      const std::string& objPath,
00146                                      IHistogram* hObj )                     = 0;
00147   virtual StatusCode registerObject( IHistogram* parentObj,
00148                                      const std::string& objPath,
00149                                      IHistogram* hObj )                     = 0;
00150   // ---------------------------
00151   virtual StatusCode registerObject( DataObject* parentObj,
00152                                      int item,
00153                                      IHistogram* hObj )                     = 0;
00154   virtual StatusCode registerObject( IHistogram* parentObj,
00155                                      int item,
00156                                      IHistogram* hObj )                     = 0;
00157 
00158 
00159   // ==========================================================================
00160   // Unregister histogram from the data store
00161   // ==========================================================================
00162 
00163   virtual StatusCode unregisterObject( IHistogram* hObj )                   = 0;
00164   // ---------------------------
00165   virtual StatusCode unregisterObject( IHistogram* hObj,
00166                                        const std::string& objectPath )      = 0;
00167   // ---------------------------
00168   virtual StatusCode unregisterObject( IHistogram* hObj,
00169                                        int item )                           = 0;
00170 
00171 
00172   // ==========================================================================
00173   // Retrieve histogram from data store
00174   // ==========================================================================
00175 
00176   virtual StatusCode retrieveObject( IDataDirectory* pDirectory,
00177                                      const std::string& path,
00178                                      IHistogram1D*& h1dObj )                = 0;
00179   virtual StatusCode retrieveObject( IDataDirectory* pDirectory,
00180                                      const std::string& path,
00181                                      IHistogram2D*& h2dObj )                = 0;
00182   // ---------------------------
00183   virtual StatusCode retrieveObject( const std::string& fullPath,
00184                                      IHistogram1D*& h1dObj )                = 0;
00185   virtual StatusCode retrieveObject( const std::string& fullPath,
00186                                      IHistogram2D*& h2dObj )                = 0;
00187   // ---------------------------
00188   virtual StatusCode retrieveObject( const std::string& parentPath,
00189                                      const std::string& objPath,
00190                                      IHistogram1D*& h1dObj )                = 0;
00191   virtual StatusCode retrieveObject( const std::string& parentPath,
00192                                      const std::string& objPath,
00193                                      IHistogram2D*& h2dObj )                = 0;
00194   // ---------------------------
00195   virtual StatusCode retrieveObject( const std::string& parentPath,
00196                                      int item, 
00197                                      IHistogram1D*& h1dObj )                = 0;
00198   virtual StatusCode retrieveObject( const std::string& parentPath,
00199                                      int item, 
00200                                      IHistogram2D*& h2dObj )                = 0;
00201   // ---------------------------
00202   virtual StatusCode retrieveObject( DataObject* parentObj,
00203                                      const std::string& objPath,
00204                                      IHistogram1D*& h1dObj )                = 0;
00205   virtual StatusCode retrieveObject( DataObject* parentObj,
00206                                      const std::string& objPath,
00207                                      IHistogram2D*& h2dObj )                = 0;
00208   virtual StatusCode retrieveObject( IHistogram* parentObj,
00209                                      const std::string& objPath,
00210                                      IHistogram1D*& h1dObj )                = 0;
00211   virtual StatusCode retrieveObject( IHistogram* parentObj,
00212                                      const std::string& objPath,
00213                                      IHistogram2D*& h2dObj )                = 0;
00214   // ---------------------------
00215   virtual StatusCode retrieveObject( DataObject* parentObj,
00216                                      int item,
00217                                      IHistogram1D*& h1dObj )                = 0;
00218   virtual StatusCode retrieveObject( DataObject* parentObj,
00219                                      int item,
00220                                      IHistogram2D*& h2dObj )                = 0;
00221   virtual StatusCode retrieveObject( IHistogram* parentObj,
00222                                      int item,
00223                                      IHistogram1D*& h1dObj )                = 0;
00224   virtual StatusCode retrieveObject( IHistogram* parentObj,
00225                                      int item,
00226                                      IHistogram2D*& h2dObj )                = 0;
00227 
00228 
00229   // ==========================================================================
00230   // Find histogram identified by its full path in the data store
00231   // ==========================================================================
00232 
00233   virtual StatusCode findObject( const std::string& fullPath,
00234                                  IHistogram1D*& h1dObj )                    = 0;
00235   virtual StatusCode findObject( const std::string& fullPath,
00236                                  IHistogram2D*& h2dObj )                    = 0;
00237   // ---------------------------
00238   virtual StatusCode findObject( IDataDirectory* pDirectory,
00239                                  const std::string& path,
00240                                  IHistogram1D*& h1dObj )                    = 0;
00241   virtual StatusCode findObject( IDataDirectory* pDirectory,
00242                                  const std::string& path,
00243                                  IHistogram2D*& h2dObj )                    = 0;
00244   // ---------------------------
00245   virtual StatusCode findObject( const std::string& parentPath,
00246                                  const std::string& objPath,
00247                                  IHistogram1D*& h1dObj )                    = 0;
00248   virtual StatusCode findObject( const std::string& parentPath,
00249                                  const std::string& objPath,
00250                                  IHistogram2D*& h2dObj )                    = 0;
00251   // ---------------------------
00252   virtual StatusCode findObject( const std::string& parentPath,
00253                                  int item,
00254                                  IHistogram1D*& h1dObj )                    = 0;
00255   virtual StatusCode findObject( const std::string& parentPath,
00256                                  int item,
00257                                  IHistogram2D*& h2dObj )                    = 0;
00258   // ---------------------------
00259   virtual StatusCode findObject( DataObject* parentObj,
00260                                  const std::string& objPath,
00261                                  IHistogram1D*& h1dObj )                    = 0;
00262   virtual StatusCode findObject( DataObject* parentObj,
00263                                  const std::string& objPath,
00264                                  IHistogram2D*& h2dObj )                    = 0;
00265   virtual StatusCode findObject( IHistogram* parentObj,
00266                                  const std::string& objPath,
00267                                  IHistogram1D*& h1dObj )                    = 0;
00268   virtual StatusCode findObject( IHistogram* parentObj,
00269                                  const std::string& objPath,
00270                                  IHistogram2D*& h2dObj )                    = 0;
00271   // ---------------------------
00272   virtual StatusCode findObject( DataObject* parentObj,
00273                                  int item,
00274                                  IHistogram1D*& h1dObj )                    = 0;
00275   virtual StatusCode findObject( DataObject* parentObj,
00276                                  int item,
00277                                  IHistogram2D*& h2dObj )                    = 0;
00278   virtual StatusCode findObject( IHistogram* parentObj,
00279                                  int item,
00280                                  IHistogram1D*& h1dObj )                    = 0;
00281   virtual StatusCode findObject( IHistogram* parentObj,
00282                                  int item,
00283                                  IHistogram2D*& h2dObj )                    = 0;
00284 
00285 
00286   // ==========================================================================
00287   // ASCII output
00288   // ==========================================================================
00289 
00290   // --------------------------------------------------------------------------
00291   // Print functions (ASCII graphical representation)
00292   
00293   // Print (ASCII) the histogram into the output stream
00294   virtual std::ostream& print( IHistogram* h,
00295                                std::ostream& s = std::cout) const           = 0;
00296 
00297   // --------------------------------------------------------------------------
00298   // Write functions (ASCII table containing numbers e.g. bin height)
00299 
00301   virtual std::ostream& write( IHistogram* h,
00302                                std::ostream& s = std::cout) const           = 0;
00303 
00305   virtual int write( IHistogram* h, const char* file_name ) const           = 0;
00306 
00307 
00308   // ==========================================================================
00309   // Create all directories in a given full path
00310   // ==========================================================================
00311 
00312   virtual DataObject* createPath( const std::string& newPath )              = 0;
00313 
00319   virtual DataObject* createDirectory   (
00320     const std::string& parentDir, 
00321     const std::string& subDir  ) = 0;
00322 
00325   virtual StatusCode registerObject(const std::string& fullPath, DataObject* pObject) = 0;
00326   virtual StatusCode registerObject(const std::string& parentPath, const std::string& objectPath, DataObject* pObject) = 0;
00327   virtual StatusCode registerObject(const std::string& parentPath, int item, DataObject* pObject) = 0;
00328   virtual StatusCode registerObject(DataObject* parentObj, const std::string& objectPath, DataObject* pObject) = 0;
00329   virtual StatusCode registerObject(DataObject* parentObj, int item, DataObject* pObject) = 0;
00330   virtual StatusCode unregisterObject(const std::string& fullPath) = 0;
00331   virtual StatusCode unregisterObject(const std::string& parentPath, const std::string& objPath) = 0;
00332   virtual StatusCode unregisterObject(const std::string& parentPath, int item) = 0;
00333   virtual StatusCode unregisterObject(DataObject* pObject) = 0;
00334   virtual StatusCode unregisterObject(DataObject* pParent, const std::string& objPath) = 0;
00335   virtual StatusCode unregisterObject(DataObject* pParent, int item) = 0;
00336   virtual StatusCode retrieveObject(IDataDirectory* pDirectory, const std::string& path, DataObject*& pObject) = 0;
00337   virtual StatusCode retrieveObject(const std::string& fullPath, DataObject*& pObject) = 0;
00338   virtual StatusCode retrieveObject(const std::string& parentPath, const std::string& objectPath, DataObject*& pObject) = 0;
00339   virtual StatusCode retrieveObject(const std::string& parentPath, int item, DataObject*& pObject) = 0;
00340   virtual StatusCode retrieveObject(DataObject* parentObj, const std::string& objectPath, DataObject*& pObject) = 0;
00341   virtual StatusCode retrieveObject(DataObject* parentObj, int item, DataObject*& pObject) = 0;
00342   virtual StatusCode findObject(IDataDirectory* pDirectory, const std::string& path, DataObject*& pObject) = 0;
00343   virtual StatusCode findObject(const std::string& fullPath, DataObject*& pObject) = 0;
00344   virtual StatusCode findObject(const std::string& parentPath, const std::string& objectPath, DataObject*& pObject) = 0;
00345   virtual StatusCode findObject(const std::string& parentPath, int item, DataObject*& pObject) = 0;
00346   virtual StatusCode findObject(DataObject* pNode, const std::string& objectPath, DataObject*& pObject) = 0;
00347   virtual StatusCode findObject(DataObject* parentObj, int item, DataObject*& pObject) = 0;
00348 };
00349 
00350 
00351 #endif  // INTERFACES_IHISTOGRAMSVC_H

Generated at Wed Nov 21 12:22:04 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000