diff --git a/GaudiCommonSvc/CMakeLists.txt b/GaudiCommonSvc/CMakeLists.txt index dd7470aad0b4eafb4ca7a9530b4bb8499ea82f49..3cfba09e6bcf5c3387475803966c4c2c3ae1d668 100644 --- a/GaudiCommonSvc/CMakeLists.txt +++ b/GaudiCommonSvc/CMakeLists.txt @@ -8,23 +8,41 @@ find_package(ROOT COMPONENTS Hist RIO) # Decide whether to link against AIDA: set( aida_lib ) +set( histo_lib ) if( AIDA_FOUND ) - set( aida_lib AIDA ) + set( aida_lib AIDA ) + set( histo_lib GaudiCommonSvcLib ) endif() # The list of sources to build into the module: +set(histo_svc_sources) set( module_sources src/*.cpp src/DataSvc/*.cpp src/PersistencySvc/*.cpp ) if( AIDA_FOUND ) - list( APPEND module_sources src/HistogramSvc/*.cpp + list( APPEND module_sources src/HistogramSvc/Factory.cpp src/HistogramPersistencySvc/*.cpp ) + list( APPEND histo_svc_sources src/HistogramSvc/HistogramSvc.cpp + src/HistogramSvc/AIDA_visibility_hack.cpp + src/HistogramSvc/H1D.cpp + src/HistogramSvc/H2D.cpp + src/HistogramSvc/H3D.cpp + src/HistogramSvc/P1D.cpp + src/HistogramSvc/P2D.cpp ) endif() # Hide some Boost/ROOT compile time warnings include_directories(SYSTEM ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}) #---Libraries--------------------------------------------------------------- +if( AIDA_FOUND ) + gaudi_add_library(GaudiCommonSvcLib + ${histo_svc_sources} + LINK_LIBRARIES GaudiKernel Boost ROOT + PUBLIC_HEADERS GaudiCommonSvc + INCLUDE_DIRS Boost ROOT ${aida_lib}) +endif() + gaudi_add_module(GaudiCommonSvc ${module_sources} - LINK_LIBRARIES GaudiKernel Boost ROOT + LINK_LIBRARIES GaudiKernel Boost ROOT ${histo_lib} INCLUDE_DIRS Boost ROOT ${aida_lib}) diff --git a/GaudiCommonSvc/src/HistogramSvc/Annotation.h b/GaudiCommonSvc/GaudiCommonSvc/Annotation.h similarity index 96% rename from GaudiCommonSvc/src/HistogramSvc/Annotation.h rename to GaudiCommonSvc/GaudiCommonSvc/Annotation.h index 94efb0dcf6acc2316f2663fa9743431414f2dc0d..957b2a06493a1e9fa2aeb3fcaea7e4a64583c759 100644 --- a/GaudiCommonSvc/src/HistogramSvc/Annotation.h +++ b/GaudiCommonSvc/GaudiCommonSvc/Annotation.h @@ -1,8 +1,6 @@ /* Emacs: -*- C++ -*- */ #ifndef GAUDISVC_ANNOTATION_H #define GAUDISVC_ANNOTATION_H 1 -/// @FIXME: AIDA interfaces visibility -#include "AIDA_visibility_hack.h" // Include files #include @@ -18,11 +16,6 @@ namespace AIDA { class Annotation : virtual public IAnnotation { public: - /// Constructor - Annotation() = default; - - /// Destructor - ~Annotation() override = default; /// Add a key/value pair with a given sticky. bool addItem( const std::string & key, @@ -114,7 +107,7 @@ inline bool AIDA::Annotation::removeItem( const std::string & key ) { inline std::string AIDA::Annotation::value( const std::string & key) const { auto iKey = m_identifiers.find( key ); - return iKey != m_identifiers.end() ? m_annotationItems[ iKey->second ].m_value + return iKey != m_identifiers.end() ? m_annotationItems[ iKey->second ].m_value : emptyString; } diff --git a/GaudiCommonSvc/src/HistogramSvc/Axis.h b/GaudiCommonSvc/GaudiCommonSvc/Axis.h similarity index 93% rename from GaudiCommonSvc/src/HistogramSvc/Axis.h rename to GaudiCommonSvc/GaudiCommonSvc/Axis.h index 517dbb751890a7422fc5494311d317638d51d8d5..fa201e448a005d36bffaf5ba669459661588f201 100644 --- a/GaudiCommonSvc/src/HistogramSvc/Axis.h +++ b/GaudiCommonSvc/GaudiCommonSvc/Axis.h @@ -4,10 +4,8 @@ // This class was generated by AID - Abstract Interface Definition // DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it. // ========================================================================= -#ifndef GAUDISVC__IAXIS_H -#define GAUDISVC__IAXIS_H 1 -/// @FIXME: AIDA interfaces visibility -#include "AIDA_visibility_hack.h" +#ifndef GAUDICOMMONSVC_AXIS_H +#define GAUDICOMMONSVC_AXIS_H 1 // This file is part of the AIDA library // Copyright (C) 2002 by the AIDA team. All rights reserved. @@ -32,8 +30,6 @@ namespace Gaudi { { public: - typedef Axis self; - static int toRootIndex(int index, int nbins) { if (index==AIDA::IAxis::OVERFLOW_BIN) return nbins+1; if (index==AIDA::IAxis::UNDERFLOW_BIN) return 0; @@ -65,14 +61,10 @@ namespace Gaudi { public: Axis() = default; - explicit Axis ( TAxis * itaxi ) : taxis_(itaxi) {} void initialize (TAxis * itaxi , bool ) { taxis_ = itaxi; } - /// Destructor. - ~Axis() override = default; - /** * Check if the IAxis has fixed binning, i.e. if all the bins have the same width. * @return true if the binning is fixed, false otherwise. @@ -148,7 +140,7 @@ namespace Gaudi { private: - self & me() const { return const_cast(*this);} + Axis & me() const { return const_cast(*this);} TAxis * taxis_ = nullptr; @@ -157,4 +149,4 @@ namespace Gaudi { } // namespace Gaudi -#endif /* ifndef AIDA_IAXIS_H */ +#endif // GAUDICOMMONSVC_AXIS_H diff --git a/GaudiCommonSvc/src/HistogramSvc/Generic1D.h b/GaudiCommonSvc/GaudiCommonSvc/Generic1D.h similarity index 99% rename from GaudiCommonSvc/src/HistogramSvc/Generic1D.h rename to GaudiCommonSvc/GaudiCommonSvc/Generic1D.h index 33ef73e30362d7ffb086f384688280a6c8908bef..b2cf7879cd1a178049084d6d437c84ea067694e4 100644 --- a/GaudiCommonSvc/src/HistogramSvc/Generic1D.h +++ b/GaudiCommonSvc/GaudiCommonSvc/Generic1D.h @@ -1,7 +1,5 @@ #ifndef GAUDISVC_GENERIC1D_H #define GAUDISVC_GENERIC1D_H 1 -/// @FIXME: AIDA interfaces visibility -#include "AIDA_visibility_hack.h" #include #include diff --git a/GaudiCommonSvc/src/HistogramSvc/Generic2D.h b/GaudiCommonSvc/GaudiCommonSvc/Generic2D.h similarity index 99% rename from GaudiCommonSvc/src/HistogramSvc/Generic2D.h rename to GaudiCommonSvc/GaudiCommonSvc/Generic2D.h index 7a2d85bffb5e5599373090a34eaa159656a26dee..2ddc44861c8f57cc89399c8cd58143e1257af2df 100644 --- a/GaudiCommonSvc/src/HistogramSvc/Generic2D.h +++ b/GaudiCommonSvc/GaudiCommonSvc/Generic2D.h @@ -1,7 +1,5 @@ #ifndef GAUDISVC_GENERIC2D_H #define GAUDISVC_GENERIC2D_H 1 -/// @FIXME: AIDA interfaces visibility -#include "AIDA_visibility_hack.h" #include #include diff --git a/GaudiCommonSvc/src/HistogramSvc/Generic3D.h b/GaudiCommonSvc/GaudiCommonSvc/Generic3D.h similarity index 99% rename from GaudiCommonSvc/src/HistogramSvc/Generic3D.h rename to GaudiCommonSvc/GaudiCommonSvc/Generic3D.h index c4d30a5dca967ff4472d50ae9cb68de41b9f3bf3..bb4d3cb61e40fe0add63712190600c244e1cb94e 100644 --- a/GaudiCommonSvc/src/HistogramSvc/Generic3D.h +++ b/GaudiCommonSvc/GaudiCommonSvc/Generic3D.h @@ -1,7 +1,5 @@ #ifndef GAUDISVC_GENERIC3D_H #define GAUDISVC_GENERIC3D_H 1 -/// @FIXME: AIDA interfaces visibility -#include "AIDA_visibility_hack.h" #include "Axis.h" #include "TFile.h" diff --git a/GaudiCommonSvc/src/HistogramSvc/H1D.h b/GaudiCommonSvc/GaudiCommonSvc/H1D.h similarity index 94% rename from GaudiCommonSvc/src/HistogramSvc/H1D.h rename to GaudiCommonSvc/GaudiCommonSvc/H1D.h index 768421d0ffef32a9e74a59da41880d19d4b14923..271025e557f64091e3f9876c1aadfacf78551e65 100644 --- a/GaudiCommonSvc/src/HistogramSvc/H1D.h +++ b/GaudiCommonSvc/GaudiCommonSvc/H1D.h @@ -1,10 +1,10 @@ #ifndef HISTOGRAMSVC_H1D_H #define HISTOGRAMSVC_H1D_H 1 -#include "GaudiKernel/DataObject.h" +#include +#include +#include #include "Generic1D.h" -#include "GaudiPI.h" -#include "TH1D.h" namespace Gaudi { @@ -26,8 +26,7 @@ namespace Gaudi { Histogram1D(); /// Standard constructor with initialization. The histogram representation will be adopted Histogram1D(TH1D* rep); - /// Destructor. - ~Histogram1D() override =default; + /// Adopt ROOT histogram representation void adoptRepresentation(TObject*rep) override; /// set bin content (entries and centre are not used ) diff --git a/GaudiCommonSvc/src/HistogramSvc/H2D.h b/GaudiCommonSvc/GaudiCommonSvc/H2D.h similarity index 86% rename from GaudiCommonSvc/src/HistogramSvc/H2D.h rename to GaudiCommonSvc/GaudiCommonSvc/H2D.h index 64ad84f75ae0d5ef95029cb848fc0b6500c5dca7..3b840f969a27c4a2ce202976663bc0cb33807862 100644 --- a/GaudiCommonSvc/src/HistogramSvc/H2D.h +++ b/GaudiCommonSvc/GaudiCommonSvc/H2D.h @@ -1,12 +1,10 @@ #ifndef HISTOGRAMSVC_H2D_H #define HISTOGRAMSVC_H2D_H 1 -#include "GaudiKernel/DataObject.h" +#include "AIDA/IHistogram2D.h" +#include +#include #include "Generic2D.h" -#include "GaudiPI.h" -#include "TH2D.h" - -using namespace AIDA; namespace Gaudi { class Histogram1D; @@ -17,14 +15,13 @@ namespace Gaudi { * * @author M.Frank */ - class GAUDI_API Histogram2D : public DataObject, public Generic2D { + class GAUDI_API Histogram2D : public DataObject, public Generic2D { public: /// Standard Constructor Histogram2D(); /// Standard initializing Constructor with TH2D representation to be adopted Histogram2D(TH2D* rep); - /// Destructor. - ~Histogram2D() override = default; + /// Fill the Histogram2D with a value and the bool fill(double x,double y,double weight = 1.) override; /// Fast filling method for a given bin. It can be also the over/underflow bin @@ -36,7 +33,7 @@ namespace Gaudi { // overwrite reset bool reset() override; /// Create new histogram from any AIDA based histogram - void copyFromAida(const IHistogram2D& h); + void copyFromAida(const AIDA::IHistogram2D& h); /// Retrieve reference to class defininition identifier const CLID& clID() const override { return classID(); } static const CLID& classID() { return CLID_H2D; } diff --git a/GaudiCommonSvc/GaudiCommonSvc/H3D.h b/GaudiCommonSvc/GaudiCommonSvc/H3D.h new file mode 100644 index 0000000000000000000000000000000000000000..7c3613638f0f9d805f966063f28198d4aed4837c --- /dev/null +++ b/GaudiCommonSvc/GaudiCommonSvc/H3D.h @@ -0,0 +1,48 @@ +#ifndef GAUDICOMMONSVC_H3D_H +#define GAUDICOMMONSVC_H3D_H + +#include +#include +#include +#include "Generic3D.h" + +namespace Gaudi { + + /**@class Histogram3D + * + * AIDA implementation for 3 D histograms using ROOT THD2 + * + * @author M.Frank + */ + class GAUDI_API Histogram3D : public DataObject, public Generic3D { + public: + /// Standard Constructor + Histogram3D(); + /// Standard Constructor + Histogram3D(TH3D* rep); + + /// Fill bin content + bool fill ( double x, double y, double z, double weight) override; + /// Fast filling method for a given bin. It can be also the over/underflow bin + virtual bool setBinContents( int i, int j, int k, int entries,double height,double error,double centreX, double centreY, double centreZ ); + /// Sets the rms of the histogram. + virtual bool setRms(double rmsX, double rmsY, double rmsZ); + // overwrite reset + bool reset() override; + /// Introspection method + void* cast(const std::string & className) const override; + /// Create new histogram from any AIDA based histogram + void copyFromAida(const AIDA::IHistogram3D & h); + /// Retrieve reference to class defininition identifier + const CLID& clID() const override { return classID(); } + static const CLID& classID() { return CLID_H3D; } + + protected: + // cache sumwx and sumwy when setting contents since I don't have bin mean + double m_sumwx = 0; + double m_sumwy = 0; + double m_sumwz = 0; + }; +} + +#endif diff --git a/GaudiCommonSvc/GaudiCommonSvc/HistogramSvc.h b/GaudiCommonSvc/GaudiCommonSvc/HistogramSvc.h new file mode 100644 index 0000000000000000000000000000000000000000..577e70562f4731f79985f700dcb4d3f2561d8651 --- /dev/null +++ b/GaudiCommonSvc/GaudiCommonSvc/HistogramSvc.h @@ -0,0 +1,1377 @@ +// ============================================================================ +#ifndef GAUDISVC_HISTOGRAMSVC_H +#define GAUDISVC_HISTOGRAMSVC_H 1 +// ============================================================================ +// Include Files +// ============================================================================ +// GaudiKernel +// ============================================================================ +#include "GaudiKernel/DataSvc.h" +#include "GaudiKernel/GaudiException.h" +#include "GaudiKernel/HistoProperty.h" +#include "GaudiKernel/IHistogramSvc.h" +#include "GaudiKernel/IRegistry.h" +#include "GaudiKernel/System.h" +// ============================================================================ +// AIDA +// ============================================================================ +/// @FIXME: AIDA interfaces visibility +#include "AIDA/IAnnotation.h" +#include "AIDA/IHistogramFactory.h" +// ============================================================================ +// local (+PI) +// ============================================================================ +#include "HistogramUtility.h" +#include "Axis.h" +#include "TH1.h" +#include "TH2.h" +#include "TH3.h" +// ============================================================================ +namespace AIDA +{ + class ICloud1D; + class ICloud2D; + class ICloud3D; +} + +namespace detail { + template + static DataObject* cast(T* p) + { + DataObject* q = dynamic_cast( p ); + if ( !q && p ) { + throw std::runtime_error( "HistogramSvc: Unexpected object type." ); + } + return q; + } +} + +// ============================================================================ +/** @class HistogramSvc HistogramSvc.h + * + * HistogramSvc class definition + * + */ +class HistogramSvc : public extends, virtual public AIDA::IHistogramFactory +{ + +private: + + void not_implemented() const + { + error() << "Sorry, not yet implemented..." << endmsg; + } + +protected: + + typedef AIDA::IHistogram3D H3D; + typedef AIDA::IProfile2D P2D; + typedef AIDA::IBaseHistogram Base; + + struct Helper { + HistogramSvc* m_svc; + Helper( HistogramSvc* p ) : m_svc( p ) {} + template + StatusCode retrieve( A1 a1, A3*& a3 ) + { + DataObject* pObject = nullptr; + StatusCode sc = m_svc->DataSvc::retrieveObject( a1, pObject ); + a3 = dynamic_cast( pObject ); + return sc; + } + template + StatusCode retrieve( A1 a1, A2 a2, A3*& a3 ) + { + DataObject* pObject = nullptr; + StatusCode sc = m_svc->DataSvc::retrieveObject( a1, a2, pObject ); + a3 = dynamic_cast( pObject ); + return sc; + } + template + StatusCode find( A1 a1, A3*& a3 ) + { + DataObject* pObject = nullptr; + StatusCode sc = m_svc->DataSvc::findObject( a1, pObject ); + a3 = dynamic_cast( pObject ); + return sc; + } + template + StatusCode find( A1 a1, A2 a2, A3*& a3 ) + { + DataObject* pObject = nullptr; + StatusCode sc = m_svc->DataSvc::findObject( a1, a2, pObject ); + a3 = dynamic_cast( pObject ); + return sc; + } + template + static R* act( R* res, const S& b, void ( T1::*pmf )( const T2*, Double_t ), Double_t scale ) + { + auto h1 = Gaudi::getRepresentation( *res ); + const auto h2 = Gaudi::getRepresentation( b ); + if ( h1 && h2 ) { + ( h1->*pmf )( h2, scale ); + return res; + } + return nullptr; + } + template + static R* act( R* res, const S& b, Bool_t ( T1::*pmf )( const T2*, Double_t ), Double_t scale ) + { + auto h1 = Gaudi::getRepresentation( *res ); + const auto h2 = Gaudi::getRepresentation( b ); + if ( h1 && h2 ) { + ( h1->*pmf )( h2, scale ); + return res; + } + return nullptr; + } + template + static R* act( R* res, const S& b, void ( T1::*pmf )( const T2* ) ) + { + auto h1 = Gaudi::getRepresentation( *res ); + const auto h2 = Gaudi::getRepresentation( b ); + if ( h1 && h2 ) { + ( h1->*pmf )( h2 ); + return res; + } + return nullptr; + } + template + static R* act( R* res, const S& b, Bool_t ( T1::*pmf )( const T2* ) ) + { + auto h1 = Gaudi::getRepresentation( *res ); + const auto h2 = Gaudi::getRepresentation( b ); + if ( h1 && h2 ) { + ( h1->*pmf )( h2 ); + return res; + } + return nullptr; + } + }; + +public: + + using Edges = std::vector; + using DBaseEntries = std::vector; + + /** Statndard Constructor + * @param name service name + * @param pointer to service locator interface + */ + HistogramSvc( const std::string& name, ISvcLocator* svc ); + + /// Destructor + ~HistogramSvc() override; + + /** Split full path into its components + * @param full Full path of the object + * @param dir Resulting directory path + * @param obj Resulting object path + */ + std::pair i_splitPath( const std::string& full ); + + /** Connect input histogram file to the service + * @param ident [IN] Input specification + */ + StatusCode connectInput( const std::string& ident ); + + template + inline T* i_book( DataObject* pPar, const std::string& rel, const std::string& title, const std::pair& o ) + { + if ( o.first && registerObject( pPar, rel, (Base*)o.second ).isSuccess() ) return o.second; + delete o.first; + throw GaudiException( "Cannot book " + System::typeinfoName( typeid( T ) ) + " " + title, "HistogramSvc", + StatusCode::FAILURE ); + } + + /// Helper for 2D projections + AIDA::IHistogram2D* i_project( const std::string& nameAndTitle, const AIDA::IHistogram3D& h, const std::string& dir ); + +public: + + /// Initialise the service + StatusCode initialize() override; + /// Initialise the service + StatusCode reinitialize() override; + /// finalize the service + StatusCode finalize() override; + + /// Retrieve the AIDA HistogramFactory interface + AIDA::IHistogramFactory* histogramFactory() override { return this; } + + // ========================================================================== + // Book 1D histogram with fix binning + // ========================================================================== + /** Book histogram and register it with the histogram data store + @param full Full path to the node of the object. + The basename (last part of the fullpath) + has to be an integer number + otherwise conversion to HBOOK is not possible) + @param par Path to parent node of the object, + the directory the histogram will be stored in. + @param pPar Pointer to parent node + @param rel Histogram identifier (std::string), the relative path + to the object with respect to the parent node + @param hID Histogram identifier (int) of the histogram + @param title Title property of the histogram + @param nx Number of bins on the axis X/Y + @param lx Lower histogram edge on the axis X/Y + @param ux Upper histogram edge on the axis X/Y + */ + AIDA::IHistogram1D* book( const std::string& par, const std::string& rel, const std::string& title, + int nx, double lowx, double upx ) override; + + AIDA::IHistogram1D* book( const std::string& par, int hID, const std::string& title, + int nx, double lowx, double upx ) override; + + AIDA::IHistogram1D* book( DataObject* pPar, int hID, const std::string& title, + int nx, double lowx, double upx ) override; + + AIDA::IHistogram1D* book( DataObject* pPar, const std::string& rel, const std::string& title, + int nx, double lowx, double upx ) override; + + virtual AIDA::IHistogram1D* book( const std::pair& loc, const std::string& title, + int nx, double lowx, double upx ); + + AIDA::IHistogram1D* book( const std::string& full, const std::string& title, + int nx, double lowx, double upx ) override; + + // ========================================================================== + // Book 1D Profile histogram with fix binning + // ========================================================================== + /** Book histogram and register it with the histogram data store + @param full Full path to the node of the object. + The basename (last part of the fullpath) + has to be an integer number + (otherwise conversion to HBOOK is not possible) + @param par Path to parent node of the object, + the directory the histogram will be stored in. + @param pPar Pointer to parent node + @param rel Histogram identifier (std::string), the relative path + to the object with respect to the parent node + @param hID Histogram identifier (int) of the histogram + @param title Title property of the histogram + @param nx Number of bins on the axis X/Y + @param lx Lower histogram edge on the axis X/Y + @param ux Upper histogram edge on the axis X/Y + */ + AIDA::IProfile1D* bookProf( const std::string& par, const std::string& rel, const std::string& title, + int nx, double lowx, double upx, const std::string& opt ) override; + + AIDA::IProfile1D* bookProf( const std::string& par, int hID, const std::string& title, + int nx, double lowx, double upx, const std::string& opt ) override; + + AIDA::IProfile1D* bookProf( DataObject* pPar, int hID, const std::string& title, + int nx, double lowx, double upx, const std::string& opt ) override; + + virtual AIDA::IProfile1D* bookProf( const std::pair& loc, + const std::string& title, + int nx, double lowx, double upx, const std::string& opt ); + + AIDA::IProfile1D* bookProf( const std::string& full, const std::string& title, + int nx, double lowx, double upx, const std::string& opt ) override; + + AIDA::IProfile1D* bookProf( DataObject* pPar, const std::string& rel, const std::string& title, + int nx, double lowx, double upx, const std::string& opt ) override; + + AIDA::IProfile1D* bookProf( const std::string& par, const std::string& rel, const std::string& title, + int nx, double lowx, double upx, + double upper, double lower, const std::string& opt ) override; + + AIDA::IProfile1D* bookProf( const std::string& par, int hID, const std::string& title, + int nx, double lowx, double upx, + double upper, double lower, const std::string& opt ) override; + + AIDA::IProfile1D* bookProf( DataObject* pPar, int hID, const std::string& title, + int nx, double lowx, double upx, + double upper, double lower, const std::string& opt ) override; + + virtual AIDA::IProfile1D* bookProf( const std::pair& loc, + const std::string& title, + int nx, double lowx, double upx, + double upper, double lower, const std::string& opt ); + + AIDA::IProfile1D* bookProf( const std::string& full, const std::string& title, + int nx, double lowx, double upx, + double upper, double lower, const std::string& opt ) override; + + AIDA::IProfile1D* bookProf( DataObject* pPar, const std::string& rel, const std::string& title, + int nx, double lowx, double upx, + double upper, double lower, const std::string& opt ) override; + + // ========================================================================== + // Book 1D histogram with variable binning + // ========================================================================== + /** Book histogram and register it with the histogram data store + @param full Full path to the node of the object. + The basename (last part of the fullpath) + has to be an integer number + (otherwise conversion to HBOOK is not possible) + @param par Path to parent node of the object, + the directory the histogram will be stored in. + @param pPar Pointer to parent node + @param rel Histogram identifier (std::string), the relative path + to the object with respect to the parent node + @param hID Histogram identifier (int) of the histogram + @param title Title property of the histogram + @param e Bin edges for variable binned histogram. + */ + AIDA::IHistogram1D* book( const std::string& par, int hID, + const std::string& title, Edges e ) override; + + AIDA::IHistogram1D* book( DataObject* pPar, int hID, + const std::string& title, Edges e ) override; + + AIDA::IHistogram1D* book( const std::string& par, const std::string& rel, + const std::string& title, Edges e ) override; + + virtual AIDA::IHistogram1D* book( const std::pair& loc, + const std::string& title, Edges e ); + + AIDA::IHistogram1D* book( const std::string& full, + const std::string& title, Edges e ) override; + + AIDA::IHistogram1D* book( DataObject* pPar, const std::string& rel, + const std::string& title, Edges e ) override; + + // ========================================================================== + // Book 1D profile histogram with variable binning + // ========================================================================== + /** Book histogram and register it with the histogram data store + @param full Full path to the node of the object. + The basename (last part of the full) + has to be an integer number + (otherwise conversion to HBOOK is not possible) + @param par Path to parent node of the object, + the directory the histogram will be stored in. + @param pPar Pointer to parent node + @param rel Histogram identifier (std::string), the relative path + to the object with respect to the parent node + @param hID Histogram identifier (int) of the histogram + @param title Title property of the histogram + @param e Bin edges for variable binned histogram. + */ + AIDA::IProfile1D* bookProf( const std::string& full, + const std::string& title, Edges e ) override; + + AIDA::IProfile1D* bookProf( const std::string& par, const std::string& rel, + const std::string& title, Edges e ) override; + + AIDA::IProfile1D* bookProf( const std::string& par, int hID, + const std::string& title, Edges e ) override; + + AIDA::IProfile1D* bookProf( DataObject* pPar, int hID, + const std::string& title, Edges e ) override; + + virtual AIDA::IProfile1D* bookProf( const std::pair& loc, + const std::string& title, Edges e ); + + AIDA::IProfile1D* bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, Edges e ) override; + + virtual AIDA::IProfile1D* bookProf( const std::string& full, const std::string& title, + Edges e, double upper, double lower ); + + virtual AIDA::IProfile1D* bookProf( const std::string& par, const std::string& rel, + const std::string& title, Edges e, + double upper, double lower ); + + virtual AIDA::IProfile1D* bookProf( const std::string& par, int hID, + const std::string& title, Edges e, + double upper, double lower ); + + virtual AIDA::IProfile1D* bookProf( DataObject* pPar, int hID, + const std::string& title, Edges e, + double upper, double lower ); + + virtual AIDA::IProfile1D* bookProf( const std::pair& loc, + const std::string& title, Edges e, + double upper, double lower ); + + virtual AIDA::IProfile1D* bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, Edges e, + double upper, double lower ); + + // ========================================================================== + // Book 2D histogram with fixed binning + // ========================================================================== + /** Book histogram and register it with the histogram data store + @param full Full path to the node of the object. + The basename (last part of the full) + has to be an integer number + (otherwise conversion to HBOOK is not possible) + @param par Path to parent node of the object, + the directory the histogram will be stored in. + @param pPar Pointer to parent node + @param rel Histogram identifier (std::string), the relative path + to the object with respect to the parent node + @param hID Histogram identifier (int) of the histogram + @param title Title property of the histogram + @param nx Number of bins on the X-axis + @param lx Lower histogram edge on the X-axis + @param ux Upper histogram edge on the X-axis + @param ny Number of bins on the Y-axis + @param ly Lower histogram edge on the Y-axis + @param uy Upper histogram edge on the Y-axis + */ + AIDA::IHistogram2D* book( const std::string& full, const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + AIDA::IHistogram2D* book( const std::string& par, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + AIDA::IHistogram2D* book( const std::string& par, int hID, const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + virtual AIDA::IHistogram2D* book( const std::pair& loc, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ); + + AIDA::IHistogram2D* book( DataObject* pPar, int hID, const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + AIDA::IHistogram2D* book( DataObject* pPar, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + + // ========================================================================== + // Book 2D profile histogram with fixed binning + // ========================================================================== + /** Book histogram and register it with the histogram data store + @param full Full path to the node of the object. + The basename (last part of the full) + has to be an integer number + (otherwise conversion to HBOOK is not possible) + @param par Path to parent node of the object, + the directory the histogram will be stored in. + @param pPar Pointer to parent node + @param rel Histogram identifier (std::string), the relative path + to the object with respect to the parent node + @param hID Histogram identifier (int) of the histogram + @param title Title property of the histogram + @param nx Number of bins on the X-axis + @param lx Lower histogram edge on the X-axis + @param ux Upper histogram edge on the X-axis + @param ny Number of bins on the Y-axis + @param ly Lower histogram edge on the Y-axis + @param uy Upper histogram edge on the Y-axis + */ + virtual AIDA::IProfile2D* bookProf( const std::string& full, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ); + + virtual AIDA::IProfile2D* bookProf( const std::string& par, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ); + + virtual AIDA::IProfile2D* bookProf( const std::pair& loc, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ); + + virtual AIDA::IProfile2D* bookProf( const std::string& par, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ); + + virtual AIDA::IProfile2D* bookProf( DataObject* pPar, int hID, const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ); + + virtual AIDA::IProfile2D* bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ); + + AIDA::IProfile2D* bookProf( const std::string& full, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + AIDA::IProfile2D* bookProf( const std::string& par, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + virtual AIDA::IProfile2D* bookProf( const std::pair& loc, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ); + + AIDA::IProfile2D* bookProf( const std::string& par, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + AIDA::IProfile2D* bookProf( DataObject* pPar, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + AIDA::IProfile2D* bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + // ========================================================================== + // Book 2D histogram with variable binning + // ========================================================================== + /** Book histogram and register it with the histogram data store + @param full Full path to the node of the object. + The basename (last part of the full) + has to be an integer number + (otherwise conversion to HBOOK is not possible) + @param par Path to parent node of the object, + the directory the histogram will be stored in. + @param pPar Pointer to parent node + @param rel Histogram identifier (std::string), the relative path + to the object with respect to the parent node + @param hID Histogram identifier (int) of the histogram + @param title Title property of the histogram + @param x/y Bin edges for variable binned histogram in X/Y. + */ + AIDA::IHistogram2D* book( const std::string& full, + const std::string& title, + Edges x, Edges y ) override; + + AIDA::IHistogram2D* book( const std::string& par, const std::string& rel, + const std::string& title, + Edges x, Edges y ) override; + + AIDA::IHistogram2D* book( const std::string& par, int hID, + const std::string& title, + Edges x, Edges y ) override; + + virtual AIDA::IHistogram2D* book( const std::pair& loc, + const std::string& title, + Edges x, Edges y ); + + AIDA::IHistogram2D* book( DataObject* pPar, int hID, + const std::string& title, + Edges x, Edges y ) override; + + AIDA::IHistogram2D* book( DataObject* pPar, const std::string& rel, + const std::string& title, + Edges x, Edges y ) override; + + // ========================================================================== + // Book 2D profile histogram with variable binning + // ========================================================================== + /** Book histogram and register it with the histogram data store + @param full Full path to the node of the object. + The basename (last part of the full) + has to be an integer number + (otherwise conversion to HBOOK is not possible) + @param par Path to parent node of the object, + the directory the histogram will be stored in. + @param pPar Pointer to parent node + @param rel Histogram identifier (std::string), the relative path + to the object with respect to the parent node + @param hID Histogram identifier (int) of the histogram + @param title Title property of the histogram + @param x/y Bin edges for variable binned histogram in X/Y. + */ + AIDA::IProfile2D* bookProf( const std::string& full, + const std::string& title, + Edges x, Edges y ) override; + + AIDA::IProfile2D* bookProf( const std::string& par, const std::string& rel, + const std::string& title, + Edges x, Edges y ) override; + + AIDA::IProfile2D* bookProf( const std::string& par, int hID, + const std::string& title, + Edges x, Edges y ) override; + + AIDA::IProfile2D* bookProf( DataObject* pPar, int hID, + const std::string& title, + Edges x, Edges y ) override; + + virtual AIDA::IProfile2D* bookProf( const std::pair& loc, + const std::string& title, + Edges x, Edges y ); + + AIDA::IProfile2D* bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, + Edges x, Edges y ) override; + + virtual AIDA::IProfile2D* bookProf( const std::string& full, + const std::string& title, + Edges x, Edges y, + double upper, double lower ); + + virtual AIDA::IProfile2D* bookProf( const std::string& par, const std::string& rel, + const std::string& title, + Edges x, Edges y, + double upper, double lower ); + + virtual AIDA::IProfile2D* bookProf( const std::string& par, int hID, + const std::string& title, + Edges x, Edges y, + double upper, double lower ); + + virtual AIDA::IProfile2D* bookProf( DataObject* pPar, int hID, + const std::string& title, + Edges x, Edges y, + double upper, double lower ); + + virtual AIDA::IProfile2D* bookProf( const std::pair& loc, + const std::string& title, + Edges x, Edges y, + double upper, double lower ); + + virtual AIDA::IProfile2D* bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, + Edges x, Edges y, + double upper, double lower ); + + // ========================================================================== + // Book 3D histogram with fixed binning + // ========================================================================== + /** Book histogram and register it with the histogram data store + @param full Full path to the node of the object. + The basename (last part of the full) + has to be an integer number + (otherwise conversion to HBOOK is not possible) + @param par Path to parent node of the object, + the directory the histogram will be stored in. + @param pPar Pointer to parent node + @param rel Histogram identifier (std::string), the relative path + to the object with respect to the parent node + @param hID Histogram identifier (int) of the histogram + @param title Title property of the histogram + @param n{x,y,z} Number of bins on the axis X/Y/Z + @param l{x,y,z} Lower histogram edge on the axis X/Y/Z + @param u{x,y,z} Upper histogram edge on the axis X/Y/Z + */ + AIDA::IHistogram3D* book( const std::string& full, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) override; + + AIDA::IHistogram3D* book( const std::string& par, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) override; + + AIDA::IHistogram3D* book( const std::string& par, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) override; + + AIDA::IHistogram3D* book( DataObject* pPar, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) override; + + virtual AIDA::IHistogram3D* book( const std::pair& loc, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ); + + AIDA::IHistogram3D* book( DataObject* pPar, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) override; + + // ========================================================================== + // Book 3D histogram with variable binning + // ========================================================================== + /** Book histogram and register it with the histogram data store + @param full Full path to the node of the object. + The basename (last part of the full) + has to be an integer number + (otherwise conversion to HBOOK is not possible) + @param par Path to parent node of the object, + the directory the histogram will be stored in. + @param pPar Pointer to parent node + @param rel Histogram identifier (std::string), the relative path + to the object with respect to the parent node + @param hID Histogram identifier (int) of the histogram + @param title Title property of the histogram + @param binsX/Y/Z Number of bins on the axis X/Y/Z + @param lowX/Y/Z Lower histogram edge on the axis X/Y/Z + @param highX/Y/Z Upper histogram edge on the axis X/Y/Z + */ + AIDA::IHistogram3D* book( const std::string& full, + const std::string& title, + Edges x, Edges y, Edges z ) override; + + AIDA::IHistogram3D* book( const std::string& par, const std::string& rel, + const std::string& title, + Edges x, Edges y, Edges z ) override; + + AIDA::IHistogram3D* book( const std::string& par, int hID, + const std::string& title, + Edges x, Edges y, Edges z ) override; + + AIDA::IHistogram3D* book( DataObject* pPar, int hID, + const std::string& title, + Edges x, Edges y, Edges z ) override; + + virtual AIDA::IHistogram3D* book( const std::pair& loc, + const std::string& title, + Edges x, Edges y, Edges z ); + + AIDA::IHistogram3D* book( DataObject* pPar, const std::string& rel, + const std::string& title, + Edges x, Edges y, Edges z ) override; + + // ========================================================================== + // Register histogram with the data store + // ========================================================================== + StatusCode registerObject( const std::string& parent, const std::string& rel, Base* obj ) override; + + StatusCode registerObject( const std::string& parent, int item, Base* obj ) override; + + StatusCode registerObject( Base* pPar, const std::string& rel, Base* obj ) override; + + StatusCode registerObject( DataObject* pPar, int item, Base* obj ) override; + + StatusCode registerObject( Base* pPar, int item, Base* obj ) override; + + StatusCode registerObject( const std::string& full, Base* obj ) override; + + StatusCode registerObject( DataObject* pPar, const std::string& rel, Base* obj ) override; + + // ========================================================================== + // Unregister histogram from the data store + // ========================================================================== + StatusCode unregisterObject( Base* obj ) override; + + StatusCode unregisterObject( Base* obj, const std::string& objectPath ) override; + + StatusCode unregisterObject( Base* obj, int item ) override; + + // ========================================================================== + // Retrieve histogram from data store + // ========================================================================== + StatusCode retrieveObject( IRegistry* pReg, const std::string& path, + AIDA::IHistogram1D*& obj ) override; + + StatusCode retrieveObject( IRegistry* pReg, const std::string& path, + AIDA::IProfile1D*& obj ) override; + + StatusCode retrieveObject( IRegistry* pReg, const std::string& path, + AIDA::IHistogram2D*& obj ) override; + + StatusCode retrieveObject( IRegistry* pReg, const std::string& path, + AIDA::IProfile2D*& obj ) override; + + StatusCode retrieveObject( IRegistry* pReg, const std::string& path, + AIDA::IHistogram3D*& obj ) override; + + StatusCode retrieveObject( const std::string& full, + AIDA::IProfile1D*& obj ) override; + + StatusCode retrieveObject( const std::string& full, + AIDA::IProfile2D*& obj ) override; + + StatusCode retrieveObject( const std::string& full, + AIDA::IHistogram1D*& obj ) override; + + StatusCode retrieveObject( const std::string& full, + AIDA::IHistogram2D*& obj ) override; + + StatusCode retrieveObject( const std::string& full, + AIDA::IHistogram3D*& obj ) override; + + StatusCode retrieveObject( const std::string& parent, const std::string& rel, + AIDA::IProfile1D*& obj ) override; + + StatusCode retrieveObject( const std::string& parent, const std::string& rel, + AIDA::IProfile2D*& obj ) override; + + StatusCode retrieveObject( const std::string& parent, const std::string& rel, + AIDA::IHistogram1D*& obj ) override; + + StatusCode retrieveObject( const std::string& parent, const std::string& rel, + AIDA::IHistogram2D*& obj ) override; + + StatusCode retrieveObject( const std::string& parent, const std::string& rel, + AIDA::IHistogram3D*& obj ) override; + + StatusCode retrieveObject( const std::string& parent, int item, + AIDA::IProfile1D*& obj ) override; + + StatusCode retrieveObject( const std::string& parent, int item, + AIDA::IProfile2D*& obj ) override; + + StatusCode retrieveObject( const std::string& parent, int item, + AIDA::IHistogram1D*& obj ) override; + + StatusCode retrieveObject( const std::string& parent, int item, + AIDA::IHistogram2D*& obj ) override; + + StatusCode retrieveObject( const std::string& parent, int item, + AIDA::IHistogram3D*& obj ) override; + + StatusCode retrieveObject( DataObject* par, const std::string& item, + AIDA::IProfile1D*& obj ) override; + + StatusCode retrieveObject( DataObject* par, const std::string& item, + AIDA::IProfile2D*& obj ) override; + + StatusCode retrieveObject( DataObject* par, const std::string& item, + AIDA::IHistogram1D*& obj ) override; + + StatusCode retrieveObject( DataObject* par, const std::string& item, + AIDA::IHistogram2D*& obj ) override; + + StatusCode retrieveObject( DataObject* par, const std::string& item, + AIDA::IHistogram3D*& obj ) override; + + StatusCode retrieveObject( DataObject* par, int item, + AIDA::IProfile1D*& obj ) override; + + StatusCode retrieveObject( DataObject* par, int item, + AIDA::IProfile2D*& obj ) override; + + StatusCode retrieveObject( DataObject* par, int item, + AIDA::IHistogram1D*& obj ) override; + + StatusCode retrieveObject( DataObject* par, int item, + AIDA::IHistogram2D*& obj ) override; + + StatusCode retrieveObject( DataObject* par, int item, + AIDA::IHistogram3D*& obj ) override; + + StatusCode retrieveObject( Base* par, int item, + AIDA::IProfile1D*& obj ) override; + + StatusCode retrieveObject( Base* par, int item, + AIDA::IProfile2D*& obj ) override; + + StatusCode retrieveObject( Base* par, int item, + AIDA::IHistogram1D*& obj ) override; + + StatusCode retrieveObject( Base* par, int item, + AIDA::IHistogram2D*& obj ) override; + + StatusCode retrieveObject( Base* par, int item, + AIDA::IHistogram3D*& obj ) override; + + StatusCode retrieveObject( Base* par, const std::string& item, + AIDA::IProfile1D*& obj ) override; + + StatusCode retrieveObject( Base* par, const std::string& item, + AIDA::IProfile2D*& obj ) override; + + StatusCode retrieveObject( Base* par, const std::string& item, + AIDA::IHistogram1D*& obj ) override; + + StatusCode retrieveObject( Base* par, const std::string& item, + AIDA::IHistogram2D*& obj ) override; + + StatusCode retrieveObject( Base* par, const std::string& item, + AIDA::IHistogram3D*& obj ) override; + + // ========================================================================== + // Find histogram identified by its full path in the data store + // ========================================================================== + StatusCode findObject( IRegistry* pReg, const std::string& path, + AIDA::IProfile1D*& obj ) override; + + StatusCode findObject( IRegistry* pReg, const std::string& path, + AIDA::IProfile2D*& obj ) override; + + StatusCode findObject( IRegistry* pReg, const std::string& path, + AIDA::IHistogram1D*& obj ) override; + + StatusCode findObject( IRegistry* pReg, const std::string& path, + AIDA::IHistogram2D*& obj ) override; + + StatusCode findObject( IRegistry* pReg, const std::string& path, + AIDA::IHistogram3D*& obj ) override; + + StatusCode findObject( const std::string& full, + AIDA::IProfile1D*& obj ) override; + + StatusCode findObject( const std::string& full, + AIDA::IProfile2D*& obj ) override ; + + StatusCode findObject( const std::string& full, + AIDA::IHistogram1D*& obj ) override; + + StatusCode findObject( const std::string& full, + AIDA::IHistogram2D*& obj ) override; + + StatusCode findObject( const std::string& full, + AIDA::IHistogram3D*& obj ) override; + + StatusCode findObject( const std::string& par, const std::string& rel, + AIDA::IProfile1D*& obj ) override; + + StatusCode findObject( const std::string& par, const std::string& rel, + AIDA::IProfile2D*& obj ) override; + + StatusCode findObject( const std::string& par, const std::string& rel, + AIDA::IHistogram1D*& obj ) override; + + StatusCode findObject( const std::string& par, const std::string& rel, + AIDA::IHistogram2D*& obj ) override; + + StatusCode findObject( const std::string& par, const std::string& rel, + AIDA::IHistogram3D*& obj ) override; + + StatusCode findObject( const std::string& par, int item, + AIDA::IProfile1D*& obj ) override; + + StatusCode findObject( const std::string& par, int item, + AIDA::IProfile2D*& obj ) override; + + StatusCode findObject( const std::string& par, int item, + AIDA::IHistogram1D*& obj ) override; + + StatusCode findObject( const std::string& par, int item, + AIDA::IHistogram2D*& obj ) override; + + StatusCode findObject( const std::string& par, int item, + AIDA::IHistogram3D*& obj ) override; + + StatusCode findObject( DataObject* par, int item, + AIDA::IProfile1D*& obj ) override; + + StatusCode findObject( DataObject* par, int item, + AIDA::IProfile2D*& obj ) override; + + StatusCode findObject( DataObject* par, int item, + AIDA::IHistogram1D*& obj ) override; + + StatusCode findObject( DataObject* par, int item, + AIDA::IHistogram2D*& obj ) override; + + StatusCode findObject( DataObject* par, int item, + AIDA::IHistogram3D*& obj ) override; + + StatusCode findObject( DataObject* par, const std::string& item, + AIDA::IProfile1D*& obj ) override; + + StatusCode findObject( DataObject* par, const std::string& item, + AIDA::IProfile2D*& obj ) override; + + StatusCode findObject( DataObject* par, const std::string& item, + AIDA::IHistogram1D*& obj ) override; + + StatusCode findObject( DataObject* par, const std::string& item, + AIDA::IHistogram2D*& obj ) override; + + StatusCode findObject( DataObject* par, const std::string& item, + AIDA::IHistogram3D*& obj ) override; + + StatusCode findObject( Base* par, int item, + AIDA::IProfile1D*& obj ) override; + + StatusCode findObject( Base* par, int item, + AIDA::IProfile2D*& obj ) override; + + StatusCode findObject( Base* par, int item, + AIDA::IHistogram1D*& obj ) override; + + StatusCode findObject( Base* par, int item, + AIDA::IHistogram2D*& obj ) override; + + StatusCode findObject( Base* par, int item, + AIDA::IHistogram3D*& obj ) override; + + StatusCode findObject( Base* par, const std::string& item, + AIDA::IProfile1D*& obj ) override; + + StatusCode findObject( Base* par, const std::string& item, + AIDA::IProfile2D*& obj ) override; + + StatusCode findObject( Base* par, const std::string& item, + AIDA::IHistogram1D*& obj ) override; + + StatusCode findObject( Base* par, const std::string& item, + AIDA::IHistogram2D*& obj ) override; + + StatusCode findObject( Base* par, const std::string& item, + AIDA::IHistogram3D*& obj ) override; + + // ========================================================================== + // Projections and slices. + // ========================================================================== + AIDA::IHistogram1D* projectionX( const std::string& name, + const AIDA::IHistogram2D& h ) override; + + AIDA::IHistogram1D* projectionY( const std::string& name, + const AIDA::IHistogram2D& h ) override; + + AIDA::IHistogram1D* sliceX( const std::string& name, const AIDA::IHistogram2D& h, + int indexY ) override ; + + AIDA::IHistogram1D* sliceY( const std::string& name, const AIDA::IHistogram2D& h, + int indexX ) override ; + + AIDA::IHistogram1D* sliceX( const std::string& name, const AIDA::IHistogram2D& h, + int indexY1, int indexY2 ) override; + + AIDA::IHistogram1D* sliceY( const std::string& name, const AIDA::IHistogram2D& h, + int indexX1, int indexX2 ) override; + + bool destroy( IBaseHistogram* hist ) override; + + AIDA::IHistogram1D* add( const std::string& nameAndTitle, const AIDA::IHistogram1D& a, + const AIDA::IHistogram1D& b ) override; + + AIDA::IHistogram1D* subtract( const std::string& nameAndTitle, const AIDA::IHistogram1D& a, + const AIDA::IHistogram1D& b ) override; + + AIDA::IHistogram1D* multiply( const std::string& nameAndTitle, const AIDA::IHistogram1D& a, + const AIDA::IHistogram1D& b ) override; + + AIDA::IHistogram1D* divide( const std::string& nameAndTitle, const AIDA::IHistogram1D& a, + const AIDA::IHistogram1D& b ) override; + + AIDA::IHistogram2D* add( const std::string& nameAndTitle, const AIDA::IHistogram2D& a, + const AIDA::IHistogram2D& b ) override; + + AIDA::IHistogram2D* subtract( const std::string& nameAndTitle, const AIDA::IHistogram2D& a, + const AIDA::IHistogram2D& b ) override; + + AIDA::IHistogram2D* multiply( const std::string& nameAndTitle, const AIDA::IHistogram2D& a, + const AIDA::IHistogram2D& b ) override; + + AIDA::IHistogram2D* divide( const std::string& nameAndTitle, const AIDA::IHistogram2D& a, + const AIDA::IHistogram2D& b ) override; + + AIDA::IHistogram3D* add( const std::string& nameAndTitle, const AIDA::IHistogram3D& a, + const AIDA::IHistogram3D& b ) override; + + AIDA::IHistogram3D* subtract( const std::string& nameAndTitle, const AIDA::IHistogram3D& a, + const AIDA::IHistogram3D& b ) override; + + AIDA::IHistogram3D* multiply( const std::string& nameAndTitle, const AIDA::IHistogram3D& a, + const AIDA::IHistogram3D& b ) override; + + AIDA::IHistogram3D* divide( const std::string& nameAndTitle, const AIDA::IHistogram3D& a, + const AIDA::IHistogram3D& b ) override; + + AIDA::IHistogram2D* projectionXY( const std::string& nameAndTitle, + const AIDA::IHistogram3D& h ) override ; + + AIDA::IHistogram2D* projectionXZ( const std::string& nameAndTitle, + const AIDA::IHistogram3D& h ) override ; + + AIDA::IHistogram2D* projectionYZ( const std::string& nameAndTitle, + const AIDA::IHistogram3D& h ) override ; + + + AIDA::IHistogram2D* sliceXY( const std::string& /* nameAndTitle */, + const AIDA::IHistogram3D& /* h */, + int /* low */, int /* high */ ) override + { + not_implemented(); + return nullptr; + } + + AIDA::IHistogram2D* sliceXZ( const std::string& /* nameAndTitle */, + const AIDA::IHistogram3D& /* h */, + int /* low */, int /* high */ ) override + { + not_implemented(); + return nullptr; + } + + AIDA::IHistogram2D* sliceYZ( const std::string& /* nameAndTitle */, + const AIDA::IHistogram3D& /* h */, + int /* low */, int /* high */ ) override + { + not_implemented(); + return nullptr; + } + + AIDA::IHistogram1D* createHistogram1D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx ); + + AIDA::IHistogram1D* createHistogram1D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + const std::string& /*opt*/ ) override; + + AIDA::IHistogram1D* createHistogram1D( const std::string& name, const std::string& title, + const Edges& x, + const std::string& /*opt*/ ) override; + + AIDA::IHistogram1D* createHistogram1D( const std::string& nameAndTitle, + int nx, double lowx, double upx ) override; + + AIDA::IHistogram1D* createCopy( const std::string& full, + const AIDA::IHistogram1D& h ) override; + + AIDA::IHistogram1D* createCopy( const std::string& par, const std::string& rel, + const AIDA::IHistogram1D& h ); + + AIDA::IHistogram1D* createCopy( const std::pair& loc, + const AIDA::IHistogram1D& h ); + + AIDA::IHistogram1D* createCopy( DataObject* pPar, const std::string& rel, + const AIDA::IHistogram1D& h ); + + AIDA::IHistogram2D* createHistogram2D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy ); + + AIDA::IHistogram2D* createHistogram2D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + const std::string& /*opt*/ ) override; + + AIDA::IHistogram2D* createHistogram2D( const std::string& name, const std::string& title, + const Edges& x, const Edges& y, + const std::string& /*opt*/ ) override; + + AIDA::IHistogram2D* createHistogram2D( const std::string& nameAndTitle, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + AIDA::IHistogram2D* createCopy( const std::string& full, + const AIDA::IHistogram2D& h ) override; + + AIDA::IHistogram2D* createCopy( const std::string& par, const std::string& rel, + const AIDA::IHistogram2D& h ); + + AIDA::IHistogram2D* createCopy( const std::pair& loc, + const AIDA::IHistogram2D& h ); + + AIDA::IHistogram2D* createCopy( DataObject* pPar, const std::string& rel, + const AIDA::IHistogram2D& h ); + + AIDA::IHistogram3D* createHistogram3D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ); + + AIDA::IHistogram3D* createHistogram3D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz, + const std::string& /*opt*/ ) override; + + AIDA::IHistogram3D* createHistogram3D( const std::string& name, const std::string& title, + const Edges& x, const Edges& y, const Edges& z, + const std::string& /*opt*/ ) override; + + AIDA::IHistogram3D* createHistogram3D( const std::string& nameAndTitle, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) override; + + AIDA::IHistogram3D* createCopy( const std::string& full, + const AIDA::IHistogram3D& h ) override; + + AIDA::IHistogram3D* createCopy( const std::string& par, const std::string& rel, + const AIDA::IHistogram3D& h ); + + AIDA::IHistogram3D* createCopy( const std::pair& loc, + const AIDA::IHistogram3D& h ); + + AIDA::IHistogram3D* createCopy( DataObject* pPar, const std::string& rel, + const AIDA::IHistogram3D& h ); + + + AIDA::IProfile1D* createProfile1D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + const std::string& opt ) override; + + AIDA::IProfile1D* createProfile1D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + double upper, double lower, + const std::string& opt ) override; + + AIDA::IProfile1D* createProfile1D( const std::string& name, + const std::string& title, const Edges& x, + const std::string& /* opt */ ) override; + + AIDA::IProfile1D* createProfile1D( const std::string& name, + const std::string& title, const Edges& x, + double upper, double lower, + const std::string& /* opt */ ) override; + + AIDA::IProfile1D* createProfile1D( const std::string& nametit, + int nx, double lowx, double upx ) override; + + AIDA::IProfile1D* createProfile1D( const std::string& nametit, + int nx, double lowx, double upx, + double upper, double lower ) override; + + AIDA::IProfile1D* createCopy( const std::string& full, + const AIDA::IProfile1D& h ) override; + + AIDA::IProfile1D* createCopy( const std::string& par, const std::string& rel, + const AIDA::IProfile1D& h ); + + AIDA::IProfile1D* createCopy( const std::pair& loc, + const AIDA::IProfile1D& h ); + + AIDA::IProfile1D* createCopy( DataObject* pPar, const std::string& rel, + const AIDA::IProfile1D& h ); + + AIDA::IProfile2D* createProfile2D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy ); + + AIDA::IProfile2D* createProfile2D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + const std::string& /*opt*/ ) override; + + AIDA::IProfile2D* createProfile2D( const std::string& name, + const std::string& title, + const Edges& x, const Edges& y, + const std::string& /*opt*/ ) override; + + AIDA::IProfile2D* createProfile2D( const std::string& nameAndTitle, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) override; + + AIDA::IProfile2D* createProfile2D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ); + + AIDA::IProfile2D* createProfile2D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower, const std::string& /*opt*/ ) override; + + AIDA::IProfile2D* createProfile2D( const std::string& name, + const std::string& title, + const Edges& x, const Edges& y, + double upper, double lower, + const std::string& /*opt*/ ) override; + + AIDA::IProfile2D* createProfile2D( const std::string& nameAndTitle, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ) override; + + AIDA::IProfile2D* createCopy( const std::string& full, + const AIDA::IProfile2D& h ) override; + + AIDA::IProfile2D* createCopy( const std::string& par, const std::string& rel, + const AIDA::IProfile2D& h ); + + AIDA::IProfile2D* createCopy( const std::pair& loc, + const AIDA::IProfile2D& h ); + + AIDA::IProfile2D* createCopy( DataObject* pPar, const std::string& rel, + const AIDA::IProfile2D& h ); + + AIDA::ICloud1D* createCloud1D( const std::string&, const std::string&, + int, const std::string& ) override + { + not_implemented(); + return nullptr; + } + + AIDA::ICloud1D* createCloud1D(const std::string&) override + { + not_implemented(); + return nullptr; + } + + AIDA::ICloud1D* createCopy(const std::string&, const AIDA::ICloud1D&) override + { + not_implemented(); + return nullptr; + } + + AIDA::ICloud2D* createCloud2D( const std::string&, const std::string&, + int, const std::string& ) override + { + not_implemented(); + return nullptr; + } + + AIDA::ICloud2D* createCloud2D(const std::string&) override + { + not_implemented(); + return nullptr; + } + + AIDA::ICloud2D* createCopy(const std::string&, const AIDA::ICloud2D&) override + { + not_implemented(); + return nullptr; + } + + AIDA::ICloud3D* createCloud3D(const std::string&, const std::string&, int, const std::string&) override + { + not_implemented(); + return nullptr; + } + + AIDA::ICloud3D* createCloud3D( const std::string& ) override + { + not_implemented(); + return nullptr; + } + + AIDA::ICloud3D* createCopy( const std::string&, const AIDA::ICloud3D& ) override + { + not_implemented(); + return nullptr; + } + + /// Avoids a compiler warning about hidden functions. + using IDataProviderSvc::registerObject; + using IDataProviderSvc::unregisterObject; + using IDataProviderSvc::retrieveObject; + using IDataProviderSvc::findObject; + + /// Print (ASCII) the 1D histogram into the output stream + std::ostream& print( Base* h, std::ostream& s = std::cout ) const override; + + /// Write (ASCII) the 1D histogram table into the output stream + std::ostream& write( Base* h, std::ostream& s = std::cout ) const override; + + /// Write (ASCII) the 1D histogram table into a file + int write( Base* h, const char* file_name ) const override; + + /// Create all directories in a given full path + DataObject* createPath( const std::string& newPath ) override; + + /** Create a sub-directory in a directory. + * @param parentDir name of the parent directory + * @param subDir to identify the histogram object in the store + */ + DataObject* createDirectory( const std::string& parentDir, const std::string& subDir ) override; + + /// handler to be invoked for updating property m_defs1D + void update1Ddefs( Gaudi::Details::PropertyBase& ); + + typedef std::map Histo1DMap; + +private: + + Gaudi::Property m_input{this, "Input", {}, "input streams"}; + Gaudi::Property m_defs1D{this, "Predefined1DHistos", {}, "histograms with predefined parameters"}; + + // modified histograms: + std::set m_mods1D; + +}; +#endif // GAUDISVC_HISTOGRAMSVC_H diff --git a/GaudiCommonSvc/GaudiCommonSvc/HistogramUtility.h b/GaudiCommonSvc/GaudiCommonSvc/HistogramUtility.h new file mode 100644 index 0000000000000000000000000000000000000000..03cdabda727478a228053ed4f7a78edc848c401c --- /dev/null +++ b/GaudiCommonSvc/GaudiCommonSvc/HistogramUtility.h @@ -0,0 +1,13 @@ +#ifndef GAUDICOMMONSVC_HISTOGRAMUTILITY_H +#define GAUDICOMMONSVC_HISTOGRAMUTILITY_H 1 + +#include "GaudiKernel/HistogramBase.h" + +namespace Gaudi { + template T* getRepresentation(const Q& hist) { + auto p = dynamic_cast(&hist); + return p ? dynamic_cast(p->representation()) : nullptr; + } +} + +#endif diff --git a/GaudiCommonSvc/src/HistogramSvc/P1D.h b/GaudiCommonSvc/GaudiCommonSvc/P1D.h similarity index 89% rename from GaudiCommonSvc/src/HistogramSvc/P1D.h rename to GaudiCommonSvc/GaudiCommonSvc/P1D.h index 30439d45b0516299465ab6eddeba89786a36d749..b2f0b020321271ef1b6af94f2bda5b044cafff15 100644 --- a/GaudiCommonSvc/src/HistogramSvc/P1D.h +++ b/GaudiCommonSvc/GaudiCommonSvc/P1D.h @@ -1,10 +1,10 @@ #ifndef GAUDISVC_P1D_H #define GAUDISVC_P1D_H -#include "GaudiKernel/DataObject.h" -#include "GaudiPI.h" +#include +#include +#include #include "Generic1D.h" -#include "TProfile.h" /* * Gaudi namespace @@ -26,8 +26,7 @@ namespace Gaudi { Profile1D(); /// Standard constructor with initialization. The histogram representation will be adopted Profile1D(TProfile* rep); - /// Destructor. - ~Profile1D() override = default; + /// Fill the Profile1D with a value and the corresponding weight. bool fill(double x, double y, double weight = 1.) override; virtual bool setBinContents(int i, int entries,double height,double error, double spread, double centre); diff --git a/GaudiCommonSvc/GaudiCommonSvc/P2D.h b/GaudiCommonSvc/GaudiCommonSvc/P2D.h new file mode 100644 index 0000000000000000000000000000000000000000..038bc252f182fac5dbf65391676c755f7baf20d1 --- /dev/null +++ b/GaudiCommonSvc/GaudiCommonSvc/P2D.h @@ -0,0 +1,41 @@ +#ifndef GAUDICOMMONSVC_P2D_H +#define GAUDICOMMONSVC_P2D_H + +#include +#include +#include +#include "Generic2D.h" + +namespace Gaudi { + + /**@class Profile2D + * + * AIDA implementation for 2 D profiles using ROOT TProfile2D + * + * @author M.Frank + */ + class GAUDI_API Profile2D : public DataObject, public Generic2D { + public: + /// Default Constructor + Profile2D() : Base( new TProfile2D() ) + { + m_classType = "IProfile2D"; + m_rep->SetErrorOption("s"); + m_rep->SetDirectory(nullptr); + } + /// Default Constructor with representation object + Profile2D(TProfile2D* rep); + + /// Fill bin content + bool fill(double x,double y,double z,double weight) override { + m_rep->Fill(x,y,z,weight); + return true; + } + /// Retrieve reference to class defininition identifier + const CLID& clID() const override { return classID(); } + static const CLID& classID() { return CLID_ProfileH2; } + }; + +} + +#endif diff --git a/GaudiCommonSvc/src/HistogramSvc/AIDA_visibility_hack.cpp b/GaudiCommonSvc/src/HistogramSvc/AIDA_visibility_hack.cpp index 9c2b358a0a052500bc398eddca9fb6f4736a7b73..0bac09154863128184d550cf430cc8831d71f0a8 100644 --- a/GaudiCommonSvc/src/HistogramSvc/AIDA_visibility_hack.cpp +++ b/GaudiCommonSvc/src/HistogramSvc/AIDA_visibility_hack.cpp @@ -12,8 +12,31 @@ #pragma clang diagnostic ignored "-Wunused-variable" #endif -/// @FIXME: AIDA interfaces visibility -#include "AIDA_visibility_hack.h" +// For the GAUDI_API macro +#include "GaudiKernel/Kernel.h" + +// To avoid breaking STL +#include +#include + +// Force visibility of the classes +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define class class GAUDI_API +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#undef class #include diff --git a/GaudiCommonSvc/src/HistogramSvc/AIDA_visibility_hack.h b/GaudiCommonSvc/src/HistogramSvc/AIDA_visibility_hack.h deleted file mode 100644 index ba22db0270bb581dc7fa3c1edcea863fa54e7007..0000000000000000000000000000000000000000 --- a/GaudiCommonSvc/src/HistogramSvc/AIDA_visibility_hack.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * AIDA_visibility_hack.h - * - * Created on: Jan 27, 2009 - * Author: Marco Clemencic - */ - -#ifndef AIDA_VISIBILITY_HACK_H_ -#define AIDA_VISIBILITY_HACK_H_ -/// @FIXME: AIDA interfaces visibility - -// For the GAUDI_API macro -#include "GaudiKernel/Kernel.h" - -// To avoid breaking STL -#include -#include - -// Force visibility of the classes -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wkeyword-macro" -#endif -#define class class GAUDI_API -#ifdef __clang__ -#pragma clang diagnostic pop -#endif -#include "AIDA/IBaseHistogram.h" -#include "AIDA/IHistogram1D.h" -#include "AIDA/IHistogram2D.h" -#include "AIDA/IHistogram3D.h" -#include "AIDA/IProfile1D.h" -#include "AIDA/IProfile2D.h" -#include "AIDA/IAnnotation.h" -#include "AIDA/IAxis.h" -#undef class - - -#endif /* AIDA_VISIBILITY_HACK_H_ */ diff --git a/GaudiCommonSvc/src/HistogramSvc/Factory.cpp b/GaudiCommonSvc/src/HistogramSvc/Factory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a6645508bd13e07409d705074720e545c28186ec --- /dev/null +++ b/GaudiCommonSvc/src/HistogramSvc/Factory.cpp @@ -0,0 +1,24 @@ +#include + +#include +#include +#include +#include +#include +#include + +namespace { + typedef Gaudi::Histogram1D H1D; + typedef Gaudi::Profile1D P1D; + typedef Gaudi::Histogram2D H2D; + typedef Gaudi::Profile2D P2D; + typedef Gaudi::Histogram3D H3D; +} + +DECLARE_COMPONENT( HistogramSvc ) + +DECLARE_DATAOBJECT_FACTORY(H1D) +DECLARE_DATAOBJECT_FACTORY(P1D) +DECLARE_DATAOBJECT_FACTORY(H2D) +DECLARE_DATAOBJECT_FACTORY(P2D) +DECLARE_DATAOBJECT_FACTORY(H3D) diff --git a/GaudiCommonSvc/src/HistogramSvc/GaudiPI.h b/GaudiCommonSvc/src/HistogramSvc/GaudiPI.h index aa579ce7d20dfe5e3cc2e188319b1651247a1323..e0efc0d0149282dd2fc795f14652469f143b6e4d 100644 --- a/GaudiCommonSvc/src/HistogramSvc/GaudiPI.h +++ b/GaudiCommonSvc/src/HistogramSvc/GaudiPI.h @@ -1,16 +1,14 @@ #ifndef GAUDISVC_GAUDIPI_H #define GAUDISVC_GAUDIPI_H -/// @FIXME: AIDA interfaces visibility -#include "AIDA_visibility_hack.h" #include #include -#include "AIDA/IHistogram1D.h" -#include "AIDA/IHistogram2D.h" -#include "AIDA/IHistogram3D.h" -#include "AIDA/IProfile1D.h" -#include "AIDA/IProfile2D.h" -#include "GaudiKernel/HistogramBase.h" +#include +#include +#include +#include +#include +#include class DataObject; class TH2D; @@ -18,14 +16,6 @@ class TH2D; namespace Gaudi { typedef std::vector Edges; - template T* getRepresentation(const Q& hist) { - T* result = nullptr; - const HistogramBase *p = dynamic_cast(&hist); - if ( p ) { - result = dynamic_cast(p->representation()); - } - return result; - } /// Copy constructor std::pair createH1D(const AIDA::IHistogram1D& hist); /// Creator for 1D histogram with fixed bins diff --git a/GaudiCommonSvc/src/HistogramSvc/H1D.cpp b/GaudiCommonSvc/src/HistogramSvc/H1D.cpp index 8ab3d4196078a44a1e6a04998072374c76c4355d..abf12ad499ef6c002cfd23756d6278fa6ddb8909 100644 --- a/GaudiCommonSvc/src/HistogramSvc/H1D.cpp +++ b/GaudiCommonSvc/src/HistogramSvc/H1D.cpp @@ -9,10 +9,11 @@ // coming from TString.h #pragma warning(disable:4996) #endif -#include "H1D.h" +#include +#include +#include +#include #include "GaudiPI.h" -#include "GaudiKernel/StreamBuffer.h" -#include "GaudiKernel/ObjectFactory.h" std::pair Gaudi::createH1D(const std::string& title,int nBins,double xlow, double xup) { auto p = new Histogram1D(new TH1D(title.c_str(),title.c_str(),nBins,xlow,xup)); @@ -54,7 +55,7 @@ namespace Gaudi { } } -Gaudi::Histogram1D::Histogram1D() +Gaudi::Histogram1D::Histogram1D() : Base( new TH1D() ) { init("",false); @@ -285,6 +286,3 @@ StreamBuffer& Gaudi::Histogram1D::serialize(StreamBuffer& s) const { s << stats[0] << stats[1] << stats[2] << stats[3]; return s; } - -typedef Gaudi::Histogram1D H1D; -DECLARE_DATAOBJECT_FACTORY(H1D) diff --git a/GaudiCommonSvc/src/HistogramSvc/H2D.cpp b/GaudiCommonSvc/src/HistogramSvc/H2D.cpp index 6d23bc6553af28b515cf1ccd60a61af47bc4a251..c67eb352b01e9e57c58f67da5723677755a603a3 100644 --- a/GaudiCommonSvc/src/HistogramSvc/H2D.cpp +++ b/GaudiCommonSvc/src/HistogramSvc/H2D.cpp @@ -10,12 +10,20 @@ #pragma warning(disable:4996) #endif #include -#include "H2D.h" -#include "H1D.h" -#include "P1D.h" -#include "TH1D.h" -#include "TProfile.h" -#include "GaudiKernel/ObjectFactory.h" +#include +#include +#include +#include +#include +#include +#include +#include "GaudiPI.h" + +namespace { + using AIDA::IProfile1D; + using AIDA::IHistogram1D; + using AIDA::IHistogram2D; +} std::pair Gaudi::createH2D(const std::string & title,int binsX,double iminX,double imaxX,int binsY,double iminY,double imaxY) { auto p = new Histogram2D(new TH2D(title.c_str(),title.c_str(),binsX, iminX, imaxX, binsY, iminY, imaxY)); @@ -114,7 +122,7 @@ namespace Gaudi { } } -Gaudi::Histogram2D::Histogram2D() +Gaudi::Histogram2D::Histogram2D() : Base( new TH2D() ) { m_rep->Sumw2(); @@ -123,7 +131,7 @@ Gaudi::Histogram2D::Histogram2D() m_rep->SetDirectory(nullptr); } -Gaudi::Histogram2D::Histogram2D(TH2D* rep) +Gaudi::Histogram2D::Histogram2D(TH2D* rep) { adoptRepresentation(rep); m_sumwx = m_sumwy = 0; @@ -238,9 +246,6 @@ void Gaudi::Histogram2D::copyFromAida(const IHistogram2D& h) { m_rep->PutStats(stat.data()); } -typedef Gaudi::Histogram2D H2D; -DECLARE_DATAOBJECT_FACTORY(H2D) - #ifdef __ICC // re-enable icc remark #1572 #pragma warning(pop) diff --git a/GaudiCommonSvc/src/HistogramSvc/H3D.cpp b/GaudiCommonSvc/src/HistogramSvc/H3D.cpp index 1ac1ba1bc7a96ca118cc15bc1ba90fe9f2568377..da5eb544848df76596ebff303276c7952be98510 100644 --- a/GaudiCommonSvc/src/HistogramSvc/H3D.cpp +++ b/GaudiCommonSvc/src/HistogramSvc/H3D.cpp @@ -10,52 +10,15 @@ #pragma warning(disable:4996) #endif -#include "GaudiKernel/DataObject.h" -#include "GaudiKernel/ObjectFactory.h" +#include +#include +#include +#include +#include + #include "GaudiPI.h" -#include "Generic3D.h" #include "TH3D.h" -namespace Gaudi { - - /**@class Histogram3D - * - * AIDA implementation for 2 D histograms using ROOT THD2 - * - * @author M.Frank - */ - class GAUDI_API Histogram3D : public DataObject, public Generic3D { - public: - /// Standard Constructor - Histogram3D(); - /// Standard Constructor - Histogram3D(TH3D* rep); - /// Destructor. - ~Histogram3D() override = default; - /// Fill bin content - bool fill ( double x, double y, double z, double weight) override; - /// Fast filling method for a given bin. It can be also the over/underflow bin - virtual bool setBinContents( int i, int j, int k, int entries,double height,double error,double centreX, double centreY, double centreZ ); - /// Sets the rms of the histogram. - virtual bool setRms(double rmsX, double rmsY, double rmsZ); - // overwrite reset - bool reset() override; - /// Introspection method - void* cast(const std::string & className) const override; - /// Create new histogram from any AIDA based histogram - void copyFromAida(const AIDA::IHistogram3D & h); - /// Retrieve reference to class defininition identifier - const CLID& clID() const override { return classID(); } - static const CLID& classID() { return CLID_H3D; } - - protected: - // cache sumwx and sumwy when setting contents since I don't have bin mean - double m_sumwx = 0; - double m_sumwy = 0; - double m_sumwz = 0; - }; -} - namespace Gaudi { template <> void Generic3D::adoptRepresentation(TObject* rep) { @@ -91,7 +54,7 @@ std::pair Gaudi::createH3D(const AIDA::IHistogr return {n,n}; } -Gaudi::Histogram3D::Histogram3D() +Gaudi::Histogram3D::Histogram3D() : Base( new TH3D() ) { setTitle(""); @@ -270,6 +233,3 @@ void Gaudi::Histogram3D::copyFromAida(const AIDA::IHistogram3D & h) { // re-enable icc remark #1572 #pragma warning(pop) #endif - -typedef Gaudi::Histogram3D H3D; -DECLARE_DATAOBJECT_FACTORY(H3D) diff --git a/GaudiCommonSvc/src/HistogramSvc/HistogramSvc.cpp b/GaudiCommonSvc/src/HistogramSvc/HistogramSvc.cpp index 218f28817b8c2178ea5ce8e55e964c42c2ebc1c7..ae11f13d31ba2ba04981ac7b3c0f6ae7805009e7 100644 --- a/GaudiCommonSvc/src/HistogramSvc/HistogramSvc.cpp +++ b/GaudiCommonSvc/src/HistogramSvc/HistogramSvc.cpp @@ -9,44 +9,37 @@ // coming from TString.h #pragma warning( disable : 4996 ) #endif -// ============================================================================ -// Include files -// ============================================================================ -// STD&STL -// ============================================================================ + +// STD & STL #include #include #include -// ============================================================================ + // GaudiKernel -// ============================================================================ #include "GaudiKernel/AttribStringParser.h" #include "GaudiKernel/DataObject.h" #include "GaudiKernel/GenericAddress.h" #include "GaudiKernel/IConversionSvc.h" #include "GaudiKernel/Property.h" -// ============================================================================ + // Local -// ============================================================================ -#include "HistogramSvc.h" -// ============================================================================ -// Instantiation of a factory class used by clients -DECLARE_COMPONENT( HistogramSvc ) -// ============================================================================ -using namespace AIDA; -// ============================================================================ +#include +#include "GaudiPI.h" + namespace { - // ========================================================================== - inline std::string histoAddr( const std::string& name ) + using namespace AIDA; + using std::string; + + inline string histoAddr( const string& name ) { if ( 0 == name.find( "/stat/" ) ) { - return std::string( name, 6 ); + return string( name, 6 ); } return name; } - // ========================================================================== - inline std::string histoAddr( const DataObject* obj, const std::string& rel ) + + inline string histoAddr( const DataObject* obj, const string& rel ) { if ( !obj ) { return rel; @@ -55,7 +48,7 @@ namespace if ( !reg ) { return rel; } - const std::string& name = reg->identifier(); + const string& name = reg->identifier(); // if ( rel.empty() ) { return histoAddr( name ); @@ -65,16 +58,31 @@ namespace } return histoAddr( name + "/" + rel ); } - // ========================================================================== + + inline size_t removeLeading( HistogramSvc::Histo1DMap& m, const string& lead = "/stat/" ) + { + for ( auto it = m.begin(); m.end() != it; ++it ) { + if ( 0 == it->first.find( lead ) ) { + string addr = string( it->first, lead.size() ); + Gaudi::Histo1DDef hdef = it->second; + m.erase( it ); // remove + m[addr] = hdef; // insert + return 1 + removeLeading( m, lead ); // return + } + } + return 0; + } } + //------------------------------------------------------------------------------ -StatusCode HistogramSvc::registerObject( CSTR full, IBaseHistogram* obj ) +StatusCode HistogramSvc::registerObject( const string& full, IBaseHistogram* obj ) { - std::pair split = i_splitPath( full ); + std::pair split = i_splitPath( full ); return registerObject( split.first, split.second, obj ); } + //------------------------------------------------------------------------------ -StatusCode HistogramSvc::registerObject( DataObject* pPar, CSTR obj, IBaseHistogram* hObj ) +StatusCode HistogramSvc::registerObject( DataObject* pPar, const string& obj, IBaseHistogram* hObj ) { // Set the histogram id if ( obj[0] == SEPARATOR ) { @@ -85,17 +93,17 @@ StatusCode HistogramSvc::registerObject( DataObject* pPar, CSTR obj, IBaseHistog if ( !hObj->annotation().addItem( "id", obj ) ) hObj->annotation().setValue( "id", obj ); } // Register the histogram in the histogram data store - return DataSvc::registerObject( pPar, obj, __cast( hObj ) ); + return DataSvc::registerObject( pPar, obj, detail::cast( hObj ) ); } // Helper for 2D projections -AIDA::IHistogram2D* HistogramSvc::i_project( CSTR nameAndTitle, const IHistogram3D& h, CSTR dir ) +AIDA::IHistogram2D* HistogramSvc::i_project( const string& nameAndTitle, const IHistogram3D& h, const string& dir ) { TH3D* h3d = Gaudi::getRepresentation( h ); if ( h3d ) { TH2D* h2d = dynamic_cast( h3d->Project3D( dir.c_str() ) ); if ( h2d ) { - std::pair r = Gaudi::createH2D( h2d ); + std::pair r = Gaudi::createH2D( h2d ); if ( r.second && registerObject( nameAndTitle, r.second ).isSuccess() ) { return r.second; } @@ -114,6 +122,7 @@ std::ostream& HistogramSvc::print( IBaseHistogram* h, std::ostream& s ) const error() << "Unknown histogram type: Cannot cast to Gaudi::HistogramBase." << endmsg; return s; } + //------------------------------------------------------------------------------ std::ostream& HistogramSvc::write( IBaseHistogram* h, std::ostream& s ) const { @@ -122,6 +131,7 @@ std::ostream& HistogramSvc::write( IBaseHistogram* h, std::ostream& s ) const error() << "Unknown histogram type: Cannot cast to Gaudi::HistogramBase." << endmsg; return s; } + //------------------------------------------------------------------------------ int HistogramSvc::write( IBaseHistogram* h, const char* file_name ) const { @@ -130,10 +140,11 @@ int HistogramSvc::write( IBaseHistogram* h, const char* file_name ) const error() << "Unknown histogram type: Cannot cast to Gaudi::HistogramBase." << endmsg; return 0; } + //------------------------------------------------------------------------------ -std::pair HistogramSvc::i_splitPath( CSTR full ) +std::pair HistogramSvc::i_splitPath( const string& full ) { - std::string tmp = full; + string tmp = full; if ( tmp[0] != SEPARATOR ) { tmp.insert( tmp.begin(), SEPARATOR ); tmp.insert( tmp.begin(), m_rootName.begin(), m_rootName.end() ); @@ -145,10 +156,11 @@ std::pair HistogramSvc::i_splitPath( CSTR full ) int sep = tmp.rfind( SEPARATOR ); return {tmp.substr( 0, sep ), tmp.substr( sep )}; } + //------------------------------------------------------------------------------ -DataObject* HistogramSvc::createPath( CSTR newPath ) +DataObject* HistogramSvc::createPath( const string& newPath ) { - std::string tmpPath = newPath; + string tmpPath = newPath; if ( tmpPath[0] != SEPARATOR ) { tmpPath.insert( tmpPath.begin(), SEPARATOR ); tmpPath.insert( tmpPath.begin(), m_rootName.begin(), m_rootName.end() ); @@ -163,8 +175,8 @@ DataObject* HistogramSvc::createPath( CSTR newPath ) return pObject; } int sep = tmpPath.rfind( SEPARATOR ); - std::string rest( tmpPath, sep + 1, tmpPath.length() - sep ); - std::string subPath( tmpPath, 0, sep ); + string rest( tmpPath, sep + 1, tmpPath.length() - sep ); + string subPath( tmpPath, 0, sep ); if ( 0 != sep ) { createPath( subPath ); } else { @@ -174,8 +186,9 @@ DataObject* HistogramSvc::createPath( CSTR newPath ) pObject = createDirectory( subPath, rest ); return pObject; } + //------------------------------------------------------------------------------ -DataObject* HistogramSvc::createDirectory( CSTR parentDir, CSTR subDir ) +DataObject* HistogramSvc::createDirectory( const string& parentDir, const string& subDir ) { std::unique_ptr directory{new DataObject()}; if ( directory ) { @@ -194,22 +207,24 @@ DataObject* HistogramSvc::createDirectory( CSTR parentDir, CSTR subDir ) } return directory.release(); } + //------------------------------------------------------------------------------ HistogramSvc::~HistogramSvc() { setDataLoader( nullptr ).ignore(); clearStore().ignore(); } + //------------------------------------------------------------------------------ -StatusCode HistogramSvc::connectInput( CSTR ident ) +StatusCode HistogramSvc::connectInput( const string& ident ) { using Parser = Gaudi::Utils::AttribStringParser; DataObject* pO = nullptr; StatusCode status = this->findObject( m_rootName, pO ); if ( status.isSuccess() ) { - std::string::size_type loc = ident.find( " " ); - std::string filename, auth, svc = "", typ = ""; - std::string logname = ident.substr( 0, loc ); + string::size_type loc = ident.find( " " ); + string filename, auth, svc = "", typ = ""; + string logname = ident.substr( 0, loc ); for ( auto attrib : Parser( ident.substr( loc + 1 ) ) ) { switch (::toupper( attrib.tag[0] ) ) { case 'F': // FILE='' @@ -225,7 +240,7 @@ StatusCode HistogramSvc::connectInput( CSTR ident ) } if ( typ.length() > 0 ) { // Now add the registry entry to the store - std::string entryname = m_rootName; + string entryname = m_rootName; entryname += '/'; entryname += logname; GenericAddress* pA = nullptr; @@ -250,6 +265,7 @@ StatusCode HistogramSvc::connectInput( CSTR ident ) error() << "Cannot add " << ident << " invalid filename!" << endmsg; return StatusCode::FAILURE; } + //------------------------------------------------------------------------------ StatusCode HistogramSvc::initialize() { @@ -286,10 +302,15 @@ StatusCode HistogramSvc::initialize() } return status; } + //------------------------------------------------------------------------------ -StatusCode HistogramSvc::reinitialize() { return StatusCode::SUCCESS; } +StatusCode HistogramSvc::reinitialize() +{ + return StatusCode::SUCCESS; +} + //------------------------------------------------------------------------------ -IHistogram1D* HistogramSvc::sliceX( CSTR name, const IHistogram2D& h, int idxY1, int idxY2 ) +IHistogram1D* HistogramSvc::sliceX( const string& name, const IHistogram2D& h, int idxY1, int idxY2 ) { std::pair o( nullptr, nullptr ); try { @@ -306,8 +327,9 @@ IHistogram1D* HistogramSvc::sliceX( CSTR name, const IHistogram2D& h, int idxY1, delete o.first; throw GaudiException( "Cannot create sliceX `" + name + "' of 2D histogram!", "HistogramSvc", StatusCode::FAILURE ); } + //------------------------------------------------------------------------------ -IHistogram1D* HistogramSvc::sliceY( CSTR name, const IHistogram2D& h, int indexX1, int indexX2 ) +IHistogram1D* HistogramSvc::sliceY( const string& name, const IHistogram2D& h, int indexX1, int indexX2 ) { std::pair o( nullptr, nullptr ); try { @@ -324,6 +346,7 @@ IHistogram1D* HistogramSvc::sliceY( CSTR name, const IHistogram2D& h, int indexX delete o.first; throw GaudiException( "Cannot create sliceY `" + name + "' of 2D histogram!", "HistogramSvc", StatusCode::FAILURE ); } + //------------------------------------------------------------------------------ bool HistogramSvc::destroy( IBaseHistogram* hist ) { @@ -332,16 +355,18 @@ bool HistogramSvc::destroy( IBaseHistogram* hist ) delete hist; return true; } + // ============================================================================ -AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, CSTR rel, CSTR title, DBINS( x ) ) +AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, const string& rel, + const string& title, int nx, double lowx, double upx ) { if ( m_defs1D.empty() ) { - return i_book( pPar, rel, title, Gaudi::createH1D( title, BINS( x ) ) ); + return i_book( pPar, rel, title, Gaudi::createH1D( title, nx, lowx, upx ) ); } - std::string hn = histoAddr( pPar, rel ); + string hn = histoAddr( pPar, rel ); auto ifound = m_defs1D.find( hn ); if ( m_defs1D.end() == ifound ) { - return i_book( pPar, rel, title, Gaudi::createH1D( title, BINS( x ) ) ); + return i_book( pPar, rel, title, Gaudi::createH1D( title, nx, lowx, upx ) ); } if ( msgLevel( MSG::DEBUG ) ) { debug() << " Redefine the parameters for the histogram '" + hn + "' to be " << ifound->second << endmsg; @@ -351,43 +376,29 @@ AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, CSTR rel, CSTR title, Gaudi::createH1D( ifound->second.title(), ifound->second.bins(), ifound->second.lowEdge(), ifound->second.lowEdge() ) ); } + // ============================================================================ // constructor // ============================================================================ -HistogramSvc::HistogramSvc( const std::string& nam, ISvcLocator* svc ) : base_class( nam, svc ) +HistogramSvc::HistogramSvc( const string& nam, ISvcLocator* svc ) + : base_class( nam, svc ) { // Properties can be declared here m_rootName = "/stat"; m_rootCLID = CLID_DataObject; m_defs1D.declareUpdateHandler( &HistogramSvc::update1Ddefs, this ); } -// ============================================================================ -// handler to be invoked for updating property m_defs1D -// ============================================================================ -namespace -{ - inline size_t removeLeading( HistogramSvc::Histo1DMap& m, const std::string& lead = "/stat/" ) - { - for ( auto it = m.begin(); m.end() != it; ++it ) { - if ( 0 == it->first.find( lead ) ) { - std::string addr = std::string( it->first, lead.size() ); - Gaudi::Histo1DDef hdef = it->second; - m.erase( it ); // remove - m[addr] = hdef; // insert - return 1 + removeLeading( m, lead ); // return - } - } - return 0; - } -} + // ============================================================================ void HistogramSvc::update1Ddefs( Gaudi::Details::PropertyBase& ) { // check and remove the leading '/stat/' removeLeading( m_defs1D.value(), "/stat/" ); } + // ============================================================================ // finalize the service +// ============================================================================ StatusCode HistogramSvc::finalize() { if ( !m_mods1D.empty() ) { @@ -403,6 +414,1774 @@ StatusCode HistogramSvc::finalize() } return DataSvc::finalize(); } + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::book( const string& par, const string& rel, + const string& title, + int nx, double lowx, double upx ) +{ + return book( createPath( par ), rel, title, nx, lowx, upx ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::book( const string& par, int hID, + const string& title, + int nx, double lowx, double upx ) +{ + return book( par, std::to_string( hID ), title, nx, lowx, upx ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, int hID, + const string& title, + int nx, double lowx, double upx ) +{ + return book( pPar, std::to_string( hID ), title, nx, lowx, upx ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::book( const std::pair& loc, + const string& title, + int nx, double lowx, double upx ) +{ + return book( loc.first, loc.second, title, nx, lowx, upx ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::book( const string& full, const string& title, + int nx, double lowx, double upx ) +{ + return book( i_splitPath( full ), title, nx, lowx, upx ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, const string& rel, + const string& title, + int nx, double lowx, double upx, const string& opt ) +{ + return bookProf( createPath( par ), rel, title, nx, lowx, upx, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, int hID, const string& title, + int nx, double lowx, double upx, const string& opt ) +{ + return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const string& title, + int nx, double lowx, double upx, const string& opt ) +{ + return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair& loc, + const string& title, + int nx, double lowx, double upx, const string& opt ) +{ + return bookProf( loc.first, loc.second, title, nx, lowx, upx, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const string& full, const string& title, + int nx, double lowx, double upx, const string& opt ) +{ + return bookProf( i_splitPath( full ), title, nx, lowx, upx, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const string& rel, + const string& title, + int nx, double lowx, double upx, const string& opt ) +{ + return i_book( pPar, rel, title, Gaudi::createProf1D( title, nx, lowx, upx, 0, 0, opt ) ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, const string& rel, + const string& title, + int nx, double lowx, double upx, + double upper, double lower, const string& opt ) +{ + return bookProf( createPath( par ), rel, title, nx, lowx, upx, upper, lower, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, int hID, const string& title, + int nx, double lowx, double upx, + double upper, double lower, const string& opt ) +{ + return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, upper, lower, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const string& title, + int nx, double lowx, double upx, + double upper, double lower, const string& opt ) +{ + return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, upper, lower, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair& loc, + const string& title, + int nx, double lowx, double upx, + double upper, double lower, const string& opt ) +{ + return bookProf( loc.first, loc.second, title, nx, lowx, upx, upper, lower, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const string& full, const string& title, + int nx, double lowx, double upx, + double upper, double lower, const string& opt ) +{ + return bookProf( i_splitPath( full ), title, nx, lowx, upx, upper, lower, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const string& rel, + const string& title, + int nx, double lowx, double upx, + double upper, double lower, const string& opt ) +{ + return i_book( pPar, rel, title, Gaudi::createProf1D( title, nx, lowx, upx, upper, lower, opt ) ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::book( const std::string& par, int hID, + const std::string& title, Edges e ) +{ + return book( par, std::to_string( hID ), title, e ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, int hID, + const std::string& title, Edges e ) +{ + return book( pPar, std::to_string( hID ), title, e ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::book( const std::string& par, const std::string& rel, + const std::string& title, Edges e ) +{ + return book( createPath( par ), rel, title, e ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::book( const std::pair& loc, + const std::string& title, Edges e ) +{ + return book( loc.first, loc.second, title, e ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::book( const std::string& full, + const std::string& title, Edges e ) +{ + return book( i_splitPath( full ), title, e ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, const std::string& rel, + const std::string& title, Edges e ) +{ + return i_book( pPar, rel, title, Gaudi::createH1D( title, e ) ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& full, + const std::string& title, Edges e ) +{ + return bookProf( i_splitPath( full ), title, e ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, + const std::string& title, Edges e ) +{ + return bookProf( createPath( par ), rel, title, e ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, int hID, + const std::string& title, Edges e ) +{ + return bookProf( par, std::to_string( hID ), title, e ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, + const std::string& title, Edges e ) +{ + return bookProf( pPar, std::to_string( hID ), title, e ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair& loc, + const std::string& title, Edges e ) +{ + return bookProf( loc.first, loc.second, title, e ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, Edges e ) +{ + return i_book( pPar, rel, title, Gaudi::createProf1D( title, e, 0, 0 ) ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& full, + const std::string& title, Edges e, + double upper, double lower ) +{ + return bookProf( i_splitPath( full ), title, e, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, + const std::string& title, Edges e, + double upper, double lower ) +{ + return bookProf( createPath( par ), rel, title, e, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, int hID, + const std::string& title, Edges e, + double upper, double lower ) +{ + return bookProf( par, std::to_string( hID ), title, e, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, + const std::string& title, Edges e, + double upper, double lower ) +{ + return bookProf( pPar, std::to_string( hID ), title, e, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair& loc, + const std::string& title, Edges e, + double upper, double lower ) +{ + return bookProf( loc.first, loc.second, title, e, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, Edges e, + double upper, double lower ) +{ + return i_book( pPar, rel, title, Gaudi::createProf1D( title, e, upper, lower ) ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( const std::string& full, const std::string& title, + int nx, double lowx, double upx, int ny, + double lowy, double upy ) +{ + return book( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return book( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return book( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( const std::pair& loc, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return book( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return book( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return i_book( pPar, rel, title, Gaudi::createH2D( title, nx, lowx, upx, ny, lowy, upy ) ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ) +{ + return bookProf( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ) +{ + return bookProf( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair& loc, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ) +{ + return bookProf( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ) +{ + return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ) +{ + return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, upper, lower ); +} + // ============================================================================ -// The END +AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ) +{ + return i_book( pPar, rel, title, Gaudi::createProf2D( title, nx, lowx, upx, ny, lowy, upy, upper, lower ) ); +} + // ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return bookProf( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return bookProf( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair& loc, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return bookProf( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return i_book( pPar, rel, title, Gaudi::createProf2D( title, nx, lowx, upx, ny, lowy, upy, 0, 0 ) ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( const std::string& full, + const std::string& title, + Edges x, Edges y ) +{ + return book( i_splitPath( full ), title, x, y ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, const std::string& rel, + const std::string& title, + Edges x, Edges y ) +{ + return book( createPath( par ), rel, title, x, y ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, int hID, + const std::string& title, + Edges x, Edges y ) +{ + return book( par, std::to_string( hID ), title, x, y ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( const std::pair& loc, + const std::string& title, + Edges x, Edges y ) +{ + return book( loc.first, loc.second, title, x, y ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, int hID, + const std::string& title, + Edges x, Edges y ) +{ + return book( pPar, std::to_string( hID ), title, x, y ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, const std::string& rel, + const std::string& title, + Edges x, Edges y ) +{ + return i_book( pPar, rel, title, Gaudi::createH2D( title, x, y ) ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, + const std::string& title, + Edges x, Edges y ) +{ + return bookProf( i_splitPath( full ), title, x, y ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, + const std::string& title, + Edges x, Edges y ) +{ + return bookProf( createPath( par ), rel, title, x, y ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, + const std::string& title, + Edges x, Edges y ) +{ + return bookProf( par, std::to_string( hID ), title, x, y ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, + const std::string& title, + Edges x, Edges y ) +{ + return bookProf( pPar, std::to_string( hID ), title, x, y ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair& loc, + const std::string& title, + Edges x, Edges y ) +{ + return bookProf( loc.first, loc.second, title, x, y ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, + Edges x, Edges y ) +{ + return i_book( pPar, rel, title, Gaudi::createProf2D( title, x, y, 0, 0 ) ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, + const std::string& title, + Edges x, Edges y, double upper, double lower ) +{ + return bookProf( i_splitPath( full ), title, x, y, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, + const std::string& title, + Edges x, Edges y, double upper, double lower ) +{ + return bookProf( createPath( par ), rel, title, x, y, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, + const std::string& title, + Edges x, Edges y, double upper, double lower ) +{ + return bookProf( par, std::to_string( hID ), title, x, y, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, + const std::string& title, + Edges x, Edges y, double upper, double lower ) +{ + return bookProf( pPar, std::to_string( hID ), title, x, y, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair& loc, + const std::string& title, + Edges x, Edges y, double upper, double lower ) +{ + return bookProf( loc.first, loc.second, title, x, y, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, + const std::string& title, + Edges x, Edges y, double upper, double lower ) +{ + return i_book( pPar, rel, title, Gaudi::createProf2D( title, x, y, upper, lower ) ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( const std::string& full, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) +{ + return book( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) +{ + return book( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) +{ + return book( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, int hID, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) +{ + return book( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( const std::pair& loc, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) +{ + return book( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, const std::string& rel, + const std::string& title, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) +{ + return i_book( pPar, rel, title, Gaudi::createH3D( title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ) ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( const std::string& full, + const std::string& title, + Edges x, Edges y, Edges z ) +{ + return book( i_splitPath( full ), title, x, y, z ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, const std::string& rel, + const std::string& title, + Edges x, Edges y, Edges z ) +{ + return book( createPath( par ), rel, title, x, y, z ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, int hID, + const std::string& title, + Edges x, Edges y, Edges z ) +{ + return book( par, std::to_string( hID ), title, x, y, z ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, int hID, + const std::string& title, + Edges x, Edges y, Edges z ) +{ + return book( pPar, std::to_string( hID ), title, x, y, z ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( const std::pair& loc, + const std::string& title, + Edges x, Edges y, Edges z ) +{ + return book( loc.first, loc.second, title, x, y, z ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, const std::string& rel, + const std::string& title, + Edges x, Edges y, Edges z ) +{ + return i_book( pPar, rel, title, Gaudi::createH3D( title, x, y, z ) ); +} + +// ============================================================================ +StatusCode HistogramSvc::registerObject( const std::string& parent, + const std::string& rel, Base* obj ) +{ + return registerObject( createPath( parent ), rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::registerObject( const std::string& parent, + int item, Base* obj ) +{ + return registerObject( parent, std::to_string( item ), obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::registerObject( Base* pPar, const std::string& rel, + Base* obj ) +{ + return registerObject( detail::cast( pPar ), rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::registerObject( DataObject* pPar, int item, Base* obj ) +{ + return registerObject( pPar, std::to_string( item ), obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::registerObject( Base* pPar, int item, Base* obj ) +{ + return registerObject( detail::cast( pPar ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::unregisterObject( Base* obj ) +{ + return DataSvc::unregisterObject( detail::cast( obj ) ); +} + +// ============================================================================ +StatusCode HistogramSvc::unregisterObject( Base* obj, const std::string& objectPath ) +{ + return DataSvc::unregisterObject( detail::cast( obj ), objectPath ); +} + +// ============================================================================ +StatusCode HistogramSvc::unregisterObject( Base* obj, int item ) +{ + return DataSvc::unregisterObject( detail::cast( obj ), item ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, + AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).retrieve( pReg, path, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, + AIDA::IProfile1D*& obj ) +{ + return Helper( this ).retrieve( pReg, path, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, + AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).retrieve( pReg, path, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, + AIDA::IProfile2D*& obj ) +{ + return Helper( this ).retrieve( pReg, path, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, + AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).retrieve( pReg, path, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& full, + AIDA::IProfile1D*& obj ) +{ + return Helper( this ).retrieve( full, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& full, + AIDA::IProfile2D*& obj ) +{ + return Helper( this ).retrieve( full, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& full, + AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).retrieve( full, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& full, + AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).retrieve( full, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& full, + AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).retrieve( full, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, + + AIDA::IProfile1D*& obj ) +{ + return Helper( this ).retrieve( parent, rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, + AIDA::IProfile2D*& obj ) +{ + return Helper( this ).retrieve( parent, rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, + AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).retrieve( parent, rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, + AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).retrieve( parent, rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, + AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).retrieve( parent, rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, + AIDA::IProfile1D*& obj ) +{ + return Helper( this ).retrieve( parent, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, + AIDA::IProfile2D*& obj ) +{ + return Helper( this ).retrieve( parent, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, + AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).retrieve( parent, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, + AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).retrieve( parent, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, + AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).retrieve( parent, item, obj ); +} +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, + AIDA::IProfile1D*& obj ) +{ + return Helper( this ).retrieve( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, + AIDA::IProfile2D*& obj ) +{ + return Helper( this ).retrieve( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, + AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).retrieve( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, + AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).retrieve( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, + AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).retrieve( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, + AIDA::IProfile1D*& obj ) +{ + return Helper( this ).retrieve( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, + AIDA::IProfile2D*& obj ) +{ + return Helper( this ).retrieve( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, + AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).retrieve( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, + AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).retrieve( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, + AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).retrieve( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( Base* par, int item, + AIDA::IProfile1D*& obj ) +{ + return Helper( this ).retrieve( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( Base* par, int item, + AIDA::IProfile2D*& obj ) +{ + return Helper( this ).retrieve( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( Base* par, int item, + AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).retrieve( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( Base* par, int item, + AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).retrieve( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( Base* par, int item, + AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).retrieve( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, + AIDA::IProfile1D*& obj ) +{ + return Helper( this ).retrieve( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, + AIDA::IProfile2D*& obj ) +{ + return Helper( this ).retrieve( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, + AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).retrieve( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, + AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).retrieve( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, + AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).retrieve( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IProfile1D*& obj ) +{ + return Helper( this ).find( pReg, path, obj ); +} +// ============================================================================ +StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IProfile2D*& obj ) +{ + return Helper( this ).find( pReg, path, obj ); +} +// ============================================================================ +StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).find( pReg, path, obj ); +} +// ============================================================================ +StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).find( pReg, path, obj ); +} +// ============================================================================ +StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).find( pReg, path, obj ); +} +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IProfile1D*& obj ) +{ + return Helper( this ).find( full, obj ); +} +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IProfile2D*& obj ) +{ + return Helper( this ).find( full, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).find( full, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).find( full, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).find( full, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IProfile1D*& obj ) +{ + return Helper( this ).find( par, rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IProfile2D*& obj ) +{ + return Helper( this ).find( par, rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).find( par, rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).find( par, rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).find( par, rel, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IProfile1D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IProfile2D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IProfile1D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IProfile2D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IProfile1D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IProfile2D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).find( par, item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IProfile1D*& obj ) +{ + return Helper( this ).find( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IProfile2D*& obj ) +{ + return Helper( this ).find( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).find( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).find( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).find( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( Base* par, const std::string& item, + AIDA::IProfile1D*& obj ) +{ + return Helper( this ).find( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( Base* par, const std::string& item, + AIDA::IProfile2D*& obj ) +{ + return Helper( this ).find( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( Base* par, const std::string& item, + AIDA::IHistogram1D*& obj ) +{ + return Helper( this ).find( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( Base* par, const std::string& item, + AIDA::IHistogram2D*& obj ) +{ + return Helper( this ).find( detail::cast( par ), item, obj ); +} + +// ============================================================================ +StatusCode HistogramSvc::findObject( Base* par, const std::string& item, + AIDA::IHistogram3D*& obj ) +{ + return Helper( this ).find( detail::cast( par ), item, obj ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::projectionX( const std::string& name, + const AIDA::IHistogram2D& h ) +{ + return sliceX( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::projectionY( const std::string& name, + const AIDA::IHistogram2D& h ) +{ + return sliceY( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::sliceX( const std::string& name, + const AIDA::IHistogram2D& h, int indexY ) +{ + return sliceX( name, h, indexY, indexY ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::sliceY( const std::string& name, + const AIDA::IHistogram2D& h, int indexX ) +{ + return sliceY( name, h, indexX, indexX ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::add( const std::string& nameAndTitle, + const AIDA::IHistogram1D& a, + const AIDA::IHistogram1D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Add, 1. ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::subtract( const std::string& nameAndTitle, + const AIDA::IHistogram1D& a, + const AIDA::IHistogram1D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Add, -1. ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::multiply( const std::string& nameAndTitle, + const AIDA::IHistogram1D& a, + const AIDA::IHistogram1D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Multiply ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::divide( const std::string& nameAndTitle, + const AIDA::IHistogram1D& a, + const AIDA::IHistogram1D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Divide ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::add( const std::string& nameAndTitle, + const AIDA::IHistogram2D& a, + const AIDA::IHistogram2D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Add, 1. ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::subtract( const std::string& nameAndTitle, + const AIDA::IHistogram2D& a, + const AIDA::IHistogram2D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Add, -1. ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::multiply( const std::string& nameAndTitle, + const AIDA::IHistogram2D& a, + const AIDA::IHistogram2D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Multiply ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::divide( const std::string& nameAndTitle, + const AIDA::IHistogram2D& a, + const AIDA::IHistogram2D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Divide ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::add( const std::string& nameAndTitle, + const AIDA::IHistogram3D& a, + const AIDA::IHistogram3D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Add, 1. ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::subtract( const std::string& nameAndTitle, + const AIDA::IHistogram3D& a, + const AIDA::IHistogram3D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Add, -1. ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::multiply( const std::string& nameAndTitle, + const AIDA::IHistogram3D& a, + const AIDA::IHistogram3D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Multiply ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::divide( const std::string& nameAndTitle, + const AIDA::IHistogram3D& a, + const AIDA::IHistogram3D& b ) +{ + return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Divide ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::projectionXY( const std::string& nameAndTitle, + const AIDA::IHistogram3D& h ) +{ + return i_project( nameAndTitle, h, "xy" ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::projectionXZ( const std::string& nameAndTitle, + const AIDA::IHistogram3D& h ) +{ + return i_project( nameAndTitle, h, "xz" ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::projectionYZ( const std::string& nameAndTitle, + const AIDA::IHistogram3D& h ) +{ + return i_project( nameAndTitle, h, "yz" ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name, + const std::string& tit, + int nx, double lowx, double upx ) +{ + return book( name, tit, nx, lowx, upx ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name, + const std::string& tit, + int nx, double lowx, double upx, + const std::string& /*opt*/ ) +{ + return book( name, tit, nx, lowx, upx ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name, + const std::string& title, + const Edges& x, + const std::string& /*opt*/ ) +{ + return book( name, title, x ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& nameAndTitle, + int nx, double lowx, double upx ) +{ + return book( nameAndTitle, nameAndTitle, nx, lowx, upx ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::createCopy( const std::string& full, + const AIDA::IHistogram1D& h ) +{ + return createCopy( i_splitPath( full ), h ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::createCopy( const std::string& par, + const std::string& rel, + const AIDA::IHistogram1D& h ) +{ + return createCopy( createPath( par ), rel, h ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::createCopy( const std::pair& loc, + const AIDA::IHistogram1D& h ) +{ + return createCopy( loc.first, loc.second, h ); +} + +// ============================================================================ +AIDA::IHistogram1D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, + const AIDA::IHistogram1D& h ) +{ + return i_book( pPar, rel, h.title(), Gaudi::createH1D( h ) ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return book( name, tit, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + const std::string& /*opt*/ ) +{ + return book( name, tit, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& title, + const Edges& x, const Edges& y, + const std::string& /*opt*/ ) +{ + return book( name, title, x, y ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& nameAndTitle, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::createCopy( const std::string& full, + const AIDA::IHistogram2D& h ) +{ + return createCopy( i_splitPath( full ), h ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::createCopy( const std::string& par, const std::string& rel, + const AIDA::IHistogram2D& h ) +{ + return createCopy( createPath( par ), rel, h ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::createCopy( const std::pair& loc, + const AIDA::IHistogram2D& h ) +{ + return createCopy( loc.first, loc.second, h ); +} + +// ============================================================================ +AIDA::IHistogram2D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, + const AIDA::IHistogram2D& h ) +{ + return i_book( pPar, rel, h.title(), Gaudi::createH2D( h ) ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) +{ + return book( name, tit, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz, + const std::string& /*opt*/ ) +{ + return book( name, tit, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& title, + const Edges& x, const Edges& y, const Edges& z, + const std::string& /*opt*/ ) +{ + return book( name, title, x, y, z ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& nameAndTitle, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + int nz, double lowz, double upz ) +{ + return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::createCopy( const std::string& full, + const AIDA::IHistogram3D& h ) +{ + return createCopy( i_splitPath( full ), h ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::createCopy( const std::string& par, const std::string& rel, + const AIDA::IHistogram3D& h ) +{ + return createCopy( createPath( par ), rel, h ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::createCopy( const std::pair& loc, + const AIDA::IHistogram3D& h ) +{ + return createCopy( loc.first, loc.second, h ); +} + +// ============================================================================ +AIDA::IHistogram3D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, + const AIDA::IHistogram3D& h ) +{ + return i_book( pPar, rel, h.title(), Gaudi::createH3D( h ) ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + const std::string& opt ) +{ + return bookProf( name, tit, nx, lowx, upx, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + double upper, double lower, + const std::string& opt ) +{ + return bookProf( name, tit, nx, lowx, upx, upper, lower, opt ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, + const std::string& title, const Edges& x, + const std::string& /* opt */ ) +{ + return bookProf( name, title, x ); +} + + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, + const std::string& title, const Edges& x, + double upper, double lower, + const std::string& /* opt */ ) +{ + return bookProf( name, title, x, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& nametit, + int nx, double lowx, double upx ) +{ + return bookProf( nametit, nametit, nx, lowx, upx, "s" ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& nametit, + int nx, double lowx, double upx, + double upper, double lower ) +{ + return bookProf( nametit, nametit, nx, lowx, upx, upper, lower, "s" ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::createCopy( const std::string& full, + const AIDA::IProfile1D& h ) +{ + return createCopy( i_splitPath( full ), h ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::createCopy( const std::string& par, const std::string& rel, + const AIDA::IProfile1D& h ) +{ + return createCopy( createPath( par ), rel, h ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::createCopy( const std::pair& loc, + const AIDA::IProfile1D& h ) +{ + return createCopy( loc.first, loc.second, h ); +} + +// ============================================================================ +AIDA::IProfile1D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, + const AIDA::IProfile1D& h ) +{ + return i_book( pPar, rel, h.title(), Gaudi::createProf1D( h ) ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + const std::string& /*opt*/ ) +{ + return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, + const std::string& title, + const Edges& x, const Edges& y, + const std::string& /*opt*/ ) +{ + return bookProf( name, title, x, y ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& nameAndTitle, + int nx, double lowx, double upx, + int ny, double lowy, double upy ) +{ + return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, + const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ) +{ + return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& tit, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower, + const std::string& /*opt*/ ) +{ + return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, + const std::string& title, + const Edges& x, const Edges& y, + double upper, double lower, + const std::string& /*opt*/ ) +{ + return bookProf( name, title, x, y, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& nameAndTitle, + int nx, double lowx, double upx, + int ny, double lowy, double upy, + double upper, double lower ) +{ + return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx, + ny, lowy, upy, upper, lower ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createCopy( const std::string& full, + const AIDA::IProfile2D& h ) +{ + return createCopy( i_splitPath( full ), h ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createCopy( const std::string& par, + const std::string& rel, + const AIDA::IProfile2D& h ) +{ + return createCopy( createPath( par ), rel, h ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createCopy( const std::pair& loc, + const AIDA::IProfile2D& h ) +{ + return createCopy( loc.first, loc.second, h ); +} + +// ============================================================================ +AIDA::IProfile2D* HistogramSvc::createCopy( DataObject* pPar, + const std::string& rel, + const AIDA::IProfile2D& h ) +{ + return i_book( pPar, rel, h.title(), Gaudi::createProf2D( h ) ); +} diff --git a/GaudiCommonSvc/src/HistogramSvc/HistogramSvc.h b/GaudiCommonSvc/src/HistogramSvc/HistogramSvc.h deleted file mode 100644 index 6bc96a3b2809d2c0f765fa9b43a700bec6bfcab0..0000000000000000000000000000000000000000 --- a/GaudiCommonSvc/src/HistogramSvc/HistogramSvc.h +++ /dev/null @@ -1,1302 +0,0 @@ -// ============================================================================ -#ifndef GAUDISVC_HISTOGRAMSVC_H -#define GAUDISVC_HISTOGRAMSVC_H 1 -// ============================================================================ -// Include Files -// ============================================================================ -// GaudiKernel -// ============================================================================ -#include "GaudiKernel/DataSvc.h" -#include "GaudiKernel/GaudiException.h" -#include "GaudiKernel/HistoProperty.h" -#include "GaudiKernel/IHistogramSvc.h" -#include "GaudiKernel/IRegistry.h" -#include "GaudiKernel/System.h" -// ============================================================================ -// AIDA -// ============================================================================ -/// @FIXME: AIDA interfaces visibility -#include "AIDA/IAnnotation.h" -#include "AIDA/IHistogramFactory.h" -#include "AIDA_visibility_hack.h" -// ============================================================================ -// local (+PI) -// ============================================================================ -#include "Axis.h" -#include "GaudiPI.h" -#include "TH1.h" -#include "TH2.h" -#include "TH3.h" -// ============================================================================ -namespace AIDA -{ - class ICloud1D; - class ICloud2D; - class ICloud3D; -} -// ============================================================================ -// Forward declarations -#define DBINS( x ) int n##x, double low##x, double up##x -#define BINS( x ) n##x, low##x, up##x -#define NOT_IMPLEMENTED \ - { \ - not_implemented(); \ - return 0; \ - } -// ============================================================================ -/** @class HistogramSvc HistogramSvc.h - * - * HistogramSvc class definition - * - */ -class HistogramSvc : public extends, virtual public AIDA::IHistogramFactory -{ - -private: - typedef const std::pair& STRPAIR; - void not_implemented() const { error() << "Sorry, not yet implemented..." << endmsg; } -protected: - typedef const std::string& CSTR; - typedef std::vector Edges; - typedef std::vector DBaseEntries; - typedef AIDA::IHistogram1D H1D; - typedef AIDA::IHistogram2D H2D; - typedef AIDA::IHistogram3D H3D; - typedef AIDA::IProfile1D P1D; - typedef AIDA::IProfile2D P2D; - typedef AIDA::IBaseHistogram Base; - struct Helper { - HistogramSvc* m_svc; - Helper( HistogramSvc* p ) : m_svc( p ) {} - template - StatusCode retrieve( A1 a1, A3*& a3 ) - { - DataObject* pObject = nullptr; - StatusCode sc = m_svc->DataSvc::retrieveObject( a1, pObject ); - a3 = dynamic_cast( pObject ); - return sc; - } - template - StatusCode retrieve( A1 a1, A2 a2, A3*& a3 ) - { - DataObject* pObject = nullptr; - StatusCode sc = m_svc->DataSvc::retrieveObject( a1, a2, pObject ); - a3 = dynamic_cast( pObject ); - return sc; - } - template - StatusCode find( A1 a1, A3*& a3 ) - { - DataObject* pObject = nullptr; - StatusCode sc = m_svc->DataSvc::findObject( a1, pObject ); - a3 = dynamic_cast( pObject ); - return sc; - } - template - StatusCode find( A1 a1, A2 a2, A3*& a3 ) - { - DataObject* pObject = nullptr; - StatusCode sc = m_svc->DataSvc::findObject( a1, a2, pObject ); - a3 = dynamic_cast( pObject ); - return sc; - } - template - static R* act( R* res, const S& b, void ( T1::*pmf )( const T2*, Double_t ), Double_t scale ) - { - T1* h1 = Gaudi::getRepresentation( *res ); - T1* h2 = Gaudi::getRepresentation( b ); - if ( h1 && h2 ) { - ( h1->*pmf )( h2, scale ); - return res; - } - return nullptr; - } - template - static R* act( R* res, const S& b, Bool_t ( T1::*pmf )( const T2*, Double_t ), Double_t scale ) - { - T1* h1 = Gaudi::getRepresentation( *res ); - T1* h2 = Gaudi::getRepresentation( b ); - if ( h1 && h2 ) { - ( h1->*pmf )( h2, scale ); - return res; - } - return nullptr; - } - template - static R* act( R* res, const S& b, void ( T1::*pmf )( const T2* ) ) - { - T1* h1 = Gaudi::getRepresentation( *res ); - T1* h2 = Gaudi::getRepresentation( b ); - if ( h1 && h2 ) { - ( h1->*pmf )( h2 ); - return res; - } - return nullptr; - } - template - static R* act( R* res, const S& b, Bool_t ( T1::*pmf )( const T2* ) ) - { - T1* h1 = Gaudi::getRepresentation( *res ); - T1* h2 = Gaudi::getRepresentation( b ); - if ( h1 && h2 ) { - ( h1->*pmf )( h2 ); - return res; - } - return nullptr; - } - }; - -public: - /** Statndard Constructor - * @param name service name - * @param pointer to service locator interface - */ - HistogramSvc( const std::string& name, ISvcLocator* svc ); - - /// Destructor - ~HistogramSvc() override; - - /** Split full path into its components - * @param full Full path of the object - * @param dir Resulting directory path - * @param obj Resulting object path - */ - std::pair i_splitPath( CSTR full ); - - /** Connect input histogram file to the service - * @param ident [IN] Input specification - */ - StatusCode connectInput( CSTR ident ); - - template - inline T* i_book( DataObject* pPar, CSTR rel, CSTR title, const std::pair& o ) - { - if ( o.first && registerObject( pPar, rel, (Base*)o.second ).isSuccess() ) return o.second; - delete o.first; - throw GaudiException( "Cannot book " + System::typeinfoName( typeid( T ) ) + " " + title, "HistogramSvc", - StatusCode::FAILURE ); - } - template - static DataObject* __cast( T* p ) - { - DataObject* q = dynamic_cast( p ); - if ( !q && p ) { - throw std::runtime_error( "HistogramSvc: Unexpected object type." ); - } - return q; - } - /// Helper for 2D projections - H2D* i_project( CSTR nameAndTitle, const H3D& h, CSTR dir ); - -public: - /// Initialise the service - StatusCode initialize() override; - /// Initialise the service - StatusCode reinitialize() override; - /// finalize the service - StatusCode finalize() override; - - /// Retrieve the AIDA HistogramFactory interface - AIDA::IHistogramFactory* histogramFactory() override { return this; } - - // ========================================================================== - // Book 1D histogram with fix binning - // ========================================================================== - /** Book histogram and register it with the histogram data store - @param full Full path to the node of the object. - The basename (last part of the fullpath) - has to be an integer number - otherwise conversion to HBOOK is not possible) - @param par Path to parent node of the object, - the directory the histogram will be stored in. - @param pPar Pointer to parent node - @param rel Histogram identifier (std::string), the relative path - to the object with respect to the parent node - @param hID Histogram identifier (int) of the histogram - @param title Title property of the histogram - @param DBINS(x) Macro for bin definition. Expands to: - int nx: Number of bins on the axis X/Y - double lx: Lower histogram edge on the axis X/Y - double ux: Upper histogram edge on the axis X/Y - */ - H1D* book( CSTR par, CSTR rel, CSTR title, DBINS( x ) ) override - { - return book( createPath( par ), rel, title, BINS( x ) ); - } - H1D* book( CSTR par, int hID, CSTR title, DBINS( x ) ) override - { - return book( par, std::to_string( hID ), title, BINS( x ) ); - } - H1D* book( DataObject* pPar, int hID, CSTR title, DBINS( x ) ) override - { - return book( pPar, std::to_string( hID ), title, BINS( x ) ); - } - H1D* book( DataObject* pPar, CSTR rel, CSTR title, DBINS( x ) ) override; - virtual H1D* book( STRPAIR loc, CSTR title, DBINS( x ) ) { return book( loc.first, loc.second, title, BINS( x ) ); } - H1D* book( CSTR full, CSTR title, DBINS( x ) ) override { return book( i_splitPath( full ), title, BINS( x ) ); } - // ========================================================================== - // Book 1D Profile histogram with fix binning - // ========================================================================== - /** Book histogram and register it with the histogram data store - @param full Full path to the node of the object. - The basename (last part of the fullpath) - has to be an integer number - (otherwise conversion to HBOOK is not possible) - @param par Path to parent node of the object, - the directory the histogram will be stored in. - @param pPar Pointer to parent node - @param rel Histogram identifier (std::string), the relative path - to the object with respect to the parent node - @param hID Histogram identifier (int) of the histogram - @param title Title property of the histogram - @param DBINS(x) Macro for bin definition. Expands to: - int nx: Number of bins on the axis X/Y - double lx: Lower histogram edge on the axis X/Y - double ux: Upper histogram edge on the axis X/Y - */ - P1D* bookProf( CSTR par, CSTR rel, CSTR title, DBINS( x ), CSTR opt ) override - { - return bookProf( createPath( par ), rel, title, BINS( x ), opt ); - } - P1D* bookProf( CSTR par, int hID, CSTR title, DBINS( x ), CSTR opt ) override - { - return bookProf( par, std::to_string( hID ), title, BINS( x ), opt ); - } - P1D* bookProf( DataObject* pPar, int hID, CSTR title, DBINS( x ), CSTR opt ) override - { - return bookProf( pPar, std::to_string( hID ), title, BINS( x ), opt ); - } - virtual P1D* bookProf( STRPAIR loc, CSTR title, DBINS( x ), CSTR opt ) - { - return bookProf( loc.first, loc.second, title, BINS( x ), opt ); - } - P1D* bookProf( CSTR full, CSTR title, DBINS( x ), CSTR opt ) override - { - return bookProf( i_splitPath( full ), title, BINS( x ), opt ); - } - P1D* bookProf( DataObject* pPar, CSTR rel, CSTR title, DBINS( x ), CSTR opt ) override - { - return i_book( pPar, rel, title, Gaudi::createProf1D( title, BINS( x ), 0, 0, opt ) ); - } - - P1D* bookProf( CSTR par, CSTR rel, CSTR title, DBINS( x ), double upper, double lower, CSTR opt ) override - { - return bookProf( createPath( par ), rel, title, BINS( x ), upper, lower, opt ); - } - P1D* bookProf( CSTR par, int hID, CSTR title, DBINS( x ), double upper, double lower, CSTR opt ) override - { - return bookProf( par, std::to_string( hID ), title, BINS( x ), upper, lower, opt ); - } - P1D* bookProf( DataObject* pPar, int hID, CSTR title, DBINS( x ), double upper, double lower, CSTR opt ) override - { - return bookProf( pPar, std::to_string( hID ), title, BINS( x ), upper, lower, opt ); - } - virtual P1D* bookProf( STRPAIR loc, CSTR title, DBINS( x ), double upper, double lower, CSTR opt ) - { - return bookProf( loc.first, loc.second, title, BINS( x ), upper, lower, opt ); - } - P1D* bookProf( CSTR full, CSTR title, DBINS( x ), double upper, double lower, CSTR opt ) override - { - return bookProf( i_splitPath( full ), title, BINS( x ), upper, lower, opt ); - } - P1D* bookProf( DataObject* pPar, CSTR rel, CSTR title, DBINS( x ), double upper, double lower, CSTR opt ) override - { - return i_book( pPar, rel, title, Gaudi::createProf1D( title, BINS( x ), upper, lower, opt ) ); - } - // ========================================================================== - // Book 1D histogram with variable binning - // ========================================================================== - /** Book histogram and register it with the histogram data store - @param full Full path to the node of the object. - The basename (last part of the fullpath) - has to be an integer number - (otherwise conversion to HBOOK is not possible) - @param par Path to parent node of the object, - the directory the histogram will be stored in. - @param pPar Pointer to parent node - @param rel Histogram identifier (std::string), the relative path - to the object with respect to the parent node - @param hID Histogram identifier (int) of the histogram - @param title Title property of the histogram - @param e Bin edges for variable binned histogram. - */ - H1D* book( CSTR par, int hID, CSTR title, Edges e ) override { return book( par, std::to_string( hID ), title, e ); } - H1D* book( DataObject* pPar, int hID, CSTR title, Edges e ) override - { - return book( pPar, std::to_string( hID ), title, e ); - } - H1D* book( CSTR par, CSTR rel, CSTR title, Edges e ) override { return book( createPath( par ), rel, title, e ); } - virtual H1D* book( STRPAIR loc, CSTR title, Edges e ) { return book( loc.first, loc.second, title, e ); } - H1D* book( CSTR full, CSTR title, Edges e ) override { return book( i_splitPath( full ), title, e ); } - H1D* book( DataObject* pPar, CSTR rel, CSTR title, Edges e ) override - { - return i_book( pPar, rel, title, Gaudi::createH1D( title, e ) ); - } - - // ========================================================================== - // Book 1D profile histogram with variable binning - // ========================================================================== - /** Book histogram and register it with the histogram data store - @param full Full path to the node of the object. - The basename (last part of the full) - has to be an integer number - (otherwise conversion to HBOOK is not possible) - @param par Path to parent node of the object, - the directory the histogram will be stored in. - @param pPar Pointer to parent node - @param rel Histogram identifier (std::string), the relative path - to the object with respect to the parent node - @param hID Histogram identifier (int) of the histogram - @param title Title property of the histogram - @param e Bin edges for variable binned histogram. - */ - P1D* bookProf( CSTR full, CSTR title, Edges e ) override { return bookProf( i_splitPath( full ), title, e ); } - P1D* bookProf( CSTR par, CSTR rel, CSTR title, Edges e ) override - { - return bookProf( createPath( par ), rel, title, e ); - } - P1D* bookProf( CSTR par, int hID, CSTR title, Edges e ) override - { - return bookProf( par, std::to_string( hID ), title, e ); - } - P1D* bookProf( DataObject* pPar, int hID, CSTR title, Edges e ) override - { - return bookProf( pPar, std::to_string( hID ), title, e ); - } - virtual P1D* bookProf( STRPAIR loc, CSTR title, Edges e ) { return bookProf( loc.first, loc.second, title, e ); } - P1D* bookProf( DataObject* pPar, CSTR rel, CSTR title, Edges e ) override - { - return i_book( pPar, rel, title, Gaudi::createProf1D( title, e, 0, 0 ) ); - } - - virtual P1D* bookProf( CSTR full, CSTR title, Edges e, double upper, double lower ) - { - return bookProf( i_splitPath( full ), title, e, upper, lower ); - } - virtual P1D* bookProf( CSTR par, CSTR rel, CSTR title, Edges e, double upper, double lower ) - { - return bookProf( createPath( par ), rel, title, e, upper, lower ); - } - virtual P1D* bookProf( CSTR par, int hID, CSTR title, Edges e, double upper, double lower ) - { - return bookProf( par, std::to_string( hID ), title, e, upper, lower ); - } - virtual P1D* bookProf( DataObject* pPar, int hID, CSTR title, Edges e, double upper, double lower ) - { - return bookProf( pPar, std::to_string( hID ), title, e, upper, lower ); - } - virtual P1D* bookProf( STRPAIR loc, CSTR title, Edges e, double upper, double lower ) - { - return bookProf( loc.first, loc.second, title, e, upper, lower ); - } - virtual P1D* bookProf( DataObject* pPar, CSTR rel, CSTR title, Edges e, double upper, double lower ) - { - return i_book( pPar, rel, title, Gaudi::createProf1D( title, e, upper, lower ) ); - } - // ========================================================================== - // Book 2D histogram with fixed binning - // ========================================================================== - /** Book histogram and register it with the histogram data store - @param full Full path to the node of the object. - The basename (last part of the full) - has to be an integer number - (otherwise conversion to HBOOK is not possible) - @param par Path to parent node of the object, - the directory the histogram will be stored in. - @param pPar Pointer to parent node - @param rel Histogram identifier (std::string), the relative path - to the object with respect to the parent node - @param hID Histogram identifier (int) of the histogram - @param title Title property of the histogram - @param DBINS(x/y) Macro for bin definition in X/Y. Expands to: - int nx: Number of bins on the axis X/Y - double lx: Lower histogram edge on the axis X/Y - double ux: Upper histogram edge on the axis X/Y - */ - H2D* book( CSTR full, CSTR title, DBINS( x ), DBINS( y ) ) override - { - return book( i_splitPath( full ), title, BINS( x ), BINS( y ) ); - } - H2D* book( CSTR par, CSTR rel, CSTR title, DBINS( x ), DBINS( y ) ) override - { - return book( createPath( par ), rel, title, BINS( x ), BINS( y ) ); - } - H2D* book( CSTR par, int hID, CSTR title, DBINS( x ), DBINS( y ) ) override - { - return book( par, std::to_string( hID ), title, BINS( x ), BINS( y ) ); - } - virtual H2D* book( STRPAIR loc, CSTR title, DBINS( x ), DBINS( y ) ) - { - return book( loc.first, loc.second, title, BINS( x ), BINS( y ) ); - } - H2D* book( DataObject* pPar, int hID, CSTR title, DBINS( x ), DBINS( y ) ) override - { - return book( pPar, std::to_string( hID ), title, BINS( x ), BINS( y ) ); - } - H2D* book( DataObject* pPar, CSTR rel, CSTR title, DBINS( x ), DBINS( y ) ) override - { - return i_book( pPar, rel, title, Gaudi::createH2D( title, BINS( x ), BINS( y ) ) ); - } - // ========================================================================== - // Book 2D profile histogram with fixed binning - // ========================================================================== - /** Book histogram and register it with the histogram data store - @param full Full path to the node of the object. - The basename (last part of the full) - has to be an integer number - (otherwise conversion to HBOOK is not possible) - @param par Path to parent node of the object, - the directory the histogram will be stored in. - @param pPar Pointer to parent node - @param rel Histogram identifier (std::string), the relative path - to the object with respect to the parent node - @param hID Histogram identifier (int) of the histogram - @param title Title property of the histogram - @param DBINS(x/y) Macro for bin definition in X/Y. Expands to: - int nx: Number of bins on the axis X/Y - double lx: Lower histogram edge on the axis X/Y - double ux: Upper histogram edge on the axis X/Y - */ - virtual P2D* bookProf( CSTR full, CSTR title, DBINS( x ), DBINS( y ), double upper, double lower ) - { - return bookProf( i_splitPath( full ), title, BINS( x ), BINS( y ), upper, lower ); - } - virtual P2D* bookProf( CSTR par, CSTR rel, CSTR title, DBINS( x ), DBINS( y ), double upper, double lower ) - { - return bookProf( createPath( par ), rel, title, BINS( x ), BINS( y ), upper, lower ); - } - virtual P2D* bookProf( STRPAIR loc, CSTR title, DBINS( x ), DBINS( y ), double upper, double lower ) - { - return bookProf( loc.first, loc.second, title, BINS( x ), BINS( y ), upper, lower ); - } - virtual P2D* bookProf( CSTR par, int hID, CSTR title, DBINS( x ), DBINS( y ), double upper, double lower ) - { - return bookProf( par, std::to_string( hID ), title, BINS( x ), BINS( y ), upper, lower ); - } - virtual P2D* bookProf( DataObject* pPar, int hID, CSTR title, DBINS( x ), DBINS( y ), double upper, double lower ) - { - return bookProf( pPar, std::to_string( hID ), title, BINS( x ), BINS( y ), upper, lower ); - } - virtual P2D* bookProf( DataObject* pPar, CSTR rel, CSTR title, DBINS( x ), DBINS( y ), double upper, double lower ) - { - return i_book( pPar, rel, title, Gaudi::createProf2D( title, BINS( x ), BINS( y ), upper, lower ) ); - } - - P2D* bookProf( CSTR full, CSTR title, DBINS( x ), DBINS( y ) ) override - { - return bookProf( i_splitPath( full ), title, BINS( x ), BINS( y ) ); - } - P2D* bookProf( CSTR par, CSTR rel, CSTR title, DBINS( x ), DBINS( y ) ) override - { - return bookProf( createPath( par ), rel, title, BINS( x ), BINS( y ) ); - } - virtual P2D* bookProf( STRPAIR loc, CSTR title, DBINS( x ), DBINS( y ) ) - { - return bookProf( loc.first, loc.second, title, BINS( x ), BINS( y ) ); - } - P2D* bookProf( CSTR par, int hID, CSTR title, DBINS( x ), DBINS( y ) ) override - { - return bookProf( par, std::to_string( hID ), title, BINS( x ), BINS( y ) ); - } - P2D* bookProf( DataObject* pPar, int hID, CSTR title, DBINS( x ), DBINS( y ) ) override - { - return bookProf( pPar, std::to_string( hID ), title, BINS( x ), BINS( y ) ); - } - P2D* bookProf( DataObject* pPar, CSTR rel, CSTR title, DBINS( x ), DBINS( y ) ) override - { - return i_book( pPar, rel, title, Gaudi::createProf2D( title, BINS( x ), BINS( y ), 0, 0 ) ); - } - // ========================================================================== - // Book 2D histogram with variable binning - // ========================================================================== - /** Book histogram and register it with the histogram data store - @param full Full path to the node of the object. - The basename (last part of the full) - has to be an integer number - (otherwise conversion to HBOOK is not possible) - @param par Path to parent node of the object, - the directory the histogram will be stored in. - @param pPar Pointer to parent node - @param rel Histogram identifier (std::string), the relative path - to the object with respect to the parent node - @param hID Histogram identifier (int) of the histogram - @param title Title property of the histogram - @param x/y Bin edges for variable binned histogram in X/Y. - */ - H2D* book( CSTR full, CSTR title, Edges x, Edges y ) override { return book( i_splitPath( full ), title, x, y ); } - H2D* book( CSTR par, CSTR rel, CSTR title, Edges x, Edges y ) override - { - return book( createPath( par ), rel, title, x, y ); - } - H2D* book( CSTR par, int hID, CSTR title, Edges x, Edges y ) override - { - return book( par, std::to_string( hID ), title, x, y ); - } - virtual H2D* book( STRPAIR loc, CSTR title, Edges x, Edges y ) { return book( loc.first, loc.second, title, x, y ); } - H2D* book( DataObject* pPar, int hID, CSTR title, Edges x, Edges y ) override - { - return book( pPar, std::to_string( hID ), title, x, y ); - } - H2D* book( DataObject* pPar, CSTR rel, CSTR title, Edges x, Edges y ) override - { - return i_book( pPar, rel, title, Gaudi::createH2D( title, x, y ) ); - } - // ========================================================================== - // Book 2D profile histogram with variable binning - // ========================================================================== - /** Book histogram and register it with the histogram data store - @param full Full path to the node of the object. - The basename (last part of the full) - has to be an integer number - (otherwise conversion to HBOOK is not possible) - @param par Path to parent node of the object, - the directory the histogram will be stored in. - @param pPar Pointer to parent node - @param rel Histogram identifier (std::string), the relative path - to the object with respect to the parent node - @param hID Histogram identifier (int) of the histogram - @param title Title property of the histogram - @param x/y Bin edges for variable binned histogram in X/Y. - */ - P2D* bookProf( CSTR full, CSTR title, Edges x, Edges y ) override - { - return bookProf( i_splitPath( full ), title, x, y ); - } - P2D* bookProf( CSTR par, CSTR rel, CSTR title, Edges x, Edges y ) override - { - return bookProf( createPath( par ), rel, title, x, y ); - } - P2D* bookProf( CSTR par, int hID, CSTR title, Edges x, Edges y ) override - { - return bookProf( par, std::to_string( hID ), title, x, y ); - } - P2D* bookProf( DataObject* pPar, int hID, CSTR title, Edges x, Edges y ) override - { - return bookProf( pPar, std::to_string( hID ), title, x, y ); - } - virtual P2D* bookProf( STRPAIR loc, CSTR title, Edges x, Edges y ) - { - return bookProf( loc.first, loc.second, title, x, y ); - } - P2D* bookProf( DataObject* pPar, CSTR rel, CSTR title, Edges x, Edges y ) override - { - return i_book( pPar, rel, title, Gaudi::createProf2D( title, x, y, 0, 0 ) ); - } - - virtual P2D* bookProf( CSTR full, CSTR title, Edges x, Edges y, double upper, double lower ) - { - return bookProf( i_splitPath( full ), title, x, y, upper, lower ); - } - virtual P2D* bookProf( CSTR par, CSTR rel, CSTR title, Edges x, Edges y, double upper, double lower ) - { - return bookProf( createPath( par ), rel, title, x, y, upper, lower ); - } - virtual P2D* bookProf( CSTR par, int hID, CSTR title, Edges x, Edges y, double upper, double lower ) - { - return bookProf( par, std::to_string( hID ), title, x, y, upper, lower ); - } - virtual P2D* bookProf( DataObject* pPar, int hID, CSTR title, Edges x, Edges y, double upper, double lower ) - { - return bookProf( pPar, std::to_string( hID ), title, x, y, upper, lower ); - } - virtual P2D* bookProf( STRPAIR loc, CSTR title, Edges x, Edges y, double upper, double lower ) - { - return bookProf( loc.first, loc.second, title, x, y, upper, lower ); - } - virtual P2D* bookProf( DataObject* pPar, CSTR rel, CSTR title, Edges x, Edges y, double upper, double lower ) - { - return i_book( pPar, rel, title, Gaudi::createProf2D( title, x, y, upper, lower ) ); - } - // ========================================================================== - // Book 3D histogram with fixed binning - // ========================================================================== - /** Book histogram and register it with the histogram data store - @param full Full path to the node of the object. - The basename (last part of the full) - has to be an integer number - (otherwise conversion to HBOOK is not possible) - @param par Path to parent node of the object, - the directory the histogram will be stored in. - @param pPar Pointer to parent node - @param rel Histogram identifier (std::string), the relative path - to the object with respect to the parent node - @param hID Histogram identifier (int) of the histogram - @param title Title property of the histogram - @param DBINS(x/y/z) Macro for bin definition in X/Y/Z. Expands to: - int nx: Number of bins on the axis X/Y/Z - double lx: Lower histogram edge on the axis X/Y/Z - double ux: Upper histogram edge on the axis X/Y/Z - */ - H3D* book( CSTR full, CSTR title, DBINS( x ), DBINS( y ), DBINS( z ) ) override - { - return book( i_splitPath( full ), title, BINS( x ), BINS( y ), BINS( z ) ); - } - H3D* book( CSTR par, CSTR rel, CSTR title, DBINS( x ), DBINS( y ), DBINS( z ) ) override - { - return book( createPath( par ), rel, title, BINS( x ), BINS( y ), BINS( z ) ); - } - H3D* book( CSTR par, int hID, CSTR title, DBINS( x ), DBINS( y ), DBINS( z ) ) override - { - return book( par, std::to_string( hID ), title, BINS( x ), BINS( y ), BINS( z ) ); - } - H3D* book( DataObject* pPar, int hID, CSTR title, DBINS( x ), DBINS( y ), DBINS( z ) ) override - { - return book( pPar, std::to_string( hID ), title, BINS( x ), BINS( y ), BINS( z ) ); - } - virtual H3D* book( STRPAIR loc, CSTR title, DBINS( x ), DBINS( y ), DBINS( z ) ) - { - return book( loc.first, loc.second, title, BINS( x ), BINS( y ), BINS( z ) ); - } - H3D* book( DataObject* pPar, CSTR rel, CSTR title, DBINS( x ), DBINS( y ), DBINS( z ) ) override - { - return i_book( pPar, rel, title, Gaudi::createH3D( title, BINS( x ), BINS( y ), BINS( z ) ) ); - } - // ========================================================================== - // Book 3D histogram with variable binning - // ========================================================================== - /** Book histogram and register it with the histogram data store - @param full Full path to the node of the object. - The basename (last part of the full) - has to be an integer number - (otherwise conversion to HBOOK is not possible) - @param par Path to parent node of the object, - the directory the histogram will be stored in. - @param pPar Pointer to parent node - @param rel Histogram identifier (std::string), the relative path - to the object with respect to the parent node - @param hID Histogram identifier (int) of the histogram - @param title Title property of the histogram - @param binsX/Y/Z Number of bins on the axis X/Y/Z - @param lowX/Y/Z Lower histogram edge on the axis X/Y/Z - @param highX/Y/Z Upper histogram edge on the axis X/Y/Z - */ - H3D* book( CSTR full, CSTR title, Edges x, Edges y, Edges z ) override - { - return book( i_splitPath( full ), title, x, y, z ); - } - H3D* book( CSTR par, CSTR rel, CSTR title, Edges x, Edges y, Edges z ) override - { - return book( createPath( par ), rel, title, x, y, z ); - } - H3D* book( CSTR par, int hID, CSTR title, Edges x, Edges y, Edges z ) override - { - return book( par, std::to_string( hID ), title, x, y, z ); - } - H3D* book( DataObject* pPar, int hID, CSTR title, Edges x, Edges y, Edges z ) override - { - return book( pPar, std::to_string( hID ), title, x, y, z ); - } - virtual H3D* book( STRPAIR loc, CSTR title, Edges x, Edges y, Edges z ) - { - return book( loc.first, loc.second, title, x, y, z ); - } - H3D* book( DataObject* pPar, CSTR rel, CSTR title, Edges x, Edges y, Edges z ) override - { - return i_book( pPar, rel, title, Gaudi::createH3D( title, x, y, z ) ); - } - - // ========================================================================== - // Register histogram with the data store - // ========================================================================== - //------------------------------------------------------------------------------ - // Register object with the data store - //------------------------------------------------------------------------------ - StatusCode registerObject( CSTR parent, CSTR rel, Base* obj ) override - { - return registerObject( createPath( parent ), rel, obj ); - } - StatusCode registerObject( CSTR parent, int item, Base* obj ) override - { - return registerObject( parent, std::to_string( item ), obj ); - } - StatusCode registerObject( Base* pPar, CSTR rel, Base* obj ) override - { - return registerObject( __cast( pPar ), rel, obj ); - } - StatusCode registerObject( DataObject* pPar, int item, Base* obj ) override - { - return registerObject( pPar, std::to_string( item ), obj ); - } - StatusCode registerObject( Base* pPar, int item, Base* obj ) override - { - return registerObject( __cast( pPar ), item, obj ); - } - StatusCode registerObject( CSTR full, Base* obj ) override; - StatusCode registerObject( DataObject* pPar, CSTR rel, Base* obj ) override; - // ========================================================================== - // Unregister histogram from the data store - // ========================================================================== - StatusCode unregisterObject( Base* obj ) override { return DataSvc::unregisterObject( __cast( obj ) ); } - StatusCode unregisterObject( Base* obj, CSTR objectPath ) override - { - return DataSvc::unregisterObject( __cast( obj ), objectPath ); - } - StatusCode unregisterObject( Base* obj, int item ) override - { - return DataSvc::unregisterObject( __cast( obj ), item ); - } - // ========================================================================== - // Retrieve histogram from data store - // ========================================================================== - StatusCode retrieveObject( IRegistry* pReg, CSTR path, H1D*& obj ) override - { - return Helper( this ).retrieve( pReg, path, obj ); - } - StatusCode retrieveObject( IRegistry* pReg, CSTR path, P1D*& obj ) override - { - return Helper( this ).retrieve( pReg, path, obj ); - } - StatusCode retrieveObject( IRegistry* pReg, CSTR path, H2D*& obj ) override - { - return Helper( this ).retrieve( pReg, path, obj ); - } - StatusCode retrieveObject( IRegistry* pReg, CSTR path, P2D*& obj ) override - { - return Helper( this ).retrieve( pReg, path, obj ); - } - StatusCode retrieveObject( IRegistry* pReg, CSTR path, H3D*& obj ) override - { - return Helper( this ).retrieve( pReg, path, obj ); - } - //------------------------------------------------------------------------------ - StatusCode retrieveObject( CSTR full, P1D*& obj ) override { return Helper( this ).retrieve( full, obj ); } - StatusCode retrieveObject( CSTR full, P2D*& obj ) override { return Helper( this ).retrieve( full, obj ); } - StatusCode retrieveObject( CSTR full, H1D*& obj ) override { return Helper( this ).retrieve( full, obj ); } - StatusCode retrieveObject( CSTR full, H2D*& obj ) override { return Helper( this ).retrieve( full, obj ); } - StatusCode retrieveObject( CSTR full, H3D*& obj ) override { return Helper( this ).retrieve( full, obj ); } - //------------------------------------------------------------------------------ - StatusCode retrieveObject( CSTR parent, CSTR rel, P1D*& obj ) override - { - return Helper( this ).retrieve( parent, rel, obj ); - } - StatusCode retrieveObject( CSTR parent, CSTR rel, P2D*& obj ) override - { - return Helper( this ).retrieve( parent, rel, obj ); - } - StatusCode retrieveObject( CSTR parent, CSTR rel, H1D*& obj ) override - { - return Helper( this ).retrieve( parent, rel, obj ); - } - StatusCode retrieveObject( CSTR parent, CSTR rel, H2D*& obj ) override - { - return Helper( this ).retrieve( parent, rel, obj ); - } - StatusCode retrieveObject( CSTR parent, CSTR rel, H3D*& obj ) override - { - return Helper( this ).retrieve( parent, rel, obj ); - } - //------------------------------------------------------------------------------ - StatusCode retrieveObject( CSTR parent, int item, P1D*& obj ) override - { - return Helper( this ).retrieve( parent, item, obj ); - } - StatusCode retrieveObject( CSTR parent, int item, P2D*& obj ) override - { - return Helper( this ).retrieve( parent, item, obj ); - } - StatusCode retrieveObject( CSTR parent, int item, H1D*& obj ) override - { - return Helper( this ).retrieve( parent, item, obj ); - } - StatusCode retrieveObject( CSTR parent, int item, H2D*& obj ) override - { - return Helper( this ).retrieve( parent, item, obj ); - } - StatusCode retrieveObject( CSTR parent, int item, H3D*& obj ) override - { - return Helper( this ).retrieve( parent, item, obj ); - } - //------------------------------------------------------------------------------ - StatusCode retrieveObject( DataObject* par, CSTR item, P1D*& obj ) override - { - return Helper( this ).retrieve( par, item, obj ); - } - StatusCode retrieveObject( DataObject* par, CSTR item, P2D*& obj ) override - { - return Helper( this ).retrieve( par, item, obj ); - } - StatusCode retrieveObject( DataObject* par, CSTR item, H1D*& obj ) override - { - return Helper( this ).retrieve( par, item, obj ); - } - StatusCode retrieveObject( DataObject* par, CSTR item, H2D*& obj ) override - { - return Helper( this ).retrieve( par, item, obj ); - } - StatusCode retrieveObject( DataObject* par, CSTR item, H3D*& obj ) override - { - return Helper( this ).retrieve( par, item, obj ); - } - //------------------------------------------------------------------------------ - StatusCode retrieveObject( DataObject* par, int item, P1D*& obj ) override - { - return Helper( this ).retrieve( par, item, obj ); - } - StatusCode retrieveObject( DataObject* par, int item, P2D*& obj ) override - { - return Helper( this ).retrieve( par, item, obj ); - } - StatusCode retrieveObject( DataObject* par, int item, H1D*& obj ) override - { - return Helper( this ).retrieve( par, item, obj ); - } - StatusCode retrieveObject( DataObject* par, int item, H2D*& obj ) override - { - return Helper( this ).retrieve( par, item, obj ); - } - StatusCode retrieveObject( DataObject* par, int item, H3D*& obj ) override - { - return Helper( this ).retrieve( par, item, obj ); - } - //------------------------------------------------------------------------------ - StatusCode retrieveObject( Base* par, int item, P1D*& obj ) override - { - return Helper( this ).retrieve( __cast( par ), item, obj ); - } - StatusCode retrieveObject( Base* par, int item, P2D*& obj ) override - { - return Helper( this ).retrieve( __cast( par ), item, obj ); - } - StatusCode retrieveObject( Base* par, int item, H1D*& obj ) override - { - return Helper( this ).retrieve( __cast( par ), item, obj ); - } - StatusCode retrieveObject( Base* par, int item, H2D*& obj ) override - { - return Helper( this ).retrieve( __cast( par ), item, obj ); - } - StatusCode retrieveObject( Base* par, int item, H3D*& obj ) override - { - return Helper( this ).retrieve( __cast( par ), item, obj ); - } - //------------------------------------------------------------------------------ - StatusCode retrieveObject( Base* par, CSTR item, P1D*& obj ) override - { - return Helper( this ).retrieve( __cast( par ), item, obj ); - } - StatusCode retrieveObject( Base* par, CSTR item, P2D*& obj ) override - { - return Helper( this ).retrieve( __cast( par ), item, obj ); - } - StatusCode retrieveObject( Base* par, CSTR item, H1D*& obj ) override - { - return Helper( this ).retrieve( __cast( par ), item, obj ); - } - StatusCode retrieveObject( Base* par, CSTR item, H2D*& obj ) override - { - return Helper( this ).retrieve( __cast( par ), item, obj ); - } - StatusCode retrieveObject( Base* par, CSTR item, H3D*& obj ) override - { - return Helper( this ).retrieve( __cast( par ), item, obj ); - } - - // ========================================================================== - // Find histogram identified by its full path in the data store - // ========================================================================== - - //------------------------------------------------------------------------------ - // Find object identified by its full path in the data store - //------------------------------------------------------------------------------ - StatusCode findObject( IRegistry* pReg, CSTR path, P1D*& obj ) override - { - return Helper( this ).find( pReg, path, obj ); - } - StatusCode findObject( IRegistry* pReg, CSTR path, P2D*& obj ) override - { - return Helper( this ).find( pReg, path, obj ); - } - StatusCode findObject( IRegistry* pReg, CSTR path, H1D*& obj ) override - { - return Helper( this ).find( pReg, path, obj ); - } - StatusCode findObject( IRegistry* pReg, CSTR path, H2D*& obj ) override - { - return Helper( this ).find( pReg, path, obj ); - } - StatusCode findObject( IRegistry* pReg, CSTR path, H3D*& obj ) override - { - return Helper( this ).find( pReg, path, obj ); - } - //------------------------------------------------------------------------------ - StatusCode findObject( CSTR full, P1D*& obj ) override { return Helper( this ).find( full, obj ); } - StatusCode findObject( CSTR full, P2D*& obj ) override { return Helper( this ).find( full, obj ); } - StatusCode findObject( CSTR full, H1D*& obj ) override { return Helper( this ).find( full, obj ); } - StatusCode findObject( CSTR full, H2D*& obj ) override { return Helper( this ).find( full, obj ); } - StatusCode findObject( CSTR full, H3D*& obj ) override { return Helper( this ).find( full, obj ); } - //------------------------------------------------------------------------------ - StatusCode findObject( CSTR par, CSTR rel, P1D*& obj ) override { return Helper( this ).find( par, rel, obj ); } - StatusCode findObject( CSTR par, CSTR rel, P2D*& obj ) override { return Helper( this ).find( par, rel, obj ); } - StatusCode findObject( CSTR par, CSTR rel, H1D*& obj ) override { return Helper( this ).find( par, rel, obj ); } - StatusCode findObject( CSTR par, CSTR rel, H2D*& obj ) override { return Helper( this ).find( par, rel, obj ); } - StatusCode findObject( CSTR par, CSTR rel, H3D*& obj ) override { return Helper( this ).find( par, rel, obj ); } - //------------------------------------------------------------------------------ - StatusCode findObject( CSTR par, int item, P1D*& obj ) override { return Helper( this ).find( par, item, obj ); } - StatusCode findObject( CSTR par, int item, P2D*& obj ) override { return Helper( this ).find( par, item, obj ); } - StatusCode findObject( CSTR par, int item, H1D*& obj ) override { return Helper( this ).find( par, item, obj ); } - StatusCode findObject( CSTR par, int item, H2D*& obj ) override { return Helper( this ).find( par, item, obj ); } - StatusCode findObject( CSTR par, int item, H3D*& obj ) override { return Helper( this ).find( par, item, obj ); } - //------------------------------------------------------------------------------ - StatusCode findObject( DataObject* par, int item, P1D*& obj ) override - { - return Helper( this ).find( par, item, obj ); - } - StatusCode findObject( DataObject* par, int item, P2D*& obj ) override - { - return Helper( this ).find( par, item, obj ); - } - StatusCode findObject( DataObject* par, int item, H1D*& obj ) override - { - return Helper( this ).find( par, item, obj ); - } - StatusCode findObject( DataObject* par, int item, H2D*& obj ) override - { - return Helper( this ).find( par, item, obj ); - } - StatusCode findObject( DataObject* par, int item, H3D*& obj ) override - { - return Helper( this ).find( par, item, obj ); - } - //------------------------------------------------------------------------------ - StatusCode findObject( DataObject* par, CSTR item, P1D*& obj ) override - { - return Helper( this ).find( par, item, obj ); - } - StatusCode findObject( DataObject* par, CSTR item, P2D*& obj ) override - { - return Helper( this ).find( par, item, obj ); - } - StatusCode findObject( DataObject* par, CSTR item, H1D*& obj ) override - { - return Helper( this ).find( par, item, obj ); - } - StatusCode findObject( DataObject* par, CSTR item, H2D*& obj ) override - { - return Helper( this ).find( par, item, obj ); - } - StatusCode findObject( DataObject* par, CSTR item, H3D*& obj ) override - { - return Helper( this ).find( par, item, obj ); - } - //------------------------------------------------------------------------------ - StatusCode findObject( Base* par, int item, P1D*& obj ) override - { - return Helper( this ).find( __cast( par ), item, obj ); - } - StatusCode findObject( Base* par, int item, P2D*& obj ) override - { - return Helper( this ).find( __cast( par ), item, obj ); - } - StatusCode findObject( Base* par, int item, H1D*& obj ) override - { - return Helper( this ).find( __cast( par ), item, obj ); - } - StatusCode findObject( Base* par, int item, H2D*& obj ) override - { - return Helper( this ).find( __cast( par ), item, obj ); - } - StatusCode findObject( Base* par, int item, H3D*& obj ) override - { - return Helper( this ).find( __cast( par ), item, obj ); - } - //------------------------------------------------------------------------------ - StatusCode findObject( Base* par, CSTR item, P1D*& obj ) override - { - return Helper( this ).find( __cast( par ), item, obj ); - } - StatusCode findObject( Base* par, CSTR item, P2D*& obj ) override - { - return Helper( this ).find( __cast( par ), item, obj ); - } - StatusCode findObject( Base* par, CSTR item, H1D*& obj ) override - { - return Helper( this ).find( __cast( par ), item, obj ); - } - StatusCode findObject( Base* par, CSTR item, H2D*& obj ) override - { - return Helper( this ).find( __cast( par ), item, obj ); - } - StatusCode findObject( Base* par, CSTR item, H3D*& obj ) override - { - return Helper( this ).find( __cast( par ), item, obj ); - } - - // ========================================================================== - // Projections and slices. - // ========================================================================== - H1D* projectionX( CSTR name, const H2D& h ) override - { - return sliceX( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN ); - } - H1D* projectionY( CSTR name, const H2D& h ) override - { - return sliceY( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN ); - } - H1D* sliceX( CSTR name, const H2D& h, int indexY ) override { return sliceX( name, h, indexY, indexY ); } - H1D* sliceY( CSTR name, const H2D& h, int indexX ) override { return sliceY( name, h, indexX, indexX ); } - H1D* sliceX( CSTR name, const H2D& h, int indexY1, int indexY2 ) override; - H1D* sliceY( CSTR name, const H2D& h, int indexX1, int indexX2 ) override; - //------------------------------------------------------------------------------ - bool destroy( IBaseHistogram* hist ) override; - - H1D* add( CSTR nameAndTitle, const H1D& a, const H1D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Add, 1. ); - } - H1D* subtract( CSTR nameAndTitle, const H1D& a, const H1D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Add, -1. ); - } - H1D* multiply( CSTR nameAndTitle, const H1D& a, const H1D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Multiply ); - } - H1D* divide( CSTR nameAndTitle, const H1D& a, const H1D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Divide ); - } - - H2D* add( CSTR nameAndTitle, const H2D& a, const H2D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Add, 1. ); - } - H2D* subtract( CSTR nameAndTitle, const H2D& a, const H2D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Add, -1. ); - } - H2D* multiply( CSTR nameAndTitle, const H2D& a, const H2D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Multiply ); - } - H2D* divide( CSTR nameAndTitle, const H2D& a, const H2D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Divide ); - } - - H3D* add( CSTR nameAndTitle, const H3D& a, const H3D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Add, 1. ); - } - H3D* subtract( CSTR nameAndTitle, const H3D& a, const H3D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Add, -1. ); - } - H3D* multiply( CSTR nameAndTitle, const H3D& a, const H3D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Multiply ); - } - H3D* divide( CSTR nameAndTitle, const H3D& a, const H3D& b ) override - { - return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Divide ); - } - - H2D* projectionXY( CSTR nameAndTitle, const H3D& h ) override { return i_project( nameAndTitle, h, "xy" ); } - H2D* projectionXZ( CSTR nameAndTitle, const H3D& h ) override { return i_project( nameAndTitle, h, "xz" ); } - H2D* projectionYZ( CSTR nameAndTitle, const H3D& h ) override { return i_project( nameAndTitle, h, "yz" ); } - H2D* sliceXY( CSTR /* nameAndTitle */, const H3D& /* h */, int /* low */, - int /* high */ ) override NOT_IMPLEMENTED H2D* sliceXZ( CSTR /* nameAndTitle */, const H3D& /* h */, - int /* low */, int /* high */ ) override - NOT_IMPLEMENTED H2D* sliceYZ( CSTR /* nameAndTitle */, const H3D& /* h */, int /* low */, - int /* high */ ) override NOT_IMPLEMENTED - - //------------------------------------------------------------------------------ - H1D* createHistogram1D( CSTR name, CSTR tit, DBINS( x ) ) - { - return book( name, tit, BINS( x ) ); - } - H1D* createHistogram1D( CSTR name, CSTR tit, DBINS( x ), CSTR /*opt*/ ) override - { - return book( name, tit, BINS( x ) ); - } - H1D* createHistogram1D( CSTR name, CSTR title, const Edges& x, CSTR /*opt*/ ) override - { - return book( name, title, x ); - } - H1D* createHistogram1D( CSTR nameAndTitle, DBINS( x ) ) override - { - return book( nameAndTitle, nameAndTitle, BINS( x ) ); - } - H1D* createCopy( CSTR full, const H1D& h ) override { return createCopy( i_splitPath( full ), h ); } - H1D* createCopy( CSTR par, CSTR rel, const H1D& h ) { return createCopy( createPath( par ), rel, h ); } - H1D* createCopy( STRPAIR loc, const H1D& h ) { return createCopy( loc.first, loc.second, h ); } - H1D* createCopy( DataObject* pPar, CSTR rel, const H1D& h ) - { - return i_book( pPar, rel, h.title(), Gaudi::createH1D( h ) ); - } - //------------------------------------------------------------------------------ - H2D* createHistogram2D( CSTR name, CSTR tit, DBINS( x ), DBINS( y ) ) - { - return book( name, tit, BINS( x ), BINS( y ) ); - } - H2D* createHistogram2D( CSTR name, CSTR tit, DBINS( x ), DBINS( y ), CSTR /*opt*/ ) override - { - return book( name, tit, BINS( x ), BINS( y ) ); - } - H2D* createHistogram2D( CSTR name, CSTR title, const Edges& x, const Edges& y, CSTR /*opt*/ ) override - { - return book( name, title, x, y ); - } - H2D* createHistogram2D( CSTR nameAndTitle, DBINS( x ), DBINS( y ) ) override - { - return book( nameAndTitle, nameAndTitle, BINS( x ), BINS( y ) ); - } - H2D* createCopy( CSTR full, const H2D& h ) override { return createCopy( i_splitPath( full ), h ); } - H2D* createCopy( CSTR par, CSTR rel, const H2D& h ) { return createCopy( createPath( par ), rel, h ); } - H2D* createCopy( STRPAIR loc, const H2D& h ) { return createCopy( loc.first, loc.second, h ); } - H2D* createCopy( DataObject* pPar, CSTR rel, const H2D& h ) - { - return i_book( pPar, rel, h.title(), Gaudi::createH2D( h ) ); - } - //------------------------------------------------------------------------------ - H3D* createHistogram3D( CSTR name, CSTR tit, DBINS( x ), DBINS( y ), DBINS( z ) ) - { - return book( name, tit, BINS( x ), BINS( y ), BINS( z ) ); - } - H3D* createHistogram3D( CSTR name, CSTR tit, DBINS( x ), DBINS( y ), DBINS( z ), CSTR /*opt*/ ) override - { - return book( name, tit, BINS( x ), BINS( y ), BINS( z ) ); - } - H3D* createHistogram3D( CSTR name, CSTR title, const Edges& x, const Edges& y, const Edges& z, CSTR /*opt*/ ) override - { - return book( name, title, x, y, z ); - } - H3D* createHistogram3D( CSTR nameAndTitle, DBINS( x ), DBINS( y ), DBINS( z ) ) override - { - return book( nameAndTitle, nameAndTitle, BINS( x ), BINS( y ), BINS( z ) ); - } - H3D* createCopy( CSTR full, const H3D& h ) override { return createCopy( i_splitPath( full ), h ); } - H3D* createCopy( CSTR par, CSTR rel, const H3D& h ) { return createCopy( createPath( par ), rel, h ); } - H3D* createCopy( STRPAIR loc, const H3D& h ) { return createCopy( loc.first, loc.second, h ); } - H3D* createCopy( DataObject* pPar, CSTR rel, const H3D& h ) - { - return i_book( pPar, rel, h.title(), Gaudi::createH3D( h ) ); - } - //------------------------------------------------------------------------------ - - P1D* createProfile1D( CSTR name, CSTR tit, DBINS( x ), CSTR opt ) override - { - return bookProf( name, tit, BINS( x ), opt ); - } - P1D* createProfile1D( CSTR name, CSTR tit, DBINS( x ), double upper, double lower, CSTR opt ) override - { - return bookProf( name, tit, BINS( x ), upper, lower, opt ); - } - P1D* createProfile1D( CSTR name, CSTR title, const Edges& x, CSTR /* opt */ ) override - { - return bookProf( name, title, x ); - } - P1D* createProfile1D( CSTR name, CSTR title, const Edges& x, double upper, double lower, CSTR /* opt */ ) override - { - return bookProf( name, title, x, upper, lower ); - } - - P1D* createProfile1D( CSTR nametit, DBINS( x ) ) override { return bookProf( nametit, nametit, BINS( x ), "s" ); } - P1D* createProfile1D( CSTR nametit, DBINS( x ), double upper, double lower ) override - { - return bookProf( nametit, nametit, BINS( x ), upper, lower, "s" ); - } - - P1D* createCopy( CSTR full, const P1D& h ) override { return createCopy( i_splitPath( full ), h ); } - P1D* createCopy( CSTR par, CSTR rel, const P1D& h ) { return createCopy( createPath( par ), rel, h ); } - P1D* createCopy( STRPAIR loc, const P1D& h ) { return createCopy( loc.first, loc.second, h ); } - P1D* createCopy( DataObject* pPar, CSTR rel, const P1D& h ) - { - return i_book( pPar, rel, h.title(), Gaudi::createProf1D( h ) ); - } - //------------------------------------------------------------------------------ - P2D* createProfile2D( CSTR name, CSTR tit, DBINS( x ), DBINS( y ) ) - { - return bookProf( name, tit, BINS( x ), BINS( y ) ); - } - P2D* createProfile2D( CSTR name, CSTR tit, DBINS( x ), DBINS( y ), CSTR /*opt*/ ) override - { - return bookProf( name, tit, BINS( x ), BINS( y ) ); - } - P2D* createProfile2D( CSTR name, CSTR title, const Edges& x, const Edges& y, CSTR /*opt*/ ) override - { - return bookProf( name, title, x, y ); - } - P2D* createProfile2D( CSTR nameAndTitle, DBINS( x ), DBINS( y ) ) override - { - return bookProf( nameAndTitle, nameAndTitle, BINS( x ), BINS( y ) ); - } - - P2D* createProfile2D( CSTR name, CSTR tit, DBINS( x ), DBINS( y ), double upper, double lower ) - { - return bookProf( name, tit, BINS( x ), BINS( y ), upper, lower ); - } - P2D* createProfile2D( CSTR name, CSTR tit, DBINS( x ), DBINS( y ), double upper, double lower, CSTR /*opt*/ ) override - { - return bookProf( name, tit, BINS( x ), BINS( y ), upper, lower ); - } - P2D* createProfile2D( CSTR name, CSTR title, const Edges& x, const Edges& y, double upper, double lower, - CSTR /*opt*/ ) override - { - return bookProf( name, title, x, y, upper, lower ); - } - P2D* createProfile2D( CSTR nameAndTitle, DBINS( x ), DBINS( y ), double upper, double lower ) override - { - return bookProf( nameAndTitle, nameAndTitle, BINS( x ), BINS( y ), upper, lower ); - } - - P2D* createCopy( CSTR full, const P2D& h ) override { return createCopy( i_splitPath( full ), h ); } - P2D* createCopy( CSTR par, CSTR rel, const P2D& h ) { return createCopy( createPath( par ), rel, h ); } - P2D* createCopy( STRPAIR loc, const P2D& h ) { return createCopy( loc.first, loc.second, h ); } - P2D* createCopy( DataObject* pPar, CSTR rel, const P2D& h ) - { - return i_book( pPar, rel, h.title(), Gaudi::createProf2D( h ) ); - } - //------------------------------------------------------------------------------ - AIDA::ICloud1D* createCloud1D( CSTR, CSTR, int, CSTR ) override NOT_IMPLEMENTED AIDA::ICloud1D* createCloud1D( - CSTR ) override NOT_IMPLEMENTED AIDA::ICloud1D* createCopy( CSTR, const AIDA::ICloud1D& ) override - NOT_IMPLEMENTED AIDA::ICloud2D* createCloud2D( CSTR, CSTR, int, CSTR ) override - NOT_IMPLEMENTED AIDA::ICloud2D* createCloud2D( CSTR ) override NOT_IMPLEMENTED AIDA::ICloud2D* createCopy( - CSTR, const AIDA::ICloud2D& ) override NOT_IMPLEMENTED AIDA::ICloud3D* createCloud3D( CSTR, CSTR, int, CSTR ) - override NOT_IMPLEMENTED AIDA::ICloud3D* createCloud3D( CSTR ) override - NOT_IMPLEMENTED AIDA::ICloud3D* createCopy( CSTR, const AIDA::ICloud3D& ) override NOT_IMPLEMENTED - - /// Avoids a compiler warning about hidden functions. - using IDataProviderSvc::registerObject; - using IDataProviderSvc::unregisterObject; - using IDataProviderSvc::retrieveObject; - using IDataProviderSvc::findObject; - - /// Print (ASCII) the 1D histogram into the output stream - std::ostream& print( Base* h, std::ostream& s = std::cout ) const override; - - /// Write (ASCII) the 1D histogram table into the output stream - std::ostream& write( Base* h, std::ostream& s = std::cout ) const override; - - /// Write (ASCII) the 1D histogram table into a file - int write( Base* h, const char* file_name ) const override; - - /// Create all directories in a given full path - DataObject* createPath( CSTR newPath ) override; - - /** Create a sub-directory in a directory. - * @param parentDir name of the parent directory - * @param subDir to identify the histogram object in the store - */ - DataObject* createDirectory( CSTR parentDir, CSTR subDir ) override; - -public: - // ========================================================================== - /// handler to be invoked for updating property m_defs1D - void update1Ddefs( Gaudi::Details::PropertyBase& ); - // ========================================================================== - typedef std::map Histo1DMap; - // ========================================================================== -private: - Gaudi::Property m_input{this, "Input", {}, "input streams"}; - Gaudi::Property m_defs1D{this, "Predefined1DHistos", {}, "histograms with predefined parameters"}; - - // ========================================================================== - // modified histograms: - std::set m_mods1D; - // ========================================================================== -}; -// =========================================================================== -// The END -// =========================================================================== -#endif // GAUDISVC_HISTOGRAMSVC_H -// =========================================================================== diff --git a/GaudiCommonSvc/src/HistogramSvc/P1D.cpp b/GaudiCommonSvc/src/HistogramSvc/P1D.cpp index 1873435fbd1b0dfc47283c0043c3d77d1c3ae5af..74cb157761ea24591ce1e079ba5e12c9827331eb 100644 --- a/GaudiCommonSvc/src/HistogramSvc/P1D.cpp +++ b/GaudiCommonSvc/src/HistogramSvc/P1D.cpp @@ -11,8 +11,10 @@ #endif #include -#include "P1D.h" -#include "GaudiKernel/ObjectFactory.h" +#include +#include +#include +#include "GaudiPI.h" std::pair Gaudi::createProf1D ( const std::string& title , @@ -67,13 +69,13 @@ namespace Gaudi { } } -Gaudi::Profile1D::Profile1D() +Gaudi::Profile1D::Profile1D() : Base( new TProfile() ) { init("",false); } -Gaudi::Profile1D::Profile1D(TProfile* rep) +Gaudi::Profile1D::Profile1D(TProfile* rep) : Base( rep) { init(m_rep->GetTitle()); @@ -113,6 +115,3 @@ bool Gaudi::Profile1D::fill ( double x, double y, double weight ) { (weight == 1.) ? m_rep->Fill(x,y) : m_rep->Fill(x,y,weight); return true; } - -typedef Gaudi::Profile1D P1D; -DECLARE_DATAOBJECT_FACTORY(P1D) diff --git a/GaudiCommonSvc/src/HistogramSvc/P2D.cpp b/GaudiCommonSvc/src/HistogramSvc/P2D.cpp index 3bda3ac38ce73bc57fda830e8acb229ef9394a62..47b9feeef6fc195f428d9e8ba792c69241c63b9b 100644 --- a/GaudiCommonSvc/src/HistogramSvc/P2D.cpp +++ b/GaudiCommonSvc/src/HistogramSvc/P2D.cpp @@ -9,44 +9,13 @@ // coming from TString.h #pragma warning(disable:4996) #endif -#include "GaudiKernel/DataObject.h" -#include "GaudiKernel/ObjectFactory.h" +#include +#include +#include +#include +#include +#include #include "GaudiPI.h" -#include "Generic2D.h" -#include "TProfile2D.h" -#include "TH2D.h" - -namespace Gaudi { - - /**@class Profile2D - * - * AIDA implementation for 2 D profiles using ROOT TProfile2D - * - * @author M.Frank - */ - class GAUDI_API Profile2D : public DataObject, public Generic2D { - public: - /// Default Constructor - Profile2D() : Base( new TProfile2D() ) - { - m_classType = "IProfile2D"; - m_rep->SetErrorOption("s"); - m_rep->SetDirectory(nullptr); - } - /// Default Constructor with representation object - Profile2D(TProfile2D* rep); - /// Destructor. - ~Profile2D() override = default; - /// Fill bin content - bool fill(double x,double y,double z,double weight) override { - m_rep->Fill(x,y,z,weight); - return true; - } - /// Retrieve reference to class defininition identifier - const CLID& clID() const override { return classID(); } - static const CLID& classID() { return CLID_ProfileH2; } - }; -} namespace Gaudi { template <> @@ -101,6 +70,3 @@ Gaudi::Profile2D::Profile2D(TProfile2D* rep) { adoptRepresentation(rep); m_sumEntries = 0; } - -typedef Gaudi::Profile2D P2D; -DECLARE_DATAOBJECT_FACTORY(P2D)