13 #include <TCollection.h> 
   52       return strcmp (b1.GetName(), b2.GetName()) < 0;
 
   89                        ::Double_t minEvFrac )
 
   92          ::Long64_t maxEntries = 0;
 
   93          xAOD::ReadStats::Vector_t::const_iterator vitr, vend;
 
   94          xAOD::ReadStats::Map_t::const_iterator itr = 
branches.begin();
 
   95          xAOD::ReadStats::Map_t::const_iterator 
end = 
branches.end();
 
   96          for( ; itr != 
end; ++itr ) {
 
   97             vitr = itr->second.begin();
 
   98             vend = itr->second.end();
 
   99             for( ; vitr != vend; ++vitr ) {
 
  100                if( ! *vitr ) 
continue;
 
  101                if( ( *vitr )->readEntries() > maxEntries ) {
 
  102                   maxEntries = ( *vitr )->readEntries();
 
  107          m_entries = 
static_cast< ::Long64_t 
>( minEvFrac * maxEntries );
 
  113          return var.readEntries() >= m_entries;
 
  117       ::Long64_t m_entries; 
 
  136       SelectByBytes( ::Long64_t bytes ) : m_bytes( bytes ) {}
 
  140                      ::Double_t minByteFrac )
 
  143          ::Long64_t maxBytes = 0;
 
  144          xAOD::ReadStats::Vector_t::const_iterator vitr, vend;
 
  145          xAOD::ReadStats::Map_t::const_iterator itr = 
branches.begin();
 
  146          xAOD::ReadStats::Map_t::const_iterator 
end = 
branches.end();
 
  147          for( ; itr != 
end; ++itr ) {
 
  148             vitr = itr->second.begin();
 
  149             vend = itr->second.end();
 
  150             for( ; vitr != vend; ++vitr ) {
 
  151                if( ! *vitr ) 
continue;
 
  152                if( ( *vitr )->zippedBytesRead() > maxBytes ) {
 
  153                   maxBytes = ( *vitr )->zippedBytesRead();
 
  158          m_bytes = 
static_cast< ::Long64_t 
>( minByteFrac * maxBytes );
 
  164          return var.zippedBytesRead() >= m_bytes;
 
  182    template< 
class SELECTOR >
 
  188       xAOD::ReadStats::Map_t::const_iterator itr = 
branches.begin();
 
  189       xAOD::ReadStats::Map_t::const_iterator 
end = 
branches.end();
 
  190       for( ; itr != 
end; ++itr ) {
 
  191          for( 
size_t auxid = 0; auxid < itr->second.size(); ++auxid ) {
 
  192             if( ! itr->second[ auxid ] ) 
continue;
 
  193             if( ! 
selector( *( itr->second[ auxid ] ) ) ) 
continue;
 
  195                const std::string 
brName = itr->first +
 
  197                tree->AddBranchToCache( 
brName.c_str(), kTRUE );
 
  214    template< 
class SELECTOR >
 
  215    std::vector< std::string >
 
  220       std::vector< std::string > 
result;
 
  223       xAOD::ReadStats::Map_t::const_iterator itr = 
branches.begin();
 
  224       xAOD::ReadStats::Map_t::const_iterator 
end = 
branches.end();
 
  225       for( ; itr != 
end; ++itr ) {
 
  226          for( 
size_t auxid = 0; auxid < itr->second.size(); ++auxid ) {
 
  228             if( ! itr->second[ auxid ] ) 
continue;
 
  230             if( ! 
selector( *( itr->second[ auxid ] ) ) ) 
continue;
 
  232             const std::string 
brName = itr->first +
 
  258                              ::Int_t nTreesAccessed, ::Long64_t nReadEntries,
 
  259                              ::Long64_t nUnzippedBytes, ::Long64_t nZippedBytes )
 
  260       : TNamed( 
name, 
type ), m_treesAccessed( nTreesAccessed ),
 
  261         m_readEntries( nReadEntries ), m_unzippedBytes( nUnzippedBytes ),
 
  262         m_zippedBytes( nZippedBytes ) {
 
  271    BranchStats::BranchStats( 
const BranchStats& 
parent )
 
  272       : TNamed( 
parent ), m_treesAccessed( 
parent.m_treesAccessed ),
 
  273         m_readEntries( 
parent.m_readEntries ),
 
  274         m_unzippedBytes( 
parent.m_unzippedBytes ),
 
  275         m_zippedBytes( 
parent.m_zippedBytes ) {
 
  293       SetName( 
parent.GetName() );
 
  294       SetTitle( 
parent.GetTitle() );
 
  297       m_treesAccessed = 
parent.m_treesAccessed;
 
  298       m_readEntries   = 
parent.m_readEntries;
 
  299       m_unzippedBytes = 
parent.m_unzippedBytes;
 
  300       m_zippedBytes   = 
parent.m_zippedBytes;
 
  305    ::Int_t BranchStats::treesAccessed()
 const {
 
  307       return m_treesAccessed;
 
  310    void BranchStats::setTreesAccessed( ::Int_t nTreesAccessed ) {
 
  312       m_treesAccessed = nTreesAccessed;
 
  316    ::Long64_t BranchStats::readEntries()
 const {
 
  318       return m_readEntries;
 
  321    void BranchStats::setReadEntries( ::Long64_t nReadEntries ) {
 
  323       m_readEntries = nReadEntries;
 
  327    ::Long64_t BranchStats::unzippedBytesRead()
 const {
 
  329       return m_unzippedBytes;
 
  332    void BranchStats::setUnzippedBytesRead( ::Long64_t nUnzippedBytes ) {
 
  334       m_unzippedBytes = nUnzippedBytes;
 
  338    ::Long64_t BranchStats::zippedBytesRead()
 const {
 
  340       return m_zippedBytes;
 
  343    void BranchStats::setZippedBytesRead( ::Long64_t nZippedBytes ) {
 
  345       m_zippedBytes = nZippedBytes;
 
  352       SetName( rh.GetName() );
 
  353       SetTitle( rh.GetTitle() );
 
  356       m_treesAccessed += rh.m_treesAccessed;
 
  357       m_readEntries   += rh.m_readEntries;
 
  358       m_unzippedBytes += rh.m_unzippedBytes;
 
  359       m_zippedBytes   += rh.m_zippedBytes;
 
  364    BranchStats& BranchStats::operator+= ( 
const BranchStats& rh ) {
 
  376    ::Int_t BranchStats::Merge( ::TCollection* coll ) {
 
  379       if( ! coll ) 
return 0;
 
  380       if( coll->IsEmpty() ) 
return 0;
 
  383       ::TIter 
next( coll );
 
  384       ::TObject* 
obj = 
nullptr;
 
  389          BranchStats* vobj = 
dynamic_cast< BranchStats* 
>( 
obj );
 
  391             Error( 
"Merge", 
"Unknown object type encountered: %s",
 
  416       Info( 
"Print", 
"Branch name \"%s\", type \"%s\", read %lli times",
 
  417             GetName(), GetTitle(), m_readEntries );
 
  420       if( ! ::strcmp( option, 
"All" ) ) {
 
  421          Info( 
"Print", 
"  TTrees accessed for this branch: %i",
 
  423          Info( 
"Print", 
"  Number of entries read         : %lli",
 
  425          Info( 
"Print", 
"  Number of unzipped bytes read  : %lli",
 
  427          Info( 
"Print", 
"  Number of zipped bytes read    : %lli",
 
  441    ReadStats::ReadStats( 
const char* 
name, 
const char* 
title )
 
  442      : ::TNamed( 
name, 
title ), m_branches(), m_containers(),
 
  443         m_bytesRead( 0 ), m_branchNum( 0 ),
 
  444         m_fileReads( 0 ), m_cacheSize( 0 ), m_readTime( 0.0 ),
 
  445         m_unzipTime( 0.0 ), m_processTime( 0.0 ),
 
  446         m_nEvents( 0 ), m_nEventsProcessed ( 0 ) {
 
  455    ReadStats::ReadStats( 
const ReadStats& 
parent )
 
  457         m_containers(
parent.m_containers),
 
  458         m_bytesRead( 
parent.m_bytesRead ), m_branchNum( 
parent.m_branchNum ),
 
  459         m_fileReads( 
parent.m_fileReads ), m_cacheSize( 
parent.m_cacheSize ),
 
  460         m_readTime( 
parent.m_readTime ),
 
  461         m_unzipTime( 
parent.m_unzipTime ),
 
  462         m_processTime( 
parent.m_processTime ), 
 
  463          m_nEvents( 
parent.m_nEvents ),
 
  464          m_nEventsProcessed( 
parent.m_nEventsProcessed ){
 
  471    ReadStats::~ReadStats() {
 
  475       for( ; mitr != mend; ++mitr ) {
 
  478          for( ; vitr != vend; ++vitr ) {
 
  479             if( ! *vitr ) 
continue;
 
  499       SetName( 
parent.GetName() );
 
  500       SetTitle( 
parent.GetTitle() );
 
  503       m_branches         = 
parent.m_branches;
 
  504       m_containers       = 
parent.m_containers;
 
  505       m_bytesRead        = 
parent.m_bytesRead;
 
  506       m_branchNum        = 
parent.m_branchNum;
 
  507       m_fileReads        = 
parent.m_fileReads;
 
  508       m_cacheSize        = 
parent.m_cacheSize;
 
  509       m_readTime         = 
parent.m_readTime;
 
  510       m_unzipTime        = 
parent.m_unzipTime;
 
  511       m_processTime      = 
parent.m_processTime;
 
  512       m_nEvents          = 
parent.m_nEvents;
 
  513       m_nEventsProcessed = 
parent.m_nEventsProcessed;
 
  518    void ReadStats::Clear( ::Option_t* ) {
 
  522       m_containers.clear();
 
  531       m_nEventsProcessed = 0;
 
  536    void ReadStats::setBytesRead( ::Long64_t 
num ) {
 
  542    ::Long64_t ReadStats::bytesRead()
 const {
 
  547    void ReadStats::setBranchNum( ::Int_t 
num ) {
 
  553    ::Int_t ReadStats::branchNum()
 const {
 
  558    void ReadStats::setFileReads( ::Int_t 
num ) {
 
  564    ::Int_t ReadStats::fileReads()
 const {
 
  569    void ReadStats::setCacheSize( ::Int_t 
size ) {
 
  575    ::Int_t ReadStats::cacheSize()
 const {
 
  580    void ReadStats::setReadTime( ::Double_t 
time ) {
 
  586    ::Double_t ReadStats::readTime()
 const {
 
  591    void ReadStats::setUnzipTime( ::Double_t 
time ) {
 
  597    ::Double_t ReadStats::unzipTime()
 const {
 
  602    void ReadStats::setProcessTime( ::Double_t 
time ) {
 
  604       m_processTime = 
time;
 
  608    ::Double_t ReadStats::processTime()
 const {
 
  610       return m_processTime;
 
  625       if( 
vec.size() <= auxid ) {
 
  626          vec.resize( auxid + 1 );
 
  629       if( ! 
vec[ auxid ] ) {
 
  633          const std::type_info* brType =
 
  636             Error( 
"branch", 
"Coudln't find type_info for aux ID %i",
 
  637                    static_cast< int >( auxid ) );
 
  643          vec[ auxid ] = 
new BranchStats( 
brName.c_str(), brTypeName.c_str() );
 
  661       Map_t::const_iterator itr = m_branches.find( 
prefix );
 
  662       if( itr != m_branches.end() ) {
 
  663          const Vector_t& 
vec = itr->second;
 
  664          if( ( 
vec.size() > auxid ) && 
vec[ auxid ] ) {
 
  673    BranchStats* ReadStats::container( 
const std::string& 
name ) {
 
  676       auto ret = m_containers.try_emplace (
name, 
name.c_str(), 
"CONTAINER");
 
  678       return &ret.first->second;
 
  681    const BranchStats* ReadStats::container( 
const std::string& 
name )
 const {
 
  684       MapC_t::const_iterator itr = m_containers.find( 
name );
 
  685       if( itr != m_containers.end() ) {
 
  686          return &( itr->second );
 
  712    bool ReadStats::isCompatible( 
const ReadStats& rh )
 const {
 
  714       return ( m_branchNum == rh.branchNum() ) &&
 
  716           ( m_cacheSize == rh.cacheSize() );
 
  727       Map_t::const_iterator itr = rh.m_branches.begin();
 
  728       Map_t::const_iterator 
end = rh.m_branches.end();
 
  729       for( ; itr != 
end; ++itr ) {
 
  730          const Vector_t& rhvec = itr->second;
 
  731          Vector_t& 
vec = m_branches[ itr->first ];
 
  732          if( 
vec.size() < rhvec.size() ) {
 
  733             vec.resize( rhvec.size() );
 
  735          for( 
size_t auxid = 0; auxid < rhvec.size(); ++auxid ) {
 
  736             if( ! rhvec[ auxid ] ) 
continue;
 
  737             if( ! 
vec[ auxid ] ) {
 
  738                vec[ auxid ] = 
new BranchStats();
 
  740             vec[ auxid ]->add( *( rhvec[ auxid ] ) );
 
  745       m_bytesRead   += rh.m_bytesRead;
 
  746       m_fileReads   += rh.m_fileReads;
 
  747       m_readTime    += rh.m_readTime;
 
  748       m_unzipTime   += rh.m_unzipTime;
 
  749       m_processTime += rh.m_processTime;
 
  754    ReadStats& ReadStats::operator+= ( 
const ReadStats& rh ) {
 
  767    void ReadStats::addToTreeCache( ::TTree* 
tree )
 const {
 
  771                                       SelectByEntries( 0 ) );
 
  774       Info( 
"addToTreeCache", 
"Added %i branches to the TTreeCache",
 
  788    void ReadStats::addToTreeCacheByEntries( ::TTree* 
tree,
 
  789                                             ::Long64_t minEntries )
 const {
 
  793                                       SelectByEntries( minEntries ) );
 
  796       Info( 
"addToTreeCacheByEntries", 
"Added %i branches to the TTreeCache",
 
  812    void ReadStats::addToTreeCacheByEntryFrac( ::TTree* 
tree,
 
  813                                               ::Double_t minEvFraction )
 const {
 
  817                                       SelectByEntries( m_branches,
 
  821       Info( 
"addToTreeCacheByEntries", 
"Added %i branches to the TTreeCache",
 
  834    void ReadStats::addToTreeCacheByBytes( ::TTree* 
tree,
 
  835                                           ::Long64_t minBytes )
 const {
 
  839                                       SelectByBytes( minBytes ) );
 
  842       Info( 
"addToTreeCacheByBytes", 
"Added %i branches to the TTreeCache",
 
  857    ReadStats::addToTreeCacheByByteFrac( ::TTree* 
tree,
 
  858                                         ::Double_t minByteFraction )
 const {
 
  862                                       SelectByBytes( m_branches,
 
  866       Info( 
"addToTreeCacheByBytes", 
"Added %i branches to the TTreeCache",
 
  878    std::vector< std::string >
 
  879    ReadStats::branchesByEntries( ::Long64_t minEntries )
 const {
 
  881       return getBranches( m_branches, SelectByEntries( minEntries ) );
 
  890    std::vector< std::string >
 
  891    ReadStats::branchesByEntryFrac( ::Double_t minEvFrac )
 const {
 
  893       return getBranches( m_branches,
 
  894                           SelectByEntries( m_branches, minEvFrac ) );
 
  903    std::vector< std::string >
 
  904    ReadStats::branchesByBytes( ::Long64_t minBytes )
 const {
 
  906       return getBranches( m_branches, SelectByBytes( minBytes ) );
 
  916    std::vector< std::string >
 
  917    ReadStats::branchesByByteFrac( ::Double_t minByteFraction )
 const {
 
  919       return getBranches( m_branches,
 
  920                           SelectByBytes( m_branches, minByteFraction ) );
 
  930    ::TH1* ReadStats::treeAccessStat()
 const {
 
  933       ::Long64_t maxTrees = 0;
 
  934       Vector_t::const_iterator vitr, vend;
 
  935       Map_t::const_iterator itr = m_branches.begin();
 
  936       Map_t::const_iterator 
end = m_branches.end();
 
  937       for( ; itr != 
end; ++itr ) {
 
  938          vitr = itr->second.begin();
 
  939          vend = itr->second.end();
 
  940          for( ; vitr != vend; ++vitr ) {
 
  941             if( ! *vitr ) 
continue;
 
  942             if( ( *vitr )->treesAccessed() > maxTrees ) {
 
  943                maxTrees = ( *vitr )->treesAccessed();
 
  949       ::TH1* 
result = new ::TH1D( 
"TreeAccessStat",
 
  950                                   "TTree access statistics;TTrees;Branches",
 
  951                                   100, 0.0, ( ( ::Double_t ) maxTrees ) * 1.1 );
 
  954       itr = m_branches.begin();
 
  955       end = m_branches.end();
 
  956       for( ; itr != 
end; ++itr ) {
 
  957          vitr = itr->second.begin();
 
  958          vend = itr->second.end();
 
  959          for( ; vitr != vend; ++vitr ) {
 
  960             if( ! *vitr ) 
continue;
 
  961             result->Fill( ( ::Double_t ) ( *vitr )->treesAccessed() );
 
  975    ::TH1* ReadStats::entryReadStat()
 const {
 
  978       ::Long64_t maxEntries = 0;
 
  979       Vector_t::const_iterator vitr, vend;
 
  980       Map_t::const_iterator itr = m_branches.begin();
 
  981       Map_t::const_iterator 
end = m_branches.end();
 
  982       for( ; itr != 
end; ++itr ) {
 
  983          vitr = itr->second.begin();
 
  984          vend = itr->second.end();
 
  985          for( ; vitr != vend; ++vitr ) {
 
  986             if( ! *vitr ) 
continue;
 
  987             if( ( *vitr )->readEntries() > maxEntries ) {
 
  988                maxEntries = ( *vitr )->readEntries();
 
  994       ::TH1* 
result = new ::TH1D( 
"EntryAccessStat",
 
  995                                   "Entry access statistics;Entries;Branches",
 
  997                                   ( ( ::Double_t ) maxEntries ) * 1.1 );
 
 1000       itr = m_branches.begin();
 
 1001       end = m_branches.end();
 
 1002       for( ; itr != 
end; ++itr ) {
 
 1003          vitr = itr->second.begin();
 
 1004          vend = itr->second.end();
 
 1005          for( ; vitr != vend; ++vitr ) {
 
 1006             if( ! *vitr ) 
continue;
 
 1007             result->Fill( ( ::Double_t ) ( *vitr )->readEntries() );
 
 1021    ::TH1* ReadStats::zippedByteReadStat()
 const {
 
 1024       ::Long64_t maxBytes = 0;
 
 1025       Vector_t::const_iterator vitr, vend;
 
 1026       Map_t::const_iterator itr = m_branches.begin();
 
 1027       Map_t::const_iterator 
end = m_branches.end();
 
 1028       for( ; itr != 
end; ++itr ) {
 
 1029          vitr = itr->second.begin();
 
 1030          vend = itr->second.end();
 
 1031          for( ; vitr != vend; ++vitr ) {
 
 1032             if( ! *vitr ) 
continue;
 
 1033             if( ( *vitr )->zippedBytesRead() > maxBytes ) {
 
 1034                maxBytes = ( *vitr )->zippedBytesRead();
 
 1040       ::TH1* 
result = new ::TH1D( 
"ZippedByteAccessStat",
 
 1041                                   "Zipped byte access statistics;Bytes;Branches",
 
 1042                                   100, 0.0, ( ( ::Double_t ) maxBytes ) * 1.1 );
 
 1045       itr = m_branches.begin();
 
 1046       end = m_branches.end();
 
 1047       for( ; itr != 
end; ++itr ) {
 
 1048          vitr = itr->second.begin();
 
 1049          vend = itr->second.end();
 
 1050          for( ; vitr != vend; ++vitr ) {
 
 1051             if( ! *vitr ) 
continue;
 
 1052             result->Fill( ( ::Double_t ) ( *vitr )->zippedBytesRead() );
 
 1066    ::TH1* ReadStats::unzippedByteReadStat()
 const {
 
 1069       ::Long64_t maxBytes = 0;
 
 1070       Vector_t::const_iterator vitr, vend;
 
 1071       Map_t::const_iterator itr = m_branches.begin();
 
 1072       Map_t::const_iterator 
end = m_branches.end();
 
 1073       for( ; itr != 
end; ++itr ) {
 
 1074          vitr = itr->second.begin();
 
 1075          vend = itr->second.end();
 
 1076          for( ; vitr != vend; ++vitr ) {
 
 1077             if( ! *vitr ) 
continue;
 
 1078             if( ( *vitr )->unzippedBytesRead() > maxBytes ) {
 
 1079                maxBytes = ( *vitr )->unzippedBytesRead();
 
 1086            new ::TH1D( 
"UnzippedByteAccessStat",
 
 1087                        "Unzipped byte access statistics;Bytes;Branches",
 
 1088                        100, 0.0, ( ( ::Double_t ) maxBytes ) * 1.1 );
 
 1091       itr = m_branches.begin();
 
 1092       end = m_branches.end();
 
 1093       for( ; itr != 
end; ++itr ) {
 
 1094          vitr = itr->second.begin();
 
 1095          vend = itr->second.end();
 
 1096          for( ; vitr != vend; ++vitr ) {
 
 1097             if( ! *vitr ) 
continue;
 
 1098             result->Fill( ( ::Double_t ) ( *vitr )->unzippedBytesRead() );
 
 1112    ::Int_t ReadStats::Merge( ::TCollection* coll ) {
 
 1115       if( ! coll ) 
return 0;
 
 1116       if( coll->IsEmpty() ) 
return 0;
 
 1119       ::TIter 
next( coll );
 
 1120       ::TObject* 
obj = 
nullptr;
 
 1125          ReadStats* dobj = 
dynamic_cast< ReadStats* 
>( 
obj );
 
 1127             Error( 
"Merge", 
"Unknown object type encountered: %s",
 
 1158       Info( 
"Print", 
"Printing xAOD I/O statistics" );
 
 1162       std::vector< BranchStats > conts;
 
 1163       MapC_t::const_iterator cont_itr = m_containers.begin();
 
 1164       MapC_t::const_iterator cont_end = m_containers.end();
 
 1165       for( ; cont_itr != cont_end; ++cont_itr ) {
 
 1166          conts.push_back( cont_itr->second );
 
 1171       std::vector< BranchStats > vars;
 
 1172       Vector_t::const_iterator vec_itr, vec_end;
 
 1173       Map_t::const_iterator map_itr = m_branches.begin();
 
 1174       Map_t::const_iterator map_end = m_branches.end();
 
 1175       for( ; map_itr != map_end; ++map_itr ) {
 
 1176          vec_itr = map_itr->second.begin();
 
 1177          vec_end = map_itr->second.end();
 
 1178          for( ; vec_itr != vec_end; ++vec_itr ) {
 
 1179             if( ! *vec_itr ) 
continue;
 
 1180             vars.push_back( **vec_itr );
 
 1185       if( ! ::strcmp( option, 
"SmartSlimming" ) ) {
 
 1187          Info( 
"Print", 
" " );
 
 1188          Info( 
"Print", 
"Smart Slimming Statistics" );
 
 1189          Info( 
"Print", 
" " );
 
 1191          const Double_t proFrac = ( ( Double_t ) m_nEventsProcessed /
 
 1192                                     ( Double_t ) m_nEvents ) * 100.0;
 
 1193          Info( 
"Print", 
"  Processed %lli events from %lli (%g%%)",
 
 1194                m_nEventsProcessed, m_nEvents, proFrac );
 
 1196          Info( 
"Print", 
"  Number of containers in on the input: %i",
 
 1197                static_cast< int >( m_containers.size() ) );
 
 1198          Info( 
"Print", 
"  Number of branches on the input: %i",
 
 1199                static_cast< int >( vars.size() ) );
 
 1202          std::sort( conts.begin(), conts.end(), sortByEntries );
 
 1205          Info( 
"Print", 
" " );
 
 1206          Info( 
"Print", 
"Accessed containers:" );
 
 1207          Info( 
"Print", 
" " );
 
 1208          std::vector< BranchStats >::const_iterator itr = conts.begin();
 
 1209          std::vector< BranchStats >::const_iterator 
end = conts.end();
 
 1210          for( ; itr != 
end; ++itr ) {
 
 1211             if( ! itr->readEntries() ) 
continue;
 
 1212             itr->Print( option );
 
 1216          std::sort( vars.begin(), vars.end(), sortByEntries );
 
 1219          Info( 
"Print", 
" " );
 
 1220          Info( 
"Print", 
"Accessed branches:" );
 
 1221          Info( 
"Print", 
" " );
 
 1224          for( ; itr != 
end; ++itr ) {
 
 1225             if( ! itr->readEntries() ) 
continue;
 
 1226             itr->Print( option );
 
 1228          Info( 
"Print", 
" " );
 
 1235       Info( 
"Print", 
"  Number of variables in the input xAOD : %i",
 
 1237       const Double_t proFrac = ( ( Double_t ) m_nEventsProcessed /
 
 1238                                  ( Double_t ) m_nEvents ) * 100.0;
 
 1239       Info( 
"Print", 
"  Processed events                      : " 
 1240             "%lli/%lli (%g%%)", m_nEventsProcessed, m_nEvents, proFrac );
 
 1241       Info( 
"Print", 
"  TTreeCache size used                  : %s",
 
 1243       Info( 
"Print", 
"  Total number of bytes read            : %s",
 
 1245       Info( 
"Print", 
"  Data reading speed per process        : %s",
 
 1246             ( std::abs( m_processTime ) > 0.0001 ?
 
 1249       Info( 
"Print", 
"  Total number of file read operations  : %i",
 
 1251       const ::Long64_t readInOneGo =
 
 1252          ( ::Long64_t ) ( ( ::Double_t ) m_bytesRead /
 
 1253                           ( ::Double_t ) m_fileReads );
 
 1254       Info( 
"Print", 
"  Data read in one go (on average)      : %s",
 
 1256       Info( 
"Print", 
"  Cumulative time spent processing data : %s (%s/event)",
 
 1258             ( m_nEventsProcessed ?
 
 1261       Info( 
"Print", 
"  Cumulative time spent reading data    : %s (%s/event)",
 
 1263             ( m_nEventsProcessed ?
 
 1266       Info( 
"Print", 
"  Cumulative time spent unzipping data  : %s (%s/event)",
 
 1268             ( m_nEventsProcessed ?
 
 1273       if( ! ::strcmp( option, 
"Summary" ) ) {
 
 1278       if( ! ::strcmp( option, 
"ByEntries" ) ) {
 
 1279          Info( 
"Print", 
"Containers, sorted by number of accesses:" );
 
 1280          std::sort( conts.begin(), conts.end(), sortByEntries );
 
 1281       } 
else if( ! ::strcmp( option, 
"ByBytes" ) ) {
 
 1282          Info( 
"Print", 
"Containers, sorted by number of bytes read:" );
 
 1283          std::sort( conts.begin(), conts.end(), sortByUnzippedBytes );
 
 1285          Info( 
"Print", 
"Containers, sorted by name:" );
 
 1289       std::vector< BranchStats >::const_iterator itr = conts.begin();
 
 1290       std::vector< BranchStats >::const_iterator 
end = conts.end();
 
 1291       for( ; itr != 
end; ++itr ) {
 
 1292          itr->Print( option );
 
 1296       if( ! ::strcmp( option, 
"ByEntries" ) ) {
 
 1297          Info( 
"Print", 
"Variables, sorted by number of accesses:" );
 
 1298          std::sort( vars.begin(), vars.end(), sortByEntries );
 
 1299       } 
else if( ! ::strcmp( option, 
"ByBytes" ) ) {
 
 1300          Info( 
"Print", 
"Variables, sorted by number of bytes read:" );
 
 1301          std::sort( vars.begin(), vars.end(), sortByUnzippedBytes );
 
 1303          Info( 
"Print", 
"Variables, sorted by name:" );
 
 1309       for( ; itr != 
end; ++itr ) {
 
 1310          itr->Print( option );
 
 1326    void ReadStats::printSmartSlimmingBranchList( 
bool autoIncludeLinks )
 const {
 
 1329       std::map< ::TString, ::TString > 
items;
 
 1332       MapC_t::const_iterator cont_itr = m_containers.begin();
 
 1333       MapC_t::const_iterator cont_end = m_containers.end();
 
 1334       for( ; cont_itr != cont_end; ++cont_itr ) {
 
 1336          if( ! cont_itr->second.readEntries() ) 
continue;
 
 1338          items[ cont_itr->first ] = 
"";
 
 1342       Map_t::const_iterator br_itr = m_branches.begin();
 
 1343       Map_t::const_iterator br_end = m_branches.end();
 
 1344       for( ; br_itr != br_end; ++br_itr ) {
 
 1347          bool containerAccessed = 
false;
 
 1348          Vector_t::const_iterator itr = br_itr->second.begin();
 
 1349          Vector_t::const_iterator 
end = br_itr->second.end();
 
 1350          for( ; itr != 
end; ++itr ) {
 
 1351             if( ( *itr ) && ( *itr )->readEntries() ) {
 
 1352                containerAccessed = 
true;
 
 1357          if( ! containerAccessed ) 
continue;
 
 1359          for( ; itr != 
end; ++itr ) {
 
 1361             const bool linkType =
 
 1363                  ::TString( ( *itr )->GetTitle() ).Contains( 
"ElementLink" ) );
 
 1366             if( ( ( ! *itr ) || ( ! ( *itr )->readEntries() ) ) &&
 
 1367                 ( ! ( autoIncludeLinks && linkType ) ) ) 
continue;
 
 1370             const ::TString brname = ( *itr )->GetName();
 
 1371             const ::Size_t dotPos = brname.First( 
'.' );
 
 1372             if( dotPos == ::kNPOS ) {
 
 1376             const ::TString cname = brname( 0, dotPos + 1 );
 
 1377             const ::TString vname = brname( dotPos + 1,
 
 1378                                             brname.Length() - dotPos );
 
 1380             ::TString& vars = 
items[ cname ];
 
 1382             if( vars.Length() ) {
 
 1386             vars.Append( vname );
 
 1391       Info( 
"printSmartSlimmingBranchList", 
"ItemList to use:" );
 
 1392       if( autoIncludeLinks ) {
 
 1393          Info( 
"printSmartSlimmingBranchList", 
"(All link variables added)" );
 
 1395       std::map< ::TString, ::TString >::const_iterator itr = 
items.begin();
 
 1396       std::map< ::TString, ::TString >::const_iterator 
end = 
items.end();
 
 1397       for( ; itr != 
end; ++itr ) {
 
 1398          if( itr->first.EndsWith( 
"Aux." ) ) {
 
 1399             Info( 
"printSmartSlimmingBranchList", 
"  %s%s",
 
 1401                   ( itr->second.Length() ? itr->second.Data() : 
"-" ) );
 
 1403             Info( 
"printSmartSlimmingBranchList", 
"  %s",
 
 1404                   itr->first.Data() );
 
 1412    void ReadStats::nextEvent(){
 
 1415       ++m_nEventsProcessed;
 
 1424    void ReadStats::setNEvents( ::Long64_t 
nevents ) {
 
 1430    void ReadStats::readBranch( 
const std::string& 
prefix,
 
 1436       stat->setReadEntries( 
stat->readEntries() + 1 );
 
 1440    void ReadStats::readContainer( 
const std::string& 
name ){
 
 1443       BranchStats* 
stat = container( 
name );
 
 1445       stat->setReadEntries( 
stat->readEntries() + 1 );