LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "Principal.h"
Public Types | |
enum | allowed_processes { allowed_processes::current_process, allowed_processes::input_source, allowed_processes::all } |
using | GroupCollection = std::map< ProductID, std::unique_ptr< Group >> |
using | const_iterator = GroupCollection::const_iterator |
Public Member Functions | |
virtual | ~Principal () noexcept=default |
Principal (BranchType, ProcessConfiguration const &, cet::exempt_ptr< ProductTable const > presentProducts, ProcessHistoryID const &id, std::unique_ptr< DelayedReader > &&reader=std::make_unique< NoDelayedReader >()) | |
Principal (Principal const &)=delete | |
Principal & | operator= (Principal const &)=delete |
GroupQueryResult | getByProductID (ProductID const pid) const |
GroupQueryResult | getBySelector (ModuleContext const &mc, WrappedTypeID const &wrapped, SelectorBase const &, ProcessTag const &) const |
GroupQueryResult | getByLabel (ModuleContext const &mc, WrappedTypeID const &wrapped, std::string const &label, std::string const &productInstanceName, ProcessTag const &processTag) const |
std::vector< GroupQueryResult > | getMany (ModuleContext const &mc, WrappedTypeID const &wrapped, SelectorBase const &, ProcessTag const &) const |
std::vector< InputTag > | getInputTags (ModuleContext const &mc, WrappedTypeID const &wrapped, SelectorBase const &, ProcessTag const &) const |
std::vector< cet::exempt_ptr< Group > > | getMatchingSequence (ModuleContext const &, SelectorBase const &, ProcessTag const &) const |
EDProductGetter const * | productGetter (ProductID id) const |
Provenance | provenance (ProductID id) const |
ProcessHistory const & | processHistory () const |
OutputHandle | getForOutput (ProductID const &, bool resolveProd) const |
cet::exempt_ptr< BranchDescription const > | getProductDescription (ProductID const pid, bool const alwaysEnableLookupOfProducedProducts=false) const |
void | createGroupsForProducedProducts (ProductTables const &producedProducts) |
void | enableLookupOfProducedProducts () |
void | markProcessHistoryAsModified () |
void | readImmediate () const |
ProcessConfiguration const & | processConfiguration () const |
ProcessHistoryID const & | processHistoryID () const |
cet::exempt_ptr< ProductProvenance const > | branchToProductProvenance (ProductID const &) const |
size_t | size () const |
const_iterator | begin () const |
const_iterator | cbegin () const |
const_iterator | end () const |
const_iterator | cend () const |
void | addToProcessHistory () |
BranchType | branchType () const |
RangeSet | seenRanges () const |
void | put (BranchDescription const &, std::unique_ptr< ProductProvenance const > &&, std::unique_ptr< EDProduct > &&, std::unique_ptr< RangeSet > &&) |
EDProductGetter const * | getEDProductGetter (ProductID const &pid) const |
Protected Member Functions | |
std::optional< ProductInserter > | makeInserter (ModuleContext const &mc) |
void | fillGroup (BranchDescription const &) |
void | setProcessHistoryIDcombined (ProcessHistoryID const &) |
void | updateSeenRanges (RangeSet const &rs) |
Private Member Functions | |
void | ctor_create_groups (cet::exempt_ptr< ProductTable const >) |
void | ctor_read_provenance () |
void | ctor_fetch_process_history (ProcessHistoryID const &) |
cet::exempt_ptr< Group > | getGroupLocal (ProductID const) const |
std::vector< cet::exempt_ptr< Group > > | matchingSequenceFromInputFile (ModuleContext const &, SelectorBase const &) const |
size_t | findGroupsFromInputFile (ModuleContext const &, WrappedTypeID const &wrapped, SelectorBase const &, std::vector< cet::exempt_ptr< Group >> &results) const |
size_t | findGroups (ProcessLookup const &, ModuleContext const &, SelectorBase const &, std::vector< cet::exempt_ptr< Group >> &groups) const |
size_t | findGroupsForProcess (std::vector< ProductID > const &vpid, ModuleContext const &mc, SelectorBase const &selector, std::vector< cet::exempt_ptr< Group >> &groups) const |
bool | producedInProcess (ProductID) const |
bool | presentFromSource (ProductID) const |
auto | tryNextSecondaryFile () const |
std::vector< cet::exempt_ptr< Group > > | findGroupsForProduct (ModuleContext const &mc, WrappedTypeID const &wrapped, SelectorBase const &, ProcessTag const &) const |
EDProductGetter const * | getEDProductGetter_ (ProductID const &) const override |
cet::exempt_ptr< Group > | getGroupTryAllFiles (ProductID const) const |
Private Attributes | |
BranchType | branchType_ {} |
ProcessHistory | processHistory_ {} |
std::atomic< bool > | processHistoryModified_ {false} |
ProcessConfiguration const & | processConfiguration_ |
std::atomic< ProductTable const * > | presentProducts_ |
std::atomic< ProductTable const * > | producedProducts_ {nullptr} |
std::atomic< bool > | enableLookupOfProducedProducts_ {false} |
std::recursive_mutex | groupMutex_ {} |
GroupCollection | groups_ {} |
std::unique_ptr< DelayedReader > | delayedReader_ {nullptr} |
std::vector< std::unique_ptr< Principal > > | secondaryPrincipals_ {} |
int | nextSecondaryFileIdx_ {} |
RangeSet | rangeSet_ {RangeSet::invalid()} |
Definition at line 49 of file Principal.h.
using art::Principal::const_iterator = GroupCollection::const_iterator |
Definition at line 52 of file Principal.h.
using art::Principal::GroupCollection = std::map<ProductID, std::unique_ptr<Group>> |
Definition at line 51 of file Principal.h.
|
strong |
Enumerator | |
---|---|
current_process | |
input_source | |
all |
Definition at line 53 of file Principal.h.
|
virtualdefaultnoexcept |
art::Principal::Principal | ( | BranchType | branchType, |
ProcessConfiguration const & | pc, | ||
cet::exempt_ptr< ProductTable const > | presentProducts, | ||
ProcessHistoryID const & | id, | ||
std::unique_ptr< DelayedReader > && | reader = std::make_unique<NoDelayedReader>() |
||
) |
Definition at line 119 of file Principal.cc.
References ctor_create_groups(), ctor_fetch_process_history(), ctor_read_provenance(), delayedReader_, hist, presentProducts_, and processConfiguration_.
|
delete |
void art::Principal::addToProcessHistory | ( | ) |
Definition at line 423 of file Principal.cc.
References art::errors::Configuration, art::thread_safe_registry_via_id< K, M >::emplace(), art::ProcessHistory::get_mutex(), processConfiguration_, processHistory_, processHistoryModified_, and art::ProcessConfiguration::processName().
Referenced by createGroupsForProducedProducts(), and processHistoryID().
Principal::const_iterator art::Principal::begin | ( | ) | const |
Definition at line 270 of file Principal.cc.
References groupMutex_, and groups_.
Referenced by processHistoryID().
cet::exempt_ptr< ProductProvenance const > art::Principal::branchToProductProvenance | ( | ProductID const & | pid | ) | const |
Definition at line 298 of file Principal.cc.
References getGroupLocal().
Referenced by art::markAncestors(), and processHistoryID().
BranchType art::Principal::branchType | ( | ) | const |
Definition at line 807 of file Principal.cc.
References branchType_.
Referenced by art::SourceHelper::makePtr(), and processHistoryID().
Principal::const_iterator art::Principal::cbegin | ( | ) | const |
Definition at line 277 of file Principal.cc.
References groupMutex_, and groups_.
Referenced by processHistoryID().
Principal::const_iterator art::Principal::cend | ( | ) | const |
Definition at line 291 of file Principal.cc.
References groupMutex_, and groups_.
Referenced by processHistoryID().
void art::Principal::createGroupsForProducedProducts | ( | ProductTables const & | producedProducts | ) |
Definition at line 201 of file Principal.cc.
References addToProcessHistory(), branchType_, fillGroup(), art::ProductTables::get(), producedProducts_, and util::values().
Referenced by art::RunPrincipal::createGroupsForProducedProducts(), art::ResultsPrincipal::createGroupsForProducedProducts(), art::SubRunPrincipal::createGroupsForProducedProducts(), and art::EventPrincipal::createGroupsForProducedProducts().
|
private |
Definition at line 68 of file Principal.cc.
References util::values().
Referenced by Principal(), and processHistoryID().
|
private |
Definition at line 109 of file Principal.cc.
References util::get(), art::Hash< I >::isValid(), and std::swap().
Referenced by Principal(), and processHistoryID().
|
private |
Definition at line 89 of file Principal.cc.
References art::productstatus::dummyToPreventDoubleCount(), and art::productstatus::unknown().
Referenced by Principal(), and processHistoryID().
void art::Principal::enableLookupOfProducedProducts | ( | ) |
Definition at line 220 of file Principal.cc.
References enableLookupOfProducedProducts_.
Principal::const_iterator art::Principal::end | ( | void | ) | const |
Definition at line 284 of file Principal.cc.
References groupMutex_, and groups_.
Referenced by processHistoryID().
|
protected |
Definition at line 137 of file Principal.cc.
References util::cend(), art::combinable(), art::errors::Configuration, delayedReader_, groupMutex_, groups_, art::BranchDescription::processName(), art::BranchDescription::productID(), and art::errors::ProductRegistrationFailure.
Referenced by createGroupsForProducedProducts(), and processHistoryID().
|
private |
Definition at line 461 of file Principal.cc.
References findGroupsForProcess(), art::ProcessHistory::get_mutex(), and processHistory_.
Referenced by findGroupsForProduct(), findGroupsFromInputFile(), getMatchingSequence(), matchingSequenceFromInputFile(), and processHistoryID().
|
private |
Definition at line 667 of file Principal.cc.
References getGroupLocal(), art::SelectorBase::match(), art::ModuleContext::onSamePathAs(), and art::ModuleContext::onTriggerPath().
Referenced by findGroups(), and processHistoryID().
|
private |
Definition at line 625 of file Principal.cc.
References art::ProcessTag::current_process_search_allowed(), enableLookupOfProducedProducts_, findGroups(), findGroupsFromInputFile(), art::TypeID::friendlyClassName(), art::ProcessTag::input_source_search_allowed(), producedProducts_, art::WrappedTypeID::product_type, secondaryPrincipals_, and tryNextSecondaryFile().
Referenced by getBySelector(), getInputTags(), getMany(), and processHistoryID().
|
private |
Definition at line 607 of file Principal.cc.
References findGroups(), art::TypeID::friendlyClassName(), presentProducts_, and art::WrappedTypeID::product_type.
Referenced by findGroupsForProduct(), and processHistoryID().
GroupQueryResult art::Principal::getByLabel | ( | ModuleContext const & | mc, |
WrappedTypeID const & | wrapped, | ||
std::string const & | label, | ||
std::string const & | productInstanceName, | ||
ProcessTag const & | processTag | ||
) | const |
Definition at line 506 of file Principal.cc.
References getBySelector(), and art::ProcessTag::name().
Referenced by art::ProductRetriever::getByLabel_().
GroupQueryResult art::Principal::getByProductID | ( | ProductID const | pid | ) | const |
Definition at line 839 of file Principal.cc.
References branchType_, getGroupTryAllFiles(), and art::errors::ProductNotFound.
Referenced by art::ProductRetriever::getByProductID_(), and art::ProductRetriever::getProductProvenance().
GroupQueryResult art::Principal::getBySelector | ( | ModuleContext const & | mc, |
WrappedTypeID const & | wrapped, | ||
SelectorBase const & | sel, | ||
ProcessTag const & | processTag | ||
) | const |
Definition at line 488 of file Principal.cc.
References findGroupsForProduct(), art::detail::indent(), art::SelectorBase::print(), art::WrappedTypeID::product_type, art::errors::ProductNotFound, and art::resolve_unique_product().
Referenced by getByLabel(), and art::ProductRetriever::getBySelector_().
|
inherited |
Definition at line 12 of file PrincipalBase.cc.
References art::PrincipalBase::getEDProductGetter_().
|
overrideprivatevirtual |
Implements art::PrincipalBase.
Definition at line 195 of file Principal.cc.
References productGetter().
Referenced by processHistoryID().
OutputHandle art::Principal::getForOutput | ( | ProductID const & | pid, |
bool | resolveProd | ||
) | const |
Definition at line 750 of file Principal.cc.
References getGroupTryAllFiles(), art::OutputHandle::invalid(), art::OutputHandle::productProvenance(), and art::OutputHandle::rangeOfValidity().
Definition at line 852 of file Principal.cc.
References groupMutex_, and groups_.
Referenced by branchToProductProvenance(), findGroupsForProcess(), getGroupTryAllFiles(), processHistoryID(), provenance(), and put().
Definition at line 860 of file Principal.cc.
References getGroupLocal(), presentFromSource(), producedInProcess(), secondaryPrincipals_, and tryNextSecondaryFile().
Referenced by getByProductID(), getForOutput(), processHistoryID(), and productGetter().
std::vector< InputTag > art::Principal::getInputTags | ( | ModuleContext const & | mc, |
WrappedTypeID const & | wrapped, | ||
SelectorBase const & | sel, | ||
ProcessTag const & | processTag | ||
) | const |
Definition at line 520 of file Principal.cc.
References findGroupsForProduct().
Referenced by art::ProductRetriever::getInputTags_().
std::vector< GroupQueryResult > art::Principal::getMany | ( | ModuleContext const & | mc, |
WrappedTypeID const & | wrapped, | ||
SelectorBase const & | sel, | ||
ProcessTag const & | processTag | ||
) | const |
Definition at line 534 of file Principal.cc.
References findGroupsForProduct(), art::resolve_products(), and art::WrappedTypeID::wrapped_product_type.
Referenced by art::ProductRetriever::getMany_().
std::vector< cet::exempt_ptr< Group > > art::Principal::getMatchingSequence | ( | ModuleContext const & | mc, |
SelectorBase const & | selector, | ||
ProcessTag const & | processTag | ||
) | const |
Definition at line 550 of file Principal.cc.
References art::ProcessTag::current_process_search_allowed(), enableLookupOfProducedProducts_, findGroups(), art::ProcessTag::input_source_search_allowed(), matchingSequenceFromInputFile(), producedProducts_, secondaryPrincipals_, and tryNextSecondaryFile().
Referenced by art::ProductRetriever::getContainerForView_().
cet::exempt_ptr< BranchDescription const > art::Principal::getProductDescription | ( | ProductID const | pid, |
bool const | alwaysEnableLookupOfProducedProducts = false |
||
) | const |
Definition at line 779 of file Principal.cc.
References enableLookupOfProducedProducts_, presentProducts_, producedProducts_, and secondaryPrincipals_.
Referenced by art::ProductRetriever::getProductDescription(), art::ProductInserter::getProductDescription_(), and art::ProductRetriever::getProductID_().
|
protected |
Definition at line 813 of file Principal.cc.
References branchType_.
Referenced by art::EventPrincipal::makeEvent(), art::ResultsPrincipal::makeResults(), art::RunPrincipal::makeRun(), art::SubRunPrincipal::makeSubRun(), and processHistoryID().
void art::Principal::markProcessHistoryAsModified | ( | ) |
Definition at line 170 of file Principal.cc.
References processHistoryModified_.
|
private |
Definition at line 595 of file Principal.cc.
References findGroups(), and presentProducts_.
Referenced by getMatchingSequence(), and processHistoryID().
|
private |
Definition at line 829 of file Principal.cc.
References presentProducts_.
Referenced by getGroupTryAllFiles(), and processHistoryID().
ProcessConfiguration const & art::Principal::processConfiguration | ( | ) | const |
Definition at line 257 of file Principal.cc.
References processConfiguration_.
ProcessHistory const & art::Principal::processHistory | ( | ) | const |
Definition at line 247 of file Principal.cc.
References processHistory_.
Referenced by art::ProductRetriever::getProcessParameterSet(), art::Event::processHistory(), art::Run::processHistory(), and art::SubRun::processHistory().
|
inline |
Definition at line 148 of file Principal.h.
References addToProcessHistory(), begin(), branchToProductProvenance(), branchType(), cbegin(), cend(), ctor_create_groups(), ctor_fetch_process_history(), ctor_read_provenance(), end(), fillGroup(), findGroups(), findGroupsForProcess(), findGroupsForProduct(), findGroupsFromInputFile(), getEDProductGetter_(), getGroupLocal(), getGroupTryAllFiles(), art::ProcessHistory::id(), makeInserter(), matchingSequenceFromInputFile(), presentFromSource(), processHistory_, producedInProcess(), put(), seenRanges(), setProcessHistoryIDcombined(), size(), tryNextSecondaryFile(), updateSeenRanges(), and lar::dump::vector().
Referenced by art::RunPrincipal::createGroupsForProducedProducts(), art::ResultsPrincipal::createGroupsForProducedProducts(), art::SubRunPrincipal::createGroupsForProducedProducts(), art::Event::processHistoryID(), and art::EventPrincipal::refreshProcessHistoryID().
|
private |
Definition at line 819 of file Principal.cc.
References enableLookupOfProducedProducts_, and producedProducts_.
Referenced by getGroupTryAllFiles(), and processHistoryID().
EDProductGetter const * art::Principal::productGetter | ( | ProductID | id | ) | const |
Definition at line 177 of file Principal.cc.
References getGroupTryAllFiles().
Referenced by getEDProductGetter_(), art::SourceHelper::makePtr(), art::ProductRetriever::productGetter(), and art::ProductInserter::productGetter_().
Provenance art::Principal::provenance | ( | ProductID | id | ) | const |
Definition at line 189 of file Principal.cc.
References getGroupLocal().
Referenced by art::ProductInserter::provenance_().
void art::Principal::put | ( | BranchDescription const & | bd, |
std::unique_ptr< ProductProvenance const > && | pp, | ||
std::unique_ptr< EDProduct > && | edp, | ||
std::unique_ptr< RangeSet > && | rs | ||
) |
Definition at line 713 of file Principal.cc.
References art::BranchDescription::branchName(), branchType_, getGroupLocal(), art::RangeSet::invalid(), art::BranchDescription::productID(), art::errors::ProductRegistrationFailure, and art::detail::range_sets_supported().
Referenced by art::ProductInserter::commitProducts(), and processHistoryID().
void art::Principal::readImmediate | ( | ) | const |
Definition at line 226 of file Principal.cc.
References groupMutex_, groups_, and util::values().
RangeSet art::Principal::seenRanges | ( | ) | const |
Definition at line 701 of file Principal.cc.
References rangeSet_.
Referenced by art::detail::Producer::doEndRun(), art::detail::Filter::doEndRun(), art::detail::Producer::doEndSubRun(), art::detail::Filter::doEndSubRun(), and processHistoryID().
|
protected |
Referenced by processHistoryID().
size_t art::Principal::size | ( | void | ) | const |
Definition at line 263 of file Principal.cc.
References groupMutex_, and groups_.
Referenced by processHistoryID().
|
private |
Definition at line 544 of file Principal.cc.
References delayedReader_, and nextSecondaryFileIdx_.
Referenced by findGroupsForProduct(), getGroupTryAllFiles(), getMatchingSequence(), and processHistoryID().
|
protected |
Definition at line 707 of file Principal.cc.
References rangeSet_.
Referenced by processHistoryID().
|
private |
Definition at line 230 of file Principal.h.
Referenced by branchType(), createGroupsForProducedProducts(), getByProductID(), makeInserter(), and put().
|
private |
Definition at line 250 of file Principal.h.
Referenced by fillGroup(), Principal(), and tryNextSecondaryFile().
|
private |
Definition at line 238 of file Principal.h.
Referenced by enableLookupOfProducedProducts(), findGroupsForProduct(), getMatchingSequence(), getProductDescription(), and producedInProcess().
|
mutableprivate |
Definition at line 241 of file Principal.h.
Referenced by begin(), cbegin(), cend(), end(), fillGroup(), getGroupLocal(), readImmediate(), and size().
|
private |
Definition at line 246 of file Principal.h.
Referenced by begin(), cbegin(), cend(), end(), fillGroup(), getGroupLocal(), readImmediate(), and size().
|
mutableprivate |
Definition at line 264 of file Principal.h.
Referenced by tryNextSecondaryFile().
|
private |
Definition at line 236 of file Principal.h.
Referenced by findGroupsFromInputFile(), getProductDescription(), matchingSequenceFromInputFile(), presentFromSource(), and Principal().
|
private |
Definition at line 233 of file Principal.h.
Referenced by addToProcessHistory(), Principal(), and processConfiguration().
|
private |
Definition at line 231 of file Principal.h.
Referenced by addToProcessHistory(), findGroups(), processHistory(), and processHistoryID().
|
private |
Definition at line 232 of file Principal.h.
Referenced by addToProcessHistory(), and markProcessHistoryAsModified().
|
private |
Definition at line 237 of file Principal.h.
Referenced by createGroupsForProducedProducts(), findGroupsForProduct(), getMatchingSequence(), getProductDescription(), and producedInProcess().
|
private |
Definition at line 266 of file Principal.h.
Referenced by seenRanges(), and updateSeenRanges().
|
mutableprivate |
Definition at line 260 of file Principal.h.
Referenced by findGroupsForProduct(), getGroupTryAllFiles(), getMatchingSequence(), and getProductDescription().