#include <RHistogramCnv.h>
Inheritance diagram for RootHistCnv::RHistogramCnv< T, S, Q >:
Public Member Functions | |
virtual StatusCode | createObj (IOpaqueAddress *pAddr, DataObject *&refpObj) |
Create the transient representation of an object. | |
virtual StatusCode | updateObj (IOpaqueAddress *, DataObject *) |
Update the transient object from the other representation. | |
virtual TObject * | createPersistent (DataObject *pObj) |
Create the persistent representation of the histogram object. | |
RHistogramCnv (ISvcLocator *svc) | |
Standard constructor. | |
virtual | ~RHistogramCnv () |
Static Public Member Functions | |
static const CLID & | classID () |
Inquire class type. | |
Classes | |
struct | TTH |
This converter shortcuts the AIDA binding and takes advantage of the underlying implementation of transient histograms using ROOT.
Note: THxY::Copy cannot be used - only THxY::Add !
Definition at line 30 of file RHistogramCnv.h.
RootHistCnv::RHistogramCnv< T, S, Q >::RHistogramCnv | ( | ISvcLocator * | svc | ) | [inline] |
Standard constructor.
Definition at line 88 of file RHistogramCnv.h.
00088 : RConverter(classID(), svc) {}
virtual RootHistCnv::RHistogramCnv< T, S, Q >::~RHistogramCnv | ( | ) | [inline, virtual] |
virtual StatusCode RootHistCnv::RHistogramCnv< T, S, Q >::createObj | ( | IOpaqueAddress * | pAddr, | |
DataObject *& | refpObj | |||
) | [inline, virtual] |
Create the transient representation of an object.
Definition at line 36 of file RHistogramCnv.h.
00036 { 00037 refpObj = ROOT::Reflex::PluginService::CreateWithId<DataObject*>(objType()); 00038 RootObjAddress *r = dynamic_cast<RootObjAddress*>(pAddr); 00039 Q* h = dynamic_cast<Q*>(refpObj); 00040 if ( r && h ) { 00041 // Need to flip representation .... clumsy for the time being, because 00042 // THXY constructor has no "generic" copy constructor 00043 std::auto_ptr<T> p(new T()); 00044 S *s = dynamic_cast<S*>(r->tObj()); 00045 if ( s && p.get() ) { 00046 TTH<S>* casted = (TTH<S>*)s; 00047 TArray* a = dynamic_cast<TArray*>(s); 00048 casted->CopyH(*p); 00049 if ( 0 != a ) { 00050 p->Set(a->GetSize()); 00051 p->Reset(); 00052 p->Add(s); 00053 h->adoptRepresentation(p.release()); 00054 return StatusCode::SUCCESS; 00055 } 00056 } 00057 } 00058 return error("Cannot create histogram - invalid address."); 00059 }
virtual StatusCode RootHistCnv::RHistogramCnv< T, S, Q >::updateObj | ( | IOpaqueAddress * | , | |
DataObject * | ||||
) | [inline, virtual] |
Update the transient object from the other representation.
Definition at line 61 of file RHistogramCnv.h.
00061 { 00062 return StatusCode::SUCCESS; 00063 }
virtual TObject* RootHistCnv::RHistogramCnv< T, S, Q >::createPersistent | ( | DataObject * | pObj | ) | [inline, virtual] |
Create the persistent representation of the histogram object.
Definition at line 65 of file RHistogramCnv.h.
00065 { 00066 Q* h = dynamic_cast<Q*>(pObj); 00067 if ( 0 != h ) { 00068 T *r = dynamic_cast<T*>(h->representation()); 00069 if ( r ) { 00070 T* c = new T(); 00071 TArray* a = dynamic_cast<TArray*>(r); 00072 ((TTH<S>*)r)->CopyH(*c); 00073 if ( 0 != a ) { 00074 c->Set(a->GetSize()); 00075 c->Reset(); 00076 c->Add(r); 00077 c->SetName(pObj->registry()->name().c_str()+1); 00078 return c; 00079 } 00080 } 00081 } 00082 error("Histogram object is invalid!"); 00083 return 0; 00084 }
const CLID & RootHistCnv::RootHistCnvH3DCnv::classID | ( | ) | [static] |