| # Gaudi Framework, version v20r4
Generated: 8 Jan 2009

# HistogramSvc.h

Go to the documentation of this file.

    00001 // $Id: HistogramSvc.h,v 1.16 2008/10/09 09:59:14 marcocle Exp $
    00002 // ============================================================================
    00003 #ifndef GAUDISVC_HISTOGRAMSVC_H
    00004 #define GAUDISVC_HISTOGRAMSVC_H 1
    00005 // ============================================================================
    00006 // Include Files
    00007 // ============================================================================
    00008 // GaudiKernel
    00009 // ============================================================================
    00010 #include "GaudiKernel/System.h"
    00011 #include "GaudiKernel/DataSvc.h"
    00012 #include "GaudiKernel/IHistogramSvc.h"
    00013 #include "GaudiKernel/GaudiException.h"
    00014 #include "GaudiKernel/IRegistry.h"
    00015 #include "GaudiKernel/HistoProperty.h"
    00016 // ============================================================================
    00017 // AIDA
    00018 // ============================================================================
    00019 #include "AIDA/IHistogramFactory.h"
    00020 #include "AIDA/IAnnotation.h"
    00021 // ============================================================================
    00022 // local (+PI)
    00023 // ============================================================================
    00024 #include "Axis.h"
    00025 #include "GaudiPI.h"
    00026 #include "TH1.h"
    00027 #include "TH2.h"
    00028 #include "TH3.h"
    00029 // ============================================================================
    00030 namespace AIDA {
    00031   class ICloud1D;
    00032   class ICloud2D;
    00033   class ICloud3D;
    00034 }
    00035 // ============================================================================
    00036 // Forward declarations
    00037 template <class T> class SvcFactory;
    00038 #define DBINS(x) int n##x, double low##x, double up##x
    00039 #define BINS(x)  n##x, low##x, up##x
    00040 #define NOT_IMPLEMENTED { not_implemented(); return 0; }
    00041 // ============================================================================
    00047 class HistogramSvc : public DataSvc,
    00048                      virtual public IHistogramSvc,
    00049                      virtual public AIDA::IHistogramFactory
    00050 {
    00051
    00052 private:
    00053   // Allow SvcFactory to instantiate the service.
    00054   friend class SvcFactory<HistogramSvc>;
    00055   typedef const std::pair<std::string,std::string>& STRPAIR;
    00056   void not_implemented()  const {
    00057     MsgStream log( msgSvc(), name() );
    00058     log << MSG::ERROR << "Sorry, not yet implemented..." << endreq;
    00059   }
    00060 protected:
    00061   typedef const std::string&       CSTR;
    00062   typedef std::vector<double>      Edges;
    00063   typedef std::vector<std::string> DBaseEntries;
    00064   typedef AIDA::IHistogram1D       H1D;
    00065   typedef AIDA::IHistogram2D       H2D;
    00066   typedef AIDA::IHistogram3D       H3D;
    00067   typedef AIDA::IProfile1D         P1D;
    00068   typedef AIDA::IProfile2D         P2D;
    00069   typedef AIDA::IBaseHistogram     Base;
    00070   struct Helper {
    00071     HistogramSvc* m_svc;
    00072     Helper(HistogramSvc* p) : m_svc(p) {}
    00073     template <class A1, class A3> StatusCode retrieve(A1 a1, A3*& a3)  {
    00074       DataObject* pObject  = 0;
    00075       StatusCode sc = m_svc->DataSvc::retrieveObject(a1,pObject);
    00076       a3 = dynamic_cast<A3*>(pObject);
    00077       return sc;
    00078     }
    00079     template <class A1, class A2, class A3> StatusCode retrieve(A1 a1, A2 a2, A3*& a3)  {
    00080       DataObject* pObject  = 0;
    00081       StatusCode sc = m_svc->DataSvc::retrieveObject(a1,a2,pObject);
    00082       a3 = dynamic_cast<A3*>(pObject);
    00083       return sc;
    00084     }
    00085     template <class A1, class A3> StatusCode find(A1 a1, A3*& a3)  {
    00086       DataObject* pObject  = 0;
    00087       StatusCode sc = m_svc->DataSvc::findObject(a1,pObject);
    00088       a3 = dynamic_cast<A3*>(pObject);
    00089       return sc;
    00090     }
    00091     template <class A1, class A2, class A3> StatusCode find(A1 a1, A2 a2, A3*& a3)  {
    00092       DataObject* pObject  = 0;
    00093       StatusCode sc = m_svc->DataSvc::findObject(a1,a2,pObject);
    00094       a3 = dynamic_cast<A3*>(pObject);
    00095       return sc;
    00096     }
    00097     template <class R, class S, class T1, class T2>
    00098     static R* act(R* res,const S& b, void (T1::*pmf)(const T2*,Double_t), Double_t scale)  {
    00099       T1 *h1 = Gaudi::getRepresentation<R,T1>(*res);
    00100       T1 *h2 = Gaudi::getRepresentation<R,T1>(b);
    00101       if ( h1 && h2 )  {
    00102         (h1->*pmf)(h2,scale);
    00103         return res;
    00104       }
    00105       return 0;
    00106     }
    00107     template <class R, class S, class T1, class T2>
    00108     static R* act(R* res,const S& b, void (T1::*pmf)(const T2*))  {
    00109       T1 *h1 = Gaudi::getRepresentation<R,T1>(*res);
    00110       T1 *h2 = Gaudi::getRepresentation<R,T1>(b);
    00111       if ( h1 && h2 )  {
    00112         (h1->*pmf)(h2);
    00113         return res;
    00114       }
    00115       return 0;
    00116     }
    00117   };
    00118
    00119
    00121   DBaseEntries                      m_input;
    00122
    00123 public:
    00128   HistogramSvc(CSTR name, ISvcLocator* svc );
    00129
    00131   virtual ~HistogramSvc();
    00132
    00138   std::pair<std::string,std::string> i_splitPath(CSTR full);
    00139
    00143   StatusCode connectInput(CSTR ident);
    00144   std::string _STR(int i);
    00145
    00146   template <class T> inline
    00147   T* i_book(DataObject* pPar,CSTR rel,CSTR title,const std::pair<DataObject*,T*>& o)  {
    00148     if (o.first && registerObject(pPar, rel, (Base*)o.second).isSuccess())
    00149       return o.second;
    00150     delete o.first;
    00151     throw GaudiException("Cannot book "+System::typeinfoName(typeid(T))+" "+title,
    00152       "HistogramSvc",StatusCode::FAILURE);
    00153   }
    00154   template <class T> static DataObject* __cast(T* p)  {
    00155     DataObject* q = dynamic_cast<DataObject*>(p);
    00156     if ( 0 == q && 0 != p )  {
    00157       throw std::runtime_error("HistogramSvc: Unexpected object type.");
    00158     }
    00159     return q;
    00160   }
    00162   H2D* i_project(CSTR nameAndTitle,const H3D& h, CSTR dir);
    00163
    00164 public:
    00166   virtual StatusCode initialize   ();
    00168   virtual StatusCode reinitialize ();
    00170   virtual StatusCode finalize     ();
    00171
    00176   virtual StatusCode queryInterface(const InterfaceID& iid, void** ppv );
    00177
    00179   virtual AIDA::IHistogramFactory* histogramFactory()   {  return this; }
    00180
    00181   // ==========================================================================
    00182   // Book 1D histogram with fix binning
    00183   // ==========================================================================
    00201   virtual H1D* book(CSTR par,  CSTR rel, CSTR title, DBINS(x))
    00202   {  return book(createPath(par), rel, title, BINS(x));                          }
    00203   virtual H1D* book(CSTR par,  int hID, CSTR title, DBINS(x))
    00204   {  return book(par, _STR(hID), title, BINS(x));                                }
    00205   virtual H1D* book(DataObject* pPar, int hID, CSTR title, DBINS(x))
    00206   {  return book(pPar, _STR(hID), title, BINS(x));                               }
    00207   virtual H1D* book(DataObject* pPar, CSTR rel, CSTR title, DBINS(x)) ;
    00208   virtual H1D* book(STRPAIR loc,CSTR title, DBINS(x))
    00209   { return book(loc.first, loc.second, title, BINS(x));                          }
    00210   virtual H1D* book(CSTR full, CSTR title, DBINS(x))
    00211   { return book(i_splitPath(full), title, BINS(x));                              }
    00212   // ==========================================================================
    00213   // Book 1D Profile histogram with fix binning
    00214   // ==========================================================================
    00232   virtual P1D* bookProf(CSTR par, CSTR rel, CSTR title, DBINS(x),CSTR opt)
    00233   { return bookProf(createPath(par), rel, title, BINS(x),opt);                     }
    00234   virtual P1D* bookProf(CSTR par, int hID, CSTR title, DBINS(x),CSTR opt )
    00235   { return bookProf(par, _STR(hID), title, BINS(x),opt);                           }
    00236   virtual P1D* bookProf(DataObject* pPar, int hID, CSTR title, DBINS(x),CSTR opt )
    00237   { return bookProf(pPar, _STR(hID), title, BINS(x),opt);                          }
    00238   virtual P1D* bookProf(STRPAIR loc,CSTR title, DBINS(x),CSTR opt)
    00239   { return bookProf(loc.first, loc.second, title, BINS(x),opt);                    }
    00240   virtual P1D* bookProf(CSTR full, CSTR title, DBINS(x),CSTR opt)
    00241   { return bookProf(i_splitPath(full), title, BINS(x),opt);                        }
    00242   virtual P1D* bookProf(DataObject* pPar, CSTR rel, CSTR title, DBINS(x),CSTR opt)
    00243   { return i_book(pPar,rel,title,Gaudi::createProf1D(title, BINS(x),0,0,opt));     }
    00244
    00245   virtual P1D* bookProf(CSTR par, CSTR rel, CSTR title, DBINS(x), double upper, double lower,CSTR opt)
    00246   { return bookProf(createPath(par), rel, title, BINS(x), upper, lower , opt);                     }
    00247   virtual P1D* bookProf(CSTR par, int hID, CSTR title, DBINS(x), double upper, double lower, CSTR opt)
    00248   { return bookProf(par, _STR(hID), title, BINS(x), upper, lower, opt );                           }
    00249   virtual P1D* bookProf(DataObject* pPar, int hID, CSTR title, DBINS(x), double upper, double lower, CSTR opt)
    00250   { return bookProf(pPar, _STR(hID), title, BINS(x), upper, lower, opt);                          }
    00251   virtual P1D* bookProf(STRPAIR loc,CSTR title, DBINS(x), double upper, double lower, CSTR opt)
    00252   { return bookProf(loc.first, loc.second, title, BINS(x), upper, lower,opt);                    }
    00253   virtual P1D* bookProf(CSTR full, CSTR title, DBINS(x), double upper, double lower, CSTR opt )
    00254   { return bookProf(i_splitPath(full), title, BINS(x), upper, lower , opt );                        }
    00255   virtual P1D* bookProf(DataObject* pPar, CSTR rel, CSTR title, DBINS(x), double upper, double lower, CSTR opt)
    00256   { return i_book(pPar,rel,title,Gaudi::createProf1D(title, BINS(x), upper, lower, opt));         }
    00257   // ==========================================================================
    00258   // Book 1D histogram with variable binning
    00259   // ==========================================================================
    00274   virtual H1D* book(CSTR par, int hID, CSTR title, Edges e)
    00275   {  return book(par, _STR(hID), title, e);                                 }
    00276   virtual H1D* book(DataObject* pPar, int hID, CSTR title, Edges e)
    00277   {  return book(pPar, _STR(hID), title, e);                                }
    00278   virtual H1D* book(CSTR par, CSTR rel, CSTR title, Edges e )
    00279   {  return book(createPath(par), rel, title, e);                           }
    00280   virtual H1D* book(STRPAIR loc,CSTR title, Edges e )
    00281   { return book(loc.first, loc.second, title, e);                           }
    00282   virtual H1D* book(CSTR full, CSTR title, Edges e )
    00283   { return book(i_splitPath(full), title, e);                               }
    00284   virtual H1D* book(DataObject* pPar, CSTR rel, CSTR title, Edges e )
    00285   { return i_book(pPar, rel, title, Gaudi::createH1D(title, e));            }
    00286
    00287   // ==========================================================================
    00288   // Book 1D profile histogram with variable binning
    00289   // ==========================================================================
    00304   virtual P1D* bookProf(CSTR full, CSTR title, Edges e )
    00305   { return bookProf(i_splitPath(full), title, e);                             }
    00306   virtual P1D* bookProf(CSTR par, CSTR rel, CSTR title, Edges e )
    00307   { return bookProf(createPath(par), rel, title, e);                          }
    00308   virtual P1D* bookProf(CSTR par, int hID, CSTR title, Edges e )
    00309   { return bookProf(par, _STR(hID), title, e);                                }
    00310   virtual P1D* bookProf(DataObject* pPar, int hID, CSTR title, Edges e )
    00311   { return bookProf(pPar, _STR(hID), title, e);                               }
    00312   virtual P1D* bookProf(STRPAIR loc,CSTR title, Edges e)
    00313   { return bookProf(loc.first, loc.second, title, e);                         }
    00314   virtual P1D* bookProf(DataObject* pPar, CSTR rel, CSTR title, Edges e )
    00315   { return i_book(pPar,rel,title,Gaudi::createProf1D(title, e, 0, 0));        }
    00316
    00317   virtual P1D* bookProf(CSTR full, CSTR title, Edges e, double upper, double lower)
    00318   { return bookProf(i_splitPath(full), title, e, upper, lower);               }
    00319   virtual P1D* bookProf(CSTR par, CSTR rel, CSTR title, Edges e, double upper, double lower)
    00320   { return bookProf(createPath(par), rel, title, e, upper, lower);            }
    00321   virtual P1D* bookProf(CSTR par, int hID, CSTR title, Edges e, double upper, double lower)
    00322   { return bookProf(par, _STR(hID), title, e, upper, lower);                  }
    00323   virtual P1D* bookProf(DataObject* pPar, int hID, CSTR title, Edges e, double upper, double lower)
    00324   { return bookProf(pPar, _STR(hID), title, e, upper, lower);                 }
    00325   virtual P1D* bookProf(STRPAIR loc,CSTR title, Edges e, double upper, double lower)
    00326   { return bookProf(loc.first, loc.second, title, e, upper, lower);           }
    00327   virtual P1D* bookProf(DataObject* pPar, CSTR rel, CSTR title, Edges e, double upper, double lower)
    00328   { return i_book(pPar,rel,title,Gaudi::createProf1D(title, e, upper, lower));}
    00329   // ==========================================================================
    00330   // Book 2D histogram with fixed binning
    00331   // ==========================================================================
    00349   virtual H2D* book(CSTR full, CSTR title, DBINS(x), DBINS(y))
    00350   { return book(i_splitPath(full), title, BINS(x),BINS(y));               }
    00351   virtual H2D* book(CSTR par, CSTR rel, CSTR title, DBINS(x), DBINS(y))
    00352   { return book(createPath(par), rel, title, BINS(x),BINS(y));            }
    00353   virtual H2D* book(CSTR par, int hID, CSTR title, DBINS(x), DBINS(y))
    00354   { return book(par,_STR(hID), title, BINS(x),BINS(y));                   }
    00355   virtual H2D* book(STRPAIR loc,CSTR title, DBINS(x), DBINS(y))
    00356   { return book(loc.first, loc.second, title, BINS(x), BINS(y));          }
    00357   virtual H2D* book(DataObject* pPar, int hID, CSTR title, DBINS(x), DBINS(y))
    00358   { return book(pPar,_STR(hID), title, BINS(x),BINS(y));                  }
    00359   virtual H2D* book(DataObject* pPar, CSTR rel, CSTR title, DBINS(x), DBINS(y))
    00360   { return i_book(pPar,rel,title,Gaudi::createH2D(title, BINS(x),BINS(y)));}
    00361   // ==========================================================================
    00362   // Book 2D profile histogram with fixed binning
    00363   // ==========================================================================
    00381   virtual P2D* bookProf(CSTR full, CSTR title, DBINS(x), DBINS(y), double upper, double lower)
    00382   { return bookProf(i_splitPath(full), title, BINS(x),BINS(y), upper, lower);               }
    00383   virtual P2D* bookProf(CSTR par, CSTR rel, CSTR title, DBINS(x), DBINS(y), double upper, double lower)
    00384   { return bookProf(createPath(par), rel, title, BINS(x),BINS(y), upper, lower);            }
    00385   virtual P2D* bookProf(STRPAIR loc,CSTR title, DBINS(x), DBINS(y), double upper, double lower)
    00386   { return bookProf(loc.first, loc.second, title, BINS(x), BINS(y), upper, lower);          }
    00387   virtual P2D* bookProf(CSTR par, int hID, CSTR title, DBINS(x), DBINS(y), double upper, double lower)
    00388   { return bookProf(par, _STR(hID), title, BINS(x),BINS(y), upper, lower);                  }
    00389   virtual P2D* bookProf(DataObject* pPar, int hID, CSTR title, DBINS(x), DBINS(y), double upper, double lower)
    00390   { return bookProf(pPar,_STR(hID), title, BINS(x),BINS(y), upper, lower);                  }
    00391   virtual P2D* bookProf(DataObject* pPar, CSTR rel, CSTR title, DBINS(x), DBINS(y), double upper, double lower)
    00392   { return i_book(pPar,rel,title,Gaudi::createProf2D(title, BINS(x),BINS(y), upper, lower));  }
    00393
    00394   virtual P2D* bookProf(CSTR full, CSTR title, DBINS(x), DBINS(y))
    00395   { return bookProf(i_splitPath(full), title, BINS(x),BINS(y));               }
    00396   virtual P2D* bookProf(CSTR par, CSTR rel, CSTR title, DBINS(x), DBINS(y))
    00397   { return bookProf(createPath(par), rel, title, BINS(x),BINS(y));            }
    00398   virtual P2D* bookProf(STRPAIR loc,CSTR title, DBINS(x), DBINS(y))
    00399   { return bookProf(loc.first, loc.second, title, BINS(x), BINS(y));          }
    00400   virtual P2D* bookProf(CSTR par, int hID, CSTR title, DBINS(x), DBINS(y))
    00401   { return bookProf(par, _STR(hID), title, BINS(x),BINS(y));                  }
    00402   virtual P2D* bookProf(DataObject* pPar, int hID, CSTR title, DBINS(x), DBINS(y))
    00403   { return bookProf(pPar,_STR(hID), title, BINS(x),BINS(y));                  }
    00404   virtual P2D* bookProf(DataObject* pPar, CSTR rel, CSTR title, DBINS(x), DBINS(y))
    00405   { return i_book(pPar,rel,title,Gaudi::createProf2D(title, BINS(x),BINS(y),0,0));}
    00406   // ==========================================================================
    00407   // Book 2D histogram with variable binning
    00408   // ==========================================================================
    00423   virtual H2D* book(CSTR full, CSTR title, Edges x, Edges y )
    00424   { return book(i_splitPath(full), title, x, y);                        }
    00425   virtual H2D* book(CSTR par, CSTR rel, CSTR title, Edges x, Edges y )
    00426   { return book(createPath(par), rel, title, x, y);                     }
    00427   virtual H2D* book(CSTR par, int hID, CSTR title, Edges x, Edges y )
    00428   { return book(par, _STR(hID), title, x, y);                           }
    00429   virtual H2D* book(STRPAIR loc,CSTR title, Edges x, Edges y )
    00430   { return book(loc.first, loc.second, title, x, y);                    }
    00431   virtual H2D* book(DataObject* pPar, int hID, CSTR title, Edges x, Edges y )
    00432   { return book(pPar, _STR(hID), title, x, y);                          }
    00433   virtual H2D* book(DataObject* pPar, CSTR rel, CSTR title, Edges x, Edges y )
    00434   { return i_book(pPar, rel, title, Gaudi::createH2D(title, x,y));      }
    00435   // ==========================================================================
    00436   // Book 2D profile histogram with variable binning
    00437   // ==========================================================================
    00452   virtual P2D* bookProf(CSTR full, CSTR title, Edges x, Edges y )
    00453   { return bookProf(i_splitPath(full), title, x, y);                    }
    00454   virtual P2D* bookProf(CSTR par, CSTR rel, CSTR title, Edges x, Edges y )
    00455   { return bookProf(createPath(par), rel, title, x, y);                  }
    00456   virtual P2D* bookProf(CSTR par, int hID, CSTR title, Edges x, Edges y )
    00457   { return bookProf(par, _STR(hID), title, x, y);                        }
    00458   virtual P2D* bookProf(DataObject* pPar, int hID, CSTR title, Edges x, Edges y )
    00459   { return bookProf(pPar, _STR(hID), title, x, y);                       }
    00460   virtual P2D* bookProf(STRPAIR loc,CSTR title, Edges x, Edges y )
    00461   { return bookProf(loc.first, loc.second, title, x, y);                 }
    00462   virtual P2D* bookProf(DataObject* pPar, CSTR rel, CSTR title, Edges x, Edges y )
    00463   { return i_book(pPar, rel, title, Gaudi::createProf2D(title,x,y,0,0)); }
    00464
    00465   virtual P2D* bookProf(CSTR full, CSTR title, Edges x, Edges y, double upper, double lower )
    00466   { return bookProf(i_splitPath(full), title, x, y, upper, lower);       }
    00467   virtual P2D* bookProf(CSTR par, CSTR rel, CSTR title, Edges x, Edges y, double upper, double lower )
    00468   { return bookProf(createPath(par), rel, title, x, y, upper, lower);                  }
    00469   virtual P2D* bookProf(CSTR par, int hID, CSTR title, Edges x, Edges y, double upper, double lower )
    00470   { return bookProf(par, _STR(hID), title, x, y, upper, lower);                        }
    00471   virtual P2D* bookProf(DataObject* pPar, int hID, CSTR title, Edges x, Edges y, double upper, double lower )
    00472   { return bookProf(pPar, _STR(hID), title, x, y, upper, lower);                       }
    00473   virtual P2D* bookProf(STRPAIR loc,CSTR title, Edges x, Edges y, double upper, double lower )
    00474   { return bookProf(loc.first, loc.second, title, x, y, upper, lower);                 }
    00475   virtual P2D* bookProf(DataObject* pPar, CSTR rel, CSTR title, Edges x, Edges y, double upper, double lower )
    00476   { return i_book(pPar, rel, title, Gaudi::createProf2D(title,x,y, upper, lower));     }
    00477   // ==========================================================================
    00478   // Book 3D histogram with fixed binning
    00479   // ==========================================================================
    00497   virtual H3D* book(CSTR full, CSTR title, DBINS(x), DBINS(y), DBINS(z))
    00498   { return book(i_splitPath(full),title,BINS(x),BINS(y),BINS(z));            }
    00499   virtual H3D* book(CSTR par, CSTR rel, CSTR title, DBINS(x), DBINS(y), DBINS(z))
    00500   { return book(createPath(par),rel,title,BINS(x),BINS(y),BINS(z));          }
    00501   virtual H3D* book(CSTR par, int hID, CSTR title, DBINS(x), DBINS(y), DBINS(z))
    00502   { return book(par,_STR(hID),title,BINS(x),BINS(y),BINS(z));                }
    00503   virtual H3D* book(DataObject* pPar, int hID, CSTR title, DBINS(x), DBINS(y), DBINS(z))
    00504   { return book(pPar,_STR(hID), title, BINS(x),BINS(y),BINS(z));             }
    00505   virtual H3D* book(STRPAIR loc,CSTR title, DBINS(x), DBINS(y), DBINS(z))
    00506   { return book(loc.first, loc.second, title, BINS(x),BINS(y),BINS(z));      }
    00507   virtual H3D* book(DataObject* pPar, CSTR rel, CSTR title, DBINS(x), DBINS(y), DBINS(z))
    00508   { return i_book(pPar, rel, title, Gaudi::createH3D(title,BINS(x),BINS(y),BINS(z)));}
    00509   // ==========================================================================
    00510   // Book 3D histogram with variable binning
    00511   // ==========================================================================
    00528   virtual H3D* book(CSTR full, CSTR title, Edges x, Edges y, Edges z)
    00529   { return book(i_splitPath(full), title, x, y, z);                         }
    00530   virtual H3D* book(CSTR par, CSTR rel, CSTR title, Edges x, Edges y, Edges z)
    00531   { return book(createPath(par), rel, title, x, y, z);                      }
    00532   virtual H3D* book(CSTR par, int hID, CSTR title, Edges x, Edges y, Edges z)
    00533   { return book(par,_STR(hID), title, x, y, z);                             }
    00534   virtual H3D* book(DataObject* pPar, int hID, CSTR title, Edges x, Edges y, Edges z)
    00535   { return book(pPar,_STR(hID), title, x, y, z);                            }
    00536   virtual H3D* book(STRPAIR loc,CSTR title, Edges x, Edges y, Edges z)
    00537   { return book(loc.first, loc.second, title, x,y,z);                       }
    00538   virtual H3D* book(DataObject* pPar, CSTR rel, CSTR title, Edges x, Edges y, Edges z)
    00539   { return i_book(pPar, rel, title, Gaudi::createH3D(title,x,y,z));         }
    00540
    00541   // ==========================================================================
    00542   // Register histogram with the data store
    00543   // ==========================================================================
    00544 //------------------------------------------------------------------------------
    00545 // Register object with the data store
    00546 //------------------------------------------------------------------------------
    00547   virtual StatusCode registerObject(CSTR parent, CSTR rel, Base* obj )
    00548   { return registerObject(createPath(parent), rel, obj);                       }
    00549   virtual StatusCode registerObject(CSTR parent, int item, Base* obj )
    00550   { return registerObject(parent, _STR(item), obj);                            }
    00551   virtual StatusCode registerObject(Base* pPar, CSTR rel, Base* obj )
    00552   { return registerObject(__cast(pPar), rel, obj);                             }
    00553   virtual StatusCode registerObject(DataObject* pPar, int item, Base* obj )
    00554   { return registerObject(pPar, _STR(item), obj);                              }
    00555   virtual StatusCode registerObject(Base* pPar, int item, Base* obj )
    00556   { return registerObject(__cast(pPar), item, obj);                            }
    00557   virtual StatusCode registerObject(CSTR full, Base* obj );
    00558   virtual StatusCode registerObject(DataObject* pPar, CSTR rel, Base* obj );
    00559   // ==========================================================================
    00560   // Unregister histogram from the data store
    00561   // ==========================================================================
    00562   virtual StatusCode unregisterObject(Base* obj )
    00563   { return DataSvc::unregisterObject(__cast(obj));                             }
    00564   virtual StatusCode unregisterObject(Base* obj, CSTR objectPath)
    00565   { return DataSvc::unregisterObject(__cast(obj),objectPath);                  }
    00566   virtual StatusCode unregisterObject(Base* obj, int item )
    00567   { return DataSvc::unregisterObject(__cast(obj),item);                        }
    00568   // ==========================================================================
    00569   // Retrieve histogram from data store
    00570   // ==========================================================================
    00571   virtual StatusCode retrieveObject(IRegistry* pReg, CSTR path, H1D*& obj)
    00572   { return Helper(this).retrieve(pReg,path,obj);                                }
    00573   virtual StatusCode retrieveObject(IRegistry* pReg, CSTR path, P1D*& obj)
    00574   { return Helper(this).retrieve(pReg,path,obj);                                }
    00575   virtual StatusCode retrieveObject(IRegistry* pReg, CSTR path, H2D*& obj)
    00576   { return Helper(this).retrieve(pReg,path,obj);                                }
    00577   virtual StatusCode retrieveObject(IRegistry* pReg, CSTR path, P2D*& obj)
    00578   { return Helper(this).retrieve(pReg,path,obj);                                }
    00579   virtual StatusCode retrieveObject(IRegistry* pReg, CSTR path, H3D*& obj)
    00580   { return Helper(this).retrieve(pReg,path,obj);                                }
    00581   //------------------------------------------------------------------------------
    00582   virtual StatusCode retrieveObject(CSTR full,P1D*& obj)
    00583   {  return Helper(this).retrieve(full,obj);                                    }
    00584   virtual StatusCode retrieveObject(CSTR full,P2D*& obj)
    00585   {  return Helper(this).retrieve(full,obj);                                    }
    00586   virtual StatusCode retrieveObject(CSTR full,H1D*& obj)
    00587   {  return Helper(this).retrieve(full,obj);                                    }
    00588   virtual StatusCode retrieveObject(CSTR full,H2D*& obj)
    00589   {  return Helper(this).retrieve(full,obj);                                    }
    00590   virtual StatusCode retrieveObject(CSTR full,H3D*& obj)
    00591   {  return Helper(this).retrieve(full,obj);                                    }
    00592   //------------------------------------------------------------------------------
    00593   virtual StatusCode retrieveObject(CSTR parent,CSTR rel,P1D*& obj)
    00594   {  return Helper(this).retrieve(parent,rel,obj);                              }
    00595   virtual StatusCode retrieveObject(CSTR parent,CSTR rel,P2D*& obj)
    00596   {  return Helper(this).retrieve(parent,rel,obj);                              }
    00597   virtual StatusCode retrieveObject(CSTR parent,CSTR rel,H1D*& obj)
    00598   {  return Helper(this).retrieve(parent,rel,obj);                              }
    00599   virtual StatusCode retrieveObject(CSTR parent,CSTR rel,H2D*& obj)
    00600   {  return Helper(this).retrieve(parent,rel,obj);                              }
    00601   virtual StatusCode retrieveObject(CSTR parent,CSTR rel,H3D*& obj)
    00602   {  return Helper(this).retrieve(parent,rel,obj);                              }
    00603   //------------------------------------------------------------------------------
    00604   virtual StatusCode retrieveObject(CSTR parent,int item,P1D*& obj)
    00605   {  return Helper(this).retrieve(parent,item,obj);                             }
    00606   virtual StatusCode retrieveObject(CSTR parent,int item,P2D*& obj)
    00607   {  return Helper(this).retrieve(parent,item,obj);                             }
    00608   virtual StatusCode retrieveObject(CSTR parent,int item,H1D*& obj)
    00609   {  return Helper(this).retrieve(parent,item,obj);                             }
    00610   virtual StatusCode retrieveObject(CSTR parent,int item,H2D*& obj)
    00611   {  return Helper(this).retrieve(parent,item,obj);                             }
    00612   virtual StatusCode retrieveObject(CSTR parent,int item,H3D*& obj)
    00613   {  return Helper(this).retrieve(parent,item,obj);                             }
    00614   //------------------------------------------------------------------------------
    00615   virtual StatusCode retrieveObject(DataObject* par,CSTR item,P1D*& obj)
    00616   {  return Helper(this).retrieve(par,item,obj);                                }
    00617   virtual StatusCode retrieveObject(DataObject* par,CSTR item,P2D*& obj)
    00618   {  return Helper(this).retrieve(par,item,obj);                                }
    00619   virtual StatusCode retrieveObject(DataObject* par,CSTR item,H1D*& obj)
    00620   {  return Helper(this).retrieve(par,item,obj);                                }
    00621   virtual StatusCode retrieveObject(DataObject* par,CSTR item,H2D*& obj)
    00622   {  return Helper(this).retrieve(par,item,obj);                                }
    00623   virtual StatusCode retrieveObject(DataObject* par,CSTR item,H3D*& obj)
    00624   {  return Helper(this).retrieve(par,item,obj);                                }
    00625   //------------------------------------------------------------------------------
    00626   virtual StatusCode retrieveObject(DataObject* par,int item,P1D*& obj)
    00627   {  return Helper(this).retrieve(par,item,obj);                                }
    00628   virtual StatusCode retrieveObject(DataObject* par,int item,P2D*& obj)
    00629   {  return Helper(this).retrieve(par,item,obj);                                }
    00630   virtual StatusCode retrieveObject(DataObject* par,int item,H1D*& obj)
    00631   {  return Helper(this).retrieve(par,item,obj);                                }
    00632   virtual StatusCode retrieveObject(DataObject* par,int item,H2D*& obj)
    00633   {  return Helper(this).retrieve(par,item,obj);                                }
    00634   virtual StatusCode retrieveObject(DataObject* par,int item,H3D*& obj)
    00635   {  return Helper(this).retrieve(par,item,obj);                                }
    00636   //------------------------------------------------------------------------------
    00637   virtual StatusCode retrieveObject(Base* par,int item,P1D*& obj)
    00638   {  return Helper(this).retrieve(__cast(par),item,obj);                        }
    00639   virtual StatusCode retrieveObject(Base* par,int item,P2D*& obj)
    00640   {  return Helper(this).retrieve(__cast(par),item,obj);                        }
    00641   virtual StatusCode retrieveObject(Base* par,int item,H1D*& obj)
    00642   {  return Helper(this).retrieve(__cast(par),item,obj);                        }
    00643   virtual StatusCode retrieveObject(Base* par,int item,H2D*& obj)
    00644   {  return Helper(this).retrieve(__cast(par),item,obj);                        }
    00645   virtual StatusCode retrieveObject(Base* par,int item,H3D*& obj)
    00646   {  return Helper(this).retrieve(__cast(par),item,obj);                        }
    00647   //------------------------------------------------------------------------------
    00648   virtual StatusCode retrieveObject(Base* par,CSTR item,P1D*& obj)
    00649   {  return Helper(this).retrieve(__cast(par),item,obj);                        }
    00650   virtual StatusCode retrieveObject(Base* par,CSTR item,P2D*& obj)
    00651   {  return Helper(this).retrieve(__cast(par),item,obj);                        }
    00652   virtual StatusCode retrieveObject(Base* par,CSTR item,H1D*& obj)
    00653   {  return Helper(this).retrieve(__cast(par),item,obj);                        }
    00654   virtual StatusCode retrieveObject(Base* par,CSTR item,H2D*& obj)
    00655   {  return Helper(this).retrieve(__cast(par),item,obj);                        }
    00656   virtual StatusCode retrieveObject(Base* par,CSTR item,H3D*& obj)
    00657   {  return Helper(this).retrieve(__cast(par),item,obj);                        }
    00658
    00659   // ==========================================================================
    00660   // Find histogram identified by its full path in the data store
    00661   // ==========================================================================
    00662
    00663   //------------------------------------------------------------------------------
    00664   // Find object identified by its full path in the data store
    00665   //------------------------------------------------------------------------------
    00666   virtual StatusCode findObject(IRegistry* pReg,CSTR path,P1D*& obj)
    00667   {  return Helper(this).find(pReg,path,obj);                                 }
    00668   virtual StatusCode findObject(IRegistry* pReg,CSTR path,P2D*& obj)
    00669   {  return Helper(this).find(pReg,path,obj);                                 }
    00670   virtual StatusCode findObject(IRegistry* pReg,CSTR path,H1D*& obj)
    00671   {  return Helper(this).find(pReg,path,obj);                                 }
    00672   virtual StatusCode findObject(IRegistry* pReg,CSTR path,H2D*& obj)
    00673   {  return Helper(this).find(pReg,path,obj);                                 }
    00674   virtual StatusCode findObject(IRegistry* pReg,CSTR path,H3D*& obj)
    00675   {  return Helper(this).find(pReg,path,obj);                                 }
    00676   //------------------------------------------------------------------------------
    00677   virtual StatusCode findObject(CSTR full,P1D*& obj)
    00678   {  return Helper(this).find(full,obj);                                      }
    00679   virtual StatusCode findObject(CSTR full,P2D*& obj)
    00680   {  return Helper(this).find(full,obj);                                      }
    00681   virtual StatusCode findObject(CSTR full,H1D*& obj)
    00682   {  return Helper(this).find(full,obj);                                      }
    00683   virtual StatusCode findObject(CSTR full,H2D*& obj)
    00684   {  return Helper(this).find(full,obj);                                      }
    00685   virtual StatusCode findObject(CSTR full,H3D*& obj)
    00686   {  return Helper(this).find(full,obj);                                      }
    00687   //------------------------------------------------------------------------------
    00688   virtual StatusCode findObject(CSTR par,CSTR rel,P1D*& obj)
    00689   {  return Helper(this).find(par,rel,obj);                                   }
    00690   virtual StatusCode findObject(CSTR par,CSTR rel,P2D*& obj)
    00691   {  return Helper(this).find(par,rel,obj);                                   }
    00692   virtual StatusCode findObject(CSTR par,CSTR rel,H1D*& obj)
    00693   {  return Helper(this).find(par,rel,obj);                                   }
    00694   virtual StatusCode findObject(CSTR par,CSTR rel,H2D*& obj)
    00695   {  return Helper(this).find(par,rel,obj);                                   }
    00696   virtual StatusCode findObject(CSTR par,CSTR rel,H3D*& obj)
    00697   {  return Helper(this).find(par,rel,obj);                                   }
    00698   //------------------------------------------------------------------------------
    00699   virtual StatusCode findObject(CSTR par,int item,P1D*& obj)
    00700   {  return Helper(this).find(par,item,obj);                                  }
    00701   virtual StatusCode findObject(CSTR par,int item,P2D*& obj)
    00702   {  return Helper(this).find(par,item,obj);                                  }
    00703   virtual StatusCode findObject(CSTR par,int item,H1D*& obj)
    00704   {  return Helper(this).find(par,item,obj);                                  }
    00705   virtual StatusCode findObject(CSTR par,int item,H2D*& obj)
    00706   {  return Helper(this).find(par,item,obj);                                  }
    00707   virtual StatusCode findObject(CSTR par,int item,H3D*& obj)
    00708   {  return Helper(this).find(par,item,obj);                                  }
    00709   //------------------------------------------------------------------------------
    00710   virtual StatusCode findObject(DataObject* par,int item,P1D*& obj)
    00711   {  return Helper(this).find(par,item,obj);                                  }
    00712   virtual StatusCode findObject(DataObject* par,int item,P2D*& obj)
    00713   {  return Helper(this).find(par,item,obj);                                  }
    00714   virtual StatusCode findObject(DataObject* par,int item,H1D*& obj)
    00715   {  return Helper(this).find(par,item,obj);                                  }
    00716   virtual StatusCode findObject(DataObject* par,int item,H2D*& obj)
    00717   {  return Helper(this).find(par,item,obj);                                  }
    00718   virtual StatusCode findObject(DataObject* par,int item,H3D*& obj)
    00719   {  return Helper(this).find(par,item,obj);                                  }
    00720   //------------------------------------------------------------------------------
    00721   virtual StatusCode findObject(DataObject* par,CSTR item,P1D*& obj)
    00722   {  return Helper(this).find(par,item,obj);                                  }
    00723   virtual StatusCode findObject(DataObject* par,CSTR item,P2D*& obj)
    00724   {  return Helper(this).find(par,item,obj);                                  }
    00725   virtual StatusCode findObject(DataObject* par,CSTR item,H1D*& obj)
    00726   {  return Helper(this).find(par,item,obj);                                  }
    00727   virtual StatusCode findObject(DataObject* par,CSTR item,H2D*& obj)
    00728   {  return Helper(this).find(par,item,obj);                                  }
    00729   virtual StatusCode findObject(DataObject* par,CSTR item,H3D*& obj)
    00730   {  return Helper(this).find(par,item,obj);                                  }
    00731   //------------------------------------------------------------------------------
    00732   virtual StatusCode findObject(Base* par,int item,P1D*& obj)
    00733   {  return Helper(this).find(__cast(par),item,obj);                          }
    00734   virtual StatusCode findObject(Base* par,int item,P2D*& obj)
    00735   {  return Helper(this).find(__cast(par),item,obj);                          }
    00736   virtual StatusCode findObject(Base* par,int item,H1D*& obj)
    00737   {  return Helper(this).find(__cast(par),item,obj);                          }
    00738   virtual StatusCode findObject(Base* par,int item,H2D*& obj)
    00739   {  return Helper(this).find(__cast(par),item,obj);                          }
    00740   virtual StatusCode findObject(Base* par,int item,H3D*& obj)
    00741   {  return Helper(this).find(__cast(par),item,obj);                          }
    00742   //------------------------------------------------------------------------------
    00743   virtual StatusCode findObject(Base* par,CSTR item,P1D*& obj)
    00744   {  return Helper(this).find(__cast(par),item,obj);                          }
    00745   virtual StatusCode findObject(Base* par,CSTR item,P2D*& obj)
    00746   {  return Helper(this).find(__cast(par),item,obj);                          }
    00747   virtual StatusCode findObject(Base* par,CSTR item,H1D*& obj)
    00748   {  return Helper(this).find(__cast(par),item,obj);                          }
    00749   virtual StatusCode findObject(Base* par,CSTR item,H2D*& obj)
    00750   {  return Helper(this).find(__cast(par),item,obj);                          }
    00751   virtual StatusCode findObject(Base* par,CSTR item,H3D*& obj)
    00752   {  return Helper(this).find(__cast(par),item,obj);                          }
    00753
    00754   // ==========================================================================
    00755   // Projections and slices.
    00756   // ==========================================================================
    00757   virtual H1D* projectionX(CSTR name,const H2D& h)
    00758   {  return sliceX( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN);      }
    00759   virtual H1D* projectionY(CSTR name,const H2D& h)
    00760   {  return sliceY( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN);      }
    00761   virtual H1D* sliceX(CSTR name,const H2D& h,int indexY)
    00762   {  return sliceX( name, h, indexY, indexY );                                }
    00763   virtual H1D* sliceY(CSTR name,const H2D& h,int indexX)
    00764   {  return sliceY( name, h, indexX, indexX );                                }
    00765   virtual H1D* sliceX(CSTR name,const H2D& h,int indexY1,int indexY2);
    00766   virtual H1D* sliceY(CSTR name,const H2D& h,int indexX1,int indexX2);
    00767   //------------------------------------------------------------------------------
    00768   bool destroy( IBaseHistogram* hist);
    00769
    00770   H1D* add(CSTR nameAndTitle, const H1D& a, const H1D& b)
    00771   { return Helper::act(createCopy(nameAndTitle,a),b,&TH1::Add, 1.);          }
    00772   H1D* subtract(CSTR nameAndTitle, const H1D& a, const H1D& b)
    00773   { return Helper::act(createCopy(nameAndTitle,a),b,&TH1::Add,-1.);          }
    00774   H1D* multiply(CSTR nameAndTitle, const H1D& a, const H1D& b)
    00775   { return Helper::act(createCopy(nameAndTitle,a),b,&TH1::Multiply);         }
    00776   H1D* divide(CSTR nameAndTitle, const H1D& a, const H1D& b)
    00777   { return Helper::act(createCopy(nameAndTitle,a),b,&TH1::Divide);           }
    00778
    00779   H2D* add(CSTR nameAndTitle, const H2D& a, const H2D& b)
    00780   { return Helper::act(createCopy(nameAndTitle,a),b,&TH2D::Add, 1.);           }
    00781   H2D* subtract(CSTR nameAndTitle, const H2D& a, const H2D& b)
    00782   { return Helper::act(createCopy(nameAndTitle,a),b,&TH2D::Add,-1.);           }
    00783   H2D* multiply(CSTR nameAndTitle, const H2D& a, const H2D& b)
    00784   { return Helper::act(createCopy(nameAndTitle,a),b,&TH2D::Multiply);          }
    00785   H2D* divide(CSTR nameAndTitle, const H2D& a, const H2D& b)
    00786   { return Helper::act(createCopy(nameAndTitle,a),b,&TH2D::Divide);            }
    00787
    00788   H3D* add(CSTR nameAndTitle, const H3D& a, const H3D& b)
    00789   { return Helper::act(createCopy(nameAndTitle,a),b,&TH3D::Add, 1.);           }
    00790   H3D* subtract(CSTR nameAndTitle, const H3D& a, const H3D& b)
    00791   { return Helper::act(createCopy(nameAndTitle,a),b,&TH3D::Add,-1.);           }
    00792   H3D* multiply(CSTR nameAndTitle, const H3D& a, const H3D& b)
    00793   { return Helper::act(createCopy(nameAndTitle,a),b,&TH3D::Multiply);          }
    00794   H3D* divide(CSTR nameAndTitle, const H3D& a, const H3D& b)
    00795   { return Helper::act(createCopy(nameAndTitle,a),b,&TH3D::Divide);            }
    00796
    00797   H2D* projectionXY(CSTR nameAndTitle,const H3D& h)
    00798   { return i_project(nameAndTitle,h,"xy");                                    }
    00799   H2D* projectionXZ(CSTR nameAndTitle,const H3D& h)
    00800   { return i_project(nameAndTitle,h,"xz");                                    }
    00801   H2D* projectionYZ(CSTR nameAndTitle,const H3D& h)
    00802   { return i_project(nameAndTitle,h,"yz");                                    }
    00803   H2D* sliceXY(CSTR /* nameAndTitle */,const H3D& /* h */,int /* low */,int /* high */ ) NOT_IMPLEMENTED
    00804   H2D* sliceXZ(CSTR /* nameAndTitle */,const H3D& /* h */,int /* low */,int /* high */ ) NOT_IMPLEMENTED
    00805   H2D* sliceYZ(CSTR /* nameAndTitle */,const H3D& /* h */,int /* low */,int /* high */ ) NOT_IMPLEMENTED
    00806
    00807   //------------------------------------------------------------------------------
    00808   H1D* createHistogram1D(CSTR name,CSTR tit,DBINS(x))
    00809   {  return book( name, tit, BINS(x));                                        }
    00810   H1D* createHistogram1D(CSTR name,CSTR tit,DBINS(x),CSTR /*opt*/)
    00811   {  return book( name, tit, BINS(x));                                        }
    00812   H1D* createHistogram1D(CSTR name,CSTR title,const Edges& x,CSTR /*opt*/)
    00813   {  return book(name, title, x);                                             }
    00814   H1D* createHistogram1D(CSTR nameAndTitle, DBINS(x))
    00815   { return book(nameAndTitle, nameAndTitle, BINS(x));                         }
    00816   H1D* createCopy(CSTR full, const H1D& h)
    00817   {  return createCopy(i_splitPath(full), h);                                 }
    00818   H1D* createCopy(CSTR par, CSTR rel, const H1D& h)
    00819   {  return createCopy(createPath(par), rel, h);                              }
    00820   H1D* createCopy(STRPAIR loc, const H1D& h)
    00821   {  return createCopy(loc.first, loc.second, h);                             }
    00822   H1D* createCopy(DataObject* pPar, CSTR rel, const H1D& h)
    00823   { return i_book(pPar, rel, h.title(), Gaudi::createH1D(h));                 }
    00824   //------------------------------------------------------------------------------
    00825   H2D* createHistogram2D(CSTR name,CSTR tit,DBINS(x),DBINS(y))
    00826   {  return book( name, tit, BINS(x), BINS(y));                               }
    00827   H2D* createHistogram2D(CSTR name,CSTR tit,DBINS(x),DBINS(y),CSTR /*opt*/)
    00828   {  return book( name, tit, BINS(x), BINS(y));                               }
    00829   H2D* createHistogram2D(CSTR name,CSTR title,const Edges& x,const Edges& y, CSTR /*opt*/)
    00830   {  return book(name, title, x, y);                                          }
    00831   H2D* createHistogram2D(CSTR nameAndTitle, DBINS(x), DBINS(y))
    00832   { return book(nameAndTitle, nameAndTitle, BINS(x), BINS(y));                }
    00833   H2D* createCopy(CSTR full, const H2D& h)
    00834   {  return createCopy(i_splitPath(full), h);                                 }
    00835   H2D* createCopy(CSTR par, CSTR rel, const H2D& h)
    00836   {  return createCopy(createPath(par), rel, h);                              }
    00837   H2D* createCopy(STRPAIR loc, const H2D& h)
    00838   {  return createCopy(loc.first, loc.second, h);                             }
    00839   H2D* createCopy(DataObject* pPar, CSTR rel, const H2D& h)
    00840   { return i_book(pPar, rel, h.title(), Gaudi::createH2D(h));                 }
    00841   //------------------------------------------------------------------------------
    00842   H3D* createHistogram3D(CSTR name, CSTR tit, DBINS(x), DBINS(y), DBINS(z))
    00843   {  return book( name, tit, BINS(x), BINS(y), BINS(z));                      }
    00844   H3D* createHistogram3D(CSTR name, CSTR tit, DBINS(x), DBINS(y), DBINS(z), CSTR /*opt*/)
    00845   {  return book( name, tit, BINS(x), BINS(y), BINS(z));                      }
    00846   H3D* createHistogram3D(CSTR name, CSTR title,const Edges& x,const Edges& y,const Edges& z,CSTR /*opt*/)
    00847   {  return book(name, title, x, y, z);                                       }
    00848   H3D* createHistogram3D(CSTR nameAndTitle, DBINS(x), DBINS(y), DBINS(z))
    00849   { return book(nameAndTitle, nameAndTitle, BINS(x), BINS(y), BINS(z));       }
    00850   H3D* createCopy(CSTR full, const H3D& h)
    00851   {  return createCopy(i_splitPath(full), h);                                 }
    00852   H3D* createCopy(CSTR par, CSTR rel, const H3D& h)
    00853   {  return createCopy(createPath(par), rel, h);                              }
    00854   H3D* createCopy(STRPAIR loc, const H3D& h)
    00855   {  return createCopy(loc.first, loc.second, h);                             }
    00856   H3D* createCopy(DataObject* pPar, CSTR rel, const H3D& h)
    00857   { return i_book(pPar, rel, h.title(), Gaudi::createH3D(h));                 }
    00858   //------------------------------------------------------------------------------
    00859
    00860
    00861   P1D* createProfile1D(CSTR name,CSTR tit,DBINS(x),CSTR opt )
    00862   {  return bookProf( name, tit, BINS(x) , opt );                             }
    00863   P1D* createProfile1D(CSTR name,CSTR tit,DBINS(x),double upper, double lower , CSTR opt )
    00864   {  return bookProf( name, tit, BINS(x), upper, lower , opt );               }
    00865   P1D* createProfile1D(CSTR name,CSTR title,const Edges& x,CSTR   /* opt */ )
    00866   {  return bookProf(name, title, x );                                        }
    00867   P1D* createProfile1D(CSTR name,CSTR title,const Edges& x,double upper, double lower, CSTR /* opt */ )
    00868   {  return bookProf(name, title, x, upper, lower );                          }
    00869
    00870   P1D* createProfile1D(CSTR nametit,DBINS(x))
    00871   {  return bookProf( nametit, nametit, BINS(x) , "s");                       }
    00872   P1D* createProfile1D(CSTR nametit,DBINS(x),double upper, double lower )
    00873   {  return bookProf( nametit, nametit, BINS(x), upper, lower , "s");         }
    00874
    00875
    00876   P1D* createCopy(CSTR full, const P1D& h)
    00877   {  return createCopy(i_splitPath(full), h);                                 }
    00878   P1D* createCopy(CSTR par, CSTR rel, const P1D& h)
    00879   {  return createCopy(createPath(par), rel, h);                              }
    00880   P1D* createCopy(STRPAIR loc, const P1D& h)
    00881   {  return createCopy(loc.first, loc.second, h);                             }
    00882   P1D* createCopy(DataObject* pPar, CSTR rel, const P1D& h)
    00883   { return i_book(pPar, rel, h.title(), Gaudi::createProf1D(h));              }
    00884   //------------------------------------------------------------------------------
    00885   P2D* createProfile2D(CSTR name,CSTR tit,DBINS(x),DBINS(y))
    00886   {  return bookProf( name, tit, BINS(x), BINS(y));                           }
    00887   P2D* createProfile2D(CSTR name,CSTR tit,DBINS(x),DBINS(y),CSTR /*opt*/)
    00888   {  return bookProf( name, tit, BINS(x), BINS(y));                           }
    00889   P2D* createProfile2D(CSTR name,CSTR title,const Edges& x,const Edges& y, CSTR /*opt*/)
    00890   {  return bookProf(name, title, x, y);                                      }
    00891   P2D* createProfile2D(CSTR nameAndTitle, DBINS(x), DBINS(y))
    00892   { return bookProf(nameAndTitle, nameAndTitle, BINS(x), BINS(y));            }
    00893
    00894   P2D* createProfile2D(CSTR name,CSTR tit,DBINS(x),DBINS(y),double upper, double lower)
    00895   {  return bookProf( name, tit, BINS(x), BINS(y), upper, lower);             }
    00896   P2D* createProfile2D(CSTR name,CSTR tit,DBINS(x),DBINS(y),double upper, double lower,CSTR /*opt*/)
    00897   {  return bookProf( name, tit, BINS(x), BINS(y), upper, lower);             }
    00898   P2D* createProfile2D(CSTR name,CSTR title,const Edges& x,const Edges& y,double upper, double lower, CSTR /*opt*/)
    00899   {  return bookProf(name, title, x, y, upper, lower);                        }
    00900   P2D* createProfile2D(CSTR nameAndTitle, DBINS(x), DBINS(y),double upper, double lower)
    00901   { return bookProf(nameAndTitle, nameAndTitle, BINS(x), BINS(y), upper, lower);}
    00902
    00903   P2D* createCopy(CSTR full, const P2D& h)
    00904   {  return createCopy(i_splitPath(full), h);                                 }
    00905   P2D* createCopy(CSTR par, CSTR rel, const P2D& h)
    00906   {  return createCopy(createPath(par), rel, h);                              }
    00907   P2D* createCopy(STRPAIR loc, const P2D& h)
    00908   {  return createCopy(loc.first, loc.second, h);                             }
    00909   P2D* createCopy(DataObject* pPar, CSTR rel, const P2D& h)
    00910   { return i_book(pPar, rel, h.title(), Gaudi::createProf2D(h));              }
    00911   //------------------------------------------------------------------------------
    00912   AIDA::ICloud1D* createCloud1D(CSTR, CSTR, int, CSTR)         NOT_IMPLEMENTED
    00913   AIDA::ICloud1D* createCloud1D(CSTR)                          NOT_IMPLEMENTED
    00914   AIDA::ICloud1D* createCopy(CSTR, const AIDA::ICloud1D&)      NOT_IMPLEMENTED
    00915   AIDA::ICloud2D* createCloud2D(CSTR, CSTR, int, CSTR)         NOT_IMPLEMENTED
    00916   AIDA::ICloud2D* createCloud2D(CSTR)                          NOT_IMPLEMENTED
    00917   AIDA::ICloud2D* createCopy(CSTR, const AIDA::ICloud2D&)      NOT_IMPLEMENTED
    00918   AIDA::ICloud3D* createCloud3D(CSTR, CSTR, int, CSTR)         NOT_IMPLEMENTED
    00919   AIDA::ICloud3D* createCloud3D(CSTR)                          NOT_IMPLEMENTED
    00920   AIDA::ICloud3D* createCopy(CSTR, const AIDA::ICloud3D&)      NOT_IMPLEMENTED
    00921
    00922   //------------------------------------------------------------------------------
    00923   // Re-implementing these here avoids a compiler warning about hidden
    00924   // functions. Refer to ARM Page 210.
    00925   // Register object with the data store.
    00926   virtual StatusCode registerObject(CSTR full, DataObject* obj )
    00927   {    return DataSvc::registerObject(full, obj );                            }
    00928   virtual StatusCode registerObject(CSTR parPath, CSTR rel, DataObject* obj)
    00929   {    return DataSvc::registerObject(parPath, rel, obj );                    }
    00930   virtual StatusCode registerObject(CSTR parPath, int item, DataObject* obj)
    00931   {    return DataSvc::registerObject(parPath, item, obj );                   }
    00932   virtual StatusCode registerObject(DataObject* pPar, CSTR rel, DataObject* obj)
    00933   {    return DataSvc::registerObject(pPar, rel, obj );                       }
    00934   virtual StatusCode registerObject(DataObject* pPar, int item, DataObject* obj)
    00935   {    return DataSvc::registerObject(pPar, item, obj );                      }
    00936
    00938   virtual StatusCode unregisterObject(CSTR full )
    00939   {    return DataSvc::unregisterObject(full );                               }
    00940   virtual StatusCode unregisterObject(CSTR parPath, CSTR objectPath )
    00941   {    return DataSvc::unregisterObject(parPath, objectPath );                }
    00942   virtual StatusCode unregisterObject(CSTR parPath, int item )
    00943   {    return DataSvc::unregisterObject(parPath, item );                      }
    00944   virtual StatusCode unregisterObject(DataObject* obj )
    00945   {    return DataSvc::unregisterObject(obj );                                }
    00946   virtual StatusCode unregisterObject(DataObject* obj, CSTR objectPath )
    00947   {    return DataSvc::unregisterObject(obj, objectPath );                    }
    00948   virtual StatusCode unregisterObject(DataObject* obj, int item )
    00949   {    return DataSvc::unregisterObject(obj, item );                          }
    00950
    00952   virtual StatusCode retrieveObject(IRegistry* dir, CSTR path, DataObject*& obj)
    00953   {    return DataSvc::retrieveObject(dir, path, obj );                       }
    00954   virtual StatusCode retrieveObject(CSTR full, DataObject*& obj )
    00955   {    return DataSvc::retrieveObject(full, obj );                            }
    00956   virtual StatusCode retrieveObject(CSTR parPath, CSTR rel, DataObject*& obj)
    00957   {    return DataSvc::retrieveObject(parPath, rel, obj );                    }
    00958   virtual StatusCode retrieveObject(CSTR parPath, int item, DataObject*& obj)
    00959   {    return DataSvc::retrieveObject(parPath, item, obj );                   }
    00960   virtual StatusCode retrieveObject(DataObject* pPar, CSTR rel, DataObject*& obj )
    00961   {    return DataSvc::retrieveObject(pPar, rel, obj );                       }
    00962   virtual StatusCode retrieveObject(DataObject* pPar, int item, DataObject*& obj )
    00963   {    return DataSvc::retrieveObject(pPar, item, obj );                      }
    00964
    00966   virtual StatusCode findObject(CSTR full, DataObject*& obj )
    00967   {    return DataSvc::findObject(full, obj );                                }
    00968   virtual StatusCode findObject(IRegistry* dir, CSTR path, DataObject*& obj )
    00969   {    return DataSvc::findObject(dir, path, obj );                           }
    00970   virtual StatusCode findObject(CSTR parPath, CSTR rel, DataObject*& obj )
    00971   {    return DataSvc::findObject(parPath, rel, obj );                        }
    00972   virtual StatusCode findObject(CSTR parPath, int item, DataObject*& obj )
    00973   {    return DataSvc::findObject(parPath, item, obj );                       }
    00974   virtual StatusCode findObject(DataObject* pPar, CSTR rel, DataObject*& obj )
    00975   {    return DataSvc::findObject(pPar, rel, obj );                           }
    00976   virtual StatusCode findObject(DataObject* pPar, int item, DataObject*& obj )
    00977   {    return DataSvc::findObject(pPar, item, obj );                          }
    00978
    00980   virtual std::ostream& print(Base* h, std::ostream& s = std::cout) const;
    00981
    00983   virtual std::ostream& write(Base* h, std::ostream& s = std::cout) const;
    00984
    00986   virtual int write(Base* h, const char* file_name ) const;
    00987
    00989   virtual DataObject* createPath(CSTR newPath );
    00990
    00995   virtual DataObject* createDirectory  (CSTR parentDir, CSTR subDir );
    00996
    00997 public:
    00998   // ==========================================================================
    01000   void update1Ddefs ( Property& ) ;
    01001   // ==========================================================================
    01002   typedef std::map<std::string,Gaudi::Histo1DDef> Histo1DMap ;
    01003   // ==========================================================================
    01004 private:
    01005   // ==========================================================================
    01006   // container with the definition of "the special" histograms
    01007   Histo1DMap                  m_defs1D ;
    01008   // ==========================================================================
    01009   // modified histograms:
    01010   std::set<std::string>       m_mods1D ;
    01011   // ==========================================================================
    01012 };
    01013 // ===========================================================================
    01014 // The END
    01015 // ===========================================================================
    01016 #endif    // GAUDISVC_HISTOGRAMSVC_H
    01017 // ===========================================================================