LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::detail Namespace Reference

Namespaces

 FDS
 
 FTS
 

Classes

struct  AggregateTuple
 
struct  AggregateTuple< 0u >
 
class  Analyzer
 
struct  are_cv_compatible
 
class  AssnsBase
 
class  BcollHelper
 
struct  CanBeAggregated
 
struct  CanBeAggregated< cet::map_vector< T > >
 
struct  CanBeAggregated< CLHEP::Hep2Vector >
 
struct  CanBeAggregated< CLHEP::Hep3Vector >
 
struct  CanBeAggregated< CLHEP::HepLorentzVector >
 
struct  CanBeAggregated< CLHEP::HepMatrix >
 
struct  CanBeAggregated< CLHEP::HepSymMatrix >
 
struct  CanBeAggregated< CLHEP::HepVector >
 
struct  CanBeAggregated< std::array< T, N > >
 
struct  CanBeAggregated< std::deque< T > >
 
struct  CanBeAggregated< std::list< T > >
 
struct  CanBeAggregated< std::map< K, V > >
 
struct  CanBeAggregated< std::multimap< K, V > >
 
struct  CanBeAggregated< std::pair< K, V > >
 
struct  CanBeAggregated< std::set< T > >
 
struct  CanBeAggregated< std::string >
 
struct  CanBeAggregated< std::tuple< Args... > >
 
struct  CanBeAggregated< std::vector< T > >
 
struct  CanBeAggregated< T, std::enable_if_t< has_aggregate< T >::value > >
 
struct  CanBeAggregated< T, std::enable_if_t< std::is_arithmetic< T >::value > >
 
struct  CanBeAggregated< T, std::enable_if_t< std::is_base_of< TH1, T >::value > >
 
class  collected_exception
 
struct  config_for_impl
 
struct  config_for_impl< T, std::void_t< typename T::Parameters > >
 
class  DataCollHelper
 
struct  default_invocation
 
struct  default_invocation< R(ARGS...)>
 
struct  do_call_hasMoreData
 
struct  do_not_call_hasMoreData
 
class  EnabledModules
 
class  EngineCreator
 
struct  EnsurePointer
 
struct  EnsurePointer< TO, PFROM * >
 
struct  EnsurePointer< TO, Ptr< PTRVAL > >
 
class  ExceptionCollector
 
class  ExitCodePrinter
 
class  FileNameComponents
 
class  FileNamesHandler
 
class  FileNamesHandler< false >
 
class  FileNamesHandler< true >
 
class  FileServiceProxy
 
class  Filter
 
struct  get_helper
 
struct  GetProduct
 
struct  handle_allowed
 
struct  handle_allowed< T, std::enable_if_t<!T::service_handle_allowed > >
 
struct  has_aggregate
 
struct  has_aggregate< T, enable_if_function_exists_t< void(T::*)(T const &),&T::aggregate > >
 
struct  has_aggregate< T, enable_if_function_exists_t< void(T::*)(T),&T::aggregate > >
 
struct  has_beginRun
 
struct  has_beginRun< T, enable_if_function_exists_t< void(T::*)(Run const &),&T::beginRun > >
 
struct  has_beginSubRun
 
struct  has_beginSubRun< T, enable_if_function_exists_t< void(T::*)(SubRun const &),&T::beginSubRun > >
 
struct  has_endRun
 
struct  has_endRun< T, enable_if_function_exists_t< void(T::*)(Run &),&T::endRun > >
 
struct  has_endSubRun
 
struct  has_endSubRun< T, enable_if_function_exists_t< void(T::*)(SubRun &),&T::endSubRun > >
 
struct  has_eventsToSkip
 
struct  has_eventsToSkip< T, enable_if_function_exists_t< size_t(T::*)() const,&T::eventsToSkip > >
 
struct  has_eventsToSkip< T, enable_if_function_exists_t< size_t(T::*)(),&T::eventsToSkip > >
 
struct  has_finalizeEvent
 
struct  has_finalizeEvent< T, enable_if_function_exists_t< void(T::*)(Event &),&T::finalizeEvent > >
 
struct  has_hasMoreData
 
struct  has_hasMoreData< T, cet::enable_if_function_exists_t< bool(T::*)() const,&T::hasMoreData > >
 
struct  has_hasMoreData< T, cet::enable_if_function_exists_t< bool(T::*)(),&T::hasMoreData > >
 
struct  has_makePartner_member
 
struct  has_makePartner_member< T, enable_if_function_exists_t< std::unique_ptr< EDProduct >(T::*)( std::type_info const &) const, &T::makePartner > >
 
struct  has_processEventAuxiliaries
 
struct  has_processEventAuxiliaries< T, enable_if_function_exists_t< void(T::*)(EventAuxiliarySequence const &), &T::processEventAuxiliaries > >
 
struct  has_processEventIDs
 
struct  has_processEventIDs< T, enable_if_function_exists_t< void(T::*)(EventIDSequence const &), &T::processEventIDs > >
 
struct  has_respondToCloseInputFile
 
struct  has_respondToCloseInputFile< T, enable_if_function_exists_t< respond_to_file< T >, &T::respondToCloseInputFile > >
 
struct  has_respondToCloseOutputFiles
 
struct  has_respondToCloseOutputFiles< T, enable_if_function_exists_t< respond_to_file< T >, &T::respondToCloseOutputFiles > >
 
struct  has_respondToOpenInputFile
 
struct  has_respondToOpenInputFile< T, enable_if_function_exists_t< respond_to_file< T >, &T::respondToOpenInputFile > >
 
struct  has_respondToOpenOutputFiles
 
struct  has_respondToOpenOutputFiles< T, enable_if_function_exists_t< respond_to_file< T >, &T::respondToOpenOutputFiles > >
 
struct  has_size_member
 
struct  has_size_member< T, std::void_t< size_expression_t< T > > >
 
struct  has_startEvent
 
struct  has_startEvent< T, enable_if_function_exists_t< void(T::*)(Event const &),&T::startEvent > >
 
struct  has_three_arg_insert_t
 
struct  has_three_arg_insert_t< T, OutIter, std::void_t< three_arg_insert_t< T, OutIter > > >
 
struct  has_two_arg_insert
 
struct  has_two_arg_insert< T, std::void_t< two_arg_insert_t< T > > >
 
class  IPRHelper
 
class  IPRHelperDef
 
struct  is_handle
 
struct  is_handle< T, std::void_t< typename T::HandleTag > >
 
class  ItemGetter
 
class  ItemGetter< std::pair< cet::map_vector_key, T >, cet::map_vector< T > >
 
class  ItemGetter< T, cet::map_vector< T > >
 
class  LegacyModule
 
class  LibraryInfo
 
class  LibraryInfoMatch
 
struct  maybe_beginJob
 
struct  maybe_beginJob< DETAIL, enable_if_function_exists_t< void(DETAIL::*)(),&DETAIL::beginJob > >
 
struct  maybe_endJob
 
struct  maybe_endJob< DETAIL, enable_if_function_exists_t< void(DETAIL::*)(),&DETAIL::endJob > >
 
struct  maybe_has_Parameters
 
struct  maybe_has_Parameters< T, std::void_t< typename T::Parameters > >
 
struct  maybe_postProcessEvent
 
struct  maybe_postProcessEvent< DETAIL, enable_if_function_exists_t< void(DETAIL::*)(), &DETAIL::postProcessEvent > >
 
struct  maybe_postProcessRun
 
struct  maybe_postProcessRun< DETAIL, enable_if_function_exists_t< void(DETAIL::*)(),&DETAIL::postProcessRun > >
 
struct  maybe_postProcessSubRun
 
struct  maybe_postProcessSubRun< DETAIL, enable_if_function_exists_t< void(DETAIL::*)(), &DETAIL::postProcessSubRun > >
 
struct  maybe_preProcessEvent
 
struct  maybe_preProcessEvent< DETAIL, enable_if_function_exists_t< void(DETAIL::*)(),&DETAIL::preProcessEvent > >
 
struct  maybe_preProcessRun
 
struct  maybe_preProcessRun< DETAIL, enable_if_function_exists_t< void(DETAIL::*)(),&DETAIL::preProcessRun > >
 
struct  maybe_preProcessSubRun
 
struct  maybe_preProcessSubRun< DETAIL, enable_if_function_exists_t< void(DETAIL::*)(), &DETAIL::preProcessSubRun > >
 
struct  maybe_processEventPrincipal
 
struct  maybe_processEventPrincipal< DETAIL, enable_if_function_exists_t< void(DETAIL::*)(Provenance const &), &DETAIL::processEventProvenance > >
 
struct  maybe_processRunPrincipal
 
struct  maybe_processRunPrincipal< DETAIL, enable_if_function_exists_t< void(DETAIL::*)(Provenance const &), &DETAIL::processRunProvenance > >
 
struct  maybe_processSubRunPrincipal
 
struct  maybe_processSubRunPrincipal< DETAIL, enable_if_function_exists_t< void(DETAIL::*)(Provenance const &), &DETAIL::processSubRunProvenance > >
 
class  MessageAccumulator
 
class  MetadataCollector
 
class  MetadataCollectorFor
 
class  MetadataSummary
 
class  MetadataSummaryFor
 
struct  mix_offset
 
struct  mix_offset< cet::map_vector< P > >
 
struct  ModuleConfig
 
struct  ModuleConfigInfo
 
struct  ModuleGraphInfo
 
class  ModuleGraphInfoMap
 
struct  ModuleKeyAndType
 
struct  ModuleSpec
 
struct  ModuleThreadingTypeDeducer
 
struct  ModuleThreadingTypeDeducer< EDAnalyzer >
 
struct  ModuleThreadingTypeDeducer< EDFilter >
 
struct  ModuleThreadingTypeDeducer< EDProducer >
 
struct  ModuleThreadingTypeDeducer< OutputModule >
 
struct  ModuleThreadingTypeDeducer< ReplicatedAnalyzer >
 
struct  ModuleThreadingTypeDeducer< ReplicatedFilter >
 
struct  ModuleThreadingTypeDeducer< ReplicatedOutputModule >
 
struct  ModuleThreadingTypeDeducer< ReplicatedProducer >
 
struct  ModuleThreadingTypeDeducer< SharedAnalyzer >
 
struct  ModuleThreadingTypeDeducer< SharedFilter >
 
struct  ModuleThreadingTypeDeducer< SharedOutputModule >
 
struct  ModuleThreadingTypeDeducer< SharedProducer >
 
struct  ModuleTypeDeducer
 
struct  ModuleTypeDeducer< EDAnalyzer >
 
struct  ModuleTypeDeducer< EDFilter >
 
struct  ModuleTypeDeducer< EDProducer >
 
struct  ModuleTypeDeducer< OutputModule >
 
struct  ModuleTypeDeducer< ReplicatedAnalyzer >
 
struct  ModuleTypeDeducer< ReplicatedFilter >
 
struct  ModuleTypeDeducer< ReplicatedOutputModule >
 
struct  ModuleTypeDeducer< ReplicatedProducer >
 
struct  ModuleTypeDeducer< SharedAnalyzer >
 
struct  ModuleTypeDeducer< SharedFilter >
 
struct  ModuleTypeDeducer< SharedOutputModule >
 
struct  ModuleTypeDeducer< SharedProducer >
 
struct  NotMapVector
 
struct  NotMapVector< cet::map_vector< T > >
 
struct  OldToNew
 
struct  PluginConfig
 
class  PluginMetadata
 
class  PrincipalProcessor
 
class  ProcessAndEventSelector
 
class  ProcessAndEventSelectors
 
class  Producer
 
struct  ProductInfo
 
struct  ProductTypeIDs
 
struct  ProductTypeIDs< Assns< L, R, D > >
 
struct  ProductTypeIDs< Assns< L, R, void > >
 
class  ProvenanceDumperImpl
 
struct  respondToXXX_function
 
struct  safe_input_tag
 
struct  SafeFileNameConfig
 
class  ServiceCacheEntry
 
struct  ServiceHelper
 
struct  ServiceHelperBase
 
struct  ServiceImplHelper
 
struct  ServiceInterfaceHelper
 
struct  ServiceInterfaceImplHelper
 
struct  ServiceLGMHelper
 
struct  ServiceLGRHelper
 
class  ServiceWrapper
 
class  ServiceWrapperBase
 
class  SharedModule
 
struct  SharedResource_t
 
class  SharedResources
 
struct  Summary
 
struct  tool_type
 
struct  tool_type< T, std::enable_if_t< std::is_class< T >::value > >
 
struct  tool_type< T, std::enable_if_t< std::is_function< T >::value > >
 
struct  ToolConfig
 
struct  tuple_element
 
struct  tuple_element< 0, AssnsNode< L, R, D > >
 
struct  tuple_element< 1, AssnsNode< L, R, D > >
 
struct  tuple_element< 2, AssnsNode< L, R, D > >
 
struct  TwoArgInsert
 
struct  TwoArgInsert< cet::map_vector< T > >
 
class  value_type_helper
 

Typedefs

using LibraryInfoCollection = std::multiset< LibraryInfo >
 
using Widths = std::vector< std::size_t >
 
using config_const_iterator = std::vector< WorkerInPath::ConfigInfo >::const_iterator
 
using path_name_t = std::string
 
using module_name_t = std::string
 
using names_t = std::vector< std::string >
 
using configs_t = std::vector< WorkerInPath::ConfigInfo >
 
using name_set_t = std::set< std::string >
 
using paths_to_modules_t = std::vector< std::pair< PathSpec, configs_t >>
 
using collection_map_t = std::map< module_name_t, ModuleGraphInfo >
 
using collection_t = std::vector< collection_map_t::value_type >
 
using distance_t = collection_t::difference_type
 
using vertex_property = boost::property< boost::vertex_name_t, std::string >
 
using edge_property = boost::property< boost::edge_index_t, int, boost::property< boost::edge_name_t, std::string >>
 
using graph_property = boost::property< boost::graph_name_t, std::string >
 
using Graph = boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, vertex_property, edge_property, graph_property >
 
using ModuleGraph = boost::subgraph< Graph >
 
using Edge = boost::graph_traits< ModuleGraph >::edge_descriptor
 
using Vertex = boost::graph_traits< ModuleGraph >::vertex_descriptor
 
using keytype_for_name_t = std::map< std::string, ModuleKeyAndType >
 
using module_entries_for_ordered_path_t = std::vector< std::pair< PathSpec, std::vector< ModuleSpec >>>
 
using module_entries_for_path_t = std::map< std::string, std::vector< ModuleSpec >>
 
using modules_for_path_t = std::map< std::string, std::vector< ModuleKeyAndType >>
 
using ModuleMaker_t = ModuleBase *(fhicl::ParameterSet const &, ProcessingFrame const &)
 
using ModuleTypeFunc_t) = ModuleType(
 
using ModuleThreadingTypeFunc_t) = ModuleThreadingType(
 
template<typename T >
using ConfigFor = typename config_for_impl< T >::type
 
template<typename T >
using respond_to_file = void(T::*)(FileBlock const &)
 
using ServiceCache = std::map< TypeID, ServiceCacheEntry >
 
using ServiceStack = std::stack< WrapperBase_ptr >
 
using WrapperBase_ptr = std::shared_ptr< ServiceWrapperBase >
 
using new_t = std::string
 
using old_t = std::string
 
using entry_selector_t = std::function< bool(PathSpec const &)>
 
template<typename T , typename InIter = typename T::const_iterator>
using two_arg_insert_t = decltype(std::declval< T >().insert(std::declval< InIter >(), std::declval< InIter >()))
 
template<typename T , typename OutIter , typename InIter = typename T::const_iterator>
using three_arg_insert_t = decltype(std::declval< T >().insert(std::declval< OutIter >(), std::declval< InIter >(), std::declval< InIter >()))
 
template<typename T >
using not_map_vector_t = typename NotMapVector< T >::type
 
template<typename T >
using size_expression_t = decltype(std::declval< T const >().size())
 

Enumerations

enum  FilterAction { FilterAction::Normal = 0, FilterAction::Ignore = 1, FilterAction::Veto = 2 }
 
enum  SignalResponseType { SignalResponseType::FIFO, SignalResponseType::LIFO }
 

Functions

void print_available_plugins (std::string const &suffix, std::string const &spec, bool verbose)
 
void print_available_plugins (std::string const &suffix, bool const verbose)
 
bool supports_key (std::string const &suffix, std::string const &spec, std::string const &key)
 
void print_description (std::vector< PluginMetadata > const &matches)
 
void print_descriptions (std::vector< std::string > const &plugins)
 
std::tuple< RunNumber_t, SubRunNumber_t, EventNumber_tevent_start (std::string const &str_num)
 
bool exists_outside_prolog (fhicl::intermediate_table const &config, std::string const &key)
 
template<typename T >
std::enable_if_t< std::is_convertible_v< T, std::string >, std::string > fhicl_key (T const &name)
 
template<typename H , typename... T>
std::enable_if_t< std::is_convertible_v< H, std::string >, std::string > fhicl_key (H const &hname, T const &...tnames)
 
void fillSourceList (std::istream &ifs, std::vector< std::string > &source_list)
 
constexpr char const * dflt_spec_pattern ()
 
LibraryInfoCollection get_LibraryInfoCollection (std::string const &suffix, std::string const &pattern, bool verbose=false)
 
std::unique_ptr< MetadataCollectorget_MetadataCollector (std::string const &suffix)
 
std::unique_ptr< MetadataSummaryget_MetadataSummary (std::string const &suffix, LibraryInfoCollection const &coll)
 
constexpr int info_success ()
 
std::regex regex_for_spec (std::string const &)
 
void replace_type (std::string &str, std::string const &spec, std::regex const &r)
 
bool output_to_stderr (std::string const &spec)
 
bool output_to_stdout (std::string const &spec)
 
std::string getFilePath (cet::LibraryManager const &lm, std::string const &fullspec)
 
std::string getType (cet::LibraryManager const &lm, std::string const &fullSpec)
 
std::unique_ptr< fhicl::ConfigurationTablegetAllowedConfiguration (cet::LibraryManager const &lm, std::string const &fullSpec, std::string const &name)
 
void print_config_summary (fhicl::ParameterSet const &pset, std::string const &verbosity, EnabledModules const &enabled_modules)
 
void print_table_numbers (fhicl::ParameterSet const &pset, std::string const &header)
 
void print_path_numbers (EnabledModules const &enabled_modules)
 
void print_path_names (EnabledModules const &enabled_modules)
 
void print_service_types (fhicl::ParameterSet const &pset)
 
void print_module_types (fhicl::ParameterSet const &pset, std::string const &header)
 
std::string indent (std::size_t const i)
 
std::string indent0 ()
 
std::string indent_1 ()
 
std::string indent__2 ()
 
template<typename T , typename Elem >
std::size_t columnWidth (T const &coll, std::string const Elem::*cp, std::string const &header)
 
std::size_t columnWidth (LibraryInfoCollection const &coll, std::string const &(LibraryInfo::*fp)() const, std::string const &header)
 
std::size_t rule_size (Widths const &widths)
 
std::vector< ModuleSpecsequence_to_entries (sequence_t const &seq, bool const allow_nil_entries)
 
std::vector< art::PathSpecpath_specs (std::vector< ModuleSpec > const &selection_override_entries, std::string const &path_selection_override)
 
EnabledModules prune_config_if_enabled (bool prune_config, bool report_enabled, fhicl::intermediate_table &config)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, Analyzer::Table< T > const &t)
 
std::set< ProductInfoconsumed_products_for_module (std::string const &current_process, ConsumesInfo::consumables_t::mapped_type const &consumables, std::map< std::string, std::set< ProductInfo >> const &produced_products, std::map< std::string, std::set< std::string >> const &viewable_products, config_const_iterator const config_begin, config_const_iterator const config_it)
 
std::pair< ModuleGraph, std::string > make_module_graph (ModuleGraphInfoMap const &modInfos, paths_to_modules_t const &trigger_paths, configs_t const &end_path)
 
void make_trigger_path_subgraphs (ModuleGraphInfoMap const &modInfos, paths_to_modules_t const &trigger_paths, ModuleGraph &graph)
 
void make_product_dependency_edges (ModuleGraphInfoMap const &modInfos, ModuleGraph &graph)
 
void make_path_ordering_edges (ModuleGraphInfoMap const &modInfos, paths_to_modules_t const &paths, ModuleGraph &graph)
 
void make_synchronization_edges (ModuleGraphInfoMap const &modInfos, paths_to_modules_t const &trigger_paths, configs_t const &end_path, ModuleGraph &graph)
 
std::string verify_no_interpath_dependencies (ModuleGraphInfoMap const &modInfos, ModuleGraph const &graph)
 
std::string verify_in_order_dependencies (ModuleGraphInfoMap const &modules, paths_to_modules_t const &trigger_paths)
 
void print_module_graph (std::ostream &os, ModuleGraphInfoMap const &modInfos, ModuleGraph const &graph)
 
void issue_reports (unsigned count, EventID const &id)
 
std::ostream & operator<< (std::ostream &os, ModuleGraphInfo const &info)
 
ModuleType module_type (std::string const &full_key)
 
bool operator== (ModuleKeyAndType const &a, ModuleKeyAndType const &b) noexcept
 
bool operator!= (ModuleKeyAndType const &a, ModuleKeyAndType const &b) noexcept
 
void verifyInstanceName (std::string const &in)
 
void verifyFriendlyClassName (std::string const &fcn)
 
template<typename T >
T * make_module (fhicl::ParameterSet const &pset, ProcessingFrame const &frame)
 
void memoryReport ()
 
void writeSummary (PathManager &pm, bool wantSummary, cet::cpu_timer const &timer)
 
void triggerReport (PerScheduleContainer< PathsInfo > const &endPathInfo, PerScheduleContainer< PathsInfo > const &triggerPathsInfo, bool wantSummary)
 
void timeReport (cet::cpu_timer const &timer)
 
FileNameComponents componentsFromPattern (std::string const &pattern)
 
void logFileAction (const char *msg, std::string const &file)
 
void validateFileNamePattern (bool do_check, std::string const &pattern)
 
TypeLabel type_label_for (TypeID const typeID, std::string const &instance, bool const supportsView, ModuleDescription const &md)
 
template<typename... T>
void throw_if_invalid (std::string const &msg, T const &...t)
 
constexpr bool range_sets_supported (BranchType const bt)
 
void ensure_only_one_thread (fhicl::ParameterSet const &service_pset)
 
template<typename T , typename ResultType , typename... Args>
std::function< ResultType(Args...)> makeWatchFunc (ResultType(T::*slot)(Args...), T &t)
 
template<typename T , typename ResultType , typename... Args>
std::function< ResultType(Args...)> makeWatchFunc (ResultType(T::*slot)(Args...) const, T const &t)
 
template<typename T >
std::enable_if_t< std::is_constructible_v< T, fhicl::ParameterSet const &, ActivityRegistry & >, std::shared_ptr< T > > makeServiceFrom (fhicl::ParameterSet const &ps, ActivityRegistry &areg)
 
template<typename T >
std::enable_if_t<!std::is_constructible_v< T, fhicl::ParameterSet const &, ActivityRegistry & >, std::shared_ptr< T > > makeServiceFrom (fhicl::ParameterSet const &ps, ActivityRegistry &)
 
template<SignalResponseType STYPE, typename SIGNAL , typename FUNC >
std::enable_if_t< STYPE==SignalResponseType::FIFOconnect_to_signal (SIGNAL &s, FUNC f)
 
template<SignalResponseType STYPE, typename SIGNAL , typename FUNC >
std::enable_if_t< STYPE==SignalResponseType::LIFOconnect_to_signal (SIGNAL &s, FUNC f)
 
std::map< old_t, new_toldToNewName ()
 
template<typename T >
bool verifyPtrCollection (std::vector< art::PtrVector< T > const * > const &in)
 
template<typename iterator >
bool verifyPtrCollection (iterator beg, iterator end, art::ProductID id={}, art::EDProductGetter const *getter=nullptr)
 
BranchKey splitToComponents (std::string const &branchName, std::string &errMsg)
 
bool checkBranchNameSelector (std::string const &branchNameSelector, std::string &errMsg)
 
bool checkBranchNameSelector (BranchKey const &components, std::string &errMsg)
 
bool checkFriendlyName (std::string const &friendlyName, std::string &errMsg)
 
bool checkFriendlyNameSelector (std::string const &friendlyNameSelector, std::string &errMsg)
 
bool checkModuleLabel (std::string const &moduleLabel, std::string &errMsg)
 
bool checkModuleLabelSelector (std::string const &moduleLabelSelector, std::string &errMsg)
 
bool checkInstanceName (std::string const &instanceName, std::string &errMsg)
 
bool checkInstanceNameSelector (std::string const &instanceNameSelector, std::string &errMsg)
 
bool checkProcessName (std::string const &processName, std::string &errMsg)
 
bool checkProcessNameSelector (std::string const &processNameSelector, std::string &errMsg)
 
std::vector< std::vector< std::string > > orderedProcessNamesCollection (ProcessHistoryMap const &pHistMap)
 
void remove_whitespace (std::string &str)
 
bool has_whitespace (std::string const &str)
 
template<typename ProdA , typename ProdB , typename Data , typename Tag >
InputTag input_tag (Tag const &tag)
 
bool upcastAllowed (std::type_info const &tiFrom, std::type_info const &tiTo)
 
void const * maybeCastObj (void const *address, std::type_info const &tiFrom, std::type_info const &tiTo)
 
template<typename element_type >
void const * maybeCastObj (element_type const *address, std::type_info const &tiTo)
 
template<typename T >
auto wrapperTypeID ()
 
void throwPartnerException (std::type_info const &generator, std::type_info const &wanted_wrapper_type)
 
ProductLookup_t createProductLookups (ProductDescriptionsByID const &descriptions)
 
ViewLookup_t createViewLookups (ProductDescriptionsByID const &descriptions)
 
void fixup (std::string &hash)
 
std::string hash_to_string (std::string const &hash)
 
std::string const & InvalidHash ()
 
EventRange full_run_event_range ()
 
template<typename TO , typename FROM >
constexpr std::enable_if_t< are_cv_compatible< TO, FROM >::value, std::add_pointer_t< std::remove_pointer_t< TO > > > addr (FROM &from)
 
template<typename TO , typename FROM >
constexpr std::enable_if_t<!are_cv_compatible< TO, FROM >::value &&are_cv_compatible< FROM, TO >::value, std::add_pointer_t< std::remove_pointer_t< TO > > > addr (FROM &from)
 

Variables

template<typename T >
bool constexpr handle_allowed_v {handle_allowed<T>::value}
 
template<typename T >
constexpr bool has_three_arg_insert
 
SharedResource_t const LegacyResource {"__legacy__", false}
 
template<typename T >
constexpr bool is_handle_v = is_handle<T>::value
 
template<typename T , typename U >
constexpr bool are_handles_v {is_handle_v<T> && is_handle_v<U>}
 

Typedef Documentation

Definition at line 20 of file graph_type_aliases.h.

using art::detail::collection_t = typedef std::vector<collection_map_t::value_type>

Definition at line 21 of file graph_type_aliases.h.

Definition at line 14 of file consumed_products.h.

template<typename T >
using art::detail::ConfigFor = typedef typename config_for_impl<T>::type

Definition at line 48 of file ModuleMacros.h.

using art::detail::configs_t = typedef std::vector<WorkerInPath::ConfigInfo>

Definition at line 17 of file graph_type_aliases.h.

using art::detail::distance_t = typedef collection_t::difference_type

Definition at line 22 of file graph_type_aliases.h.

using art::detail::Edge = typedef boost::graph_traits<ModuleGraph>::edge_descriptor

Definition at line 24 of file ModuleGraph.h.

using art::detail::edge_property = typedef boost::property<boost::edge_index_t, int, boost::property<boost::edge_name_t, std::string>>

Definition at line 15 of file ModuleGraph.h.

using art::detail::entry_selector_t = typedef std::function<bool(PathSpec const&)>

Definition at line 41 of file TriggerNamesService.h.

using art::detail::Graph = typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, vertex_property, edge_property, graph_property>

Definition at line 22 of file ModuleGraph.h.

using art::detail::graph_property = typedef boost::property<boost::graph_name_t, std::string>

Definition at line 16 of file ModuleGraph.h.

using art::detail::keytype_for_name_t = typedef std::map<std::string, ModuleKeyAndType>

Definition at line 39 of file ModuleKeyAndType.h.

using art::detail::LibraryInfoCollection = typedef std::multiset<LibraryInfo>

Definition at line 10 of file LibraryInfoCollection.h.

using art::detail::module_entries_for_ordered_path_t = typedef std::vector<std::pair<PathSpec, std::vector<ModuleSpec>>>

Definition at line 41 of file ModuleKeyAndType.h.

using art::detail::module_entries_for_path_t = typedef std::map<std::string, std::vector<ModuleSpec>>

Definition at line 43 of file ModuleKeyAndType.h.

using art::detail::module_name_t = typedef std::string

Definition at line 15 of file graph_type_aliases.h.

using art::detail::ModuleGraph = typedef boost::subgraph<Graph>

Definition at line 23 of file ModuleGraph.h.

Definition at line 33 of file ModuleMacros.h.

using art::detail::modules_for_path_t = typedef std::map<std::string, std::vector<ModuleKeyAndType>>

Definition at line 45 of file ModuleKeyAndType.h.

using art::detail::ModuleThreadingTypeFunc_t = typedef ModuleThreadingType(

Definition at line 35 of file ModuleMacros.h.

using art::detail::ModuleTypeFunc_t = typedef ModuleType(

Definition at line 34 of file ModuleMacros.h.

using art::detail::name_set_t = typedef std::set<std::string>

Definition at line 18 of file graph_type_aliases.h.

using art::detail::names_t = typedef std::vector<std::string>

Definition at line 16 of file graph_type_aliases.h.

using art::detail::new_t = typedef std::string

Definition at line 10 of file SAMMetadataTranslators.h.

template<typename T >
using art::detail::not_map_vector_t = typedef typename NotMapVector<T>::type

Definition at line 405 of file Ptr.h.

using art::detail::old_t = typedef std::string

Definition at line 11 of file SAMMetadataTranslators.h.

using art::detail::path_name_t = typedef std::string

Definition at line 14 of file graph_type_aliases.h.

using art::detail::paths_to_modules_t = typedef std::vector<std::pair<PathSpec, configs_t>>

Definition at line 19 of file graph_type_aliases.h.

template<typename T >
using art::detail::respond_to_file = typedef void (T::*)(FileBlock const&)

Definition at line 308 of file MixFilter.h.

Definition at line 11 of file ServiceCache.h.

using art::detail::ServiceStack = typedef std::stack<WrapperBase_ptr>

Definition at line 10 of file ServiceStack.h.

template<typename T >
using art::detail::size_expression_t = typedef decltype(std::declval<T const>().size())

Definition at line 42 of file Wrapper.h.

template<typename T , typename OutIter , typename InIter = typename T::const_iterator>
using art::detail::three_arg_insert_t = typedef decltype(std::declval<T>().insert(std::declval<OutIter>(), std::declval<InIter>(), std::declval<InIter>()))

Definition at line 234 of file CollectionUtilities.h.

template<typename T , typename InIter = typename T::const_iterator>
using art::detail::two_arg_insert_t = typedef decltype(std::declval<T>().insert(std::declval<InIter>(), std::declval<InIter>()))

Definition at line 218 of file CollectionUtilities.h.

using art::detail::Vertex = typedef boost::graph_traits<ModuleGraph>::vertex_descriptor

Definition at line 25 of file ModuleGraph.h.

using art::detail::vertex_property = typedef boost::property<boost::vertex_name_t, std::string>

Definition at line 11 of file ModuleGraph.h.

using art::detail::Widths = typedef std::vector<std::size_t>

Definition at line 65 of file PrintFormatting.h.

using art::detail::WrapperBase_ptr = typedef std::shared_ptr<ServiceWrapperBase>

Definition at line 29 of file ServiceWrapperBase.h.

Enumeration Type Documentation

Enumerator
Normal 
Ignore 
Veto 

Definition at line 18 of file ModuleKeyAndType.h.

Function Documentation

template<typename TO , typename FROM >
constexpr std::enable_if_t<are_cv_compatible<TO, FROM>::value, std::add_pointer_t<std::remove_pointer_t<TO> > > art::detail::addr ( FROM &  from)

Definition at line 35 of file ensurePointer.h.

References value.

36  {
37  return &from;
38  }
template<typename TO , typename FROM >
constexpr std::enable_if_t<!are_cv_compatible<TO, FROM>::value && are_cv_compatible<FROM, TO>::value, std::add_pointer_t<std::remove_pointer_t<TO> > > art::detail::addr ( FROM &  from)

Definition at line 44 of file ensurePointer.h.

45  {
46  return &dynamic_cast<
47  std::add_lvalue_reference_t<std::remove_pointer_t<TO>>>(from);
48  }
bool art::detail::checkBranchNameSelector ( std::string const &  branchNameSelector,
std::string &  errMsg 
)

Definition at line 61 of file branchNameComponentChecking.cc.

References splitToComponents().

63 {
64  errMsg.clear();
65  auto components = splitToComponents(branchNameSelector, errMsg);
66  return (!errMsg.empty()) || checkBranchNameSelector(components, errMsg);
67 }
bool checkBranchNameSelector(std::string const &branchNameSelector, std::string &errMsg)
BranchKey splitToComponents(std::string const &branchName, std::string &errMsg)
bool art::detail::checkBranchNameSelector ( BranchKey const &  components,
std::string &  errMsg 
)

Definition at line 70 of file branchNameComponentChecking.cc.

References checkFriendlyNameSelector(), checkInstanceNameSelector(), checkModuleLabelSelector(), checkProcessNameSelector(), art::BranchKey::friendlyClassName_, art::BranchKey::moduleLabel_, art::BranchKey::processName_, and art::BranchKey::productInstanceName_.

72 {
73  // Inclusive operation: do all steps.
74  bool result =
75  checkFriendlyNameSelector(components.friendlyClassName_, errMsg);
76  result = checkModuleLabelSelector(components.moduleLabel_, errMsg) && result;
77  result = checkInstanceNameSelector(components.productInstanceName_, errMsg) &&
78  result;
79  result = checkProcessNameSelector(components.processName_, errMsg) && result;
80  return result;
81 }
bool checkModuleLabelSelector(std::string const &moduleLabelSelector, std::string &errMsg)
bool checkInstanceNameSelector(std::string const &instanceNameSelector, std::string &errMsg)
bool checkProcessNameSelector(std::string const &processNameSelector, std::string &errMsg)
bool checkFriendlyNameSelector(std::string const &friendlyNameSelector, std::string &errMsg)
bool art::detail::checkFriendlyName ( std::string const &  friendlyName,
std::string &  errMsg 
)

Definition at line 84 of file branchNameComponentChecking.cc.

86 {
87  return checkBranchNameComponent(
88  friendlyName, "friendly name", typeRE, errMsg);
89 }
std::string friendlyName(std::string const &iFullName)
bool art::detail::checkFriendlyNameSelector ( std::string const &  friendlyNameSelector,
std::string &  errMsg 
)

Definition at line 92 of file branchNameComponentChecking.cc.

Referenced by checkBranchNameSelector().

94 {
95  return checkBranchNameComponent(
96  friendlyNameSelector, "friendly name", typeSelectorRE, errMsg);
97 }
bool art::detail::checkInstanceName ( std::string const &  instanceName,
std::string &  errMsg 
)

Definition at line 115 of file branchNameComponentChecking.cc.

117 {
118  return checkBranchNameComponent(instanceName,
119  "instance name",
120  processRE, // sic.
121  errMsg,
122  true);
123 }
bool art::detail::checkInstanceNameSelector ( std::string const &  instanceNameSelector,
std::string &  errMsg 
)

Definition at line 126 of file branchNameComponentChecking.cc.

Referenced by checkBranchNameSelector().

128 {
129  return checkBranchNameComponent(instanceNameSelector,
130  "instance name",
131  processSelectorRE, // sic.
132  errMsg,
133  true);
134 }
bool art::detail::checkModuleLabel ( std::string const &  moduleLabel,
std::string &  errMsg 
)

Definition at line 100 of file branchNameComponentChecking.cc.

102 {
103  return checkBranchNameComponent(moduleLabel, "module label", labelRE, errMsg);
104 }
bool art::detail::checkModuleLabelSelector ( std::string const &  moduleLabelSelector,
std::string &  errMsg 
)

Definition at line 107 of file branchNameComponentChecking.cc.

Referenced by checkBranchNameSelector().

109 {
110  return checkBranchNameComponent(
111  moduleLabelSelector, "module label", labelSelectorRE, errMsg);
112 }
bool art::detail::checkProcessName ( std::string const &  processName,
std::string &  errMsg 
)

Definition at line 137 of file branchNameComponentChecking.cc.

139 {
140  return checkBranchNameComponent(
141  processName, "process name", processRE, errMsg);
142 }
bool art::detail::checkProcessNameSelector ( std::string const &  processNameSelector,
std::string &  errMsg 
)

Definition at line 145 of file branchNameComponentChecking.cc.

Referenced by checkBranchNameSelector().

147 {
148  return checkBranchNameComponent(
149  processNameSelector, "process name", processSelectorRE, errMsg);
150 }
template<typename T , typename Elem >
std::size_t art::detail::columnWidth ( T const &  coll,
std::string const Elem::*  cp,
std::string const &  header 
)

Definition at line 41 of file PrintFormatting.h.

Referenced by art::FileDumperOutput::printPrincipal().

44  {
45  std::size_t s{header.size()};
46  cet::for_all(
47  coll, [&s, cp](auto const& elem) { s = std::max(s, (elem.*cp).size()); });
48  return s;
49  }
std::size_t art::detail::columnWidth ( LibraryInfoCollection const &  coll,
std::string const &(LibraryInfo::*)() const  fp,
std::string const &  header 
)
inline

Definition at line 52 of file PrintFormatting.h.

55  {
56  std::size_t s{header.size()};
57  cet::for_all(
58  coll, [&s, fp](auto const& li) { s = std::max(s, (li.*fp)().size()); });
59  return s;
60  }
FILE * fp
Definition: plot.C:34
FileNameComponents art::detail::componentsFromPattern ( std::string const &  pattern)

Definition at line 62 of file FileNameComponents.cc.

References art::detail::FileNameComponents::add(), util::cbegin(), util::cend(), and art::detail::FileNameComponents::setSuffix().

Referenced by art::PostCloseFileRenamer::applySubstitutions().

63  {
64  FileNameComponents result;
65 
66  boost::smatch match;
67  auto sid = cbegin(pattern), se = cend(pattern);
68  while (boost::regex_search(
69  sid,
70  se,
71  match,
72  boost::regex{"%(\\d+)?#", boost::regex_constants::ECMAScript})) {
73  assert(match.size() == 2);
74  // Subexpressions:
75  // 0. Entire matched expression
76  // 1. Possible fill format digits for numeric substitution.
77  result.add(match.prefix(), match[1].str());
78  sid = match[0].second;
79  }
80  // Get remaining characters of filename
81  result.setSuffix(std::string(sid, se));
82  return result;
83  }
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
Definition: StdUtils.h:93
decltype(auto) constexpr cbegin(T &&obj)
ADL-aware version of std::cbegin.
Definition: StdUtils.h:85
template<SignalResponseType STYPE, typename SIGNAL , typename FUNC >
std::enable_if_t<STYPE == SignalResponseType::FIFO> art::detail::connect_to_signal ( SIGNAL &  s,
FUNC  f 
)

Definition at line 16 of file SignalResponseType.h.

17  {
18  s.emplace_back(f);
19  }
TFile f
Definition: plotHisto.C:6
template<SignalResponseType STYPE, typename SIGNAL , typename FUNC >
std::enable_if_t<STYPE == SignalResponseType::LIFO> art::detail::connect_to_signal ( SIGNAL &  s,
FUNC  f 
)

Definition at line 23 of file SignalResponseType.h.

24  {
25  s.emplace_front(f);
26  }
TFile f
Definition: plotHisto.C:6
std::set< ProductInfo > art::detail::consumed_products_for_module ( std::string const &  current_process,
ConsumesInfo::consumables_t::mapped_type const &  consumables,
std::map< std::string, std::set< ProductInfo >> const &  produced_products,
std::map< std::string, std::set< std::string >> const &  viewable_products,
config_const_iterator const  config_begin,
config_const_iterator const  config_it 
)

Definition at line 159 of file consumed_products.cc.

References util::begin(), util::cend(), art::ProductInfo::Many, util::pi(), art::ProductInfo::Product, and art::ProductInfo::ViewElement.

Referenced by art::PathManager::fillModuleOnlyDeps_().

166 {
167  auto const& module_name =
168  config_it->moduleConfigInfo->modDescription.moduleLabel();
169  std::set<ProductInfo> result;
170  for (auto const& per_branch_type : consumables) {
171  for (auto const& prod_info : per_branch_type) {
172  switch (prod_info.consumableType) {
173  case ProductInfo::ConsumableType::Product: {
174  auto dep = consumes_dependency(config_begin,
175  config_it,
176  prod_info,
177  current_process,
178  produced_products);
179  result.insert(std::move(dep));
180  break;
181  }
182  case ProductInfo::ConsumableType::Many: {
183  // Loop through modules on this path, introducing
184  // product-lookup dependencies if the type of the product
185  // created by the module matches the type requested in the
186  // consumesMany call.
187  auto const& class_name = prod_info.friendlyClassName;
188  for (auto mit = config_begin; mit != config_it; ++mit) {
189  auto possible_products = produced_products.find(
190  mit->moduleConfigInfo->modDescription.moduleLabel());
191  if (possible_products == cend(produced_products)) {
192  continue;
193  }
194  cet::copy_if_all(possible_products->second,
195  inserter(result, begin(result)),
196  [&class_name](auto const& pi) {
197  return class_name == pi.friendlyClassName;
198  });
199  }
200  break;
201  }
202  case ProductInfo::ConsumableType::ViewElement: {
203  auto dep = consumes_view_dependency(
204  prod_info, module_name, current_process, viewable_products);
205  result.insert(std::move(dep));
206  }
207  // No default case to allow compiler to warn.
208  }
209  }
210  }
211  return result;
212 }
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
Definition: StdUtils.h:93
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
art::ProductLookup_t art::detail::createProductLookups ( ProductDescriptionsByID const &  descriptions)

Definition at line 68 of file createProductLookups.cc.

References art::friendlyname::friendlyName(), art::is_assns(), and art::name_of_assns_base().

Referenced by art::ProductTable::ProductTable().

69 {
70  // Computing the product lookups does not rely on any ROOT facilities.
71  ProductLookup_t result;
72  std::vector<PendingBTLEntry> pendingEntries;
73  std::unordered_map<ProductID, CheapTag, ProductID::Hash> insertedABVs;
74  for (auto const& [pid, pd] : descriptions) {
75  auto const& prodFCN = pd.friendlyClassName();
76  auto const& procName = pd.processName();
77  result[prodFCN][procName].emplace_back(pid);
78 
79  // Additional work only for Assns lookup
80  auto const& moduleLabel = pd.moduleLabel();
81  auto const& instanceName = pd.productInstanceName();
82  auto const& className = pd.producedClassName();
83 
84  if (!is_assns(className))
85  continue;
86 
87  auto const baseName = name_of_assns_base(className);
88  if (!baseName.empty()) {
89  // We're an Assns<A, B, D>, with a base Assns<A, B>.
90  pendingEntries.emplace_back(art::friendlyname::friendlyName(baseName),
91  moduleLabel,
92  instanceName,
93  procName,
94  pid);
95  } else {
96  // Add our pid to the list of real Assns<A, B, void>
97  // products already registered.
98  insertedABVs.emplace(pid, CheapTag{moduleLabel, instanceName, procName});
99  }
100  }
101 
102  auto const iend = insertedABVs.cend();
103  // Preserve useful ordering, only inserting if we don't already have
104  // a *real* Assns<A, B, void> for that module label / instance name
105  // combination.
106  std::for_each(
107  pendingEntries.cbegin(),
108  pendingEntries.cend(),
109  [&result, &insertedABVs, iend](auto const& pe) {
110  auto& pids = result[pe.fcn()][pe.process()];
111  if (pids.empty() ||
112  !std::any_of(pids.cbegin(),
113  pids.cend(),
114  [&insertedABVs, &iend, &pe](ProductID const pid) {
115  auto i = insertedABVs.find(pid);
116  return i != iend && pe.ct() == i->second;
117  })) {
118  pids.emplace_back(pe.pid());
119  }
120  });
121 
122  return result;
123 }
string name_of_assns_base(string assns_type_name)
Definition: TypeID.cc:188
std::string friendlyName(std::string const &iFullName)
std::map< std::string, ProcessLookup > ProductLookup_t
Definition: type_aliases.h:23
bool is_assns(std::string const &type_name)
Definition: TypeID.h:66
art::ViewLookup_t art::detail::createViewLookups ( ProductDescriptionsByID const &  descriptions)

Definition at line 5 of file createViewLookups.cc.

Referenced by art::ProductTable::ProductTable().

6 {
7  // This version stores the list of products that support views.
8  ViewLookup_t result;
9  for (auto const& [pid, pd] : descriptions) {
10  if (!pd.supportsView())
11  continue;
12 
13  auto const& procName = pd.processName();
14  result[procName].emplace_back(pid);
15  }
16  return result;
17 }
ProcessLookup ViewLookup_t
Definition: type_aliases.h:18
constexpr char const* art::detail::dflt_spec_pattern ( )

Definition at line 11 of file get_LibraryInfoCollection.h.

References get_LibraryInfoCollection().

Referenced by print_available_plugins().

12  {
13  return "[A-Za-z0-9]+";
14  }
void art::detail::ensure_only_one_thread ( fhicl::ParameterSet const &  service_pset)

Definition at line 15 of file ensure_only_one_thread.cc.

References art::errors::Configuration, e, fhicl::ParameterSet::get(), fhicl::ParameterSet::get_if_present(), and instance.

16 {
17  auto const& globals = *Globals::instance();
18  auto const nschedules = globals.nschedules();
19  auto const nthreads = globals.nthreads();
20  if (nschedules == 1u && nthreads == 1u)
21  return;
22 
23  auto const service_type = service_pset.get<std::string>("service_type");
25  e << "The service '" << service_type << '\'';
26  if (auto provider =
27  service_pset.get_if_present<std::string>("service_provider")) {
28  e << " (provider: '" << *provider << "')";
29  }
30  e << " is a legacy service,\n"
31  << "which can be used with only one schedule and one thread.\n"
32  << "This job uses " << nschedules << maybe_s(nschedules, " schedule")
33  << " and " << nthreads << maybe_s(nthreads, " thread") << ".\n"
34  << "Please reconfigure your job to use only one schedule/thread.\n";
35  throw e;
36 }
const std::string instance
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
Float_t e
Definition: plot.C:35
std::tuple< art::RunNumber_t, art::SubRunNumber_t, art::EventNumber_t > art::detail::event_start ( std::string const &  str_num)

Definition at line 73 of file event_start.cc.

Referenced by art::BasicSourceOptionsHandler::doProcessOptions().

74 {
75  std::smatch parts;
76  auto const success = std::regex_match(event_spec, parts, re_event_id);
77  if (!success) {
78  throw_configuration_exception(event_spec);
79  }
80 
81  assert(parts.size() == 4ull);
82  // A successful match will populate 'parts' with 5 elements.
83  // Consider the following valid specifications:
84  //
85  // +-------------+---------+
86  // | User spec. | '1:0:3' |
87  // +-------------+---------+
88  // | parts[0] == | '1:0:3' |
89  // | parts[1] == | '1' |
90  // | parts[2] == | '0' |
91  // | parts[3] == | '3' |
92  // +-------------+---------+
93 
94  auto const run = convert_or_throw<Level::Run>(parts[1], event_spec);
95  auto const subrun = convert_or_throw<Level::SubRun>(parts[2], event_spec);
96  auto const event = convert_or_throw<Level::Event>(parts[3], event_spec);
97 
98  return std::make_tuple(run, subrun, event);
99 }
Event finding and building.
template<typename T >
std::enable_if_t<std::is_convertible_v<T, std::string>, std::string> art::detail::fhicl_key ( T const &  name)
template<typename H , typename... T>
std::enable_if_t<std::is_convertible_v<H, std::string>, std::string> art::detail::fhicl_key ( H const &  hname,
T const &...  tnames 
)

Definition at line 19 of file fhicl_key.h.

References fhicl_key().

20  {
21  std::string const head{hname};
22  return head.empty() ? fhicl_key(tnames...) :
23  head + "." + fhicl_key(tnames...);
24  }
std::enable_if_t< std::is_convertible_v< H, std::string >, std::string > fhicl_key(H const &hname, T const &...tnames)
Definition: fhicl_key.h:19
void art::detail::fillSourceList ( std::istream &  ifs,
std::vector< std::string > &  source_list 
)

Definition at line 4 of file fillSourceList.cc.

Referenced by art::BasicSourceOptionsHandler::processSourceListArg_().

6 {
7  for (std::string line; std::getline(is, line);) {
8  auto const comment_start = line.find('#');
9  if (comment_start != std::string::npos)
10  line.erase(comment_start);
11  if (!line.empty())
12  source_list.push_back(line);
13  }
14 }
void art::detail::fixup ( std::string &  hash)

Definition at line 12 of file Hash.cc.

References InvalidHash(), and art::errors::LogicError.

Referenced by art::Hash< I >::Hash(), art::Hash< I >::operator=(), and art::Hash< I >::swap().

13  {
14  if (hash.size() == 16) {
15  // Already in compact form.
16  return;
17  }
18  if (hash.size() == 0) {
19  hash = art::detail::InvalidHash();
20  return;
21  }
22  if (hash.size() == 32) {
23  cet::MD5Result md5;
24  md5.fromHexifiedString(hash);
25  hash = md5.compactForm();
26  return;
27  }
29  << "art::Hash<> instance with data in illegal state:\n"
30  << hash << "\nPlease report this to the core framework developers";
31  }
std::string const & InvalidHash()
Definition: Hash.cc:43
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
EventRange art::detail::full_run_event_range ( )

Definition at line 81 of file RangeSet.cc.

Referenced by art::RangeSet::forRun(), and art::RangeSet::is_full_run().

82  {
83  static EventRange const range{
84  IDNumber<Level::SubRun>::invalid(), 0, IDNumber<Level::Event>::invalid()};
85  return range;
86  }
LibraryInfoCollection art::detail::get_LibraryInfoCollection ( std::string const &  suffix,
std::string const &  pattern,
bool  verbose = false 
)

Definition at line 239 of file get_LibraryInfoCollection.cc.

References art::Suffixes::service().

Referenced by dflt_spec_pattern(), art::BasicOutputOptionsHandler::doCheckOptions(), print_available_plugins(), and supports_key().

242 {
243  if (suffix == art::Suffixes::service()) {
244  return collection_for_services(pattern, verbose);
245  }
246  return collection_for_plugins(suffix, pattern, verbose);
247 }
static std::string const & service()
std::unique_ptr< MetadataCollector > art::detail::get_MetadataCollector ( std::string const &  suffix)

Definition at line 15 of file get_MetadataCollector.cc.

References art::Suffixes::mfPlugin(), art::Suffixes::mfStatsPlugin(), art::Suffixes::module(), art::Suffixes::plugin(), art::Suffixes::service(), art::Suffixes::source(), and art::Suffixes::tool().

16 {
17  if (suffix == art::Suffixes::module()) {
18  return std::make_unique<MetadataCollectorFor<suffix_type::module>>();
19  }
20  if (suffix == art::Suffixes::plugin()) {
21  return std::make_unique<MetadataCollectorFor<suffix_type::plugin>>();
22  }
23  if (suffix == art::Suffixes::service()) {
24  return std::make_unique<MetadataCollectorFor<suffix_type::service>>();
25  }
26  if (suffix == art::Suffixes::source()) {
27  return std::make_unique<MetadataCollectorFor<suffix_type::source>>();
28  }
29  if (suffix == art::Suffixes::tool()) {
30  return std::make_unique<MetadataCollectorFor<suffix_type::tool>>();
31  }
32  if (suffix == art::Suffixes::mfPlugin()) {
33  return std::make_unique<MetadataCollectorFor<suffix_type::mfPlugin>>();
34  }
35  if (suffix == art::Suffixes::mfStatsPlugin()) {
36  return std::make_unique<MetadataCollectorFor<suffix_type::mfStatsPlugin>>();
37  }
38  return std::unique_ptr<MetadataCollector>{nullptr};
39 }
static std::string const & mfStatsPlugin()
static std::string const & source()
static std::string const & plugin()
static std::string const & tool()
static std::string const & mfPlugin()
static std::string const & service()
static std::string const & module()
std::unique_ptr< MetadataSummary > art::detail::get_MetadataSummary ( std::string const &  suffix,
LibraryInfoCollection const &  coll 
)

Definition at line 15 of file get_MetadataSummary.cc.

References art::Suffixes::mfPlugin(), art::Suffixes::mfStatsPlugin(), art::Suffixes::module(), art::Suffixes::plugin(), art::Suffixes::service(), art::Suffixes::source(), and art::Suffixes::tool().

Referenced by print_available_plugins().

17 {
18  if (suffix == art::Suffixes::module()) {
19  return std::make_unique<MetadataSummaryFor<suffix_type::module>>(coll);
20  }
21  if (suffix == art::Suffixes::plugin()) {
22  return std::make_unique<MetadataSummaryFor<suffix_type::plugin>>(coll);
23  }
24  if (suffix == art::Suffixes::service()) {
25  return std::make_unique<MetadataSummaryFor<suffix_type::service>>(coll);
26  }
27  if (suffix == art::Suffixes::source()) {
28  return std::make_unique<MetadataSummaryFor<suffix_type::source>>(coll);
29  }
30  if (suffix == art::Suffixes::tool()) {
31  return std::make_unique<MetadataSummaryFor<suffix_type::tool>>(coll);
32  }
33  if (suffix == art::Suffixes::mfPlugin()) {
34  return std::make_unique<MetadataSummaryFor<suffix_type::mfPlugin>>(coll);
35  }
36  if (suffix == art::Suffixes::mfStatsPlugin()) {
37  return std::make_unique<MetadataSummaryFor<suffix_type::mfStatsPlugin>>(
38  coll);
39  }
40  return std::unique_ptr<MetadataSummary>{nullptr};
41 }
static std::string const & mfStatsPlugin()
static std::string const & source()
static std::string const & plugin()
static std::string const & tool()
static std::string const & mfPlugin()
static std::string const & service()
static std::string const & module()
std::unique_ptr< fhicl::ConfigurationTable > art::detail::getAllowedConfiguration ( cet::LibraryManager const &  lm,
std::string const &  fullSpec,
std::string const &  name 
)

Definition at line 94 of file PluginSymbolResolvers.cc.

97  {
98  using GetAllowedConfiguration_t =
99  std::unique_ptr<fhicl::ConfigurationTable>(std::string const&);
100 
101  auto description = [&lm, &fullSpec, &name] {
102  GetAllowedConfiguration_t* symbolType{};
103  lm.getSymbolByLibspec(fullSpec, "allowed_configuration", symbolType);
104  return symbolType(name);
105  };
106 
107  return resolve_if_present(
108  description,
109  __func__,
110  std::unique_ptr<fhicl::ConfigurationTable>{nullptr});
111  }
std::string art::detail::getFilePath ( cet::LibraryManager const &  lm,
std::string const &  fullspec 
)

Definition at line 31 of file PluginSymbolResolvers.cc.

References art::source.

32  {
33  using GetSourceLoc_t = std::string();
34 
35  using namespace std::string_literals;
36  auto path = [&lm, &fullspec] {
37  GetSourceLoc_t* symbolLoc{};
38  lm.getSymbolByLibspec(fullspec, "get_source_location", symbolLoc);
39  std::string source{symbolLoc()};
40  boost::filesystem::path const p{source};
41  if (!boost::filesystem::exists(p)) {
42  source =
43  "/ [ external source ] /" + fullspec + "_" + lm.libType() + ".cc";
44  }
45  return source;
46  };
47 
48  return resolve_if_present(path, __func__, "[ not found ]"s);
49  }
std::string art::detail::getType ( cet::LibraryManager const &  lm,
std::string const &  fullSpec 
)

Definition at line 52 of file PluginSymbolResolvers.cc.

References util::to_string().

Referenced by cosmic::CosmicTrackTagger::produce().

53  {
54  auto const& suffix = lm.libType();
55  if (suffix == Suffixes::module()) {
57 
58  auto type = [&lm, &fullSpec] {
59  ModuleTypeFunc_t* symbolType{nullptr};
60  lm.getSymbolByLibspec(fullSpec, "moduleType", symbolType);
61  return to_string(symbolType());
62  };
63 
64  return resolve_if_present(type, __func__, "[ error ]"s);
65  }
66 
67  if (suffix == Suffixes::plugin()) {
68  using PluginTypeFunc_t = std::string();
69 
70  auto type = [&lm, &fullSpec] {
71  PluginTypeFunc_t* symbolType{nullptr};
72  lm.getSymbolByLibspec(fullSpec, "pluginType", symbolType);
73  return symbolType();
74  };
75 
76  return resolve_if_present(type, __func__, "[ error ]"s);
77  }
78 
79  if (suffix == Suffixes::tool()) {
80  using ToolTypeFunc_t = std::string();
81 
82  auto type = [&lm, &fullSpec] {
83  ToolTypeFunc_t* symbolType{nullptr};
84  lm.getSymbolByLibspec(fullSpec, "toolType", symbolType);
85  return symbolType();
86  };
87 
88  return resolve_if_present(type, __func__, "[ error ]"s);
89  }
90  return {};
91  }
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
ModuleType( ModuleTypeFunc_t)
Definition: ModuleMacros.h:34
ModuleType
Definition: ModuleType.h:11
bool art::detail::has_whitespace ( std::string const &  str)

Definition at line 17 of file remove_whitespace.cc.

18 {
19  return str.find_first_of(whitespace_chars) != std::string::npos;
20 }
std::string art::detail::hash_to_string ( std::string const &  hash)

Definition at line 34 of file Hash.cc.

Referenced by art::Hash< I >::print().

35  {
36  cet::MD5Result temp;
37  cet::copy_all(hash, temp.bytes);
38  return temp.toString();
39  }
std::string art::detail::indent ( std::size_t const  i)
inline

Definition at line 17 of file PrintFormatting.h.

Referenced by geo::PlaneGeo::ActiveArea(), lar_cluster3d::ClusterPathFinder::breakIntoTinyBits(), lar_cluster3d::VoronoiPathFinder::breakIntoTinyBits(), lar_cluster3d::ClusterPathFinder::buildConvexHull(), lar_cluster3d::VoronoiPathFinder::buildConvexHull(), lar_cluster3d::ConvexHullPathFinder::buildConvexHull(), lar_cluster3d::MSTPathFinder::buildConvexHull(), geo::part::Partition< Data >::describe(), recob::PointCharge::dump(), lar::example::CheatTrack::dump(), sim::OpDetBacktrackerRecord::Dump(), sim::SimChannel::Dump(), sim::DumpSimPhotons::DumpElement(), sim::DumpMCShowers::DumpMCShower(), sim::DumpMCTracks::DumpMCTrack(), sim::DumpOpDetBacktrackerRecords::DumpOpDetBacktrackerRecord(), recob::dumper::DumpPCAxis(), sim::DumpSimPhotonsLite::DumpPhoton(), sim::DumpSimChannels::DumpSimChannel(), mf::service::ELdestination::emitToken(), recob::TrajectoryPointFlags::fromHit(), art::Principal::getBySelector(), geo::CryostatGeo::ID(), indent0(), indent_1(), indent__2(), geo::OpDetGeo::isSphere(), recob::TrackTrajectory::LocalToGlobalRotationAtPoint(), recob::Trajectory::LocalToGlobalRotationAtPoint(), lar_cluster3d::ConvexHullPathFinder::makeCandidateCluster(), lar_cluster3d::VoronoiPathFinder::makeCandidateCluster(), fhicl::detail::MaybeDisplayParent::MaybeDisplayParent(), geo::AuxDetGeo::NSensitiveVolume(), rndm::details::RangeCheckHelper< seed_t >::operator()(), util::MultipleChoiceSelection< Choices >::optionListDump(), geo::part::GridPartition< Data >::part(), geo::part::PartitionBase::PartitionBase(), geo::part::PartitionContainer< Data >::PartitionContainer(), art::SelectorBase::print(), geo::GeometryCore::Print(), lar::debug::printBacktrace(), art::Selector::Selector(), lar_cluster3d::VoronoiPathFinder::subDivideCluster(), geo::GeometryCore::SurfaceY(), geo::WireGeo::TanThetaZ(), geo::AuxDetSensitiveGeo::toLocalCoords(), and geo::TPCGeo::toLocalCoords().

18  {
19  return std::string(i, ' ');
20  }
std::string art::detail::indent0 ( )
inline

Definition at line 22 of file PrintFormatting.h.

References indent().

Referenced by print_descriptions(), and rule_size().

23  {
24  return indent(3);
25  }
std::string indent(std::size_t const i)
std::string art::detail::indent_1 ( )
inline

Definition at line 27 of file PrintFormatting.h.

References indent().

28  {
29  return indent(4);
30  }
std::string indent(std::size_t const i)
std::string art::detail::indent__2 ( )
inline

Definition at line 32 of file PrintFormatting.h.

References indent().

33  {
34  return indent(8);
35  }
std::string indent(std::size_t const i)
constexpr int art::detail::info_success ( )

Definition at line 8 of file info_success.h.

Referenced by art::BasicOptionsHandler::doCheckOptions(), art::detail::ExitCodePrinter::exitcode(), art::run_art(), and art::detail::ExitCodePrinter::~ExitCodePrinter().

9  {
10  return std::numeric_limits<int>::max();
11  }
template<typename ProdA , typename ProdB , typename Data , typename Tag >
InputTag art::detail::input_tag ( Tag const &  tag)

Definition at line 30 of file IPRHelper.h.

References art::detail::safe_input_tag< ProdA, ProdB, Data >::tag.

31  {
32  static_assert(
33  std::is_convertible_v<Tag, InputTag> ||
34  std::is_same_v<Tag, ProductToken<Assns<ProdA, ProdB>>> ||
35  std::is_same_v<Tag, ProductToken<Assns<ProdA, ProdB, Data>>>,
36  "\n\nart error: The input tag or product token provided to the "
37  "smart-query object\n"
38  " constructor has a type that conflicts with that of the "
39  "smart-query object.\n");
40  return safe_input_tag<ProdA, ProdB, Data>(tag).tag;
41  }
std::string const & art::detail::InvalidHash ( )

Definition at line 43 of file Hash.cc.

Referenced by fixup(), and art::Hash< I >::isValid().

44  {
45  return invalid;
46  }
void art::detail::issue_reports ( unsigned  count,
EventID const &  id 
)

Definition at line 29 of file issue_reports.cc.

Referenced by art::ProcessingLimits::update().

30 {
31  time_t t = time(0);
32  constexpr char tsOutput[] = "dd-Mon-yyyy hh:mm:ss TZN ";
33  constexpr size_t tsmax = (sizeof tsOutput) + 1;
34  char ts[tsmax];
35  strftime(ts, tsmax, "%d-%b-%Y %H:%M:%S %Z", localtime(&t));
36  mf::LogVerbatim{"ArtReport"} << "Begin processing the " << count
37  << suffix(count) << " record. " << id << " at "
38  << ts;
39  // At some point we may want to initiate checkpointing here
40 }
void art::detail::logFileAction ( const char *  msg,
std::string const &  file 
)

Definition at line 9 of file logFileAction.cc.

10 {
11  time_t t = time(0);
12  char ts[] = "dd-Mon-yyyy hh:mm:ss TZN ";
13  struct tm localtm;
14  strftime(
15  ts, strlen(ts) + 1, "%d-%b-%Y %H:%M:%S %Z", localtime_r(&t, &localtm));
16  mf::LogAbsolute("fileAction") << ts << " " << msg << '\"' << file << '\"';
17 }
TFile * file
MaybeLogger_< ELseverityLevel::ELsev_severe, true > LogAbsolute
template<typename T >
T* art::detail::make_module ( fhicl::ParameterSet const &  pset,
ProcessingFrame const &  frame 
)

Definition at line 52 of file ModuleMacros.h.

References art::legacy.

53  {
54  // Reference to avoid copy if ConfigFor<T> is a ParameterSet.
55  ConfigFor<T> const& config{pset};
57  ModuleThreadingType::legacy) {
58  return new T{config};
59  } else {
60  return new T{config, frame};
61  }
62  }
double value
Definition: spectrum.C:18
std::pair< ModuleGraph, std::string > art::detail::make_module_graph ( ModuleGraphInfoMap const &  modInfos,
paths_to_modules_t const &  trigger_paths,
configs_t const &  end_path 
)

Definition at line 46 of file graph_algorithms.cc.

References make_path_ordering_edges(), make_product_dependency_edges(), make_synchronization_edges(), make_trigger_path_subgraphs(), art::detail::ModuleGraphInfoMap::size(), verify_in_order_dependencies(), and verify_no_interpath_dependencies().

Referenced by art::PathManager::createModulesAndWorkers().

49 {
50  auto const nmodules = modInfos.size();
51  ModuleGraph module_graph{nmodules};
52 
53  make_trigger_path_subgraphs(modInfos, trigger_paths, module_graph);
54  make_product_dependency_edges(modInfos, module_graph);
55  auto err = verify_no_interpath_dependencies(modInfos, module_graph);
56  if (err.empty()) {
57  // Cannot currently check intrapath dependencies unless the above
58  // check is successful.
59  err += verify_in_order_dependencies(modInfos, trigger_paths);
60  }
61 
62  make_path_ordering_edges(modInfos, trigger_paths, module_graph);
63  make_synchronization_edges(modInfos, trigger_paths, end_path, module_graph);
64 
65  return std::make_pair(module_graph, err);
66 }
std::string verify_in_order_dependencies(ModuleGraphInfoMap const &modules, paths_to_modules_t const &trigger_paths)
void make_synchronization_edges(ModuleGraphInfoMap const &modInfos, paths_to_modules_t const &trigger_paths, configs_t const &end_path, ModuleGraph &graph)
void make_trigger_path_subgraphs(ModuleGraphInfoMap const &modInfos, paths_to_modules_t const &trigger_paths, ModuleGraph &graph)
boost::subgraph< Graph > ModuleGraph
Definition: ModuleGraph.h:23
std::string verify_no_interpath_dependencies(ModuleGraphInfoMap const &modInfos, ModuleGraph const &graph)
void make_path_ordering_edges(ModuleGraphInfoMap const &modInfos, paths_to_modules_t const &paths, ModuleGraph &graph)
void make_product_dependency_edges(ModuleGraphInfoMap const &modInfos, ModuleGraph &graph)
void art::detail::make_path_ordering_edges ( ModuleGraphInfoMap const &  modInfos,
paths_to_modules_t const &  paths,
ModuleGraph graph 
)

Definition at line 115 of file graph_algorithms.cc.

References util::cbegin(), util::cend(), util::end(), art::PathSpec::name, art::path_spec(), util::pi(), and art::detail::ModuleGraphInfoMap::vertex_index().

Referenced by make_module_graph().

118 {
119  // Make edges corresponding to path ordering
120  auto path_label = get(boost::edge_name, graph);
121  for (auto const& [path_spec, modules] : trigger_paths) {
122  if (modules.empty())
123  continue;
124  auto prev = cbegin(modules);
125  auto curr = prev + 1;
126  auto const end = cend(modules);
127  while (curr != end) {
128  auto const pi = modInfos.vertex_index(module_label(*prev));
129  auto const ci = modInfos.vertex_index(module_label(*curr));
130  auto const edge = add_edge(ci, pi, graph);
131  path_label[edge.first] = "path:" + path_spec.name;
132  prev = curr;
133  ++curr;
134  }
135  }
136 }
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
Definition: StdUtils.h:93
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
std::string name
Definition: PathSpec.h:48
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
decltype(auto) constexpr cbegin(T &&obj)
ADL-aware version of std::cbegin.
Definition: StdUtils.h:85
PathSpec path_spec(std::string const &path_spec)
Definition: PathSpec.cc:22
void art::detail::make_product_dependency_edges ( ModuleGraphInfoMap const &  modInfos,
ModuleGraph graph 
)

Definition at line 100 of file graph_algorithms.cc.

References art::detail::ModuleGraphInfoMap::info(), art::detail::ModuleGraphInfoMap::size(), and art::detail::ModuleGraphInfoMap::vertex_index().

Referenced by make_module_graph().

102 {
103  auto edge_label = get(boost::edge_name, graph);
104  for (Vertex u{}; u < modInfos.size(); ++u) {
105  auto const& modu = modInfos.info(u);
106  for (auto const& dep : modu.consumed_products) {
107  auto const v = modInfos.vertex_index(dep.label);
108  auto const edge = add_edge(u, v, graph);
109  edge_label[edge.first] = "prod";
110  }
111  }
112 }
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
void art::detail::make_synchronization_edges ( ModuleGraphInfoMap const &  modInfos,
paths_to_modules_t const &  trigger_paths,
configs_t const &  end_path,
ModuleGraph graph 
)

Definition at line 139 of file graph_algorithms.cc.

References art::detail::ModuleGraphInfoMap::info(), art::module, art::PathSpec::name, art::path_spec(), and art::detail::ModuleGraphInfoMap::vertex_index().

Referenced by make_module_graph().

143 {
144  auto const source_index = modInfos.vertex_index("input_source");
145  auto sync_label = get(boost::edge_name, graph);
146  if (!trigger_paths.empty()) {
147  auto const tr_index = modInfos.vertex_index("TriggerResults");
148  for (auto const& [path_spec, modules] : trigger_paths) {
149  if (modules.empty()) {
150  continue;
151  }
152  auto const front_index =
153  modInfos.vertex_index(module_label(modules.front()));
154  auto const back_index =
155  modInfos.vertex_index(module_label(modules.back()));
156  auto const edge1 = add_edge(front_index, source_index, graph);
157  sync_label[edge1.first] = "source:" + path_spec.name;
158  auto const edge2 = add_edge(tr_index, back_index, graph);
159  sync_label[edge2.first] = "sync";
160  }
161  for (auto const& module : end_path) {
162  auto const index = modInfos.vertex_index(module_label(module));
163  auto const edge = add_edge(index, tr_index, graph);
164  sync_label[edge.first] = "sync";
165  }
166  } else if (!end_path.empty()) {
167  for (auto const& module : end_path) {
168  auto const index = modInfos.vertex_index(module_label(module));
169  auto const edge = add_edge(index, source_index, graph);
170  sync_label[edge.first] = "sync";
171  }
172  }
173 
174  auto constexpr invalid = std::numeric_limits<std::size_t>::max();
175 
176  // Now synchronize between previous filters
177  for (auto const& [path_spec, modules] : trigger_paths) {
178  auto preceding_filter_index = invalid;
179  for (auto const& module : modules) {
180  auto const index = modInfos.vertex_index(module_label(module));
181  auto const& info = modInfos.info(index);
182  if (preceding_filter_index != invalid) {
183  auto const edge = add_edge(index, preceding_filter_index, graph);
184  sync_label[edge.first] = "filter:" + path_spec.name;
185  }
186  if (info.module_type == ModuleType::filter) {
187  preceding_filter_index = index;
188  }
189  }
190  }
191 
192  if (trigger_paths.empty()) {
193  return;
194  }
195 
196  // Synchronize end-path modules if a 'SelectEvents' parameter has
197  // been specified. Treat it as a filter.
198  auto const tr_index = modInfos.vertex_index("TriggerResults");
199  for (auto const& module : end_path) {
200  auto const index = modInfos.vertex_index(module_label(module));
201  auto const& info = modInfos.info(index);
202  for (auto const& path : info.select_events) {
203  auto const edge = add_edge(index, tr_index, graph);
204  sync_label[edge.first] = "filter:" + path;
205  }
206  }
207 }
std::string name
Definition: PathSpec.h:48
PathSpec path_spec(std::string const &path_spec)
Definition: PathSpec.cc:22
void art::detail::make_trigger_path_subgraphs ( ModuleGraphInfoMap const &  modInfos,
paths_to_modules_t const &  trigger_paths,
ModuleGraph graph 
)

Definition at line 69 of file graph_algorithms.cc.

References art::is_modifier(), art::PathSpec::name, art::path_spec(), and art::detail::ModuleGraphInfoMap::vertex_index().

Referenced by make_module_graph().

73 {
74  using namespace ::ranges;
75  std::map<path_name_t, ModuleGraph*> path_graphs;
76  auto const source_index = modInfos.vertex_index("input_source");
77  for (auto const& path_name : trigger_paths | views::keys |
78  views::transform([](auto const& path_spec) {
79  return path_spec.name;
80  })) {
81  auto& path_graph = module_graph.create_subgraph();
82  // Always include the source on the path.
83  add_vertex(source_index, path_graph);
84  path_graphs[path_name] = &path_graph;
85  }
86 
87  auto vertex_names = get(boost::vertex_name_t{}, module_graph);
88  for (auto const& [module_name, info] : modInfos) {
89  if (!is_modifier(info.module_type))
90  continue;
91  auto const index = modInfos.vertex_index(module_name);
92  for (auto const& path : info.paths) {
93  add_vertex(index, *path_graphs.at(path));
94  }
95  vertex_names[index] = module_name;
96  }
97 }
std::string name
Definition: PathSpec.h:48
bool is_modifier(ModuleType const mt)
Definition: ModuleType.h:22
PathSpec path_spec(std::string const &path_spec)
Definition: PathSpec.cc:22
template<typename T >
std::enable_if_t< std::is_constructible_v<T, fhicl::ParameterSet const&, ActivityRegistry&>, std::shared_ptr<T> > art::detail::makeServiceFrom ( fhicl::ParameterSet const &  ps,
ActivityRegistry areg 
)

Definition at line 28 of file ServiceWrapper.h.

29  {
30  static_assert(
31  !std::is_base_of_v<ProducingService, T>,
32  "\n\nart-error: A service that inherits from art::ProducingService\n"
33  " cannot have a constructor that takes an ActivityRegistry&\n"
34  " argument. Contact artists@fnal.gov for guidance.\n");
35  return std::make_shared<T>(ps, areg);
36  }
template<typename T >
std::enable_if_t<!std::is_constructible_v<T, fhicl::ParameterSet const&, ActivityRegistry&>, std::shared_ptr<T> > art::detail::makeServiceFrom ( fhicl::ParameterSet const &  ps,
ActivityRegistry  
)

Definition at line 43 of file ServiceWrapper.h.

References art::detail::ServiceWrapper< T >::operator=(), and art::detail::ServiceWrapper< T >::ServiceWrapper().

44  {
45  return std::make_shared<T>(ps);
46  }
template<typename T , typename ResultType , typename... Args>
std::function<ResultType(Args...)> art::detail::makeWatchFunc ( ResultType(T::*)(Args...)  slot,
T &  t 
)

Definition at line 16 of file makeWatchFunc.h.

Referenced by art::GlobalSignal< SRTYPE, ResultType(Args...)>::watch(), art::LocalSignal< STYPE, ResultType(Args...)>::watch(), and art::LocalSignal< STYPE, ResultType(Args...)>::watchAll().

17  {
18  return [slot, &t](Args&&... args) -> ResultType {
19  return (t.*slot)(std::forward<Args>(args)...);
20  };
21  }
template<typename T , typename ResultType , typename... Args>
std::function<ResultType(Args...)> art::detail::makeWatchFunc ( ResultType(T::*)(Args...) const  slot,
T const &  t 
)

Definition at line 25 of file makeWatchFunc.h.

26  {
27  return [slot, &t](Args&&... args) -> ResultType {
28  return (t.*slot)(std::forward<Args>(args)...);
29  };
30  }
void const* art::detail::maybeCastObj ( void const *  address,
std::type_info const &  tiFrom,
std::type_info const &  tiTo 
)
template<typename element_type >
void const * art::detail::maybeCastObj ( element_type const *  address,
std::type_info const &  tiTo 
)
inline

Definition at line 18 of file maybeCastObj.h.

References maybeCastObj().

20 {
21  static std::type_info const& tiFrom{typeid(element_type)};
22  return maybeCastObj(address, tiFrom, tiTo);
23 }
void const * maybeCastObj(element_type const *address, std::type_info const &tiTo)
Definition: maybeCastObj.h:18
void art::detail::memoryReport ( )

Definition at line 4 of file memoryReportDarwin.cc.

Referenced by writeSummary().

5 {
6  // Not implemented for Darwin
7 }
ModuleType art::detail::module_type ( std::string const &  full_key)

Definition at line 5 of file ModuleKeyAndType.cc.

References art::analyzer, art::filter, art::non_art, art::output_module, and art::producer.

Referenced by art::BasicOutputOptionsHandler::doProcessOptions(), art::PathManager::makeModule_(), art::PathManager::makeModules_(), art::PathManager::moduleInformation_(), operator!=(), path_specs(), print_module_types(), and verify_in_order_dependencies().

6  {
7  if (full_key.find("physics.producers") == 0) {
8  return ModuleType::producer;
9  } else if (full_key.find("physics.filters") == 0) {
10  return ModuleType::filter;
11  } else if (full_key.find("physics.analyzers") == 0) {
12  return ModuleType::analyzer;
13  } else if (full_key.find("outputs") == 0) {
14  return ModuleType::output_module;
15  }
16  return ModuleType::non_art;
17  }
std::map<old_t, new_t> art::detail::oldToNewName ( )
inline

Definition at line 14 of file SAMMetadataTranslators.h.

Referenced by art::detail::OldToNew::operator()().

15  {
16  return {{"fileType", "file_type"},
17  {"dataTier", "data_tier"},
18  {"streamName", "data_stream"},
19  {"runType", "run_type"}};
20  }
bool art::detail::operator!= ( ModuleKeyAndType const &  a,
ModuleKeyAndType const &  b 
)
inlinenoexcept

Definition at line 32 of file ModuleKeyAndType.h.

References module_type().

33  {
34  return not(a == b);
35  }
std::ostream & art::detail::operator<< ( std::ostream &  os,
ModuleGraphInfo const &  info 
)

Definition at line 4 of file ModuleGraphInfo.cc.

References art::detail::ModuleGraphInfo::consumed_products, art::detail::ModuleGraphInfo::module_type, art::detail::ModuleGraphInfo::paths, and util::to_string().

5 {
6  os << "Module type: " << to_string(info.module_type) << '\n';
7  os << "Product dependencies: ";
8  for (auto const& dep : info.consumed_products) {
9  os << dep << ' ';
10  }
11  os << "\nPaths: ";
12  for (auto const& path : info.paths) {
13  os << path << ' ';
14  }
15  return os;
16 }
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
template<typename T >
std::ostream& art::detail::operator<< ( std::ostream &  os,
Analyzer::Table< T > const &  t 
)
inline

Definition at line 135 of file Analyzer.h.

Referenced by art::RangeSet::emplace_range().

136  {
137  std::ostringstream config;
138  t.print_allowed_configuration(config, std::string(3, ' '));
139  return os << config.str();
140  }
bool art::detail::operator== ( ModuleKeyAndType const &  a,
ModuleKeyAndType const &  b 
)
inlinenoexcept

Definition at line 26 of file ModuleKeyAndType.h.

Referenced by art::RangeSet::emplace_range().

27  {
28  return a.key == b.key && a.type == b.type;
29  }
std::vector< std::vector< std::string > > art::detail::orderedProcessNamesCollection ( ProcessHistoryMap const &  pHistMap)

Definition at line 74 of file orderedProcessNamesCollection.cc.

References util::begin(), e, util::end(), and util::values().

75 {
76  std::vector<std::string> all_process_names;
77  all_process_names.reserve(histories.size());
78  for (auto const& history : histories | ::ranges::views::values) {
79  all_process_names.push_back(stringified_process_names(history));
80  }
81  cet::sort_all(all_process_names);
82 
83  // It is possible for two non-overlapping histories to have the same
84  // process name. We thus need to erase duplicate names.
85  auto const e = end(all_process_names);
86  auto const new_end = std::unique(begin(all_process_names), e);
87  all_process_names.erase(new_end, e);
88 
89  auto const collapsed = collapsed_histories(all_process_names);
90  return transform_to_final_result(collapsed);
91 }
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
decltype(auto) values(Coll &&coll)
Range-for loop helper iterating across the values of the specified collection.
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
Float_t e
Definition: plot.C:35
bool art::detail::output_to_stderr ( std::string const &  spec)

Definition at line 15 of file output_to.cc.

Referenced by art::DebugOptionsHandler::doProcessOptions().

16 {
17  return std::regex_match(spec, re_stderr);
18 }
bool art::detail::output_to_stdout ( std::string const &  spec)

Definition at line 21 of file output_to.cc.

Referenced by art::DebugOptionsHandler::doProcessOptions().

22 {
23  return std::regex_match(spec, re_stdout);
24 }
std::vector< PathSpec > art::detail::path_specs ( std::vector< ModuleSpec > const &  selection_override_entries,
std::string const &  path_selection_override 
)

Definition at line 218 of file prune_configuration.cc.

References util::begin(), util::cbegin(), util::cend(), fhicl::detail::decode(), e, util::empty(), util::end(), exists_outside_prolog(), fhicl_key(), art::filter, fhicl::intermediate_table::find(), fhicl::intermediate_table::get(), art::PathID::invalid(), fhicl::is_table(), module_type(), art::PathSpec::name, fhicl::NIL, Normal, art::path_spec(), fhicl::SEQUENCE, sequence_to_entries(), fhicl::STRING, fhicl::TABLE, fhicl::to_string(), and value.

Referenced by art::TriggerNamesService::index_(), and art::detail::ProcessAndEventSelectors::ProcessAndEventSelectors().

220  {
221  auto guidance = [](std::string const& name,
222  std::string const& path_selection_override,
223  std::string const& id_str) {
224  std::ostringstream oss;
225  oss << "If you would like to repeat the path specification, all "
226  "path specifications\n"
227  "with the name '"
228  << name << "' must be prepended with the same path ID (e.g.):\n\n"
229  << " " << path_selection_override << ": ['" << id_str << ':' << name
230  << "', '" << id_str << ':' << name << "', ...]\n\n";
231  return oss.str();
232  };
233 
234  std::map<PathID, std::string> id_to_name;
235  std::map<std::string, PathID> name_to_id;
236  std::vector<art::PathSpec> result;
237 
238  size_t i = 0;
239  for (auto it = cbegin(selection_override_entries),
240  e = cend(selection_override_entries);
241  it != e;
242  ++it, ++i) {
243  auto const& path = *it;
244  auto spec = art::path_spec(path.name);
245  if (spec.name == at_nil) {
246  continue;
247  }
248 
249  // Path names with unspecified IDs cannot be reused
250  auto const emplacement_result =
251  name_to_id.try_emplace(spec.name, spec.path_id);
252  bool const name_already_present = not emplacement_result.second;
253  auto const emplaced_path_id = emplacement_result.first->second;
254 
255  if (name_already_present) {
256  if (spec.path_id == art::PathID::invalid()) {
257  throw path_exception(path_selection_override, i, path.name)
258  << "The path name '" << spec.name
259  << "' has already been specified in the " << path_selection_override
260  << " sequence.\n"
261  << guidance(spec.name,
262  path_selection_override,
263  to_string(emplaced_path_id));
264  }
265  if (spec.path_id != emplaced_path_id) {
266  throw path_exception(path_selection_override, i, path.name)
267  << "The path name '" << spec.name
268  << "' has already been specified (perhaps implicitly) with a\n"
269  "path ID of "
270  << to_string(emplaced_path_id) << " (not "
271  << to_string(spec.path_id) << ") in the " << path_selection_override
272  << " sequence.\n\n"
273  << guidance(spec.name,
274  path_selection_override,
275  to_string(emplaced_path_id));
276  }
277  // Name is already present and the PathID has been explicitly
278  // listed and matches what has already been seen.
279  continue;
280  }
281 
282  if (spec.path_id == art::PathID::invalid()) {
283  spec.path_id =
284  art::PathID{i}; // Use calculated bit number if not specified
285  emplacement_result.first->second = spec.path_id;
286  }
287 
288  // Each ID must have only one name
289  if (auto const [it, inserted] =
290  id_to_name.try_emplace(spec.path_id, spec.name);
291  not inserted) {
292  throw path_exception(path_selection_override, i, path.name)
293  << "Path ID " << to_string(spec.path_id)
294  << " cannot be assigned to path name '" << spec.name
295  << "' as it has already been assigned to path name '" << it->second
296  << "'.\n";
297  }
298 
299  result.push_back(std::move(spec));
300  }
301  return result;
302  }
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
Definition: StdUtils.h:93
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
constexpr static auto invalid() noexcept
Definition: PathSpec.h:20
decltype(auto) constexpr cbegin(T &&obj)
ADL-aware version of std::cbegin.
Definition: StdUtils.h:85
PathSpec path_spec(std::string const &path_spec)
Definition: PathSpec.cc:22
Float_t e
Definition: plot.C:35
void art::detail::print_available_plugins ( std::string const &  suffix,
std::string const &  spec,
bool  verbose 
)

Definition at line 105 of file AllowedConfiguration.cc.

References get_LibraryInfoCollection(), get_MetadataSummary(), and rule_size().

Referenced by art::BasicOptionsHandler::doCheckOptions(), and print_available_plugins().

108 {
109  auto coll = get_LibraryInfoCollection(suffix, spec, verbose);
110  if (coll.empty()) {
111  cout << "Unable to find any plugins with suffix '" << suffix << "'.\n";
112  return;
113  }
114 
115  auto ms = get_MetadataSummary(suffix, coll);
116 
117  cet::HorizontalRule const rule{rule_size(ms->widths())};
118  cout << '\n'
119  << rule('=') << '\n'
120  << ms->header() << '\n'
121  << rule('-') << '\n';
122 
123  std::size_t i{};
124  Duplicates_t duplicates;
125  for (auto const& info : coll) {
126  auto summary = ms->summary(info, ++i);
127  cout << summary.message;
128  if (summary.is_duplicate)
129  duplicates[info.short_spec()].push_back(info.long_spec());
130  }
131  cout << rule('=') << "\n\n";
132 
133  if (duplicates.empty())
134  return;
135 
136  duplicates_message(suffix, duplicates);
137  cout << '\n';
138 }
LibraryInfoCollection get_LibraryInfoCollection(std::string const &suffix, std::string const &pattern, bool verbose=false)
std::size_t rule_size(Widths const &widths)
std::unique_ptr< MetadataSummary > get_MetadataSummary(std::string const &suffix, LibraryInfoCollection const &coll)
void art::detail::print_available_plugins ( std::string const &  suffix,
bool const  verbose 
)
inline

Definition at line 83 of file AllowedConfiguration.h.

References dflt_spec_pattern(), print_available_plugins(), print_description(), print_descriptions(), and supports_key().

84  {
85  print_available_plugins(suffix, dflt_spec_pattern(), verbose);
86  }
void print_available_plugins(std::string const &suffix, bool const verbose)
constexpr char const * dflt_spec_pattern()
void art::detail::print_config_summary ( fhicl::ParameterSet const &  pset,
std::string const &  verbosity,
EnabledModules const &  enabled_modules 
)

Definition at line 187 of file print_config_summary.cc.

References art::errors::Configuration, fhicl::ParameterSet::get(), print_module_types(), print_path_names(), print_path_numbers(), print_service_types(), print_table_numbers(), and art::source.

Referenced by art::run_art().

190 {
191  auto const process_name = pset.get<std::string>("process_name");
192  auto const source = pset.get<std::string>("source.module_type");
193  auto const services = pset.get<fhicl::ParameterSet>("services");
194  auto const physics = pset.get<fhicl::ParameterSet>("physics", {});
195  auto const analyzers = physics.get<fhicl::ParameterSet>("analyzers", {});
196  auto const filters = physics.get<fhicl::ParameterSet>("filters", {});
197  auto const producers = physics.get<fhicl::ParameterSet>("producers", {});
198  auto const outputs = pset.get<fhicl::ParameterSet>("outputs", {});
199 
200  std::cout << "Process name: " << process_name << '\n'
201  << "Source module: " << source << '\n';
202  if (verbosity == "brief") {
203  print_table_numbers(services, "Services");
204  print_table_numbers(producers, "Producers");
205  print_table_numbers(filters, "Filters");
206  print_table_numbers(analyzers, "Analyzers");
207  print_table_numbers(outputs, "Output modules");
208  print_path_numbers(enabled_modules);
209  return;
210  } else if (verbosity == "detailed") {
211  print_service_types(services);
212  std::cout << '\n' << header_rule('=') << '\n' << "Physics modules\n\n";
213  print_table_numbers(producers, "Producers");
214  print_table_numbers(filters, "Filters");
215  print_table_numbers(analyzers, "Analyzers");
216  print_module_types(outputs, "Output modules");
217  print_path_names(enabled_modules);
218  return;
219  } else if (verbosity == "full") {
220  print_service_types(services);
221  print_module_types(producers, "Producers");
222  print_module_types(filters, "Filters");
223  print_module_types(analyzers, "Analyzers");
224  print_module_types(outputs, "Output modules");
225  print_path_names(enabled_modules);
226  return;
227  }
229  << "Unrecognized configuration-summary verbosity level: '" << verbosity
230  << "'\n";
231 }
void print_service_types(fhicl::ParameterSet const &pset)
void print_module_types(fhicl::ParameterSet const &pset, std::string const &header)
void print_table_numbers(fhicl::ParameterSet const &pset, std::string const &header)
T get(std::string const &key) const
Definition: ParameterSet.h:314
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void print_path_numbers(EnabledModules const &enabled_modules)
void print_path_names(EnabledModules const &enabled_modules)
void art::detail::print_description ( std::vector< PluginMetadata > const &  matches)

Definition at line 164 of file AllowedConfiguration.cc.

References art::errors::Configuration, and art::Suffixes::print().

Referenced by print_available_plugins(), and print_descriptions().

165 {
166  for (auto const& m : matches) {
167  cout << m.header() << m.details() << m.allowed_configuration();
168  cout << '\n' << fixed_rule('=') << "\n\n";
169  }
170 }
void art::detail::print_descriptions ( std::vector< std::string > const &  plugins)

Definition at line 204 of file AllowedConfiguration.cc.

References indent0(), and print_description().

Referenced by art::BasicOptionsHandler::doCheckOptions(), and print_available_plugins().

205 {
206  cout << '\n' << fixed_rule('=') << "\n\n";
207  for (auto const& spec : specs) {
208  auto const [plugin_type, instance_pattern] = parse_specified_plugin(spec);
209 
210  auto matches = matchesBySpec(plugin_type, instance_pattern);
211  if (matches.empty()) {
212  cout << indent0()
213  << (instance_pattern.empty() ? "[Missing specification]" :
214  cet::bold_fontify(instance_pattern))
215  << " did not match any plugin";
216  cout << (plugin_type.empty() ? "" : " of type '" + plugin_type + "'");
217  cout << ".\n";
218  cout << '\n' << fixed_rule('=') << "\n\n";
219  continue;
220  }
221  print_description(matches);
222  }
223 }
std::string indent0()
void print_description(std::vector< PluginMetadata > const &matches)
void art::detail::print_module_graph ( std::ostream &  os,
ModuleGraphInfoMap const &  modInfos,
ModuleGraph const &  graph 
)

Definition at line 481 of file graph_algorithms.cc.

References art::filter, art::detail::ModuleGraphInfoMap::info(), art::detail::ModuleGraphInfoMap::name(), art::source, and target.

Referenced by art::PathManager::createModulesAndWorkers().

484 {
485  std::set<Vertex> vertices;
486  std::map<path_name_t, std::set<EdgePair>> path_edges;
487  std::map<path_name_t, std::set<EdgePair>> filter_edges;
488  std::set<EdgePair> trigger_path_edges;
489  std::map<EdgePair, unsigned> product_edges;
490  graph_printer printer{info_map,
491  vertices,
492  path_edges,
493  filter_edges,
494  trigger_path_edges,
495  product_edges};
496  boost::depth_first_search(graph, visitor(printer));
497  os << "digraph {\n"
498  << " rankdir=BT\n";
499  // Vertices
500  for (auto const& v : vertices) {
501  auto const& name = info_map.name(v);
502  auto const& info = info_map.info(v);
503  if (name == "input_source") {
504  os << " \"input_source\"[shape=box label=source]";
505  } else if (name == "TriggerResults") {
506  os << " \"" << name << '\"';
507  os << "[shape=box style=filled fillcolor=black label=\"\" height=0.1 "
508  "width=2]";
509  } else {
510  os << " \"" << name << '\"';
511  if (info.module_type == art::ModuleType::filter) {
512  os << "[style=filled fillcolor=pink]";
513  }
514  }
515  os << ";\n";
516  }
517 
518  // Path edges
519  for (auto const& [path_name, edges] : path_edges) {
520  for (auto const& [source, target] : edges) {
521  os << " \"" << info_map.name(source) << "\" -> \""
522  << info_map.name(target) << '\"' << "[label=\"" << path_name
523  << "\" color=gray];\n";
524  }
525  }
526 
527  // Filter edges
528  for (auto const& [path_name, edges] : filter_edges) {
529  for (auto const& [source, target] : edges) {
530  os << " \"" << info_map.name(source) << "\" -> \""
531  << info_map.name(target) << '\"' << "[label=\"" << path_name
532  << "\" color=red];\n";
533  }
534  }
535 
536  // Trigger-path edges
537  for (auto const& [source, target] : trigger_path_edges) {
538  os << " \"" << info_map.name(source) << "\" -> \"" << info_map.name(target)
539  << '\"' << "[style=invisible arrowhead=none];\n";
540  }
541 
542  // Product edges
543  for (auto const& [edge_pair, multiplicity] : product_edges) {
544  auto const& [source, target] = edge_pair;
545  os << " \"" << info_map.name(source) << "\" -> \"" << info_map.name(target)
546  << '\"';
547  if (multiplicity > 1) {
548  os << "[label=\"" << multiplicity << "\" color=black]";
549  }
550  os << ";\n";
551  }
552  os << "}\n";
553 }
cout<< "-> Edep in the target
Definition: analysis.C:53
void art::detail::print_module_types ( fhicl::ParameterSet const &  pset,
std::string const &  header 
)

Definition at line 150 of file print_config_summary.cc.

References util::empty(), fhicl_key(), fhicl::ParameterSet::get(), fhicl::ParameterSet::get_names(), art::left(), module_type(), print_table_numbers(), and util::size().

Referenced by print_config_summary().

152 {
153  std::cout << '\n' << header_rule('=') << '\n';
154  print_table_numbers(pset, header);
155 
156  auto const names = pset.get_names();
157  if (empty(names)) {
158  return;
159  }
160 
161  std::cout << '\n';
162  std::string column_1{"Module label"};
163  std::string column_2{"module_type"};
164  auto column_1_width = size(column_1);
165  auto column_2_width = size(column_2);
166  for (auto const& name : names) {
167  auto const module_type =
168  pset.get<std::string>(fhicl_key(name, "module_type"));
169  column_1_width = std::max(column_1_width, size(name));
170  column_2_width = std::max(column_2_width, size(module_type));
171  }
172 
173  cet::HorizontalRule const rule_1{column_1_width};
174  cet::HorizontalRule const rule_2{column_2_width};
175  std::cout << std::left << std::setw(column_1_width) << column_1 << " "
176  << column_2 << '\n'
177  << rule_1('-') << " " << rule_2('-') << '\n';
178  for (auto const& name : names) {
179  auto const module_type =
180  pset.get<std::string>(fhicl_key(name, "module_type"));
181  std::cout << std::left << std::setw(column_1_width) << name << " "
182  << module_type << '\n';
183  }
184 }
ModuleType module_type(std::string const &full_key)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
void print_table_numbers(fhicl::ParameterSet const &pset, std::string const &header)
std::enable_if_t< std::is_convertible_v< T, std::string >, std::string > fhicl_key(T const &name)
Definition: fhicl_key.h:12
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:94
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:109
void art::detail::print_path_names ( EnabledModules const &  enabled_modules)

Definition at line 39 of file print_config_summary.cc.

References util::empty(), art::detail::EnabledModules::end_paths(), art::detail::EnabledModules::end_paths_override(), art::left(), art::PathSpec::name, art::PathSpec::path_id, art::path_spec(), art::right(), util::size(), util::to_string(), art::detail::EnabledModules::trigger_path_specs(), and art::detail::EnabledModules::trigger_paths_override().

Referenced by print_config_summary().

40 {
41  {
42  auto const& trigger_paths = enabled_modules.trigger_path_specs();
43  std::cout << '\n'
44  << header_rule('=') << '\n'
45  << "Trigger paths: " << size(trigger_paths) << '\n'
46  << (enabled_modules.trigger_paths_override() ?
47  " -> 'trigger_paths' specified\n\n" :
48  "\n");
49  if (empty(trigger_paths)) {
50  return;
51  }
52 
53  std::string column_0{"Path ID"};
54  std::string column_1{"Path name"};
55  std::string column_2{"Path size"};
56 
57  auto column_0_width = size(column_0);
58  auto column_1_width = size(column_1);
59  for (auto const& spec : trigger_paths | ::ranges::views::keys) {
60  column_1_width = std::max(column_1_width, size(spec.name));
61  }
62 
63  std::cout << column_0 << " " << std::left << std::setw(column_1_width)
64  << column_1 << " " << column_2 << '\n'
65  << std::string(column_0_width, '-') << " "
66  << std::string(column_1_width, '-') << " "
67  << std::string(size(column_2), '-') << '\n';
68  for (auto const& [path_spec, entries] :
69  enabled_modules.trigger_path_specs()) {
70  std::cout << std::right << std::setw(column_0_width)
71  << to_string(path_spec.path_id) << " " << std::left
72  << std::setw(column_1_width) << path_spec.name << " "
73  << size(entries) << '\n';
74  }
75  }
76 
77  {
78  auto const& end_paths = enabled_modules.end_paths();
79 
80  std::cout << '\n'
81  << header_rule('=') << '\n'
82  << "End paths: " << size(end_paths) << '\n'
83  << (enabled_modules.end_paths_override() ?
84  " -> 'end_paths' specified\n\n" :
85  "\n");
86 
87  if (empty(end_paths)) {
88  return;
89  }
90 
91  std::string column_1{"Path name"};
92  std::string column_2{"Path size"};
93  auto column_1_width = size(column_1);
94  for (auto const& spec : end_paths | ::ranges::views::keys) {
95  column_1_width = std::max(column_1_width, size(spec.name));
96  }
97 
98  std::cout << std::left << std::setw(column_1_width) << column_1 << " "
99  << column_2 << '\n'
100  << std::string(column_1_width, '-') << " "
101  << std::string(size(column_2), '-') << '\n';
102  for (auto const& [path_spec, entries] : end_paths) {
103  std::cout << std::left << std::setw(column_1_width) << path_spec.name
104  << " " << size(entries) << '\n';
105  }
106  }
107 }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102
PathID path_id
Definition: PathSpec.h:49
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
std::string name
Definition: PathSpec.h:48
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:94
PathSpec path_spec(std::string const &path_spec)
Definition: PathSpec.cc:22
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:109
void art::detail::print_path_numbers ( EnabledModules const &  enabled_modules)

Definition at line 25 of file print_config_summary.cc.

References art::detail::EnabledModules::end_paths(), art::detail::EnabledModules::end_paths_override(), util::size(), art::detail::EnabledModules::trigger_path_specs(), and art::detail::EnabledModules::trigger_paths_override().

Referenced by print_config_summary().

26 {
27  std::cout << "Trigger paths: " << size(enabled_modules.trigger_path_specs())
28  << '\n'
29  << (enabled_modules.trigger_paths_override() ?
30  " -> 'trigger_paths' specified\n" :
31  "")
32  << "End paths: " << size(enabled_modules.end_paths()) << '\n'
33  << (enabled_modules.end_paths_override() ?
34  " -> 'end_paths' specified\n" :
35  "");
36 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
void art::detail::print_service_types ( fhicl::ParameterSet const &  pset)

Definition at line 110 of file print_config_summary.cc.

References fhicl_key(), fhicl::ParameterSet::get(), fhicl::ParameterSet::get_names(), art::left(), print_table_numbers(), and util::size().

Referenced by print_config_summary().

111 {
112  std::cout << '\n' << header_rule('=') << '\n';
113  print_table_numbers(pset, "Services");
114  std::cout << '\n';
115 
116  auto const names = pset.get_names();
117 
118  std::string column_1{"Service name"};
119  auto column_1_width = size(column_1);
120  auto column_2_width = std::string::size_type{};
121  for (auto const& name : names) {
122  auto const service_provider =
123  pset.get<std::string>(fhicl_key(name, "service_provider"), {});
124  column_1_width = std::max(column_1_width, size(name));
125  column_2_width = std::max(column_2_width, size(service_provider));
126  }
127 
128  cet::HorizontalRule const rule_1{column_1_width};
129  if (column_2_width == 0ull) {
130  std::cout << column_1 << '\n' << rule_1('-') << '\n';
131  for (auto const& name : names) {
132  std::cout << std::left << std::setw(column_1_width) << name << '\n';
133  }
134  } else {
135  std::string const column_2{"service_provider"};
136  cet::HorizontalRule const rule_2{std::max(column_2_width, size(column_2))};
137  std::cout << std::left << std::setw(column_1_width) << column_1 << " "
138  << column_2 << '\n'
139  << rule_1('-') << " " << rule_2('-') << '\n';
140  for (auto const& name : names) {
141  auto const service_provider =
142  pset.get<std::string>(fhicl_key(name, "service_provider"), "-");
143  std::cout << std::left << std::setw(column_1_width) << name << " "
144  << service_provider << '\n';
145  }
146  }
147 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
void print_table_numbers(fhicl::ParameterSet const &pset, std::string const &header)
std::enable_if_t< std::is_convertible_v< T, std::string >, std::string > fhicl_key(T const &name)
Definition: fhicl_key.h:12
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:94
void art::detail::print_table_numbers ( fhicl::ParameterSet const &  pset,
std::string const &  header 
)

Definition at line 17 of file print_config_summary.cc.

References fhicl::ParameterSet::get_names(), and util::size().

Referenced by print_config_summary(), print_module_types(), and print_service_types().

19 {
20  auto const names = pset.get_names();
21  std::cout << header << ": " << size(names) << '\n';
22 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
art::detail::EnabledModules art::detail::prune_config_if_enabled ( bool  prune_config,
bool  report_enabled,
fhicl::intermediate_table config 
)

Definition at line 577 of file prune_configuration.cc.

References util::begin(), util::cend(), util::empty(), util::end(), fhicl::intermediate_table::erase(), exists_outside_prolog(), fhicl_key(), fhicl::intermediate_table::find(), art::PathSpec::name, art::path_spec(), fhicl::intermediate_table::put(), fhicl::to_string(), value, and util::values().

Referenced by art::run_art().

580 {
581  auto const modules = declared_modules(config, module_tables);
582 
583  auto paths = all_paths(config);
584 
585  auto [trigger_paths, trigger_paths_override] =
586  enabled_paths(paths, modules, ModuleCategory::modifier);
587  auto [end_paths, end_paths_override] =
588  enabled_paths(paths, modules, ModuleCategory::observer);
589 
590  auto enabled_modules =
591  get_enabled_modules(modules, trigger_paths, ModuleCategory::modifier);
592  // C++17 provides the std::map::merge member function, but Clang 7
593  // and older does not support it. Will do it by hand for now, until
594  // we have time to handle this properly.
595  auto end_path_enabled_modules =
596  get_enabled_modules(modules, end_paths, ModuleCategory::observer);
597  enabled_modules.insert(begin(end_path_enabled_modules),
598  end(end_path_enabled_modules));
599 
600  modules_t unused_modules;
601  for (auto const& pr : modules) {
602  if (enabled_modules.find(pr.first) == cend(enabled_modules)) {
603  unused_modules.insert(pr);
604  }
605  }
606 
607  // Find unused paths
608  using namespace ::ranges;
609  paths.erase("trigger_paths");
610  paths.erase("end_paths");
611  for (auto const& spec : trigger_paths | views::keys) {
612  paths.erase(spec.name);
613  }
614  for (auto const& spec : end_paths | views::keys) {
615  paths.erase(spec.name);
616  }
617 
618  // The only paths left are those that are not enabled for execution.
619  if (report_enabled && !empty(paths)) {
620  std::cerr << "The following paths have not been enabled for execution and "
621  "will be ignored:\n";
622  for (auto const& path_name : paths | views::keys) {
623  std::cerr << " " << path_name << '\n';
624  }
625  }
626 
627  if (report_enabled && !empty(unused_modules)) {
628  std::ostringstream os;
629  os << "The following module label"
630  << ((unused_modules.size() == 1) ? " is" : "s are")
631  << " either not assigned to any path,\n"
632  << "or " << ((unused_modules.size() == 1ull) ? "it has" : "they have")
633  << " been assigned to ignored path(s):\n";
634  for (auto const& label : unused_modules | views::keys) {
635  os << " " << label << '\n';
636  }
637  std::cerr << os.str();
638  }
639 
640  if (prune_config) {
641  auto to_full_path_name = [](auto const& path_name) {
642  return fhicl_key("physics", path_name);
643  };
644  for (auto const& key :
645  paths | views::keys | views::transform(to_full_path_name)) {
646  config.erase(key);
647  }
648  for (auto const& label : unused_modules | views::values) {
649  config.erase(label);
650  }
651 
652  // Check if module tables can be removed
653  auto if_outside_prolog = [&config](auto const& table_name) {
654  return exists_outside_prolog(config, table_name);
655  };
656  for (auto const& table_name :
657  module_tables | views::filter(if_outside_prolog)) {
658  if (table_t const value = config.find(table_name); empty(value)) {
659  config.erase(table_name);
660  }
661  }
662 
663  // Check if top-level physics table can be removed
664  if (exists_outside_prolog(config, "physics")) {
665  if (table_t const value = config.find("physics"); empty(value)) {
666  config.erase("physics");
667  }
668  }
669  }
670 
671  // Ensure that trigger_paths/end_paths is present in the configuration
672  if (not empty(end_paths) and not end_paths_override) {
673  // We do not return the Path ID for end paths as they are not meaningful.
674  auto end_paths_entries =
675  end_paths | views::keys |
676  views::transform([](auto const& path_spec) { return path_spec.name; }) |
677  to<std::vector>();
678 
679  config.put("physics.end_paths", std::move(end_paths_entries));
680  }
681 
682  // Place 'trigger_paths' as top-level configuration table
683  if (not empty(trigger_paths)) {
684  auto trigger_paths_entries = trigger_paths | views::keys |
685  views::transform([](auto const& path_spec) {
686  return to_string(path_spec);
687  }) |
688  to<std::vector>();
689  if (not trigger_paths_override) {
690  config.put("physics.trigger_paths", trigger_paths_entries);
691  }
692  config.put("trigger_paths.trigger_paths", std::move(trigger_paths_entries));
693  }
694 
695  return EnabledModules{std::move(enabled_modules),
696  std::move(trigger_paths),
697  std::move(end_paths),
698  trigger_paths_override,
699  end_paths_override};
700 }
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
Definition: StdUtils.h:93
bool exists_outside_prolog(fhicl::intermediate_table const &config, std::string const &key)
std::map< std::string, std::string > modules_t
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
decltype(auto) values(Coll &&coll)
Range-for loop helper iterating across the values of the specified collection.
std::enable_if_t< std::is_convertible_v< T, std::string >, std::string > fhicl_key(T const &name)
Definition: fhicl_key.h:12
std::string name
Definition: PathSpec.h:48
bool put(std::string const &name, std::string const &value, bool in_prolog=false)
double value
Definition: spectrum.C:18
void erase(std::string const &key, bool in_prolog=false)
extended_value const & find(std::string const &key) const
PathSpec path_spec(std::string const &path_spec)
Definition: PathSpec.cc:22
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:109
constexpr bool art::detail::range_sets_supported ( BranchType const  bt)

Definition at line 10 of file RangeSetsSupported.h.

References art::InRun, and art::InSubRun.

Referenced by art::ProductInserter::commitProducts(), and art::Principal::put().

11  {
12  return bt == InRun || bt == InSubRun;
13  }
std::regex art::detail::regex_for_spec ( std::string const &  spec)

Definition at line 6 of file MetadataRegexHelpers.cc.

7 {
8  return std::regex{"(" + spec + "\\s*:\\s*)(:?<string>)"};
9 }
void art::detail::remove_whitespace ( std::string &  str)

Definition at line 11 of file remove_whitespace.cc.

Referenced by art::PathManager::fillSelectEventsDeps_(), and art::split_process_and_path_names().

12 {
13  boost::remove_erase_if(str, boost::is_any_of(whitespace_chars));
14 }
void art::detail::replace_type ( std::string &  str,
std::string const &  spec,
std::regex const &  r 
)

Definition at line 12 of file MetadataRegexHelpers.cc.

15 {
16  str = std::regex_replace(str, r, "$1"s + spec);
17 }
TRandom r
Definition: spectrum.C:23
std::size_t art::detail::rule_size ( Widths const &  widths)
inline

Definition at line 68 of file PrintFormatting.h.

References indent0(), and w.

Referenced by print_available_plugins().

69  {
70  std::size_t result{indent0().size()};
71  for (std::size_t const w : widths)
72  result += w;
73  return result +=
74  (widths.size() - 1) * 4u; // Account for space between columns;
75  }
std::string indent0()
Float_t w
Definition: plot.C:20
std::vector< ModuleSpec > art::detail::sequence_to_entries ( sequence_t const &  seq,
bool const  allow_nil_entries 
)

Definition at line 173 of file prune_configuration.cc.

References util::empty(), fhicl::NIL, art::Normal, and fhicl::STRING.

Referenced by path_specs().

174  {
175  std::vector<ModuleSpec> result;
176  for (auto const& ev : seq) {
177  if (allow_nil_entries and ev.is_a(NIL)) {
178  result.push_back({at_nil, FilterAction::Normal});
179  continue;
180  }
181  if (!ev.is_a(STRING)) {
182  continue;
183  }
184  auto mod_spec = ev.to_string();
185  if (empty(mod_spec)) {
186  continue;
187  }
188  boost::replace_all(mod_spec, "\"", "");
189  auto action = FilterAction::Normal;
190  if (mod_spec[0] == '!') {
191  action = FilterAction::Veto;
192  mod_spec = mod_spec.substr(1);
193  } else if (mod_spec[0] == '-') {
194  action = FilterAction::Ignore;
195  mod_spec = mod_spec.substr(1);
196  }
197 
198  // Handle remaining '!' or '-' characters
199  if (mod_spec.find_first_of("!-") != std::string::npos) {
200  throw config_exception("There was an error parsing the entry "s +
201  ev.to_string() + "in a FHiCL sequence.")
202  << "The '!' or '-' character may appear as only the first character "
203  "in the path entry.\n";
204  }
205  result.push_back({mod_spec, action});
206  }
207 
208  if (result.size() != seq.size()) {
209  throw config_exception("There was an error parsing the specified entries "
210  "in a FHiCL sequence.")
211  << "One of the presented elements is either an empty string or not a "
212  "string at all.\n";
213  }
214  return result;
215  }
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:109
art::BranchKey art::detail::splitToComponents ( std::string const &  branchName,
std::string &  errMsg 
)

Definition at line 46 of file branchNameComponentChecking.cc.

Referenced by checkBranchNameSelector().

48 {
49  std::vector<std::string> parts;
50  boost::split(parts, branchName, boost::is_any_of("_"));
51  if (parts.size() != 4) {
52  errMsg += "Illegal product name specification \"" + branchName + "\".\n";
53  }
54  return BranchKey(std::move(parts[0]),
55  std::move(parts[1]),
56  std::move(parts[2]),
57  std::move(parts[3]));
58 }
bool art::detail::supports_key ( std::string const &  suffix,
std::string const &  spec,
std::string const &  key 
)

Definition at line 141 of file AllowedConfiguration.cc.

References e, get_LibraryInfoCollection(), art::errors::LogicError, and fhicl::detail::SearchAllowedConfiguration::supports_key().

Referenced by art::BasicOutputOptionsHandler::doProcessOptions(), and print_available_plugins().

144 {
145  art::Exception e{art::errors::LogicError, "art::detail::supports_key"};
146  auto coll = get_LibraryInfoCollection(suffix, spec);
147  if (coll.empty()) {
148  throw e << (spec.empty() ? "[Missing specification]" :
149  cet::bold_fontify(spec))
150  << " did not match any plugin.\n";
151  } else if (coll.size() > 1ull) {
152  throw e << cet::bold_fontify(spec) << " matched more than one plugin.\n"
153  << "When querying plugin configurations, the plugin specification\n"
154  << "must resolve to a unique library.\n";
155  }
156  if (auto config = coll.begin()->allowed_config()) {
158  *config->parameter_base(), key);
159  }
160  return false;
161 }
LibraryInfoCollection get_LibraryInfoCollection(std::string const &suffix, std::string const &pattern, bool verbose=false)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
Float_t e
Definition: plot.C:35
static bool supports_key(ParameterBase const &pb, std::string const &searched_for_key)
template<typename... T>
void art::detail::throw_if_invalid ( std::string const &  msg,
T const &...  t 
)

Definition at line 71 of file Handle.h.

References art::disjoint_ranges(), art::errors::NullPointerError, art::overlapping_ranges(), art::range_of_validity(), and art::same_ranges().

Referenced by art::ValidHandle< T >::productGetter(), and art::SummedValue< T >::update().

72  {
73  bool const all_valid = true && (... && t.isValid());
74  if (!all_valid) {
75  throw Exception{art::errors::NullPointerError} << msg << '\n';
76  }
77  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void art::detail::throwPartnerException ( std::type_info const &  generator,
std::type_info const &  wanted_wrapper_type 
)

Definition at line 6 of file throwPartnerException.cc.

References art::errors::LogicError.

Referenced by art::Assns< L, R, void >::makePartner_(), and art::Assns< L, R, D >::makePartner_().

8 {
9  throw Exception(errors::LogicError, "makePartner")
10  << "Attempted to make type "
11  << cet::demangle_symbol(wanted_wrapper_type.name())
12  << " which is not a valid wrapped partner of "
13  << cet::demangle_symbol(generator.name())
14  << "\nPlease report to the ART framework developers.\n";
15 }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void art::detail::timeReport ( cet::cpu_timer const &  timer)

Definition at line 298 of file writeSummary.cc.

Referenced by writeSummary().

299 {
300  LogPrint("ArtSummary") << "TimeReport "
301  << "---------- Time summary [sec] -------";
302  LogPrint("ArtSummary") << "TimeReport " << setprecision(6) << fixed
303  << "CPU = " << timer.cpuTime()
304  << " Real = " << timer.realTime();
305 }
MaybeLogger_< ELseverityLevel::ELsev_warning, true > LogPrint
void art::detail::triggerReport ( PerScheduleContainer< PathsInfo > const &  endPathInfo,
PerScheduleContainer< PathsInfo > const &  triggerPathsInfo,
bool  wantSummary 
)

Definition at line 104 of file writeSummary.cc.

References art::PathSpec::name, art::PathSpec::path_id, art::path_spec(), util::pi(), art::right(), and util::to_string().

Referenced by writeSummary().

107 {
108  // Checking the first element is sufficient since the path
109  // structures are identical across schedules/end-path executors.
110  auto observers_enabled = !epis[ScheduleID::first()].paths().empty();
111 
112  SummaryCounts total_counts{};
113  for (auto const& tpi : tpis) {
114  total_counts.total += tpi.totalEvents();
115  total_counts.passed += tpi.passedEvents();
116  total_counts.failed += tpi.failedEvents();
117  }
118  // The trigger report (pass/fail etc.):
119  // Printed even if summary not requested, per issue #1864.
120  LogPrint("ArtSummary") << "TrigReport "
121  << "---------- Event summary -------------";
122  LogPrint("ArtSummary") << "TrigReport"
123  << " Events total = " << total_counts.total
124  << " passed = " << total_counts.passed
125  << " failed = " << total_counts.failed;
126 
127  if (wantSummary) {
128  LogPrint("ArtSummary") << "";
129  LogPrint("ArtSummary") << "TrigReport "
130  << "---------- Trigger-path summary ------------";
131  LogPrint("ArtSummary") << "TrigReport " << std::right << setw(10)
132  << "Path ID"
133  << " " << std::right << setw(10) << "Run"
134  << " " << std::right << setw(10) << "Passed"
135  << " " << std::right << setw(10) << "Failed"
136  << " " << std::right << setw(10) << "Error"
137  << " "
138  << "Name";
139  std::map<PathID, TriggerCounts> counts_per_path{};
140  for (auto const& tpi : tpis) {
141  for (auto const& path : tpi.paths()) {
142  auto& counts = counts_per_path[path.pathID()];
143  counts.path_name = path.name(); // No increment!
144  counts.run += path.timesRun();
145  counts.passed += path.timesPassed();
146  counts.failed += path.timesFailed();
147  counts.except += path.timesExcept();
148  }
149  }
150  for (auto const& [pathID, counts] : counts_per_path) {
151  LogPrint("ArtSummary")
152  << "TrigReport " << std::right << setw(10) << to_string(pathID) << " "
153  << std::right << setw(10) << counts.run << " " << std::right << setw(10)
154  << counts.passed << " " << std::right << setw(10) << counts.failed
155  << " " << std::right << setw(10) << counts.except << " "
156  << counts.path_name;
157  }
158 
159  LogPrint("ArtSummary") << "";
160  LogPrint("ArtSummary") << "TrigReport "
161  << "---------- End-path summary ---------";
162  LogPrint("ArtSummary") << "TrigReport"
163  << " " << std::right << setw(10) << "Run"
164  << " " << std::right << setw(10) << "Success"
165  << " " << std::right << setw(10) << "Error";
166 
167  if (observers_enabled) {
168  EndPathCounts epCounts{};
169  for (auto const& epi : epis) {
170  for (auto const& path : epi.paths()) {
171  epCounts.run += path.timesRun();
172  epCounts.success += path.timesPassed();
173  epCounts.except += path.timesExcept();
174  }
175  }
176  LogPrint("ArtSummary")
177  << "TrigReport " << std::right << setw(10) << epCounts.run << " "
178  << std::right << setw(10) << epCounts.success << " " << std::right
179  << setw(10) << epCounts.except;
180  }
181 
182  std::map<PathSpec, WorkersInPathCounts> counts_per_worker_in_path;
183  for (auto const& tpi : tpis) {
184  for (auto const& path : tpi.paths()) {
185  auto& counts_per_worker = counts_per_worker_in_path[path.pathSpec()];
186  if (counts_per_worker.empty() && !path.workersInPath().empty()) {
187  counts_per_worker.resize(path.workersInPath().size());
188  }
189  std::size_t i{};
190  for (auto const& workerInPath : path.workersInPath()) {
191  auto const* worker = workerInPath.getWorker();
192  auto& counts = counts_per_worker[i];
193  if (counts.moduleLabel.empty()) {
194  counts.moduleLabel = worker->description().moduleLabel();
195  }
196  counts.visited += workerInPath.timesVisited();
197  counts.passed += workerInPath.timesPassed();
198  counts.failed += workerInPath.timesFailed();
199  counts.except += workerInPath.timesExcept();
200  ++i;
201  }
202  }
203  }
204  for (auto const& [path_spec, worker_in_path_counts] :
205  counts_per_worker_in_path) {
206  LogPrint("ArtSummary") << "";
207  LogPrint("ArtSummary")
208  << "TrigReport "
209  << "---------- Modules in path: " << path_spec.name << " ------------";
210  LogPrint("ArtSummary")
211  << "TrigReport " << std::right << setw(10) << "Path ID"
212  << " " << std::right << setw(10) << "Visited"
213  << " " << std::right << setw(10) << "Passed"
214  << " " << std::right << setw(10) << "Failed"
215  << " " << std::right << setw(10) << "Error"
216  << " "
217  << "Name";
218  workersInPathTriggerReport(path_spec.path_id, worker_in_path_counts);
219  }
220  }
221 
222  // Printed even if summary not requested, per issue #1864.
223  WorkersInPathCounts endPathWIPCounts;
224  for (auto const& epi : epis) {
225  for (auto const& path : epi.paths()) {
226  if (endPathWIPCounts.empty() && !path.workersInPath().empty()) {
227  endPathWIPCounts.resize(path.workersInPath().size());
228  }
229  std::size_t i{};
230  for (auto const& workerInPath : path.workersInPath()) {
231  auto const* worker = workerInPath.getWorker();
232  auto& counts = endPathWIPCounts[i];
233  if (counts.moduleLabel.empty()) {
234  counts.moduleLabel = worker->description().moduleLabel();
235  }
236  counts.visited += worker->timesRun(); // proxy for 'visited'
237  counts.passed += worker->timesPassed();
238  counts.except += worker->timesExcept();
239  ++i;
240  }
241  }
242  }
243 
244  if (observers_enabled) {
245  LogPrint("ArtSummary") << "";
246  LogPrint("ArtSummary") << "TrigReport "
247  << "---------- Modules in End-path ----------";
248  LogPrint("ArtSummary") << "TrigReport"
249  << " " << std::right << setw(10) << "Run"
250  << " " << std::right << setw(10) << "Success"
251  << " " << std::right << setw(10) << "Error"
252  << " "
253  << "Name";
254  workersInEndPathTriggerReport(endPathWIPCounts);
255  }
256 
257  if (wantSummary) {
258  // This table can arguably be removed since all summary
259  // information is better described above.
260  LogPrint("ArtSummary") << "";
261  LogPrint("ArtSummary") << "TrigReport "
262  << "---------- Module summary ------------";
263  LogPrint("ArtSummary") << "TrigReport " << std::right << setw(10)
264  << "Visited"
265  << " " << std::right << setw(10) << "Run"
266  << " " << std::right << setw(10) << "Passed"
267  << " " << std::right << setw(10) << "Failed"
268  << " " << std::right << setw(10) << "Error"
269  << " "
270  << "Name";
271  std::map<std::string, ModuleCounts> counts_per_module;
272  auto update_counts = [&counts_per_module](auto const& pathInfos) {
273  for (auto const& pi : pathInfos) {
274  for (auto const& [module_label, module_counts] : pi.workers()) {
275  auto& counts = counts_per_module[module_label];
276  counts.visited += module_counts->timesVisited();
277  counts.run += module_counts->timesRun();
278  counts.passed += module_counts->timesPassed();
279  counts.failed += module_counts->timesFailed();
280  counts.except += module_counts->timesExcept();
281  }
282  }
283  };
284  update_counts(tpis);
285  update_counts(epis);
286  for (auto const& [module_label, module_counts] : counts_per_module) {
287  LogPrint("ArtSummary")
288  << "TrigReport " << std::right << setw(10) << module_counts.visited
289  << " " << std::right << setw(10) << module_counts.run << " "
290  << std::right << setw(10) << module_counts.passed << " " << std::right
291  << setw(10) << module_counts.failed << " " << std::right << setw(10)
292  << module_counts.except << " " << module_label;
293  }
294  }
295 }
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:102
PathID path_id
Definition: PathSpec.h:49
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
counts_as<> counts
Number of ADC counts, represented by signed short int.
Definition: electronics.h:112
std::string name
Definition: PathSpec.h:48
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
PathSpec path_spec(std::string const &path_spec)
Definition: PathSpec.cc:22
MaybeLogger_< ELseverityLevel::ELsev_warning, true > LogPrint
TypeLabel art::detail::type_label_for ( TypeID const  typeID,
std::string const &  instance,
bool const  supportsView,
ModuleDescription const &  md 
)
inline

Definition at line 10 of file type_label_for.h.

References instance, art::ModuleDescription::isEmulatedModule(), and art::ModuleDescription::moduleLabel().

Referenced by art::ProductInserter::put().

14  {
15  if (md.isEmulatedModule()) {
16  return TypeLabel{typeID, instance, supportsView, md.moduleLabel()};
17  }
18  return TypeLabel{typeID, instance, supportsView, false};
19  }
const std::string instance
bool art::detail::upcastAllowed ( std::type_info const &  tiFrom,
std::type_info const &  tiTo 
)
void art::detail::validateFileNamePattern ( bool  do_check,
std::string const &  pattern 
)

Definition at line 7 of file validateFileNamePattern.cc.

References art::errors::Configuration.

9 {
10  if (!do_check)
11  return;
12 
13  if (std::regex_search(pattern, std::regex("%(\\d*)#"))) {
14  return;
15  }
16 
18  << "If you have specified the 'fileProperties' table in your "
19  "configuration,\n"
20  << "then the file pattern '%#' MUST be present in the file name. For "
21  "example:\n"
22  << " " << pattern.substr(0, pattern.find(".root")) << "_%#.root\n"
23  << "is a supported file name. Please change your file name to include "
24  "the '%#' pattern.";
25 }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::string art::detail::verify_in_order_dependencies ( ModuleGraphInfoMap const &  modules,
paths_to_modules_t const &  trigger_paths 
)

Definition at line 293 of file graph_algorithms.cc.

References util::begin(), util::cbegin(), util::cend(), util::end(), art::is_modifier(), art::module, and module_type().

Referenced by make_module_graph().

296 {
297  // Precondition: there are no inter-path dependencies
298  std::map<module_name_t, name_set_t> illegal_module_orderings;
299  for (auto const& module : modInfos) {
300  auto const& module_name = module.first;
301  auto const module_type = module.second.module_type;
302  auto const& module_paths = module.second.paths;
303  if (!is_modifier(module_type)) {
304  continue;
305  }
306  if (module_paths.empty()) {
307  continue;
308  }
309  // Only need to check one path since when we call this function,
310  // we have already guaranteed that there are no interpath
311  // dependencies.
312  auto const& first_path_for_module = *cbegin(module_paths);
313  auto const& path_it = std::find_if(trigger_paths.cbegin(),
314  trigger_paths.cend(),
315  path_matches{first_path_for_module});
316  assert(path_it != trigger_paths.cend());
317  auto const begin = cbegin(path_it->second);
318  auto const end = cend(path_it->second);
319  auto const module_position =
320  std::find_if(begin, end, module_matches{module_name});
321  assert(module_position != end);
322 
323  for (auto const& dep : module.second.consumed_products) {
324  if (dep.label == "input_source") {
325  continue;
326  }
327  auto const dep_position =
328  std::find_if(begin, end, module_matches{dep.label});
329  assert(dep_position != end);
330  if (dep_position < module_position) {
331  continue;
332  }
333  illegal_module_orderings[module_name].insert(dep.label);
334  }
335  }
336 
337  if (illegal_module_orderings.empty()) {
338  return {};
339  }
340 
341  std::ostringstream oss;
342  oss << "\nThe following are module-ordering errors due to declared "
343  "data-product dependencies:\n";
344  for (auto const& mod : illegal_module_orderings) {
345  auto const& module_name = mod.first;
346  auto const mod_index = modInfos.vertex_index(module_name);
347  auto const& module_paths = modInfos.info(mod_index).paths;
348  oss << " Module " << module_name << " on path"
349  << (module_paths.size() == 1ull ? " " : "s ")
350  << comma_separated_list(module_paths)
351  << " depends on either itself or modules that follow it:\n";
352  for (auto const& dep_name : mod.second) {
353  auto const dep_index = modInfos.vertex_index(dep_name);
354  auto const& on_paths = modInfos.info(dep_index).paths;
355  oss << " Module " << dep_name << " on path"
356  << (on_paths.size() == 1ull ? " " : "s ")
357  << comma_separated_list(on_paths)
358  << (module_name == dep_name ? " (self circularity)" : "") << '\n';
359  }
360  }
361  return oss.str();
362 }
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
Definition: StdUtils.h:93
ModuleType module_type(std::string const &full_key)
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
bool is_modifier(ModuleType const mt)
Definition: ModuleType.h:22
decltype(auto) constexpr cbegin(T &&obj)
ADL-aware version of std::cbegin.
Definition: StdUtils.h:85
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
std::string art::detail::verify_no_interpath_dependencies ( ModuleGraphInfoMap const &  modInfos,
ModuleGraph const &  graph 
)

Definition at line 210 of file graph_algorithms.cc.

References art::detail::ModuleGraphInfoMap::info(), art::detail::ModuleGraphInfoMap::name(), and target.

Referenced by make_module_graph().

213 {
214  using namespace ::ranges;
215  auto make_range = [](auto const pr) { return subrange{pr.first, pr.second}; };
216 
217  std::map<Vertex, std::set<Vertex>> illegal_dependencies;
218  for (auto const& path_graph : make_range(graph.children())) {
219  for (auto const gv :
220  make_range(vertices(path_graph)) |
221  views::transform([&path_graph](auto const local_vertex) {
222  return path_graph.local_to_global(local_vertex);
223  })) {
224  // Verify that the target of each out edge is a member of the
225  // same subgraph (which is determined by calling find_vertex).
226  // If not, then it is an illegal path specification.
227  for (auto const out_edge : make_range(out_edges(gv, graph))) {
228  auto const tv = target(out_edge, graph);
229  if (path_graph.find_vertex(tv).second) {
230  continue;
231  }
232  illegal_dependencies[gv].insert(tv);
233  }
234  }
235  }
236 
237  if (illegal_dependencies.empty()) {
238  return {};
239  }
240 
241  std::ostringstream oss;
242  oss << "\nThe following represent cross-path data-dependency errors:\n"
243  << cet::HorizontalRule{60}('-') << '\n';
244  for (auto const& [mod_index, target_indices] : illegal_dependencies) {
245  auto const& module_name = modInfos.name(mod_index);
246  auto const& mod_paths = modInfos.info(mod_index).paths;
247  oss << " Module " << module_name << " on path"
248  << (mod_paths.size() == 1ull ? " " : "s ")
249  << comma_separated_list(mod_paths) << " depends on\n";
250  for (auto const& dep : target_indices) {
251  auto const& dep_name = modInfos.name(dep);
252  auto const& on_paths = modInfos.info(dep).paths;
253  oss << " Module " << dep_name << " on path"
254  << (on_paths.size() == 1ull ? " " : "s ")
255  << comma_separated_list(on_paths) << '\n';
256  }
257  }
258  oss << "\nSuch errors occur whenever a module on one path depends on the "
259  "data products\n"
260  << "from another. Such dependencies can be subtle--for example, a "
261  "module that\n"
262  << "uses an event.getManyByType call cannot be shared across paths if "
263  "the modules\n"
264  << "that precede it in the paths do not give consistent result. Please "
265  "check your\n"
266  << "configuration, or email artists@fnal.gov for assistance.\n";
267  return oss.str();
268 }
cout<< "-> Edep in the target
Definition: analysis.C:53
void art::detail::verifyFriendlyClassName ( std::string const &  fcn)

Definition at line 16 of file verify_names.cc.

References art::errors::LogicError.

Referenced by art::ProducesCollector::produces(), and art::ProducesCollector::reconstitutes().

17 {
18  if (fcn.find('_') != std::string::npos) {
20  << "Class \"" << fcn
21  << "\" is not suitable for use as a product due to the presence of "
22  << "underscores which are not allowed anywhere in the class name "
23  << "(including namespace and enclosing classes).\n";
24  }
25 }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void art::detail::verifyInstanceName ( std::string const &  in)

Definition at line 5 of file verify_names.cc.

References art::errors::Configuration.

Referenced by art::ProducesCollector::produces(), and art::ProducesCollector::reconstitutes().

6 {
7  if (instanceName.find('_') != std::string::npos) {
9  << "Instance name \"" << instanceName
10  << "\" is illegal: underscores are not permitted in instance names."
11  << '\n';
12  }
13 }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
template<typename T >
bool art::detail::verifyPtrCollection ( std::vector< art::PtrVector< T > const * > const &  in)

Definition at line 132 of file CollectionUtilities.h.

References in.

Referenced by art::flattenCollections().

134 {
135  return verifyPtrCollection(in.begin(), in.end());
136 }
bool verifyPtrCollection(iterator beg, iterator end, art::ProductID id={}, art::EDProductGetter const *getter=nullptr)
template<typename iterator >
bool art::detail::verifyPtrCollection ( iterator  beg,
iterator  end,
art::ProductID  id = {},
art::EDProductGetter const *  getter = nullptr 
)

Definition at line 141 of file CollectionUtilities.h.

References util::end().

145 {
146  if (beg == end)
147  return true;
148  if (!id.isValid()) {
149  id = (*beg).id();
150  }
151  if (!getter) {
152  getter = (*beg).productGetter();
153  }
154  for (iterator i = beg; i != end; ++i) {
155  if ((*i) != nullptr &&
156  !((*i)->productGetter() && (*i)->productGetter() == getter &&
157  (*i)->id().isValid() && (*i)->id() == id)) {
158  return false;
159  }
160  }
161  return true;
162 }
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
template<typename T >
auto art::detail::wrapperTypeID ( )
inline

Definition at line 9 of file ProductTypeIDs.h.

10  {
11  return TypeID{typeid(art::Wrapper<T>)};
12  }
void art::detail::writeSummary ( PathManager pm,
bool  wantSummary,
cet::cpu_timer const &  timer 
)

Definition at line 89 of file writeSummary.cc.

References art::PathManager::endPathInfo(), memoryReport(), timeReport(), art::PathManager::triggerPathsInfo(), and triggerReport().

Referenced by art::EventProcessor::endJob().

92 {
93  auto const& epis = pm.endPathInfo();
94  auto const& tpis = pm.triggerPathsInfo();
95  LogPrint("ArtSummary") << "";
96  triggerReport(epis, tpis, wantSummary);
97  LogPrint("ArtSummary") << "";
98  timeReport(jobTimer);
99  LogPrint("ArtSummary") << "";
100  memoryReport();
101 }
void triggerReport(PerScheduleContainer< PathsInfo > const &endPathInfo, PerScheduleContainer< PathsInfo > const &triggerPathsInfo, bool wantSummary)
void timeReport(cet::cpu_timer const &timer)
MaybeLogger_< ELseverityLevel::ELsev_warning, true > LogPrint

Variable Documentation

template<typename T , typename U >
constexpr bool art::detail::are_handles_v {is_handle_v<T> && is_handle_v<U>}

Definition at line 17 of file is_handle.h.

template<typename T >
bool constexpr art::detail::handle_allowed_v {handle_allowed<T>::value}

Definition at line 24 of file ServiceHandleAllowed.h.

template<typename T >
constexpr bool art::detail::has_three_arg_insert
template<typename T >
constexpr bool art::detail::is_handle_v = is_handle<T>::value

Definition at line 14 of file is_handle.h.