14 #include "TDirectory.h"
19 #include "TProfile2D.h"
60 if ( createDirectory(loc).isSuccess() ) {
74 const std::string& fname = pAddr->
par()[0];
77 findTFile(full,tf).ignore();
81 TIter nextkey(gDirectory->GetListOfKeys());
82 while (TKey *key = (TKey*)nextkey()) {
84 TObject *obj = key->ReadObj();
85 std::string title = obj->GetTitle();
86 std::string sid = obj->GetName();
87 std::string f2 = full +
"/" + sid;
88 int idh = ::strtol(sid.c_str(),NULL,10);
90 std::string clname = key->GetClassName();
91 std::string clnm = clname.substr(0,3);
92 TClass* isa = obj->IsA();
93 if (isa->InheritsFrom(
"TTree")) {
94 createAddress(full, CLID_ColumnWiseTuple, idh, obj, pA).ignore();
95 TTree* tree = (TTree*) obj;
97 log <<
MSG::DEBUG <<
"Reg CWNT \"" << obj->GetTitle()
98 <<
"\" as " << f2 <<
endmsg;
100 }
else if (isa->InheritsFrom(
"TDirectory")) {
101 createAddress(full,CLID_NTupleDirectory, title, obj, pA).ignore();
102 }
else if ( isa == TProfile::Class() ) {
103 createAddress(full,CLID_ProfileH,idh,obj,pA).ignore();
105 }
else if ( isa == TProfile2D::Class() ) {
106 createAddress(full,CLID_ProfileH2,idh,obj,pA).ignore();
108 }
else if ( isa == TH1C::Class() ) {
109 createAddress(full,CLID_H1D,idh,obj,pA).ignore();
111 }
else if ( isa == TH1S::Class() ) {
112 createAddress(full,CLID_H1D,idh,obj,pA).ignore();
114 }
else if ( isa == TH1I::Class() ) {
115 createAddress(full,CLID_H1D,idh,obj,pA).ignore();
117 }
else if ( isa == TH1F::Class() ) {
118 createAddress(full,CLID_H1D,idh,obj,pA).ignore();
120 }
else if ( isa == TH1D::Class() ) {
121 createAddress(full,CLID_H1D,idh,obj,pA).ignore();
123 }
else if ( isa == TH2C::Class() ) {
124 createAddress(full,CLID_H2D,idh,obj,pA).ignore();
126 }
else if ( isa == TH2S::Class() ) {
127 createAddress(full,CLID_H2D,idh,obj,pA).ignore();
129 }
else if ( isa == TH2I::Class() ) {
130 createAddress(full,CLID_H2D,idh,obj,pA).ignore();
132 }
else if ( isa == TH2F::Class() ) {
133 createAddress(full,CLID_H2D,idh,obj,pA).ignore();
135 }
else if ( isa == TH2D::Class() ) {
136 createAddress(full,CLID_H2D,idh,obj,pA).ignore();
138 }
else if ( isa == TH3C::Class() ) {
139 createAddress(full,CLID_H3D,idh,obj,pA).ignore();
141 }
else if ( isa == TH3S::Class() ) {
142 createAddress(full,CLID_H3D,idh,obj,pA).ignore();
144 }
else if ( isa == TH3I::Class() ) {
145 createAddress(full,CLID_H3D,idh,obj,pA).ignore();
147 }
else if ( isa == TH3F::Class() ) {
148 createAddress(full,CLID_H3D,idh,obj,pA).ignore();
150 }
else if ( isa == TH3D::Class() ) {
151 createAddress(full,CLID_H3D,idh,obj,pA).ignore();
154 log <<
MSG::ERROR <<
"Encountered an unknown object with key: "
155 << obj->GetName() <<
" in ROOT file " << fname <<
endmsg;
159 StatusCode sc = dataManager()->registerAddress(pReg, title, pA);
165 <<
"'" << title <<
"' in " << full <<
endmsg;
virtual const std::string * par() const =0
Retrieve String parameters.
Definition of the MsgStream class used to transmit messages.
void setDirectory(const std::string &loc)
bool isSuccess() const
Test for a status code of SUCCESS.
StatusCode createDirectory(const std::string &loc)
IRegistry * registry() const
Get pointer to Registry.
This class is used for returning status codes from appropriate routines.
virtual StatusCode createRep(DataObject *pObj, IOpaqueAddress *&refpAddr)
Convert the transient object to the requested representation.
Create persistent and transient representations of data store directories.
virtual StatusCode updateRep(IOpaqueAddress *pAddr, DataObject *pObject)
Convert the transient object to the requested representation.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddr, DataObject *refpObj)
Update the transient object from the other representation.
#define DECLARE_NAMESPACE_CONVERTER_FACTORY(n, x)
virtual const id_type & identifier() const =0
Full identifier (or key)
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
Small class representing an N tuple directory in the transient store.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode createAddress(DataObject *pObject, TDirectory *pDir, TObject *pTObject, IOpaqueAddress *&refpAddr)
Create address of the transient object according to the requested representation. ...
void setDiskDirectory(const std::string &loc)