LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
art::PathsInfo Class Reference

#include "PathsInfo.h"

Public Types

using ModInfos = std::vector< detail::ModuleInPathInfo >
 

Public Member Functions

 PathsInfo (std::size_t const numPaths, detail::ModuleFactory &factory, fhicl::ParameterSet const &procPS, MasterProductRegistry &preg, ProductDescriptions &productsToProduce, ActionTable &actions, ActivityRegistry &areg)
 
HLTGlobalStatuspathResults ()
 
void makeAndAppendPath (std::string const &pathName, ModInfos const &modInfos, bool trigResultsNeeded=true)
 
void addEvent ()
 
void addPass ()
 
WorkerMap const & workers () const
 
PathPtrs const & pathPtrs () const
 
size_t passedEvents () const
 
size_t failedEvents () const
 
size_t totalEvents () const
 

Private Member Functions

void makeWorker_ (detail::ModuleInPathInfo const &mipi, std::vector< WorkerInPath > &pathWorkers)
 
cet::exempt_ptr< WorkermakeWorker_ (detail::ModuleConfigInfo const &mci)
 

Private Attributes

WorkerMap workers_ {}
 
PathPtrs pathPtrs_ {}
 
HLTGlobalStatus pathResults_
 
size_t totalEvents_ {}
 
size_t passedEvents_ {}
 
detail::ModuleFactoryfact_
 
fhicl::ParameterSet const & procPS_
 
MasterProductRegistrypreg_
 
ProductDescriptionsproductsToProduce_
 
ActionTableexceptActions_
 
ActivityRegistryareg_
 
std::vector< std::string > configErrMsgs_
 

Detailed Description

Definition at line 15 of file PathsInfo.h.

Member Typedef Documentation

Definition at line 26 of file PathsInfo.h.

Constructor & Destructor Documentation

art::PathsInfo::PathsInfo ( std::size_t const  numPaths,
detail::ModuleFactory factory,
fhicl::ParameterSet const &  procPS,
MasterProductRegistry preg,
ProductDescriptions productsToProduce,
ActionTable actions,
ActivityRegistry areg 
)
explicit

Definition at line 11 of file PathsInfo.cc.

References areg_, exceptActions_, fact_, preg_, procPS_, and productsToProduce_.

18  : pathResults_{numPaths}
19  , fact_{factory}
20  , procPS_{procPS}
21  , preg_{preg}
22  , productsToProduce_{productsToProduce}
23  , exceptActions_{actions}
24  , areg_{areg}
25 {}
fhicl::ParameterSet const & procPS_
Definition: PathsInfo.h:54
ActivityRegistry & areg_
Definition: PathsInfo.h:58
ActionTable & exceptActions_
Definition: PathsInfo.h:57
ProductDescriptions & productsToProduce_
Definition: PathsInfo.h:56
detail::ModuleFactory & fact_
Definition: PathsInfo.h:53
HLTGlobalStatus pathResults_
Definition: PathsInfo.h:48
MasterProductRegistry & preg_
Definition: PathsInfo.h:55

Member Function Documentation

void art::PathsInfo::addEvent ( )
inline

Definition at line 69 of file PathsInfo.h.

References totalEvents_.

Referenced by art::EndPathExecutor::process(), and art::Schedule::process().

70 {
71  ++totalEvents_;
72 }
size_t totalEvents_
Definition: PathsInfo.h:50
void art::PathsInfo::addPass ( )
inline

Definition at line 75 of file PathsInfo.h.

References passedEvents_.

Referenced by art::EndPathExecutor::process(), and art::Schedule::process().

76 {
77  ++passedEvents_;
78 }
size_t passedEvents_
Definition: PathsInfo.h:51
size_t art::PathsInfo::failedEvents ( ) const
inline

Definition at line 99 of file PathsInfo.h.

References passedEvents_, and totalEvents_.

Referenced by art::detail::triggerReport().

100 {
101  return totalEvents_ - passedEvents_;
102 }
size_t totalEvents_
Definition: PathsInfo.h:50
size_t passedEvents_
Definition: PathsInfo.h:51
void art::PathsInfo::makeAndAppendPath ( std::string const &  pathName,
ModInfos const &  modInfos,
bool  trigResultsNeeded = true 
)

Definition at line 29 of file PathsInfo.cc.

References areg_, configErrMsgs_, art::errors::Configuration, exceptActions_, art::is_observer(), makeWorker_(), pathPtrs_, pathResults(), and pathResults_.

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

32 {
33  assert(!modInfos.empty());
34  std::vector<WorkerInPath> pathWorkers;
35  for (auto const& mci : modInfos) {
36  makeWorker_(mci, pathWorkers);
37  }
38 
39  if (!configErrMsgs_.empty()) {
40  constexpr cet::HorizontalRule rule{100};
41  std::ostringstream err_msg;
42  err_msg << "\n"
43  << rule('=') << "\n\n"
44  << "!! The following modules have been misconfigured: !!"
45  << "\n";
46  for (auto const& err : configErrMsgs_) {
47  err_msg << "\n" << rule('-') << "\n" << err;
48  }
49  err_msg << "\n" << rule('=') << "\n\n";
50 
51  throw art::Exception(art::errors::Configuration) << err_msg.str();
52  }
53 
54  cet::exempt_ptr<HLTGlobalStatus> pathResults{
55  trigResultsNeeded ? &pathResults_ : nullptr};
56  auto const bit_position_for_new_path = pathPtrs_.size();
57  auto path = std::make_unique<art::Path>(
58  bit_position_for_new_path,
59  pathName,
60  std::move(pathWorkers),
61  std::move(pathResults),
63  areg_,
64  is_observer(modInfos.front().moduleConfigInfo().moduleType()));
65  pathPtrs_.push_back(std::move(path));
66 }
void makeWorker_(detail::ModuleInPathInfo const &mipi, std::vector< WorkerInPath > &pathWorkers)
Definition: PathsInfo.cc:69
std::vector< std::string > configErrMsgs_
Definition: PathsInfo.h:59
ActivityRegistry & areg_
Definition: PathsInfo.h:58
ActionTable & exceptActions_
Definition: PathsInfo.h:57
bool is_observer(ModuleType mt)
Definition: ModuleType.h:53
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
HLTGlobalStatus & pathResults()
Definition: PathsInfo.h:63
PathPtrs pathPtrs_
Definition: PathsInfo.h:47
HLTGlobalStatus pathResults_
Definition: PathsInfo.h:48
void art::PathsInfo::makeWorker_ ( detail::ModuleInPathInfo const &  mipi,
std::vector< WorkerInPath > &  pathWorkers 
)
private

Definition at line 69 of file PathsInfo.cc.

References art::detail::ModuleInPathInfo::filterAction(), art::detail::ModuleInPathInfo::moduleConfigInfo(), and w.

Referenced by makeAndAppendPath().

71 {
72  auto w = makeWorker_(mipi.moduleConfigInfo());
73  pathWorkers.emplace_back(w, mipi.filterAction());
74 }
void makeWorker_(detail::ModuleInPathInfo const &mipi, std::vector< WorkerInPath > &pathWorkers)
Definition: PathsInfo.cc:69
Float_t w
Definition: plot.C:23
cet::exempt_ptr< art::Worker > art::PathsInfo::makeWorker_ ( detail::ModuleConfigInfo const &  mci)
private

Definition at line 77 of file PathsInfo.cc.

References areg_, art::detail::bold_fontify(), configErrMsgs_, art::detail::ModuleConfigInfo::configPath(), e, exceptActions_, fact_, fhicl::ParameterSet::get(), art::getReleaseVersion(), fhicl::ParameterSet::id(), art::ModuleDescription::id(), art::detail::ModuleConfigInfo::label(), art::detail::ModuleFactory::makeWorker(), preg_, art::ProcessConfiguration::processName_, procPS_, productsToProduce_, art::ActivityRegistry::sPostModuleConstruction, art::ActivityRegistry::sPreModuleConstruction, fhicl::detail::validationException::what(), and workers_.

78 {
79  auto it = workers_.find(mci.label());
80  if (it == workers_.end()) { // Need worker.
81  auto moduleConfig =
82  procPS_.get<fhicl::ParameterSet>(mci.configPath() + '.' + mci.label());
83  WorkerParams const p{
84  procPS_,
85  moduleConfig,
86  preg_,
89  ServiceHandle<TriggerNamesService const>{}->getProcessName()};
90  ModuleDescription const md{
91  moduleConfig.id(),
92  p.pset_.get<std::string>("module_type"),
93  p.pset_.get<std::string>("module_label"),
94  ProcessConfiguration{p.processName_, procPS_.id(), getReleaseVersion()}};
95  areg_.sPreModuleConstruction.invoke(md);
96  try {
97  auto worker = fact_.makeWorker(p, md);
98  areg_.sPostModuleConstruction.invoke(md);
99  it = workers_.emplace(mci.label(), std::move(worker)).first;
100  it->second->setActivityRegistry(&areg_);
101  }
102  catch (fhicl::detail::validationException const& e) {
103  std::ostringstream err_stream;
104  err_stream << "\n\nModule label: "
105  << detail::bold_fontify(md.moduleLabel())
106  << "\nmodule_type : " << detail::bold_fontify(md.moduleName())
107  << "\n\n"
108  << e.what();
109  configErrMsgs_.push_back(err_stream.str());
110  }
111  }
112  return cet::exempt_ptr<Worker>{it->second.get()};
113 }
std::string bold_fontify(std::string const &s)
Definition: bold_fontify.h:9
GlobalSignal< detail::SignalResponseType::FIFO, void(ModuleDescription const &)> sPreModuleConstruction
GlobalSignal< detail::SignalResponseType::LIFO, void(ModuleDescription const &)> sPostModuleConstruction
fhicl::ParameterSet const & procPS_
Definition: PathsInfo.h:54
std::vector< std::string > configErrMsgs_
Definition: PathsInfo.h:59
ActivityRegistry & areg_
Definition: PathsInfo.h:58
T get(std::string const &key) const
Definition: ParameterSet.h:231
ActionTable & exceptActions_
Definition: PathsInfo.h:57
ProductDescriptions & productsToProduce_
Definition: PathsInfo.h:56
std::string const & getReleaseVersion()
detail::ModuleFactory & fact_
Definition: PathsInfo.h:53
WorkerMap workers_
Definition: PathsInfo.h:46
ParameterSetID id() const
std::unique_ptr< Worker > makeWorker(WorkerParams const &wp, ModuleDescription const &md)
char const * what() const noexcept override
Float_t e
Definition: plot.C:34
MasterProductRegistry & preg_
Definition: PathsInfo.h:55
size_t art::PathsInfo::passedEvents ( ) const
inline

Definition at line 93 of file PathsInfo.h.

References passedEvents_.

Referenced by art::detail::triggerReport().

94 {
95  return passedEvents_;
96 }
size_t passedEvents_
Definition: PathsInfo.h:51
art::PathPtrs const & art::PathsInfo::pathPtrs ( ) const
inline
art::HLTGlobalStatus & art::PathsInfo::pathResults ( )
inline

Definition at line 63 of file PathsInfo.h.

References pathResults_.

Referenced by makeAndAppendPath(), art::Schedule::makeTriggerResultsInserter_(), art::Schedule::process(), and art::Schedule::runTriggerPaths_().

64 {
65  return pathResults_;
66 }
HLTGlobalStatus pathResults_
Definition: PathsInfo.h:48
size_t art::PathsInfo::totalEvents ( ) const
inline

Definition at line 105 of file PathsInfo.h.

References totalEvents_.

Referenced by art::detail::triggerReport().

106 {
107  return totalEvents_;
108 }
size_t totalEvents_
Definition: PathsInfo.h:50

Member Data Documentation

ActivityRegistry& art::PathsInfo::areg_
private

Definition at line 58 of file PathsInfo.h.

Referenced by makeAndAppendPath(), makeWorker_(), and PathsInfo().

std::vector<std::string> art::PathsInfo::configErrMsgs_
private

Definition at line 59 of file PathsInfo.h.

Referenced by makeAndAppendPath(), and makeWorker_().

ActionTable& art::PathsInfo::exceptActions_
private

Definition at line 57 of file PathsInfo.h.

Referenced by makeAndAppendPath(), makeWorker_(), and PathsInfo().

detail::ModuleFactory& art::PathsInfo::fact_
private

Definition at line 53 of file PathsInfo.h.

Referenced by makeWorker_(), and PathsInfo().

size_t art::PathsInfo::passedEvents_ {}
private

Definition at line 51 of file PathsInfo.h.

Referenced by addPass(), failedEvents(), and passedEvents().

PathPtrs art::PathsInfo::pathPtrs_ {}
private

Definition at line 47 of file PathsInfo.h.

Referenced by makeAndAppendPath(), and pathPtrs().

HLTGlobalStatus art::PathsInfo::pathResults_
private

Definition at line 48 of file PathsInfo.h.

Referenced by makeAndAppendPath(), and pathResults().

MasterProductRegistry& art::PathsInfo::preg_
private

Definition at line 55 of file PathsInfo.h.

Referenced by makeWorker_(), and PathsInfo().

fhicl::ParameterSet const& art::PathsInfo::procPS_
private

Definition at line 54 of file PathsInfo.h.

Referenced by makeWorker_(), and PathsInfo().

ProductDescriptions& art::PathsInfo::productsToProduce_
private

Definition at line 56 of file PathsInfo.h.

Referenced by makeWorker_(), and PathsInfo().

size_t art::PathsInfo::totalEvents_ {}
private

Definition at line 50 of file PathsInfo.h.

Referenced by addEvent(), failedEvents(), and totalEvents().

WorkerMap art::PathsInfo::workers_ {}
private

Definition at line 46 of file PathsInfo.h.

Referenced by makeWorker_(), and workers().


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