Public Types | Public Member Functions | Private Attributes | List of all members
art::RootInputTree Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/art/v2_13_00/source/art/Framework/IO/Root/RootInputTree.h"

Public Types

using BranchMap = input::BranchMap
 
using EntryNumber = input::EntryNumber
 
using EntryNumbers = input::EntryNumbers
 

Public Member Functions

 RootInputTree (cet::exempt_ptr< TFile >, BranchType, int64_t saveMemoryObjectThreshold, cet::exempt_ptr< RootInputFile >, bool compactSubRunRanges=false, bool missingOK=false, bool rangesEnabled=true)
 
 RootInputTree (RootInputTree const &)=delete
 
RootInputTreeoperator= (RootInputTree const &)=delete
 
 operator bool () const
 
bool isValid () const
 
bool hasBranch (std::string const &branchName) const
 
void addBranch (BranchKey const &, BranchDescription const &)
 
void dropBranch (std::string const &branchName)
 
bool next ()
 
bool previous ()
 
bool current (EntryNumbers const &numbers)
 
void rewind ()
 
EntryNumber entryNumber () const
 
EntryNumber entries () const
 
void setEntryNumber (EntryNumber theEntryNumber)
 
void fillGroups (Principal &p)
 
std::unique_ptr< DelayedReadermakeDelayedReader (FileFormatVersion, cet::exempt_ptr< BranchIDLists const > branchIDLists, BranchType, std::vector< EntryNumber > const &entrySet, EventID)
 
std::unique_ptr< DelayedReadermakeDelayedReader (FileFormatVersion, sqlite3 *inputDB, cet::exempt_ptr< BranchIDLists const > branchIDLists, BranchType, std::vector< EntryNumber > const &entrySet, EventID)
 
std::unique_ptr< BranchMappermakeBranchMapper () const
 
template<typename AUX >
AUX getAux (EntryNumber const entry)
 
template<typename AUX >
std::unique_ptr< RangeSetHandlerfillAux (FileFormatVersion const fileFormatVersion, EntryNumbers const &entries, FileIndex const &fileIndex, sqlite3 *db, std::string const &filename, AUX &aux)
 
TTree const * tree () const
 
TTree const * metaTree () const
 
void setCacheSize (unsigned int cacheSize) const
 
void setTreeMaxVirtualSize (int treeMaxVirtualSize)
 
TBranch * productProvenanceBranch () const
 

Private Attributes

cet::exempt_ptr< TFile > filePtr_
 
TTree * tree_ {nullptr}
 
TTree * metaTree_ {nullptr}
 
BranchType branchType_
 
int64_t const saveMemoryObjectThreshold_
 
TBranch * auxBranch_ {nullptr}
 
TBranch * productProvenanceBranch_ {nullptr}
 
EntryNumber entries_ {0}
 
EntryNumber entryNumber_ {-1}
 
BranchMap branches_ {}
 
cet::exempt_ptr< RootInputFileprimaryFile_
 
bool const compactSubRunRanges_
 
bool const rangesEnabled_ {true}
 

Detailed Description

Definition at line 74 of file RootInputTree.h.

Member Typedef Documentation

Definition at line 76 of file RootInputTree.h.

Definition at line 77 of file RootInputTree.h.

Definition at line 78 of file RootInputTree.h.

Constructor & Destructor Documentation

art::RootInputTree::RootInputTree ( cet::exempt_ptr< TFile >  ,
BranchType  ,
int64_t  saveMemoryObjectThreshold,
cet::exempt_ptr< RootInputFile ,
bool  compactSubRunRanges = false,
bool  missingOK = false,
bool  rangesEnabled = true 
)
art::RootInputTree::RootInputTree ( RootInputTree const &  )
delete

Member Function Documentation

void art::RootInputTree::addBranch ( BranchKey const &  ,
BranchDescription const &   
)
bool art::RootInputTree::current ( EntryNumbers const &  numbers)
inline

Definition at line 109 of file RootInputTree.h.

References ana::assert(), and HTMLTools::entry().

110  {
111  assert(!numbers.empty());
112  return std::all_of(numbers.cbegin(), numbers.cend(), [this](auto entry) {
113  return (entry < entries_) && (entry >= 0);
114  });
115  }
assert(nhit_max >=nhit_nbins)
def entry(str)
Definition: HTMLTools.py:26
EntryNumber entries_
void art::RootInputTree::dropBranch ( std::string const &  branchName)
EntryNumber art::RootInputTree::entries ( ) const
inline

Definition at line 128 of file RootInputTree.h.

129  {
130  return entries_;
131  }
EntryNumber entries_
EntryNumber art::RootInputTree::entryNumber ( ) const
inline

Definition at line 123 of file RootInputTree.h.

124  {
125  return entryNumber_;
126  }
EntryNumber entryNumber_
template<typename AUX >
std::unique_ptr<RangeSetHandler> art::RootInputTree::fillAux ( FileFormatVersion const  fileFormatVersion,
EntryNumbers const &  entries,
FileIndex const &  fileIndex,
sqlite3 *  db,
std::string const &  filename,
AUX &  aux 
)
inline

Definition at line 188 of file RootInputTree.h.

References febshutoff_auto::db, e, shutoffs::filename, MECModelEnuComparisons::i, art::detail::mergeAuxiliary(), art::detail::rangeSetFromFileIndex(), art::detail::resolveRangeSet(), art::detail::resolveRangeSetInfo(), std::swap(), submit_hadd::u, and art::FileFormatVersion::value_.

194  {
195  auto auxResult = getAux<AUX>(entries[0]);
196  if ((fileFormatVersion.value_ < 9) || (db == nullptr)) {
197  auxResult.setRangeSetID(-1u);
198  auto const& rs = detail::rangeSetFromFileIndex(
199  fileIndex, auxResult.id(), compactSubRunRanges_);
200  std::swap(aux, auxResult);
201  return std::make_unique<ClosedRangeSetHandler>(rs);
202  }
203 
204  auto resolve_info = [db, &filename](auto const id,
205  bool const compactSubRunRanges) {
207  db, filename, AUX::branch_type, id, compactSubRunRanges);
208  };
209 
210  auto rangeSetInfo =
211  resolve_info(auxResult.rangeSetID(), compactSubRunRanges_);
212  for (auto i = entries.cbegin() + 1, e = entries.cend(); i != e; ++i) {
213  auto const& tmpAux = getAux<AUX>(*i);
214  detail::mergeAuxiliary(auxResult, tmpAux);
215  rangeSetInfo.update(
216  resolve_info(tmpAux.rangeSetID(), compactSubRunRanges_),
218  }
219 
220  auxResult.setRangeSetID(-1u); // Range set of new auxiliary is invalid
221  std::swap(aux, auxResult);
222  return std::make_unique<ClosedRangeSetHandler>(
223  resolveRangeSet(rangeSetInfo));
224  }
::xsd::cxx::tree::id< char, ncname > id
Definition: Database.h:165
RangeSet resolveRangeSet(RangeSetInfo const &rs)
RangeSet rangeSetFromFileIndex(FileIndex const &fileIndex, RunID runID, bool compactRanges)
EntryNumber entries() const
string filename
Definition: shutoffs.py:106
void mergeAuxiliary(AUX &left, AUX const &right)
Definition: RootInputTree.h:43
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
RangeSetInfo resolveRangeSetInfo(sqlite3 *, std::string const &filename, BranchType, unsigned RangeSetID, bool compact)
bool const compactSubRunRanges_
Float_t e
Definition: plot.C:35
void art::RootInputTree::fillGroups ( Principal p)
inline

Definition at line 136 of file RootInputTree.h.

References b, and art::Principal::fillGroup().

137  {
138  if ((metaTree_ == nullptr) || (metaTree_->GetNbranches() == 0)) {
139  return;
140  }
141  // Loop over provenance
142  for (auto const& b : branches_) {
143  p.fillGroup(b.second.branchDescription_);
144  }
145  }
const char * p
Definition: xmltok.h:285
const hit & b
Definition: hits.cxx:21
template<typename AUX >
AUX art::RootInputTree::getAux ( EntryNumber const  entry)
inline

Definition at line 175 of file RootInputTree.h.

References art::input::getEntry().

176  {
177  auto aux = std::make_unique<AUX>();
178  auto pAux = aux.get();
179  auxBranch_->SetAddress(&pAux);
182  auxBranch_->ResetAddress();
183  return *aux;
184  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
def entry(str)
Definition: HTMLTools.py:26
void setEntryNumber(EntryNumber theEntryNumber)
bool art::RootInputTree::hasBranch ( std::string const &  branchName) const
bool art::RootInputTree::isValid ( ) const
std::unique_ptr<BranchMapper> art::RootInputTree::makeBranchMapper ( ) const
std::unique_ptr<DelayedReader> art::RootInputTree::makeDelayedReader ( FileFormatVersion  ,
cet::exempt_ptr< BranchIDLists const >  branchIDLists,
BranchType  ,
std::vector< EntryNumber > const &  entrySet,
EventID   
)
std::unique_ptr<DelayedReader> art::RootInputTree::makeDelayedReader ( FileFormatVersion  ,
sqlite3 *  inputDB,
cet::exempt_ptr< BranchIDLists const >  branchIDLists,
BranchType  ,
std::vector< EntryNumber > const &  entrySet,
EventID   
)
TTree const* art::RootInputTree::metaTree ( ) const
inline

Definition at line 232 of file RootInputTree.h.

233  {
234  return metaTree_;
235  }
bool art::RootInputTree::next ( )
inline

Definition at line 98 of file RootInputTree.h.

Referenced by art::RootInputFile::nextEventEntry().

99  {
100  return ++entryNumber_ < entries_;
101  }
EntryNumber entryNumber_
EntryNumber entries_
art::RootInputTree::operator bool ( ) const
inlineexplicit

Definition at line 90 of file RootInputTree.h.

References art::detail::dropBranch(), and string.

90 { return isValid(); }
bool isValid() const
RootInputTree& art::RootInputTree::operator= ( RootInputTree const &  )
delete
bool art::RootInputTree::previous ( )
inline

Definition at line 103 of file RootInputTree.h.

104  {
105  return --entryNumber_ >= 0;
106  }
EntryNumber entryNumber_
TBranch* art::RootInputTree::productProvenanceBranch ( ) const
inline

Definition at line 241 of file RootInputTree.h.

242  {
244  }
TBranch * productProvenanceBranch_
void art::RootInputTree::rewind ( )
inline

Definition at line 118 of file RootInputTree.h.

Referenced by art::RootInputFile::rewind().

119  {
120  entryNumber_ = 0;
121  }
EntryNumber entryNumber_
void art::RootInputTree::setCacheSize ( unsigned int  cacheSize) const
void art::RootInputTree::setEntryNumber ( EntryNumber  theEntryNumber)
void art::RootInputTree::setTreeMaxVirtualSize ( int  treeMaxVirtualSize)
TTree const* art::RootInputTree::tree ( ) const
inline

Definition at line 227 of file RootInputTree.h.

228  {
229  return tree_;
230  }

Member Data Documentation

TBranch* art::RootInputTree::auxBranch_ {nullptr}
private

Definition at line 255 of file RootInputTree.h.

BranchMap art::RootInputTree::branches_ {}
private

Definition at line 259 of file RootInputTree.h.

BranchType art::RootInputTree::branchType_
private

Definition at line 253 of file RootInputTree.h.

bool const art::RootInputTree::compactSubRunRanges_
private

Definition at line 261 of file RootInputTree.h.

EntryNumber art::RootInputTree::entries_ {0}
private

Definition at line 257 of file RootInputTree.h.

EntryNumber art::RootInputTree::entryNumber_ {-1}
private

Definition at line 258 of file RootInputTree.h.

cet::exempt_ptr<TFile> art::RootInputTree::filePtr_
private

Definition at line 247 of file RootInputTree.h.

TTree* art::RootInputTree::metaTree_ {nullptr}
private

Definition at line 252 of file RootInputTree.h.

cet::exempt_ptr<RootInputFile> art::RootInputTree::primaryFile_
private

Definition at line 260 of file RootInputTree.h.

TBranch* art::RootInputTree::productProvenanceBranch_ {nullptr}
private

Definition at line 256 of file RootInputTree.h.

bool const art::RootInputTree::rangesEnabled_ {true}
private

Definition at line 262 of file RootInputTree.h.

int64_t const art::RootInputTree::saveMemoryObjectThreshold_
private

Definition at line 254 of file RootInputTree.h.

TTree* art::RootInputTree::tree_ {nullptr}
private

Definition at line 251 of file RootInputTree.h.


The documentation for this class was generated from the following file: