1 #ifndef ROOTHISTCNV_RHISTOGRAMCNV_H 2 #define ROOTHISTCNV_RHISTOGRAMCNV_H 1 30 template <
typename T,
typename S,
typename Q>
32 template <
typename CLASS>
35 template <
typename INPUT>
36 TTH( INPUT* i ) :
m_c( dynamic_cast<CLASS*>( i ) ) {}
37 template <
typename INPUT>
39 if (
m_c ) {
m_c->Copy( i ); }
40 return m_c !=
nullptr;
52 Q* h =
dynamic_cast<Q*
>( refpObj );
56 auto s =
dynamic_cast<S*
>( r->
tObj() );
58 auto a =
dynamic_cast<TArray*
>(
s );
60 auto p = std::make_unique<T>();
63 p->Set( a->GetSize() );
66 h->adoptRepresentation( p.release() );
72 return error(
"Cannot create histogram - invalid address." );
78 auto h =
dynamic_cast<Q*
>( pObj );
80 auto r =
dynamic_cast<T*
>( h->representation() );
82 auto a =
dynamic_cast<TArray*
>( r );
84 auto c = std::make_unique<T>();
87 c->Set( a->GetSize() );
96 error(
"Histogram object is invalid!" );
105 #endif // ROOTHISTCNV_RHISTOGRAMCNV_H
RHistogramCnv(ISvcLocator *svc)
Standard constructor.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
const CLID & objType() const override
Retrieve the class type of objects the converter produces.
TObject * createPersistent(DataObject *pObj) override
Create the persistent representation of the histogram object.
constexpr static const auto SUCCESS
virtual const name_type & name() const =0
Name of the directory (or key)
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.
unsigned int CLID
Class ID definition.
virtual unsigned long release()
release reference to object
StatusCode error(const std::string &msg)
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
StatusCode updateObj(IOpaqueAddress *, DataObject *) override
Update the transient object from the other representation.
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&refpObj) override
Create the transient representation of an object.