1 #ifndef art_Framework_IO_Root_RootInputTree_h 2 #define art_Framework_IO_Root_RootInputTree_h 25 #include "cetlib/exempt_ptr.h" 41 template <
typename AUX>
45 left.mergeAuxiliary(right);
53 template <BranchType,
typename ID>
82 int64_t saveMemoryObjectThreshold,
83 cet::exempt_ptr<RootInputFile>,
84 bool compactSubRunRanges =
false,
85 bool missingOK =
false);
89 explicit operator bool()
const {
return isValid(); }
92 bool hasBranch(std::string
const& branchName)
const;
94 void dropBranch(std::string
const& branchName);
99 return ++entryNumber_ < entries_;
104 return --entryNumber_ >= 0;
110 assert(!numbers.empty());
111 return std::all_of(numbers.cbegin(), numbers.cend(), [
this](
auto entry) {
112 return (entry < entries_) && (entry >= 0);
137 if ((metaTree_ ==
nullptr) || (metaTree_->GetNbranches() == 0)) {
141 for (
auto const& b : branches_) {
142 p.
fillGroup(b.second.branchDescription_);
155 std::unique_ptr<DelayedReader> makeDelayedReader(
157 cet::exempt_ptr<BranchIDLists const> branchIDLists,
159 std::vector<EntryNumber>
const& entrySet,
162 std::unique_ptr<DelayedReader> makeDelayedReader(
165 cet::exempt_ptr<BranchIDLists const> branchIDLists,
167 std::vector<EntryNumber>
const& entrySet,
170 std::unique_ptr<BranchMapper> makeBranchMapper()
const;
172 template <
typename AUX>
176 auto aux = std::make_unique<AUX>();
177 auto pAux = aux.get();
178 auxBranch_->SetAddress(&pAux);
179 setEntryNumber(entry);
184 template <
typename AUX>
185 std::unique_ptr<RangeSetHandler>
190 std::string
const& filename,
193 auto auxResult = getAux<AUX>(entries[0]);
194 if (fileFormatVersion.
value_ < 9) {
195 auxResult.setRangeSetID(-1u);
197 fileIndex, auxResult.id(), compactSubRunRanges_);
198 std::swap(aux, auxResult);
199 return std::make_unique<ClosedRangeSetHandler>(rs);
202 auto resolve_info = [db, &filename](
auto const id,
203 bool const compactSubRunRanges) {
205 db, filename, AUX::branch_type,
id, compactSubRunRanges);
209 resolve_info(auxResult.rangeSetID(), compactSubRunRanges_);
210 for (
auto i = entries.cbegin() + 1,
e = entries.cend(); i !=
e; ++i) {
211 auto const& tmpAux = getAux<AUX>(*i);
214 resolve_info(tmpAux.rangeSetID(), compactSubRunRanges_),
215 compactSubRunRanges_);
218 auxResult.setRangeSetID(-1u);
219 std::swap(aux, auxResult);
220 return std::make_unique<ClosedRangeSetHandler>(
235 void setCacheSize(
unsigned int cacheSize)
const;
236 void setTreeMaxVirtualSize(
int treeMaxVirtualSize);
241 return productProvenanceBranch_;
249 TTree* tree_{
nullptr};
250 TTree* metaTree_{
nullptr};
253 TBranch* auxBranch_{
nullptr};
254 TBranch* productProvenanceBranch_{
nullptr};
RangeSet makeFullRangeSet(ID const &)
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
RangeSetInfo resolveRangeSetInfo(sqlite3 *, std::string const &filename, BranchType, unsigned RangeSetID, bool compact)
RangeSet makeFullRangeSet< InSubRun, SubRunID >(SubRunID const &id)
RangeSet rangeSetFromFileIndex(FileIndex const &fileIndex, RunID runID, bool compactRanges)
RangeSet resolveRangeSet(RangeSetInfo const &rs)
void mergeAuxiliary(AUX &left, AUX const &right)
RangeSet makeFullRangeSet< InRun, RunID >(RunID const &id)
static RangeSet forRun(RunID)
virtual void fillGroup(BranchDescription const &)=0
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
static RangeSet forSubRun(SubRunID)