test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
edm::UnscheduledCallProducer Class Reference

#include <UnscheduledCallProducer.h>

Inheritance diagram for edm::UnscheduledCallProducer:
edm::UnscheduledHandler

Classes

class  WorkerLookup
 

Public Member Functions

void addWorker (Worker *aWorker)
 
template<typename T , typename U >
void runNow (typename T::MyPrincipal &p, EventSetup const &es, StreamID streamID, typename T::Context const *topContext, U const *context) const
 
 UnscheduledCallProducer ()
 
- Public Member Functions inherited from edm::UnscheduledHandler
UnscheduledHandleroperator= (UnscheduledHandler const &)=delete
 
void setEventSetup (EventSetup const &iSetup)
 
bool tryToFill (std::string const &label, EventPrincipal const &iEvent, ModuleCallingContext const *mcc) const
 returns true if found an EDProducer and ran it More...
 
 UnscheduledHandler ()
 
 UnscheduledHandler (UnscheduledHandler const &)=delete
 
virtual ~UnscheduledHandler ()
 

Private Member Functions

virtual bool tryToFillImpl (std::string const &moduleLabel, EventPrincipal const &event, EventSetup const &eventSetup, ModuleCallingContext const *mcc) const override
 

Private Attributes

WorkerLookup workerLookup_
 

Detailed Description

Definition at line 21 of file UnscheduledCallProducer.h.

Constructor & Destructor Documentation

edm::UnscheduledCallProducer::UnscheduledCallProducer ( )
inline

Member Function Documentation

void edm::UnscheduledCallProducer::addWorker ( Worker aWorker)
inline

Definition at line 60 of file UnscheduledCallProducer.h.

References edm::UnscheduledCallProducer::WorkerLookup::add(), assert(), and workerLookup_.

60  {
61  assert(0 != aWorker);
62  workerLookup_.add(aWorker);
63  }
assert(m_qm.get())
template<typename T , typename U >
void edm::UnscheduledCallProducer::runNow ( typename T::MyPrincipal &  p,
EventSetup const &  es,
StreamID  streamID,
typename T::Context const *  topContext,
U const *  context 
) const
inline

Definition at line 66 of file UnscheduledCallProducer.h.

References cms::Exception::addContext(), edm::InLumi, edm::InRun, AlCaHLTBitMon_ParallelJobs::p, and workerLookup_.

67  {
68  //do nothing for event since we will run when requested
69  if(!T::isEvent_) {
70  for(auto worker: workerLookup_) {
71  try {
72  ParentContext parentContext(context);
73  worker->doWork<T>(p, es, streamID, parentContext, topContext);
74  }
75  catch (cms::Exception & ex) {
76  std::ostringstream ost;
77  if (T::isEvent_) {
78  ost << "Calling event method";
79  }
80  else if (T::begin_ && T::branchType_ == InRun) {
81  ost << "Calling beginRun";
82  }
83  else if (T::begin_ && T::branchType_ == InLumi) {
84  ost << "Calling beginLuminosityBlock";
85  }
86  else if (!T::begin_ && T::branchType_ == InLumi) {
87  ost << "Calling endLuminosityBlock";
88  }
89  else if (!T::begin_ && T::branchType_ == InRun) {
90  ost << "Calling endRun";
91  }
92  else {
93  // It should be impossible to get here ...
94  ost << "Calling unknown function";
95  }
96  ost << " for unscheduled module " << worker->description().moduleName()
97  << "/'" << worker->description().moduleLabel() << "'";
98  ex.addContext(ost.str());
99  ost.str("");
100  ost << "Processing " << p.id();
101  ex.addContext(ost.str());
102  throw;
103  }
104  }
105  }
106  }
void addContext(std::string const &context)
Definition: Exception.cc:227
long double T
virtual bool edm::UnscheduledCallProducer::tryToFillImpl ( std::string const &  moduleLabel,
EventPrincipal const &  event,
EventSetup const &  eventSetup,
ModuleCallingContext const *  mcc 
) const
inlineoverrideprivatevirtual

Implements edm::UnscheduledHandler.

Definition at line 109 of file UnscheduledCallProducer.h.

References cms::Exception::addContext(), event(), edm::UnscheduledCallProducer::WorkerLookup::find(), edm::ModuleCallingContext::getStreamContext(), and workerLookup_.

112  {
113  auto worker =
114  workerLookup_.find(moduleLabel);
115  if(worker != nullptr) {
116  try {
117  ParentContext parentContext(mcc);
118  worker->doWork<OccurrenceTraits<EventPrincipal, BranchActionStreamBegin> >(event,
119  eventSetup, event.streamID(), parentContext, mcc->getStreamContext());
120  }
121  catch (cms::Exception & ex) {
122  std::ostringstream ost;
123  ost << "Calling produce method for unscheduled module "
124  << worker->description().moduleName() << "/'"
125  << worker->description().moduleLabel() << "'";
126  ex.addContext(ost.str());
127  throw;
128  }
129  return true;
130  }
131  return false;
132  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void addContext(std::string const &context)
Definition: Exception.cc:227
Worker * find(std::string const &iLabel) const

Member Data Documentation

WorkerLookup edm::UnscheduledCallProducer::workerLookup_
private

Definition at line 133 of file UnscheduledCallProducer.h.

Referenced by addWorker(), runNow(), and tryToFillImpl().