14 #include "canvas_root_io/Streamers/ProductIDStreamer.h" 15 #include "canvas_root_io/Streamers/RefCoreStreamer.h" 19 #include "TBranchElement.h" 32 RootDelayedReader::~RootDelayedReader() =
default;
34 RootDelayedReader::RootDelayedReader(
37 vector<input::EntryNumber>
const& entrySet,
39 TBranch* provenanceBranch,
40 int64_t const saveMemoryObjectThreshold,
45 bool const compactSubRunRanges)
47 , fileFormatVersion_{version}
66 std::vector<ProductProvenance>
70 vector<ProductProvenance> ppv;
100 vector<ProductProvenance> ppv;
106 for (
auto const&
val : ppv) {
107 if (
val.productID() == bid) {
115 if (prov !=
nullptr) {
129 unique_ptr<EDProduct>
138 assert(br !=
nullptr);
139 auto const& pd = branchInfo.branchDescription_;
147 <<
"Attempt to delay read a produced product!\n";
155 TClass* cl = TClass::GetClass(pd.wrappedName().c_str());
156 auto get_product = [
this, cl, br](
auto entry) {
157 unique_ptr<EDProduct>
p{
static_cast<EDProduct*
>(cl->New())};
160 unsigned long long ticks = 0;
164 br->DropBaskets(
"all");
172 configureProductIDStreamer();
173 configureRefCoreStreamer();
188 configureProductIDStreamer();
189 configureRefCoreStreamer();
193 vector<ProductProvenance> ppv;
194 unique_ptr<ProductProvenance const> prov;
199 for (
auto const&
val : ppv) {
200 if (
val.productID() == pid) {
220 result->getRangeSetID(),
231 auto p = get_product(*it);
232 vector<ProductProvenance> new_ppv;
233 unique_ptr<ProductProvenance const> new_prov;
235 auto p_ppv = &new_ppv;
238 for (
auto const&
val : new_ppv) {
239 if (
val.productID() == pid) {
268 mergedRangeSet = newRS;
273 principal_->insert_pp(const_cast<Group*>(grp),
274 make_unique<ProductProvenance const>(*new_prov));
275 prov = move(new_prov);
281 result->combine(
p.get());
282 mergedRangeSet.
merge(newRS);
311 "RootDelayedReader::getProduct_"}
312 <<
"\nThe following ranges corresponding to the product:\n" 313 <<
" '" << branchInfo.branchDescription_ <<
"'" 314 <<
"\ncannot be aggregated\n" 315 << mergedRangeSet <<
" and\n" 316 << newRS <<
"\nPlease contact artists@fnal.gov.\n";
322 configureProductIDStreamer();
323 configureRefCoreStreamer();
340 assert(!(
static_cast<decltype(sfnm.size())
>(idx) > sfnm.size()));
345 if (
static_cast<decltype(sfnm.size())
>(idx) == sfnm.size()) {
354 if (!sf[idx]->readEventForSecondaryFile(
eventID_)) {
369 assert(
false &&
"RootDelayedReader encountered an unknown BranchType!");
RunID const & runID() const
SubRunID const & subRunID() const
ProductStatus const & productStatus() const
int64_t saveMemoryObjectThreshold_
bool isAvailableAfterCombine_(ProductID) const override
RangeSet resolveRangeSet(RangeSetInfo const &rs)
int openNextSecondaryFile_(int idx) override
static RangeSet forSubRun(SubRunID)
std::vector< ProductProvenance > readProvenance_() const override
void swap(Handle< T > &a, Handle< T > &b)
cet::exempt_ptr< input::BranchMap const > branches_
std::enable_if_t< detail::are_handles< T, U >::value, bool > disjoint_ranges(T const &a, U const &b)
std::vector< input::EntryNumber > const entrySet_
TBranch * provenanceBranch_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
bool const compactSubRunRanges_
cet::exempt_ptr< RootInputFile > primaryFile_
void setPrincipal_(cet::exempt_ptr< Principal >) override
std::enable_if_t< detail::are_handles< T, U >::value, bool > overlapping_ranges(T const &a, U const &b)
std::enable_if_t< detail::are_handles< T, U >::value, bool > same_ranges(T const &a, U const &b)
RangeSet & merge(RangeSet const &other)
cet::exempt_ptr< Principal > principal_
cet::exempt_ptr< BranchIDLists const > branchIDLists_
static RangeSet forRun(RunID)
std::unique_ptr< EDProduct > getProduct_(Group const *, ProductID, RangeSet &) const override
FileFormatVersion fileFormatVersion_