Go to the documentation of this file.
   31     TBranch* 
getBranch( std::string_view section, std::string_view branch_name )
 override {
 
   34       for ( 
int i = 0, 
m = 
n.length() - 1; i < 
m; ++i )
 
   35         if ( !isalnum( 
n[i] ) ) 
n[i] = 
'_';
 
   37       TBranch* b = 
t ? 
t->GetBranch( 
n.c_str() ) : 
nullptr;
 
   39       if ( b ) b->SetAutoDelete( kFALSE );
 
   47         b->SetAddress( &prefs );
 
   48         int nb = b->GetEntry( entry );
 
   54             pair<const RootRef*, const ContainerSection*> ls = 
c->
getMergeSection( cnt, entry );
 
   56               if ( ls.first->dbase >= 0 ) {
 
   59                 if ( 
msg.isActive() ) {
 
   60                   msg << 
"Refs: LS [" << entry << 
"] -> " << ls.first->dbase << 
"," << ls.first->container << 
"," 
   61                       << ls.first->link << 
"," << ls.first->entry << 
endmsg;
 
   63                 for ( 
size_t j = 0, 
n = 
refs.refs.size(); j < 
n; ++j ) {
 
   65                   if ( 
r.entry >= 0 && 
r.dbase >= 0 ) {
 
   66                     int db = 
r.dbase + ls.first->dbase;
 
   68                       if ( 
r.dbase ) 
r.dbase += ls.first->dbase;
 
   69                       if ( 
r.container ) 
r.container += ls.first->container;
 
   70                       if ( 
r.link ) 
r.link += ls.first->link;
 
   72                       auto          k  = 
ms.find( 
rc );
 
   73                       if ( k != 
ms.end() ) {
 
   74                         const auto& cs = ( *k ).second;
 
   75                         r.entry        = ( ls.first->entry >= 0 && ls.first->entry < (int)cs.size() )
 
   76                                       ? cs[ls.first->entry].start + 
r.entry
 
   78                         if ( 
msg.isActive() ) {
 
   79                           msg << 
"Add link [" << 
r.entry << 
"," << ls.first->entry << 
"," << ls.first->container << 
"," 
   80                               << 
r.container << 
"," << 
r.entry << 
"] to -> " << 
rc << 
endmsg;
 
   84                             << 
" Invalid link to " << 
rc << 
endmsg;
 
   92                                [&]( 
int& i ) { i += ls.first->link; } );
 
  105       char* q = strchr( p, 
'=' );
 
  108         c.emplace_back( p, ++q );
 
  114     template <
class C, 
class F>
 
  117       TBranch* b = 
t->GetBranch( nam );
 
  119         TLeaf* 
l = b->GetLeaf( nam );
 
  122           b->SetAddress( text );
 
  124           for ( Long64_t i = 0, 
n = b->GetEntries(); i < 
n; ++i ) {
 
  125             if ( b->GetEntry( i ) > 0 ) {
 
  126               char* p = (
char*)
l->GetValuePointer();
 
  127               msgSvc() << 
"Add Value[" << b->GetName() << 
"]:" << p << 
endmsg;
 
  128               ( this->*pmf )( 
v, p );
 
  140     bool get( 
const string& dsc, pair<string, ContainerSection>& e ) {
 
  141       if ( dsc != 
"[END-OF-SECTION]" ) {
 
  142         size_t id1 = dsc.find( 
"[CNT=" );
 
  143         size_t id2 = dsc.find( 
"[START=" );
 
  144         size_t id3 = dsc.find( 
"[LEN=" );
 
  145         if ( id1 != string::npos && id2 != string::npos && id3 != string::npos ) {
 
  146           string cnt            = dsc.substr( id1 + 5, id2 - 1 - 5 );
 
  147           int    section_start  = 
std::stoi( dsc.substr( id2 + 7, id3 - id2 - 8 ) );
 
  148           int    section_length = 
std::stoi( dsc.substr( id3 + 5, dsc.find( 
"]", id3 + 5 ) - id3 - 5 ) );
 
  162       pair<string, ContainerSection> e;
 
  169       r.dbase = 
r.container = 
r.link = 
r.clid = 
r.svc = 
r.entry = 0;
 
  170       for ( 
const auto& i : tmp ) {
 
  172           msg << 
"Added Merge Section:" << e.first << 
endmsg;
 
  173           ms[e.first].push_back( e.second );
 
  174           if ( e.first == 
"Links" )
 
  175             r.link = e.second.start;
 
  176           else if ( e.first == 
"Containers" )
 
  177             r.container = e.second.start;
 
  178           else if ( e.first == 
"Databases" )
 
  179             r.dbase = e.second.start;
 
  180           else if ( e.first == 
"Params" )
 
  181             r.svc = e.second.start;
 
  182         } 
else if ( i == 
"[END-OF-SECTION]" ) {
 
  184           if ( 
msg.isActive() ) {
 
  185             msg << 
"Link Section [" << 
r.entry << 
"," << ls.
size() << 
"] -> D:" << 
r.dbase << 
" C:" << 
r.container
 
  186                 << 
" L:" << 
r.link << 
" P:" << 
r.svc << 
endmsg;
 
  195       TTree*     
t  = (TTree*)
c->
file()->Get( 
"Sections" );
 
  213     string getParam( 
const pair<string, string>& p ) { 
return p.first + 
"=" + p.second; }
 
  215     template <
class C, 
class F>
 
  218       string               val, typ = nam;
 
  220       TDirectory::TContext ctxt( 
c->
file() );
 
  221       TBranch*             b = 
refs()->GetBranch( nam );
 
  222       if ( !b ) b = 
refs()->Branch( nam, 0, ( typ + 
"/C" ).c_str() );
 
  224         for ( i = b->GetEntries(), 
n = Long64_t( 
v.size() ); i < 
n; ++i ) {
 
  225           val = ( this->*pmf )( 
v[
size_t( i )] );
 
  226           b->SetAddress( (
char*)val.c_str() );
 
  
 
const std::string & getDb(int which) const
Access database/file name from saved index.
const std::string & getCont(int which) const
Access container name from saved index.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
TFile * file() const
Direct access to TFile structure.
Header file for std:chrono::duration-based Counters.
constexpr static const auto SUCCESS
TTree * getSection(std::string_view sect, bool create=false)
Access TTree section from section name. The section is created if required.
const MergeSections & mergeSections() const
Access merged data section inventory.
std::pair< const RootRef *, const ContainerSection * > getMergeSection(std::string_view container, int entry) const
Access link section for single container and entry.
const std::string & fid() const
Access file id.
constexpr static const auto FAILURE