2 #ifndef GAUDISVC_HISTOGRAMSVC_H 3 #define GAUDISVC_HISTOGRAMSVC_H 1 19 #include "AIDA/IAnnotation.h" 20 #include "AIDA/IHistogramFactory.h" 40 if ( !q && p ) {
throw std::runtime_error(
"HistogramSvc: Unexpected object type." ); }
57 typedef AIDA::IHistogram3D
H3D;
58 typedef AIDA::IProfile2D
P2D;
59 typedef AIDA::IBaseHistogram
Base;
64 template <
class A1,
class A3>
68 a3 =
dynamic_cast<A3*
>( pObject );
71 template <
class A1,
class A2,
class A3>
75 a3 =
dynamic_cast<A3*
>( pObject );
78 template <
class A1,
class A3>
82 a3 =
dynamic_cast<A3*
>( pObject );
85 template <
class A1,
class A2,
class A3>
89 a3 =
dynamic_cast<A3*
>( pObject );
92 template <
class R,
class S,
class T1,
class T2>
93 static R*
act( R* res,
const S& b,
void ( T1::*pmf )(
const T2*, Double_t ), Double_t scale ) {
94 auto h1 = Gaudi::getRepresentation<R, T1>( *res );
95 const auto h2 = Gaudi::getRepresentation<R, T2>( b );
97 ( h1->*pmf )( h2, scale );
102 template <
class R,
class S,
class T1,
class T2>
103 static R*
act( R* res,
const S& b, Bool_t ( T1::*pmf )(
const T2*, Double_t ), Double_t scale ) {
104 auto h1 = Gaudi::getRepresentation<R, T1>( *res );
105 const auto h2 = Gaudi::getRepresentation<R, T2>( b );
107 ( h1->*pmf )( h2, scale );
112 template <
class R,
class S,
class T1,
class T2>
113 static R*
act( R* res,
const S& b,
void ( T1::*pmf )(
const T2* ) ) {
114 auto h1 = Gaudi::getRepresentation<R, T1>( *res );
115 const auto h2 = Gaudi::getRepresentation<R, T2>( b );
122 template <
class R,
class S,
class T1,
class T2>
123 static R*
act( R* res,
const S& b, Bool_t ( T1::*pmf )(
const T2* ) ) {
124 auto h1 = Gaudi::getRepresentation<R, T1>( *res );
125 const auto h2 = Gaudi::getRepresentation<R, T2>( b );
162 if ( o.first && registerObject( pPar, rel, (Base*)o.second ).isSuccess() )
return o.second;
169 AIDA::IHistogram2D* i_project(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& h,
const std::string& dir );
202 double lowx,
double upx )
override;
205 double upx )
override;
208 double upx )
override;
211 double upx )
override;
214 double lowx,
double upx );
217 double upx )
override;
239 double lowx,
double upx,
const std::string& opt )
override;
257 double lowx,
double upx,
double upper,
double lower,
const std::string& opt )
override;
260 double upx,
double upper,
double lower,
const std::string& opt )
override;
263 double upper,
double lower,
const std::string& opt )
override;
266 double lowx,
double upx,
double upper,
double lower,
const std::string& opt );
269 double upper,
double lower,
const std::string& opt )
override;
272 double upx,
double upper,
double lower,
const std::string& opt )
override;
339 double upper,
double lower );
348 double upper,
double lower );
351 double upper,
double lower );
376 double lowy,
double upy )
override;
379 double lowx,
double upx,
int ny,
double lowy,
double upy )
override;
382 int ny,
double lowy,
double upy )
override;
385 double lowx,
double upx,
int ny,
double lowy,
double upy );
388 int ny,
double lowy,
double upy )
override;
391 double upx,
int ny,
double lowy,
double upy )
override;
416 double upx,
int ny,
double lowy,
double upy,
double upper,
double lower );
419 double lowx,
double upx,
int ny,
double lowy,
double upy,
double upper,
423 double lowx,
double upx,
int ny,
double lowy,
double upy,
double upper,
427 double upx,
int ny,
double lowy,
double upy,
double upper,
double lower );
430 double upx,
int ny,
double lowy,
double upy,
double upper,
double lower );
433 double lowx,
double upx,
int ny,
double lowy,
double upy,
double upper,
437 int ny,
double lowy,
double upy )
override;
440 double lowx,
double upx,
int ny,
double lowy,
double upy )
override;
443 double lowx,
double upx,
int ny,
double lowy,
double upy );
446 double upx,
int ny,
double lowy,
double upy )
override;
449 int ny,
double lowy,
double upy )
override;
452 double upx,
int ny,
double lowy,
double upy )
override;
522 Edges y,
double upper,
double lower );
525 double upper,
double lower );
528 double upper,
double lower );
531 Edges y,
double upper,
double lower );
534 Edges y,
double upper,
double lower );
556 double lowy,
double upy,
int nz,
double lowz,
double upz )
override;
559 double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
560 double upz )
override;
563 int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz )
override;
566 int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz )
override;
569 double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
573 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz )
override;
625 StatusCode unregisterObject( Base* obj )
override;
629 StatusCode unregisterObject( Base* obj,
int item )
override;
694 StatusCode retrieveObject( Base* par,
int item, AIDA::IProfile1D*& obj )
override;
696 StatusCode retrieveObject( Base* par,
int item, AIDA::IProfile2D*& obj )
override;
698 StatusCode retrieveObject( Base* par,
int item, AIDA::IHistogram1D*& obj )
override;
700 StatusCode retrieveObject( Base* par,
int item, AIDA::IHistogram2D*& obj )
override;
702 StatusCode retrieveObject( Base* par,
int item, AIDA::IHistogram3D*& obj )
override;
777 StatusCode findObject( Base* par,
int item, AIDA::IProfile1D*& obj )
override;
779 StatusCode findObject( Base* par,
int item, AIDA::IProfile2D*& obj )
override;
781 StatusCode findObject( Base* par,
int item, AIDA::IHistogram1D*& obj )
override;
783 StatusCode findObject( Base* par,
int item, AIDA::IHistogram2D*& obj )
override;
785 StatusCode findObject( Base* par,
int item, AIDA::IHistogram3D*& obj )
override;
800 AIDA::IHistogram1D* projectionX(
const std::string&
name,
const AIDA::IHistogram2D& h )
override;
802 AIDA::IHistogram1D* projectionY(
const std::string& name,
const AIDA::IHistogram2D& h )
override;
804 AIDA::IHistogram1D* sliceX(
const std::string& name,
const AIDA::IHistogram2D& h,
int indexY )
override;
806 AIDA::IHistogram1D* sliceY(
const std::string& name,
const AIDA::IHistogram2D& h,
int indexX )
override;
808 AIDA::IHistogram1D* sliceX(
const std::string& name,
const AIDA::IHistogram2D& h,
int indexY1,
int indexY2 )
override;
810 AIDA::IHistogram1D* sliceY(
const std::string& name,
const AIDA::IHistogram2D& h,
int indexX1,
int indexX2 )
override;
812 bool destroy( IBaseHistogram* hist )
override;
814 AIDA::IHistogram1D*
add(
const std::string& nameAndTitle,
const AIDA::IHistogram1D& a,
815 const AIDA::IHistogram1D& b )
override;
817 AIDA::IHistogram1D* subtract(
const std::string& nameAndTitle,
const AIDA::IHistogram1D& a,
818 const AIDA::IHistogram1D& b )
override;
820 AIDA::IHistogram1D* multiply(
const std::string& nameAndTitle,
const AIDA::IHistogram1D& a,
821 const AIDA::IHistogram1D& b )
override;
823 AIDA::IHistogram1D* divide(
const std::string& nameAndTitle,
const AIDA::IHistogram1D& a,
824 const AIDA::IHistogram1D& b )
override;
826 AIDA::IHistogram2D*
add(
const std::string& nameAndTitle,
const AIDA::IHistogram2D& a,
827 const AIDA::IHistogram2D& b )
override;
829 AIDA::IHistogram2D* subtract(
const std::string& nameAndTitle,
const AIDA::IHistogram2D& a,
830 const AIDA::IHistogram2D& b )
override;
832 AIDA::IHistogram2D* multiply(
const std::string& nameAndTitle,
const AIDA::IHistogram2D& a,
833 const AIDA::IHistogram2D& b )
override;
835 AIDA::IHistogram2D* divide(
const std::string& nameAndTitle,
const AIDA::IHistogram2D& a,
836 const AIDA::IHistogram2D& b )
override;
838 AIDA::IHistogram3D*
add(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& a,
839 const AIDA::IHistogram3D& b )
override;
841 AIDA::IHistogram3D* subtract(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& a,
842 const AIDA::IHistogram3D& b )
override;
844 AIDA::IHistogram3D* multiply(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& a,
845 const AIDA::IHistogram3D& b )
override;
847 AIDA::IHistogram3D* divide(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& a,
848 const AIDA::IHistogram3D& b )
override;
850 AIDA::IHistogram2D* projectionXY(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& h )
override;
852 AIDA::IHistogram2D* projectionXZ(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& h )
override;
854 AIDA::IHistogram2D* projectionYZ(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& h )
override;
874 AIDA::IHistogram1D* createHistogram1D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
877 AIDA::IHistogram1D* createHistogram1D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
883 AIDA::IHistogram1D* createHistogram1D(
const std::string& nameAndTitle,
int nx,
double lowx,
double upx )
override;
885 AIDA::IHistogram1D* createCopy(
const std::string& full,
const AIDA::IHistogram1D& h )
override;
887 AIDA::IHistogram1D* createCopy(
const std::string& par,
const std::string& rel,
const AIDA::IHistogram1D& h );
891 AIDA::IHistogram1D* createCopy(
DataObject* pPar,
const std::string& rel,
const AIDA::IHistogram1D& h );
893 AIDA::IHistogram2D* createHistogram2D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
894 double upx,
int ny,
double lowy,
double upy );
896 AIDA::IHistogram2D* createHistogram2D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
897 double upx,
int ny,
double lowy,
double upy,
903 AIDA::IHistogram2D* createHistogram2D(
const std::string& nameAndTitle,
int nx,
double lowx,
double upx,
int ny,
904 double lowy,
double upy )
override;
906 AIDA::IHistogram2D* createCopy(
const std::string& full,
const AIDA::IHistogram2D& h )
override;
908 AIDA::IHistogram2D* createCopy(
const std::string& par,
const std::string& rel,
const AIDA::IHistogram2D& h );
912 AIDA::IHistogram2D* createCopy(
DataObject* pPar,
const std::string& rel,
const AIDA::IHistogram2D& h );
914 AIDA::IHistogram3D* createHistogram3D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
915 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz );
917 AIDA::IHistogram3D* createHistogram3D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
918 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz,
924 AIDA::IHistogram3D* createHistogram3D(
const std::string& nameAndTitle,
int nx,
double lowx,
double upx,
int ny,
925 double lowy,
double upy,
int nz,
double lowz,
double upz )
override;
927 AIDA::IHistogram3D* createCopy(
const std::string& full,
const AIDA::IHistogram3D& h )
override;
929 AIDA::IHistogram3D* createCopy(
const std::string& par,
const std::string& rel,
const AIDA::IHistogram3D& h );
933 AIDA::IHistogram3D* createCopy(
DataObject* pPar,
const std::string& rel,
const AIDA::IHistogram3D& h );
935 AIDA::IProfile1D* createProfile1D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
double upx,
938 AIDA::IProfile1D* createProfile1D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
double upx,
939 double upper,
double lower,
const std::string& opt )
override;
947 AIDA::IProfile1D* createProfile1D(
const std::string& nametit,
int nx,
double lowx,
double upx )
override;
949 AIDA::IProfile1D* createProfile1D(
const std::string& nametit,
int nx,
double lowx,
double upx,
double upper,
950 double lower )
override;
952 AIDA::IProfile1D* createCopy(
const std::string& full,
const AIDA::IProfile1D& h )
override;
954 AIDA::IProfile1D* createCopy(
const std::string& par,
const std::string& rel,
const AIDA::IProfile1D& h );
960 AIDA::IProfile2D* createProfile2D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
double upx,
961 int ny,
double lowy,
double upy );
963 AIDA::IProfile2D* createProfile2D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
double upx,
964 int ny,
double lowy,
double upy,
const std::string& )
override;
969 AIDA::IProfile2D* createProfile2D(
const std::string& nameAndTitle,
int nx,
double lowx,
double upx,
int ny,
970 double lowy,
double upy )
override;
972 AIDA::IProfile2D* createProfile2D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
double upx,
973 int ny,
double lowy,
double upy,
double upper,
double lower );
975 AIDA::IProfile2D* createProfile2D(
const std::string& name,
const std::string& title,
int nx,
double lowx,
double upx,
976 int ny,
double lowy,
double upy,
double upper,
double lower,
980 double upper,
double lower,
const std::string& )
override;
982 AIDA::IProfile2D* createProfile2D(
const std::string& nameAndTitle,
int nx,
double lowx,
double upx,
int ny,
983 double lowy,
double upy,
double upper,
double lower )
override;
985 AIDA::IProfile2D* createCopy(
const std::string& full,
const AIDA::IProfile2D& h )
override;
987 AIDA::IProfile2D* createCopy(
const std::string& par,
const std::string& rel,
const AIDA::IProfile2D& h );
1051 int write( Base* h,
const char* file_name )
const override;
1066 void update1Ddefs();
1075 #endif // GAUDISVC_HISTOGRAMSVC_H AIDA::ICloud3D * createCloud3D(const std::string &, const std::string &, int, const std::string &) override
Define general base for Gaudi exception.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
std::set< std::string > m_mods1D
GAUDI_API AIDA::IHistogram1D * book(IHistogramSvc *svc, const std::string &path, const Gaudi::Histo1DDef &hist)
helper function to book 1D-histogram
std::map< std::string, Gaudi::Histo1DDef > Histo1DMap
Implementation of property with value of concrete type.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
virtual StatusCode findObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Find object identified by its directory entry.
StatusCode retrieveObject(IRegistry *pReg, const std::string &path, AIDA::IHistogram1D *&obj) override
void not_implemented() const
StatusCode find(A1 a1, A3 *&a3)
AIDA::ICloud1D * createCloud1D(const std::string &, const std::string &, int, const std::string &) override
StatusCode retrieve(A1 a1, A2 a2, A3 *&a3)
AIDA::ICloud1D * createCloud1D(const std::string &) override
StatusCode registerObject(boost::string_ref parentPath, boost::string_ref objPath, DataObject *pObject) override
Register object with the data store.
T * i_book(DataObject *pPar, const std::string &rel, const std::string &title, const std::pair< DataObject *, T * > &o)
TupleObj.h GaudiAlg/TupleObj.h namespace with few technical implementations.
AIDA::ICloud1D * createCopy(const std::string &, const AIDA::ICloud1D &) override
This class is used for returning status codes from appropriate routines.
static R * act(R *res, const S &b, void(T1::*pmf)(const T2 *))
AIDA::ICloud3D * createCloud3D(const std::string &) override
AIDA::IBaseHistogram Base
The IRegistry represents the entry door to the environment any data object residing in a transient da...
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
AIDA::ICloud2D * createCloud2D(const std::string &) override
AIDA::ICloud3D * createCopy(const std::string &, const AIDA::ICloud3D &) override
AIDA::IHistogram2D * sliceYZ(const std::string &, const AIDA::IHistogram3D &, int, int) override
StatusCode findObject(IRegistry *pReg, const std::string &path, AIDA::IProfile1D *&obj) override
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject)
Register object with the data store.
virtual StatusCode unregisterObject(boost::string_ref fullPath)=0
Unregister object from the data store.
AIDA::ICloud2D * createCloud2D(const std::string &, const std::string &, int, const std::string &) override
static R * act(R *res, const S &b, Bool_t(T1::*pmf)(const T2 *, Double_t), Double_t scale)
def bookProf(args, kwargs)
Base class used to extend a class implementing other interfaces.
AIDA::IHistogramFactory * histogramFactory() override
Retrieve the AIDA HistogramFactory interface.
AIDA::IHistogram2D * sliceXY(const std::string &, const AIDA::IHistogram3D &, int, int) override
static R * act(R *res, const S &b, Bool_t(T1::*pmf)(const T2 *))
constexpr static const auto FAILURE
static R * act(R *res, const S &b, void(T1::*pmf)(const T2 *, Double_t), Double_t scale)
StatusCode retrieve(A1 a1, A3 *&a3)
AIDA::IHistogram2D * sliceXZ(const std::string &, const AIDA::IHistogram3D &, int, int) override
A DataObject is the base class of any identifiable object on any data store.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
AIDA::ICloud2D * createCopy(const std::string &, const AIDA::ICloud2D &) override
void update1Ddefs()
handler to be invoked for updating property m_defs1D
StatusCode find(A1 a1, A2 a2, A3 *&a3)
HistogramSvc class definition.