11 #ifndef ROOTHISTCNV_RHISTOGRAMCNV_H 12 #define ROOTHISTCNV_RHISTOGRAMCNV_H 1 40 template <
typename T,
typename S,
typename Q>
42 template <
typename CLASS>
45 template <
typename INPUT>
46 TTH( INPUT* i ) :
m_c( dynamic_cast<CLASS*>( i ) ) {}
47 template <
typename INPUT>
49 if (
m_c ) {
m_c->Copy( i ); }
50 return m_c !=
nullptr;
62 Q* h = dynamic_cast<Q*>( refpObj );
66 auto s = dynamic_cast<S*>( r->
tObj() );
68 auto a = dynamic_cast<TArray*>(
s );
70 auto p = std::make_unique<T>();
73 p->Set( a->GetSize() );
76 h->adoptRepresentation( p.release() );
82 return error(
"Cannot create histogram - invalid address." );
88 auto h = dynamic_cast<Q*>( pObj );
90 auto r = dynamic_cast<T*>( h->representation() );
92 auto a = dynamic_cast<TArray*>( r );
94 auto c = std::make_unique<T>();
97 c->Set( a->GetSize() );
106 error(
"Histogram object is invalid!" );
115 #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...
IRegistry * registry() const
Get pointer to Registry.
virtual TObject * tObj() const
Retrieve TObject* ptr.
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)
static const CLID & classID()
Inquire class type.
This class is used for returning status codes from appropriate routines.
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.
const CLID & objType() const override
Retrieve the class type of objects the converter produces.