1 #ifndef ROOTHISTCNV_RHISTOGRAMCNV_H 2 #define ROOTHISTCNV_RHISTOGRAMCNV_H 1 31 template <
typename T,
typename S,
typename Q>
34 template <
typename CLASS>
35 struct TTH :
public CLASS {
36 void CopyH( TObject& o ) { CLASS::Copy( o ); }
45 Q* h =
dynamic_cast<Q*
>( refpObj );
49 auto p = std::make_unique<T>();
50 S*
s =
dynamic_cast<S*
>( r->
tObj() );
53 TArray* a =
dynamic_cast<TArray*
>(
s );
56 p->Set( a->GetSize() );
59 h->adoptRepresentation( p.release() );
64 return error(
"Cannot create histogram - invalid address." );
71 Q* h =
dynamic_cast<Q*
>( pObj );
73 T* r =
dynamic_cast<T*
>( h->representation() );
76 TArray* a =
dynamic_cast<TArray*
>( r );
77 ( (
TTH<S>*)r )->CopyH( *c );
79 c->Set( a->GetSize() );
87 error(
"Histogram object is invalid!" );
96 #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.
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.
constexpr static const auto SUCCESS
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.