2 #ifndef GAUDISVC_HISTOGRAMSVC_H 3 #define GAUDISVC_HISTOGRAMSVC_H 1 19 #include "AIDA/IAnnotation.h" 20 #include "AIDA/IHistogramFactory.h" 63 typedef AIDA::IHistogram3D
H3D;
64 typedef AIDA::IProfile2D
P2D;
65 typedef AIDA::IBaseHistogram
Base;
70 template <
class A1,
class A3>
74 StatusCode sc = m_svc->DataSvc::retrieveObject( a1, pObject );
75 a3 =
dynamic_cast<A3*
>( pObject );
78 template <
class A1,
class A2,
class A3>
82 StatusCode sc = m_svc->DataSvc::retrieveObject( a1, a2, pObject );
83 a3 =
dynamic_cast<A3*
>( pObject );
86 template <
class A1,
class A3>
90 StatusCode sc = m_svc->DataSvc::findObject( a1, pObject );
91 a3 =
dynamic_cast<A3*
>( pObject );
94 template <
class A1,
class A2,
class A3>
98 StatusCode sc = m_svc->DataSvc::findObject( a1, a2, pObject );
99 a3 =
dynamic_cast<A3*
>( pObject );
102 template <
class R,
class S,
class T1,
class T2>
103 static R*
act( R* res,
const S& b,
void ( T1::*pmf )(
const T2*, Double_t ), Double_t scale )
105 auto h1 = Gaudi::getRepresentation<R, T1>( *res );
106 const auto h2 = Gaudi::getRepresentation<R, T2>( b );
108 ( h1->*pmf )( h2, scale );
113 template <
class R,
class S,
class T1,
class T2>
114 static R*
act( R* res,
const S& b, Bool_t ( T1::*pmf )(
const T2*, Double_t ), Double_t scale )
116 auto h1 = Gaudi::getRepresentation<R, T1>( *res );
117 const auto h2 = Gaudi::getRepresentation<R, T2>( b );
119 ( h1->*pmf )( h2, scale );
124 template <
class R,
class S,
class T1,
class T2>
125 static R*
act( R* res,
const S& b,
void ( T1::*pmf )(
const T2* ) )
127 auto h1 = Gaudi::getRepresentation<R, T1>( *res );
128 const auto h2 = Gaudi::getRepresentation<R, T2>( b );
135 template <
class R,
class S,
class T1,
class T2>
136 static R*
act( R* res,
const S& b, Bool_t ( T1::*pmf )(
const T2* ) )
138 auto h1 = Gaudi::getRepresentation<R, T1>( *res );
139 const auto h2 = Gaudi::getRepresentation<R, T2>( b );
177 if ( o.first && registerObject( pPar, rel, (Base*)o.second ).isSuccess() )
return o.second;
184 AIDA::IHistogram2D* i_project(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& h,
const std::string& dir );
217 double lowx,
double upx )
override;
220 double upx )
override;
223 double upx )
override;
226 double upx )
override;
229 double lowx,
double upx );
232 double upx )
override;
254 double lowx,
double upx,
const std::string& opt )
override;
272 double lowx,
double upx,
double upper,
double lower,
const std::string& opt )
override;
275 double upx,
double upper,
double lower,
const std::string& opt )
override;
278 double upper,
double lower,
const std::string& opt )
override;
281 double lowx,
double upx,
double upper,
double lower,
const std::string& opt );
284 double upper,
double lower,
const std::string& opt )
override;
287 double upx,
double upper,
double lower,
const std::string& opt )
override;
354 double upper,
double lower );
363 double upper,
double lower );
366 double upper,
double lower );
391 double lowy,
double upy )
override;
394 double lowx,
double upx,
int ny,
double lowy,
double upy )
override;
397 int ny,
double lowy,
double upy )
override;
400 double lowx,
double upx,
int ny,
double lowy,
double upy );
403 int ny,
double lowy,
double upy )
override;
406 double upx,
int ny,
double lowy,
double upy )
override;
431 double upx,
int ny,
double lowy,
double upy,
double upper,
double lower );
434 double lowx,
double upx,
int ny,
double lowy,
double upy,
double upper,
438 double lowx,
double upx,
int ny,
double lowy,
double upy,
double upper,
442 double upx,
int ny,
double lowy,
double upy,
double upper,
double lower );
445 double upx,
int ny,
double lowy,
double upy,
double upper,
double lower );
448 double lowx,
double upx,
int ny,
double lowy,
double upy,
double upper,
452 int ny,
double lowy,
double upy )
override;
455 double lowx,
double upx,
int ny,
double lowy,
double upy )
override;
458 double lowx,
double upx,
int ny,
double lowy,
double upy );
461 double upx,
int ny,
double lowy,
double upy )
override;
464 int ny,
double lowy,
double upy )
override;
467 double upx,
int ny,
double lowy,
double upy )
override;
537 Edges y,
double upper,
double lower );
540 double upper,
double lower );
543 double upper,
double lower );
546 Edges y,
double upper,
double lower );
549 Edges y,
double upper,
double lower );
571 double lowy,
double upy,
int nz,
double lowz,
double upz )
override;
574 double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
575 double upz )
override;
578 int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz )
override;
581 int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz )
override;
584 double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
588 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz )
override;
636 StatusCode registerObject( Base* pPar,
int item, Base* obj )
override;
645 StatusCode unregisterObject( Base* obj )
override;
649 StatusCode unregisterObject( Base* obj,
int item )
override;
714 StatusCode retrieveObject( Base* par,
int item, AIDA::IProfile1D*& obj )
override;
716 StatusCode retrieveObject( Base* par,
int item, AIDA::IProfile2D*& obj )
override;
718 StatusCode retrieveObject( Base* par,
int item, AIDA::IHistogram1D*& obj )
override;
720 StatusCode retrieveObject( Base* par,
int item, AIDA::IHistogram2D*& obj )
override;
722 StatusCode retrieveObject( Base* par,
int item, AIDA::IHistogram3D*& obj )
override;
797 StatusCode findObject( Base* par,
int item, AIDA::IProfile1D*& obj )
override;
799 StatusCode findObject( Base* par,
int item, AIDA::IProfile2D*& obj )
override;
801 StatusCode findObject( Base* par,
int item, AIDA::IHistogram1D*& obj )
override;
803 StatusCode findObject( Base* par,
int item, AIDA::IHistogram2D*& obj )
override;
805 StatusCode findObject( Base* par,
int item, AIDA::IHistogram3D*& obj )
override;
820 AIDA::IHistogram1D* projectionX(
const std::string&
name,
const AIDA::IHistogram2D& h )
override;
822 AIDA::IHistogram1D* projectionY(
const std::string& name,
const AIDA::IHistogram2D& h )
override;
824 AIDA::IHistogram1D* sliceX(
const std::string& name,
const AIDA::IHistogram2D& h,
int indexY )
override;
826 AIDA::IHistogram1D* sliceY(
const std::string& name,
const AIDA::IHistogram2D& h,
int indexX )
override;
828 AIDA::IHistogram1D* sliceX(
const std::string& name,
const AIDA::IHistogram2D& h,
int indexY1,
int indexY2 )
override;
830 AIDA::IHistogram1D* sliceY(
const std::string& name,
const AIDA::IHistogram2D& h,
int indexX1,
int indexX2 )
override;
832 bool destroy( IBaseHistogram* hist )
override;
834 AIDA::IHistogram1D*
add(
const std::string& nameAndTitle,
const AIDA::IHistogram1D& a,
835 const AIDA::IHistogram1D& b )
override;
837 AIDA::IHistogram1D* subtract(
const std::string& nameAndTitle,
const AIDA::IHistogram1D& a,
838 const AIDA::IHistogram1D& b )
override;
840 AIDA::IHistogram1D* multiply(
const std::string& nameAndTitle,
const AIDA::IHistogram1D& a,
841 const AIDA::IHistogram1D& b )
override;
843 AIDA::IHistogram1D* divide(
const std::string& nameAndTitle,
const AIDA::IHistogram1D& a,
844 const AIDA::IHistogram1D& b )
override;
846 AIDA::IHistogram2D*
add(
const std::string& nameAndTitle,
const AIDA::IHistogram2D& a,
847 const AIDA::IHistogram2D& b )
override;
849 AIDA::IHistogram2D* subtract(
const std::string& nameAndTitle,
const AIDA::IHistogram2D& a,
850 const AIDA::IHistogram2D& b )
override;
852 AIDA::IHistogram2D* multiply(
const std::string& nameAndTitle,
const AIDA::IHistogram2D& a,
853 const AIDA::IHistogram2D& b )
override;
855 AIDA::IHistogram2D* divide(
const std::string& nameAndTitle,
const AIDA::IHistogram2D& a,
856 const AIDA::IHistogram2D& b )
override;
858 AIDA::IHistogram3D*
add(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& a,
859 const AIDA::IHistogram3D& b )
override;
861 AIDA::IHistogram3D* subtract(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& a,
862 const AIDA::IHistogram3D& b )
override;
864 AIDA::IHistogram3D* multiply(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& a,
865 const AIDA::IHistogram3D& b )
override;
867 AIDA::IHistogram3D* divide(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& a,
868 const AIDA::IHistogram3D& b )
override;
870 AIDA::IHistogram2D* projectionXY(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& h )
override;
872 AIDA::IHistogram2D* projectionXZ(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& h )
override;
874 AIDA::IHistogram2D* projectionYZ(
const std::string& nameAndTitle,
const AIDA::IHistogram3D& h )
override;
897 AIDA::IHistogram1D* createHistogram1D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
900 AIDA::IHistogram1D* createHistogram1D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
906 AIDA::IHistogram1D* createHistogram1D(
const std::string& nameAndTitle,
int nx,
double lowx,
double upx )
override;
908 AIDA::IHistogram1D* createCopy(
const std::string& full,
const AIDA::IHistogram1D& h )
override;
910 AIDA::IHistogram1D* createCopy(
const std::string& par,
const std::string& rel,
const AIDA::IHistogram1D& h );
914 AIDA::IHistogram1D* createCopy(
DataObject* pPar,
const std::string& rel,
const AIDA::IHistogram1D& h );
916 AIDA::IHistogram2D* createHistogram2D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
917 double upx,
int ny,
double lowy,
double upy );
919 AIDA::IHistogram2D* createHistogram2D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
920 double upx,
int ny,
double lowy,
double upy,
926 AIDA::IHistogram2D* createHistogram2D(
const std::string& nameAndTitle,
int nx,
double lowx,
double upx,
int ny,
927 double lowy,
double upy )
override;
929 AIDA::IHistogram2D* createCopy(
const std::string& full,
const AIDA::IHistogram2D& h )
override;
931 AIDA::IHistogram2D* createCopy(
const std::string& par,
const std::string& rel,
const AIDA::IHistogram2D& h );
935 AIDA::IHistogram2D* createCopy(
DataObject* pPar,
const std::string& rel,
const AIDA::IHistogram2D& h );
937 AIDA::IHistogram3D* createHistogram3D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
938 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz );
940 AIDA::IHistogram3D* createHistogram3D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
941 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz,
947 AIDA::IHistogram3D* createHistogram3D(
const std::string& nameAndTitle,
int nx,
double lowx,
double upx,
int ny,
948 double lowy,
double upy,
int nz,
double lowz,
double upz )
override;
950 AIDA::IHistogram3D* createCopy(
const std::string& full,
const AIDA::IHistogram3D& h )
override;
952 AIDA::IHistogram3D* createCopy(
const std::string& par,
const std::string& rel,
const AIDA::IHistogram3D& h );
956 AIDA::IHistogram3D* createCopy(
DataObject* pPar,
const std::string& rel,
const AIDA::IHistogram3D& h );
958 AIDA::IProfile1D* createProfile1D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
double upx,
961 AIDA::IProfile1D* createProfile1D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
double upx,
962 double upper,
double lower,
const std::string& opt )
override;
970 AIDA::IProfile1D* createProfile1D(
const std::string& nametit,
int nx,
double lowx,
double upx )
override;
972 AIDA::IProfile1D* createProfile1D(
const std::string& nametit,
int nx,
double lowx,
double upx,
double upper,
973 double lower )
override;
975 AIDA::IProfile1D* createCopy(
const std::string& full,
const AIDA::IProfile1D& h )
override;
977 AIDA::IProfile1D* createCopy(
const std::string& par,
const std::string& rel,
const AIDA::IProfile1D& h );
983 AIDA::IProfile2D* createProfile2D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
double upx,
984 int ny,
double lowy,
double upy );
986 AIDA::IProfile2D* createProfile2D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
double upx,
987 int ny,
double lowy,
double upy,
const std::string& )
override;
992 AIDA::IProfile2D* createProfile2D(
const std::string& nameAndTitle,
int nx,
double lowx,
double upx,
int ny,
993 double lowy,
double upy )
override;
995 AIDA::IProfile2D* createProfile2D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
double upx,
996 int ny,
double lowy,
double upy,
double upper,
double lower );
998 AIDA::IProfile2D* createProfile2D(
const std::string& name,
const std::string& tit,
int nx,
double lowx,
double upx,
999 int ny,
double lowy,
double upy,
double upper,
double lower,
1003 double upper,
double lower,
const std::string& )
override;
1005 AIDA::IProfile2D* createProfile2D(
const std::string& nameAndTitle,
int nx,
double lowx,
double upx,
int ny,
1006 double lowy,
double upy,
double upper,
double lower )
override;
1008 AIDA::IProfile2D* createCopy(
const std::string& full,
const AIDA::IProfile2D& h )
override;
1010 AIDA::IProfile2D* createCopy(
const std::string& par,
const std::string& rel,
const AIDA::IProfile2D& h );
1014 AIDA::IProfile2D* createCopy(
DataObject* pPar,
const std::string& rel,
const AIDA::IProfile2D& h );
1083 int write( Base* h,
const char* file_name )
const override;
1106 #endif // GAUDISVC_HISTOGRAMSVC_H AIDA::ICloud3D * createCloud3D(const std::string &, const std::string &, int, const std::string &) override
constexpr static const auto FAILURE
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.
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
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...
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
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
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.
virtual StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject)=0
Register object with the data store.
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 *))
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
StatusCode find(A1 a1, A2 a2, A3 *&a3)
HistogramSvc class definition.