9 #include "boost/optional.hpp" 15 #include "TDirectory.h" 20 #include "TProfile2D.h" 26 constexpr
struct maybe_stol_t {
27 boost::optional<int> operator()(
const std::string&
s)
const {
29 if ( pos == std::string::npos )
return boost::none;
54 if ( createDirectory(loc).isSuccess() ) {
56 setDiskDirectory(loc);
58 return createAddress(pObject, gDirectory,
nullptr, refpAddress);
60 refpAddress =
nullptr;
71 if ( createDirectory(loc).isSuccess() ) {
88 findTFile(full,tf).ignore();
92 TIter nextkey(gDirectory->GetListOfKeys());
93 while (TKey *key = (TKey*)nextkey()) {
95 TObject *obj = key->ReadObj();
99 int idh = maybe_stol(sid).get_value_or(0);
103 TClass* isa = obj->IsA();
104 if (isa->InheritsFrom(
"TTree")) {
105 createAddress(full, CLID_ColumnWiseTuple, idh, obj, pA).ignore();
106 TTree* tree = (TTree*) obj;
108 log <<
MSG::DEBUG <<
"Reg CWNT \"" << obj->GetTitle()
109 <<
"\" as " << f2 <<
endmsg;
111 }
else if (isa->InheritsFrom(
"TDirectory")) {
112 createAddress(full,CLID_NTupleDirectory, title, obj, pA).ignore();
113 }
else if ( isa == TProfile::Class() ) {
114 createAddress(full,CLID_ProfileH,idh,obj,pA).ignore();
116 }
else if ( isa == TProfile2D::Class() ) {
117 createAddress(full,CLID_ProfileH2,idh,obj,pA).ignore();
119 }
else if ( isa == TH1C::Class() ) {
120 createAddress(full,CLID_H1D,idh,obj,pA).ignore();
122 }
else if ( isa == TH1S::Class() ) {
123 createAddress(full,CLID_H1D,idh,obj,pA).ignore();
125 }
else if ( isa == TH1I::Class() ) {
126 createAddress(full,CLID_H1D,idh,obj,pA).ignore();
128 }
else if ( isa == TH1F::Class() ) {
129 createAddress(full,CLID_H1D,idh,obj,pA).ignore();
131 }
else if ( isa == TH1D::Class() ) {
132 createAddress(full,CLID_H1D,idh,obj,pA).ignore();
134 }
else if ( isa == TH2C::Class() ) {
135 createAddress(full,CLID_H2D,idh,obj,pA).ignore();
137 }
else if ( isa == TH2S::Class() ) {
138 createAddress(full,CLID_H2D,idh,obj,pA).ignore();
140 }
else if ( isa == TH2I::Class() ) {
141 createAddress(full,CLID_H2D,idh,obj,pA).ignore();
143 }
else if ( isa == TH2F::Class() ) {
144 createAddress(full,CLID_H2D,idh,obj,pA).ignore();
146 }
else if ( isa == TH2D::Class() ) {
147 createAddress(full,CLID_H2D,idh,obj,pA).ignore();
149 }
else if ( isa == TH3C::Class() ) {
150 createAddress(full,CLID_H3D,idh,obj,pA).ignore();
152 }
else if ( isa == TH3S::Class() ) {
153 createAddress(full,CLID_H3D,idh,obj,pA).ignore();
155 }
else if ( isa == TH3I::Class() ) {
156 createAddress(full,CLID_H3D,idh,obj,pA).ignore();
158 }
else if ( isa == TH3F::Class() ) {
159 createAddress(full,CLID_H3D,idh,obj,pA).ignore();
161 }
else if ( isa == TH3D::Class() ) {
162 createAddress(full,CLID_H3D,idh,obj,pA).ignore();
165 log <<
MSG::ERROR <<
"Encountered an unknown object with key: " 166 << obj->GetName() <<
" in ROOT file " << fname <<
endmsg;
170 StatusCode sc = dataManager()->registerAddress(pReg, title, pA);
176 <<
"'" << title <<
"' in " << full <<
endmsg;
Definition of the MsgStream class used to transmit messages.
bool isSuccess() const
Test for a status code of SUCCESS.
StatusCode createRep(DataObject *pObj, IOpaqueAddress *&refpAddr) override
Convert the transient object to the requested representation.
virtual const std::string * par() const =0
Retrieve String parameters.
IRegistry * registry() const
Get pointer to Registry.
virtual const id_type & identifier() const =0
Full identifier (or key)
This class is used for returning status codes from appropriate routines.
Create persistent and transient representations of data store directories.
T find_first_of(T...args)
The IRegistry represents the entry door to the environment any data object residing in a transient da...
StatusCode fillObjRefs(IOpaqueAddress *pAddr, DataObject *refpObj) override
Update the transient object from the other representation.
#define DECLARE_NAMESPACE_CONVERTER_FACTORY(n, x)
StatusCode updateRep(IOpaqueAddress *pAddr, DataObject *pObject) override
Convert the transient object to the requested representation.
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.