1 #ifndef ROOTHISTCNV_RHISTOGRAMCNV_H
2 #define ROOTHISTCNV_RHISTOGRAMCNV_H 1
6 #include "GaudiKernel/SmartIF.h"
7 #include "GaudiKernel/DataObject.h"
8 #include "GaudiKernel/IRegistry.h"
9 #include "GaudiKernel/IOpaqueAddress.h"
10 #include "GaudiKernel/HistogramBase.h"
11 #include "GaudiKernel/ObjectFactory.h"
31 template <
typename CLASS>
struct TTH :
public CLASS {
32 void CopyH(TObject& o) { CLASS::Copy(o); }
37 refpObj = DataObjFactory::create(
objType());
39 Q*
h =
dynamic_cast<Q*
>(refpObj);
43 std::unique_ptr<T> p(
new T());
44 S *
s =
dynamic_cast<S*
>(r->
tObj());
47 TArray* a =
dynamic_cast<TArray*
>(
s);
53 h->adoptRepresentation(p.release());
58 return error(
"Cannot create histogram - invalid address.");
66 Q*
h =
dynamic_cast<Q*
>(pObj);
68 T *r =
dynamic_cast<T*
>(h->representation());
71 TArray* a =
dynamic_cast<TArray*
>(r);
82 error(
"Histogram object is invalid!");
92 #endif // ROOTHISTCNV_RHISTOGRAMCNV_H
virtual StatusCode updateObj(IOpaqueAddress *, DataObject *)
Update the transient object from the other representation.
RHistogramCnv(ISvcLocator *svc)
Standard constructor.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
virtual StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&refpObj)
Create the transient representation of an object.
virtual const name_type & name() const =0
Name of the directory (or key)
virtual ~RHistogramCnv()=default
IRegistry * registry() const
Get pointer to Registry.
static const CLID & classID()
Inquire class type.
This class is used for returning status codes from appropriate routines.
virtual TObject * tObj() const
Retrieve TObject* ptr.
Generic converter to save/read AIDA_ROOT histograms using ROOT.
virtual TObject * createPersistent(DataObject *pObj)
Create the persistent representation of the histogram object.
StatusCode error(const std::string &msg)
Opaque address interface definition.
unsigned int CLID
Class ID definition.
A DataObject is the base class of any identifiable object on any data store.
const CLID & objType() const override
Retrieve the class type of objects the converter produces.