LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::PathsInfo Class Reference

#include "PathsInfo.h"

Public Member Functions

 ~PathsInfo ()
 
std::map< std::string, std::shared_ptr< Worker > > & workers ()
 
std::map< std::string, std::shared_ptr< Worker > > const & workers () const
 
void add_path (ActionTable const &, ActivityRegistry const &, PathContext const &, std::vector< WorkerInPath > &&, GlobalTaskGroup &)
 
std::vector< Path > & paths ()
 
std::vector< Path > const & paths () const
 
std::vector< std::string > pathNames () const
 
HLTGlobalStatuspathResults ()
 
void reset ()
 
void reset_for_event ()
 
void incrementTotalEventCount ()
 
void incrementPassedEventCount ()
 
std::size_t passedEvents () const
 
std::size_t failedEvents () const
 
std::size_t totalEvents () const
 

Private Attributes

std::map< std::string, std::shared_ptr< Worker > > workers_ {}
 
std::vector< Pathpaths_ {}
 
HLTGlobalStatus pathResults_ {}
 
std::atomic< std::size_t > totalEvents_ {}
 
std::atomic< std::size_t > passedEvents_ {}
 

Detailed Description

Definition at line 16 of file PathsInfo.h.

Constructor & Destructor Documentation

art::PathsInfo::~PathsInfo ( )
default

Member Function Documentation

void art::PathsInfo::add_path ( ActionTable const &  actions,
ActivityRegistry const &  registry,
PathContext const &  pc,
std::vector< WorkerInPath > &&  wips,
GlobalTaskGroup task_group 
)

Definition at line 34 of file PathsInfo.cc.

References art::PathContext::pathID(), art::PathContext::pathName(), art::PathContext::scheduleID(), util::size(), TDEBUG_FUNC_SI, and util::to_string().

39  {
40  if (pc.pathName() == PathContext::end_path()) {
41  paths_.emplace_back(
42  actions, registry, pc, std::move(wips), nullptr, task_group);
43  } else {
44  paths_.emplace_back(
45  actions, registry, pc, std::move(wips), &pathResults_, task_group);
46  pathResults_ = HLTGlobalStatus(size(paths_));
47  }
48  TDEBUG_FUNC_SI(5, pc.scheduleID())
49  << "Made path " << std::hex << &paths_.back() << std::dec
50  << " pathID: " << to_string(pc.pathID()) << " name: " << pc.pathName();
51  }
static std::string end_path()
Definition: PathContext.h:14
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
#define TDEBUG_FUNC_SI(LEVEL, SI)
std::vector< Path > paths_
Definition: PathsInfo.h:41
HLTGlobalStatus pathResults_
Definition: PathsInfo.h:42
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
size_t art::PathsInfo::failedEvents ( ) const

Definition at line 116 of file PathsInfo.cc.

117  {
118  // MT: This is fragile!
119  return totalEvents_.load() - passedEvents_.load();
120  }
std::atomic< std::size_t > totalEvents_
Definition: PathsInfo.h:43
std::atomic< std::size_t > passedEvents_
Definition: PathsInfo.h:44
void art::PathsInfo::incrementPassedEventCount ( )

Definition at line 104 of file PathsInfo.cc.

Referenced by art::EndPathExecutor::process(), and art::TriggerPathsExecutor::process_event_paths_done().

105  {
106  ++passedEvents_;
107  }
std::atomic< std::size_t > passedEvents_
Definition: PathsInfo.h:44
void art::PathsInfo::incrementTotalEventCount ( )

Definition at line 98 of file PathsInfo.cc.

Referenced by art::TriggerPathsExecutor::process_event(), and art::EndPathExecutor::process_event().

99  {
100  ++totalEvents_;
101  }
std::atomic< std::size_t > totalEvents_
Definition: PathsInfo.h:43
size_t art::PathsInfo::passedEvents ( ) const

Definition at line 110 of file PathsInfo.cc.

111  {
112  return passedEvents_.load();
113  }
std::atomic< std::size_t > passedEvents_
Definition: PathsInfo.h:44
vector< string > art::PathsInfo::pathNames ( ) const

Definition at line 66 of file PathsInfo.cc.

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

67  {
68  vector<string> result;
69  std::transform(begin(paths_),
70  end(paths_),
71  back_inserter(result),
72  [](auto const& path) { return path.name(); });
73  return result;
74  }
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
std::vector< Path > paths_
Definition: PathsInfo.h:41
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
HLTGlobalStatus & art::PathsInfo::pathResults ( )

Definition at line 92 of file PathsInfo.cc.

Referenced by art::TriggerPathsExecutor::process_event_paths_done().

93  {
94  return pathResults_;
95  }
HLTGlobalStatus pathResults_
Definition: PathsInfo.h:42
vector< Path > & art::PathsInfo::paths ( )
vector< Path > const & art::PathsInfo::paths ( ) const

Definition at line 60 of file PathsInfo.cc.

61  {
62  return paths_;
63  }
std::vector< Path > paths_
Definition: PathsInfo.h:41
void art::PathsInfo::reset ( )

Definition at line 77 of file PathsInfo.cc.

References util::values().

Referenced by art::TriggerPathsExecutor::process().

78  {
79  for (auto const& worker : workers_ | ::ranges::views::values) {
80  worker->reset();
81  }
82  }
decltype(auto) values(Coll &&coll)
Range-for loop helper iterating across the values of the specified collection.
std::map< std::string, std::shared_ptr< Worker > > workers_
Definition: PathsInfo.h:40
void art::PathsInfo::reset_for_event ( )

Definition at line 85 of file PathsInfo.cc.

Referenced by art::TriggerPathsExecutor::process_event(), and art::EndPathExecutor::process_event().

86  {
87  reset();
89  }
HLTGlobalStatus pathResults_
Definition: PathsInfo.h:42
void reset()
Definition: PathsInfo.cc:77
size_t art::PathsInfo::totalEvents ( ) const

Definition at line 123 of file PathsInfo.cc.

124  {
125  return totalEvents_.load();
126  }
std::atomic< std::size_t > totalEvents_
Definition: PathsInfo.h:43
map< string, std::shared_ptr< Worker > > & art::PathsInfo::workers ( )

Definition at line 22 of file PathsInfo.cc.

Referenced by art::EndPathExecutor::EndPathExecutor().

23  {
24  return workers_;
25  }
std::map< std::string, std::shared_ptr< Worker > > workers_
Definition: PathsInfo.h:40
map< string, std::shared_ptr< Worker > > const & art::PathsInfo::workers ( ) const

Definition at line 28 of file PathsInfo.cc.

29  {
30  return workers_;
31  }
std::map< std::string, std::shared_ptr< Worker > > workers_
Definition: PathsInfo.h:40

Member Data Documentation

std::atomic<std::size_t> art::PathsInfo::passedEvents_ {}
private

Definition at line 44 of file PathsInfo.h.

HLTGlobalStatus art::PathsInfo::pathResults_ {}
private

Definition at line 42 of file PathsInfo.h.

std::vector<Path> art::PathsInfo::paths_ {}
private

Definition at line 41 of file PathsInfo.h.

std::atomic<std::size_t> art::PathsInfo::totalEvents_ {}
private

Definition at line 43 of file PathsInfo.h.

std::map<std::string, std::shared_ptr<Worker> > art::PathsInfo::workers_ {}
private

Definition at line 40 of file PathsInfo.h.


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