22 for(
int i=0,
m=n.length()-1;
i<
m; ++
i)
if ( !
isalnum(n[
i]) ) n[i]=
'_';
23 TTree* t =
c->getSection(section);
24 TBranch* b = t ? t->GetBranch(n.c_str()) : 0;
25 if ( !b ) b = t ? t->GetBranch(branch_name.c_str()) : 0;
26 if ( b ) b->SetAutoDelete(kFALSE);
34 b->SetAddress(&prefs);
35 int nb = b->GetEntry(entry);
41 pair<const RootRef*,const ContainerSection*> ls =
c->getMergeSection(cnt,entry);
43 if ( ls.first->dbase >= 0 ) {
47 msg <<
"Refs: LS [" << entry <<
"] -> "
48 << ls.first->dbase <<
"," << ls.first->container
49 <<
"," << ls.first->link
50 <<
"," << ls.first->entry
53 for(
size_t j=0, n=refs.
refs.
size(); j<n; ++j) {
56 int db = r.
dbase + ls.first->dbase;
57 if (
c->getDb(db) ==
c->fid() ) {
60 if ( r.
link ) r.
link += ls.first->link;
63 if ( k != ms.
end() ) {
65 r.
entry = ( ls.first->entry >= 0 && ls.first->entry < (
int)cs.
size() )
66 ? cs[ls.first->entry].start + r.
entry : -1;
68 msg <<
"Add link [" << r.
entry
69 <<
"," << ls.first->entry
70 <<
"," << ls.first->container
73 <<
"] to -> " << rc <<
endmsg;
78 <<
"] Evt:" << entry <<
" Invalid link to " << rc <<
endmsg;
86 (*i) += ls.first->link;
111 TBranch* b = t->GetBranch(nam);
113 TLeaf*
l = b->GetLeaf(nam);
118 for(Long64_t
i=0, n=b->GetEntries();
i<n; ++
i) {
119 if ( b->GetEntry(
i)>0 ) {
120 char* p = (
char*)l->GetValuePointer();
121 msgSvc() <<
"Add Value[" << b->GetName() <<
"]:" << p <<
endmsg;
125 sc = RootDataConnection::ROOT_READ_ERROR;
132 return RootDataConnection::ROOT_READ_ERROR;
135 bool get(
const string& dsc, pair<string,ContainerSection>& e) {
136 if ( dsc !=
"[END-OF-SECTION]" ) {
137 size_t id1 = dsc.find(
"[CNT=");
138 size_t id2 = dsc.find(
"[START=");
139 size_t id3 = dsc.find(
"[LEN=");
140 if ( id1 != string::npos && id2 != string::npos && id3 != string::npos ) {
142 string cnt = dsc.substr(id1+5, id2-1-5);
143 int section_start = ::atoi((tmp=dsc.
substr(id2+7,id3-id2-8)).c_str());
144 int section_length = ::atoi((tmp=dsc.
substr(id3+5,dsc.find(
"]",id3+5)-id3-5)).c_str());
159 pair<string,ContainerSection> e;
169 msg <<
"Added Merge Section:" << e.first <<
endmsg;
170 ms[e.first].push_back(e.second);
171 if ( e.first ==
"Links" )
172 r.
link = e.second.start;
173 else if ( e.first ==
"Containers" )
175 else if ( e.first ==
"Databases" )
176 r.
dbase = e.second.start;
177 else if ( e.first ==
"Params" )
178 r.
svc = e.second.start;
180 else if ( (*i) ==
"[END-OF-SECTION]" ) {
183 msg <<
"Link Section [" << r.
entry <<
"," << ls.
size()
184 <<
"] -> D:" << r.
dbase
197 TTree* t = (TTree*)
c->file()->Get(
"Sections");
200 if ( t && !(sc=
readBranch(t,
"Sections", tmp, &RootTool::addEntry)).isSuccess() )
204 if ( !(sc=
readBranch(
refs(),
"Databases",
dbs(), &RootTool::addEntry)).isSuccess() )
219 string getParam(
const pair<string,string>& p) {
return p.first+
"="+p.second; }
223 string val, typ = nam;
225 TDirectory::TContext ctxt(
c->file());
226 TBranch* b =
refs()->GetBranch(nam);
227 if ( !b ) b =
refs()->Branch(nam,0,(typ+
"/C").c_str());
229 for(i=b->GetEntries(), n=Long64_t(v.size()); i<n; ++
i) {
230 val = (this->*pmf)(v[
size_t(i)]);
231 b->SetAddress((
char*)val.
c_str());
242 if ( !
saveBranch(
"Databases",
dbs(), &RootTool::getEntry).isSuccess() )
244 if ( !
saveBranch(
"Containers",
conts(), &RootTool::getEntry).isSuccess() )