CMS 3D CMS Logo

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

#include <UnscheduledCallProducer.h>

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

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)
 
 UnscheduledCallProducer ()
 
- Public Member Functions inherited from edm::UnscheduledHandler
UnscheduledHandleroperator= (UnscheduledHandler const &)=delete
 
void setEventSetup (EventSetup const &iSetup)
 
bool tryToFill (std::string const &label, EventPrincipal &iEvent, ModuleCallingContext const *mcc)
 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 &event, EventSetup const &eventSetup, ModuleCallingContext const *mcc)
 

Private Attributes

std::map< std::string, Worker * > labelToWorkers_
 

Detailed Description

Definition at line 20 of file UnscheduledCallProducer.h.

Constructor & Destructor Documentation

edm::UnscheduledCallProducer::UnscheduledCallProducer ( )
inline

Definition at line 22 of file UnscheduledCallProducer.h.

Member Function Documentation

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

Definition at line 23 of file UnscheduledCallProducer.h.

References edm::Worker::description(), labelToWorkers_, and edm::ModuleDescription::moduleLabel().

23  {
24  assert(0 != aWorker);
25  labelToWorkers_[aWorker->description().moduleLabel()] = aWorker;
26  }
std::map< std::string, Worker * > labelToWorkers_
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 
)
inline

Definition at line 29 of file UnscheduledCallProducer.h.

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

30  {
31  //do nothing for event since we will run when requested
32  if(!T::isEvent_) {
33  for(std::map<std::string, Worker*>::iterator it = labelToWorkers_.begin(), itEnd=labelToWorkers_.end();
34  it != itEnd;
35  ++it) {
36  try {
37  ParentContext parentContext(context);
38  it->second->doWork<T>(p, es, streamID, parentContext, topContext);
39  }
40  catch (cms::Exception & ex) {
41  std::ostringstream ost;
42  if (T::isEvent_) {
43  ost << "Calling event method";
44  }
45  else if (T::begin_ && T::branchType_ == InRun) {
46  ost << "Calling beginRun";
47  }
48  else if (T::begin_ && T::branchType_ == InLumi) {
49  ost << "Calling beginLuminosityBlock";
50  }
51  else if (!T::begin_ && T::branchType_ == InLumi) {
52  ost << "Calling endLuminosityBlock";
53  }
54  else if (!T::begin_ && T::branchType_ == InRun) {
55  ost << "Calling endRun";
56  }
57  else {
58  // It should be impossible to get here ...
59  ost << "Calling unknown function";
60  }
61  ost << " for unscheduled module " << it->second->description().moduleName()
62  << "/'" << it->second->description().moduleLabel() << "'";
63  ex.addContext(ost.str());
64  ost.str("");
65  ost << "Processing " << p.id();
66  ex.addContext(ost.str());
67  throw;
68  }
69  }
70  }
71  }
void addContext(std::string const &context)
Definition: Exception.cc:227
long double T
std::map< std::string, Worker * > labelToWorkers_
virtual bool edm::UnscheduledCallProducer::tryToFillImpl ( std::string const &  moduleLabel,
EventPrincipal event,
EventSetup const &  eventSetup,
ModuleCallingContext const *  mcc 
)
inlineprivatevirtual

Implements edm::UnscheduledHandler.

Definition at line 74 of file UnscheduledCallProducer.h.

References cms::Exception::addContext(), event(), edm::ModuleCallingContext::getStreamContext(), and labelToWorkers_.

77  {
78  std::map<std::string, Worker*>::const_iterator itFound =
79  labelToWorkers_.find(moduleLabel);
80  if(itFound != labelToWorkers_.end()) {
81  try {
82  ParentContext parentContext(mcc);
83  itFound->second->doWork<OccurrenceTraits<EventPrincipal, BranchActionStreamBegin> >(event,
84  eventSetup, event.streamID(), parentContext, mcc->getStreamContext());
85  }
86  catch (cms::Exception & ex) {
87  std::ostringstream ost;
88  ost << "Calling produce method for unscheduled module "
89  << itFound->second->description().moduleName() << "/'"
90  << itFound->second->description().moduleLabel() << "'";
91  ex.addContext(ost.str());
92  throw;
93  }
94  return true;
95  }
96  return false;
97  }
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
std::map< std::string, Worker * > labelToWorkers_

Member Data Documentation

std::map<std::string, Worker*> edm::UnscheduledCallProducer::labelToWorkers_
private

Definition at line 98 of file UnscheduledCallProducer.h.

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