LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::detail::KeptProvenance Class Reference

#include "KeptProvenance.h"

Public Member Functions

 KeptProvenance (DropMetaData dropMetaData, bool dropMetaDataForDroppedData, std::set< ProductID > &branchesWithStoredHistory)
 
ProductProvenance const & insert (ProductProvenance const &)
 
ProductProvenance const & emplace (ProductID, ProductStatus)
 
void setStatus (ProductProvenance const &, ProductStatus)
 
auto begin () const
 
auto end () const
 
void insertAncestors (ProductProvenance const &iGetParents, Principal const &principal)
 

Private Attributes

DropMetaData const dropMetaData_
 
bool const dropMetaDataForDroppedData_
 
std::set< ProductID > & branchesWithStoredHistory_
 
std::set< ProductProvenanceprovenance_ {}
 

Detailed Description

Definition at line 21 of file KeptProvenance.h.

Constructor & Destructor Documentation

detail::KeptProvenance::KeptProvenance ( DropMetaData  dropMetaData,
bool  dropMetaDataForDroppedData,
std::set< ProductID > &  branchesWithStoredHistory 
)

Definition at line 7 of file KeptProvenance.cc.

References branchesWithStoredHistory_, and dropMetaDataForDroppedData_.

11  : dropMetaData_{dropMetaData}
12  , dropMetaDataForDroppedData_{dropMetaDataForDroppedData}
13  , branchesWithStoredHistory_{branchesWithStoredHistory}
14 {}
DropMetaData const dropMetaData_
bool const dropMetaDataForDroppedData_
std::set< ProductID > & branchesWithStoredHistory_

Member Function Documentation

auto art::detail::KeptProvenance::begin ( ) const
inline

Definition at line 32 of file KeptProvenance.h.

References provenance_.

33  {
34  return provenance_.begin();
35  }
std::set< ProductProvenance > provenance_
ProductProvenance const & detail::KeptProvenance::emplace ( ProductID  pid,
ProductStatus  status 
)

Definition at line 23 of file KeptProvenance.cc.

References provenance_.

24 {
25  return *provenance_.emplace(pid, status).first;
26 }
std::set< ProductProvenance > provenance_
auto art::detail::KeptProvenance::end ( void  ) const
inline

Definition at line 37 of file KeptProvenance.h.

References insertAncestors(), and provenance_.

38  {
39  return provenance_.end();
40  }
std::set< ProductProvenance > provenance_
ProductProvenance const & detail::KeptProvenance::insert ( ProductProvenance const &  pp)

Definition at line 17 of file KeptProvenance.cc.

References provenance_.

18 {
19  return *provenance_.insert(pp).first;
20 }
std::set< ProductProvenance > provenance_
void detail::KeptProvenance::insertAncestors ( ProductProvenance const &  iGetParents,
Principal const &  principal 
)

Definition at line 29 of file KeptProvenance.cc.

References branchesWithStoredHistory_, art::Principal::branchMapper(), art::BranchMapper::branchToProductProvenance(), art::DropMetaData::DropAll, dropMetaData_, dropMetaDataForDroppedData_, art::DropMetaData::DropNone, art::Principal::getForOutput(), art::ProductProvenance::parentage(), art::Parentage::parents(), and provenance_.

Referenced by end().

31 {
33  return;
34  }
36  return;
37  }
38  auto const& parents = iGetParents.parentage().parents();
39  for (auto const pid : parents) {
40  auto info = principal.branchMapper().branchToProductProvenance(pid);
41  if (!info || dropMetaData_ != DropMetaData::DropNone) {
42  continue;
43  }
44  // These two data structures should be in sync.
46  (void)provenance_.insert(*info).second;
47 
48  auto const* pd = principal.getForOutput(info->productID(), false).desc();
49  if (pd && pd->produced()) {
50  // FIXME: Remove recursion!
51  insertAncestors(*info, principal);
52  }
53  }
54 }
DropMetaData const dropMetaData_
bool const dropMetaDataForDroppedData_
void insertAncestors(ProductProvenance const &iGetParents, Principal const &principal)
std::set< ProductProvenance > provenance_
std::set< ProductID > & branchesWithStoredHistory_
void detail::KeptProvenance::setStatus ( ProductProvenance const &  key,
ProductStatus  status 
)

Definition at line 57 of file KeptProvenance.cc.

References art::errors::LogicError, art::ProductProvenance::productID(), and provenance_.

59 {
60  if (provenance_.erase(key) != 1ull)
61  throw Exception(errors::LogicError, "detail::KeptProvenance::setStatus")
62  << "Attempt to set product status for product whose provenance is not "
63  "being recorded.\n";
64  provenance_.emplace(key.productID(), status);
65 }
std::set< ProductProvenance > provenance_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66

Member Data Documentation

std::set<ProductID>& art::detail::KeptProvenance::branchesWithStoredHistory_
private

Definition at line 48 of file KeptProvenance.h.

Referenced by insertAncestors(), and KeptProvenance().

DropMetaData const art::detail::KeptProvenance::dropMetaData_
private

Definition at line 46 of file KeptProvenance.h.

Referenced by insertAncestors().

bool const art::detail::KeptProvenance::dropMetaDataForDroppedData_
private

Definition at line 47 of file KeptProvenance.h.

Referenced by insertAncestors(), and KeptProvenance().

std::set<ProductProvenance> art::detail::KeptProvenance::provenance_ {}
private

Definition at line 49 of file KeptProvenance.h.

Referenced by begin(), emplace(), end(), insert(), insertAncestors(), and setStatus().


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