CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
edm::WorkerInPath Class Reference

#include <WorkerInPath.h>

Public Types

enum  FilterAction { Normal =0, Ignore, Veto }
 

Public Member Functions

bool checkResultsOfRunWorker (bool wasEvent)
 
void clearCounters ()
 
FilterAction filterAction () const
 
WorkergetWorker () const
 
template<typename T >
void runWorkerAsync (WaitingTask *iTask, typename T::MyPrincipal const &, EventSetup const &, ServiceToken const &, StreamID streamID, typename T::Context const *context)
 
void setPathContext (PathContext const *v)
 
void skipWorker (EventPrincipal const &iPrincipal)
 
void skipWorker (RunPrincipal const &)
 
void skipWorker (LuminosityBlockPrincipal const &)
 
int timesExcept () const
 
int timesFailed () const
 
int timesPassed () const
 
int timesVisited () const
 
 WorkerInPath (Worker *, FilterAction theAction, unsigned int placeInPath)
 

Private Attributes

FilterAction filterAction_
 
PlaceInPathContext placeInPathContext_
 
int timesExcept_
 
int timesFailed_
 
int timesPassed_
 
int timesVisited_
 
Workerworker_
 

Detailed Description

Definition at line 25 of file WorkerInPath.h.

Member Enumeration Documentation

Enumerator
Normal 
Ignore 
Veto 

Definition at line 27 of file WorkerInPath.h.

Constructor & Destructor Documentation

edm::WorkerInPath::WorkerInPath ( Worker w,
FilterAction  theAction,
unsigned int  placeInPath 
)

Definition at line 6 of file WorkerInPath.cc.

References edm::Worker::addedToPath().

6  :
8  timesPassed_(),
9  timesFailed_(),
10  timesExcept_(),
11  filterAction_(theFilterAction),
12  worker_(w),
13  placeInPathContext_(placeInPath)
14  {
15  w->addedToPath();
16  }
const double w
Definition: UKUtility.cc:23
FilterAction filterAction_
Definition: WorkerInPath.h:67
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:70

Member Function Documentation

bool edm::WorkerInPath::checkResultsOfRunWorker ( bool  wasEvent)
inline

Definition at line 73 of file WorkerInPath.h.

References edm::Worker::Exception, edm::Worker::Fail, filterAction(), Ignore, edm::Worker::Pass, edm::Worker::state(), timesExcept_, timesFailed_, timesPassed_, Veto, and worker_.

73  {
74  if(not wasEvent) {
75  return true;
76  }
77  auto state = worker_->state();
78  bool rc = true;
79  switch (state) {
80  case Worker::Fail:
81  {
82  rc = false;
83  break;
84  }
85  case Worker::Pass:
86  break;
87  case Worker::Exception:
88  {
89  ++timesExcept_;
90  return true;
91  }
92 
93  default:
94  assert(false);
95  }
96 
97  if(Ignore == filterAction()) {
98  rc = true;
99  } else if(Veto == filterAction()) {
100  rc = !rc;
101  }
102 
103  if(rc) {
104  ++timesPassed_;
105  } else {
106  ++timesFailed_;
107  }
108  return rc;
109 
110  }
State state() const
Definition: Worker.h:229
FilterAction filterAction() const
Definition: WorkerInPath.h:56
void edm::WorkerInPath::clearCounters ( )
inline
FilterAction edm::WorkerInPath::filterAction ( ) const
inline

Definition at line 56 of file WorkerInPath.h.

References filterAction_.

Referenced by checkResultsOfRunWorker().

56 { return filterAction_; }
FilterAction filterAction_
Definition: WorkerInPath.h:67
Worker* edm::WorkerInPath::getWorker ( ) const
inline

Definition at line 57 of file WorkerInPath.h.

References worker_.

57 { return worker_; }
template<typename T >
void edm::WorkerInPath::runWorkerAsync ( WaitingTask iTask,
typename T::MyPrincipal const &  ep,
EventSetup const &  es,
ServiceToken const &  token,
StreamID  streamID,
typename T::Context const *  context 
)

Definition at line 113 of file WorkerInPath.h.

References edm::Worker::doWorkAsync(), edm::Worker::doWorkNoPrefetchingAsync(), placeInPathContext_, timesVisited_, and worker_.

117  {
118  if (T::isEvent_) {
119  ++timesVisited_;
120  }
121 
122  if(T::isEvent_) {
123  ParentContext parentContext(&placeInPathContext_);
124  worker_->doWorkAsync<T>(iTask,ep, es, token, streamID, parentContext, context);
125  } else {
126  ParentContext parentContext(context);
127 
128  // We do not need to run prefetching here because this only handles
129  // stream transitions for runs and lumis. There are no products put
130  // into the runs or lumis in stream transitions, so there can be
131  // no data dependencies which require prefetching. Prefetching is
132  // needed for global transitions, but they are run elsewhere.
133  worker_->doWorkNoPrefetchingAsync<T>(iTask,ep, es,token, streamID, parentContext, context);
134  }
135  }
void doWorkNoPrefetchingAsync(WaitingTask *task, typename T::MyPrincipal const &, EventSetup const &c, ServiceToken const &token, StreamID stream, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:954
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:70
void doWorkAsync(WaitingTask *task, typename T::MyPrincipal const &, EventSetup const &c, ServiceToken const &token, StreamID stream, ParentContext const &parentContext, typename T::Context const *context)
Definition: Worker.h:852
long double T
void edm::WorkerInPath::setPathContext ( PathContext const *  v)
inline

Definition at line 59 of file WorkerInPath.h.

References placeInPathContext_, and edm::PlaceInPathContext::setPathContext().

void setPathContext(PathContext const *v)
PlaceInPathContext placeInPathContext_
Definition: WorkerInPath.h:70
void edm::WorkerInPath::skipWorker ( EventPrincipal const &  iPrincipal)
inline

Definition at line 41 of file WorkerInPath.h.

References edm::Worker::skipOnPath(), and worker_.

41  {
43  }
void skipOnPath()
Definition: Worker.cc:369
void edm::WorkerInPath::skipWorker ( RunPrincipal const &  )
inline

Definition at line 44 of file WorkerInPath.h.

44 {}
void edm::WorkerInPath::skipWorker ( LuminosityBlockPrincipal const &  )
inline

Definition at line 45 of file WorkerInPath.h.

45 {}
int edm::WorkerInPath::timesExcept ( ) const
inline

Definition at line 54 of file WorkerInPath.h.

References timesExcept_.

54 { return timesExcept_; }
int edm::WorkerInPath::timesFailed ( ) const
inline

Definition at line 53 of file WorkerInPath.h.

References timesFailed_.

53 { return timesFailed_; }
int edm::WorkerInPath::timesPassed ( ) const
inline

Definition at line 52 of file WorkerInPath.h.

References timesPassed_.

52 { return timesPassed_; }
int edm::WorkerInPath::timesVisited ( ) const
inline

Definition at line 51 of file WorkerInPath.h.

References timesVisited_.

51 { return timesVisited_; }

Member Data Documentation

FilterAction edm::WorkerInPath::filterAction_
private

Definition at line 67 of file WorkerInPath.h.

Referenced by filterAction().

PlaceInPathContext edm::WorkerInPath::placeInPathContext_
private

Definition at line 70 of file WorkerInPath.h.

Referenced by runWorkerAsync(), and setPathContext().

int edm::WorkerInPath::timesExcept_
private

Definition at line 65 of file WorkerInPath.h.

Referenced by checkResultsOfRunWorker(), clearCounters(), and timesExcept().

int edm::WorkerInPath::timesFailed_
private

Definition at line 64 of file WorkerInPath.h.

Referenced by checkResultsOfRunWorker(), clearCounters(), and timesFailed().

int edm::WorkerInPath::timesPassed_
private

Definition at line 63 of file WorkerInPath.h.

Referenced by checkResultsOfRunWorker(), clearCounters(), and timesPassed().

int edm::WorkerInPath::timesVisited_
private

Definition at line 62 of file WorkerInPath.h.

Referenced by clearCounters(), runWorkerAsync(), and timesVisited().

Worker* edm::WorkerInPath::worker_
private

Definition at line 68 of file WorkerInPath.h.

Referenced by checkResultsOfRunWorker(), getWorker(), runWorkerAsync(), and skipWorker().