9 #include "boost/optional.hpp" 14 #include "TDirectory.h" 22 #include "TProfile2D.h" 27 constexpr
struct maybe_stol_t {
31 if ( pos == std::string::npos )
return boost::none;
52 if ( createDirectory( loc ).isSuccess() ) {
54 setDiskDirectory( loc );
56 return createAddress( pObject, gDirectory,
nullptr, refpAddress );
58 refpAddress =
nullptr;
67 if ( createDirectory( loc ).isSuccess() ) {
83 findTFile( full, tf ).ignore();
87 TIter nextkey( gDirectory->GetListOfKeys() );
88 while ( TKey* key = (TKey*)nextkey() ) {
90 TObject* obj = key->ReadObj();
94 int idh = maybe_stol( sid ).get_value_or( 0 );
98 TClass* isa = obj->IsA();
99 if ( isa->InheritsFrom(
"TTree" ) ) {
100 createAddress( full, CLID_ColumnWiseTuple, idh, obj, pA ).ignore();
101 TTree* tree = (TTree*)obj;
103 log <<
MSG::DEBUG <<
"Reg CWNT \"" << obj->GetTitle() <<
"\" as " << f2 <<
endmsg;
105 }
else if ( isa->InheritsFrom(
"TDirectory" ) ) {
106 createAddress( full, CLID_NTupleDirectory, title, obj, pA ).ignore();
107 }
else if ( isa == TProfile::Class() ) {
108 createAddress( full, CLID_ProfileH, idh, obj, pA ).ignore();
110 }
else if ( isa == TProfile2D::Class() ) {
111 createAddress( full, CLID_ProfileH2, idh, obj, pA ).ignore();
113 }
else if ( isa == TH1C::Class() ) {
114 createAddress( full, CLID_H1D, idh, obj, pA ).ignore();
116 }
else if ( isa == TH1S::Class() ) {
117 createAddress( full, CLID_H1D, idh, obj, pA ).ignore();
119 }
else if ( isa == TH1I::Class() ) {
120 createAddress( full, CLID_H1D, idh, obj, pA ).ignore();
122 }
else if ( isa == TH1F::Class() ) {
123 createAddress( full, CLID_H1D, idh, obj, pA ).ignore();
125 }
else if ( isa == TH1D::Class() ) {
126 createAddress( full, CLID_H1D, idh, obj, pA ).ignore();
128 }
else if ( isa == TH2C::Class() ) {
129 createAddress( full, CLID_H2D, idh, obj, pA ).ignore();
131 }
else if ( isa == TH2S::Class() ) {
132 createAddress( full, CLID_H2D, idh, obj, pA ).ignore();
134 }
else if ( isa == TH2I::Class() ) {
135 createAddress( full, CLID_H2D, idh, obj, pA ).ignore();
137 }
else if ( isa == TH2F::Class() ) {
138 createAddress( full, CLID_H2D, idh, obj, pA ).ignore();
140 }
else if ( isa == TH2D::Class() ) {
141 createAddress( full, CLID_H2D, idh, obj, pA ).ignore();
143 }
else if ( isa == TH3C::Class() ) {
144 createAddress( full, CLID_H3D, idh, obj, pA ).ignore();
146 }
else if ( isa == TH3S::Class() ) {
147 createAddress( full, CLID_H3D, idh, obj, pA ).ignore();
149 }
else if ( isa == TH3I::Class() ) {
150 createAddress( full, CLID_H3D, idh, obj, pA ).ignore();
152 }
else if ( isa == TH3F::Class() ) {
153 createAddress( full, CLID_H3D, idh, obj, pA ).ignore();
155 }
else if ( isa == TH3D::Class() ) {
156 createAddress( full, CLID_H3D, idh, obj, pA ).ignore();
159 log <<
MSG::ERROR <<
"Encountered an unknown object with key: " << obj->GetName() <<
" in ROOT file " << fname
164 StatusCode sc = dataManager()->registerAddress( pReg, title, pA );
169 log <<
MSG::VERBOSE <<
"Created address for " << clnm <<
"'" << title <<
"' in " << full <<
endmsg;
constexpr static const auto FAILURE
Definition of the MsgStream class used to transmit messages.
#define DECLARE_CONVERTER(x)
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...
constexpr static const auto SUCCESS
StatusCode fillObjRefs(IOpaqueAddress *pAddr, DataObject *refpObj) override
Update the transient object from the other representation.
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
StatusCode updateRep(IOpaqueAddress *pAddr, DataObject *pObject) override
Convert the transient object to the requested representation.
Small class representing an N tuple directory in the transient store.
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.