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 >
void runNow (typename T::MyPrincipal &p, EventSetup const &es)
 
 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)
 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, CurrentProcessingContext const *iContext)
 

Private Attributes

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

Detailed Description

Definition at line 16 of file UnscheduledCallProducer.h.

Constructor & Destructor Documentation

edm::UnscheduledCallProducer::UnscheduledCallProducer ( )
inline

Definition at line 18 of file UnscheduledCallProducer.h.

Member Function Documentation

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

Definition at line 19 of file UnscheduledCallProducer.h.

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

19  {
20  assert(0 != aWorker);
21  labelToWorkers_[aWorker->description().moduleLabel()] = aWorker;
22  }
std::map< std::string, Worker * > labelToWorkers_
template<typename T >
void edm::UnscheduledCallProducer::runNow ( typename T::MyPrincipal &  p,
EventSetup const &  es 
)
inline

Definition at line 25 of file UnscheduledCallProducer.h.

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

25  {
26  //do nothing for event since we will run when requested
27  if(!T::isEvent_) {
28  for(std::map<std::string, Worker*>::iterator it = labelToWorkers_.begin(), itEnd=labelToWorkers_.end();
29  it != itEnd;
30  ++it) {
31  CPUTimer timer;
32  try {
33  it->second->doWork<T>(p, es, nullptr, &timer);
34  }
35  catch (cms::Exception & ex) {
36  std::ostringstream ost;
37  if (T::isEvent_) {
38  ost << "Calling event method";
39  }
40  else if (T::begin_ && T::branchType_ == InRun) {
41  ost << "Calling beginRun";
42  }
43  else if (T::begin_ && T::branchType_ == InLumi) {
44  ost << "Calling beginLuminosityBlock";
45  }
46  else if (!T::begin_ && T::branchType_ == InLumi) {
47  ost << "Calling endLuminosityBlock";
48  }
49  else if (!T::begin_ && T::branchType_ == InRun) {
50  ost << "Calling endRun";
51  }
52  else {
53  // It should be impossible to get here ...
54  ost << "Calling unknown function";
55  }
56  ost << " for unscheduled module " << it->second->description().moduleName()
57  << "/'" << it->second->description().moduleLabel() << "'";
58  ex.addContext(ost.str());
59  ost.str("");
60  ost << "Processing " << p.id();
61  ex.addContext(ost.str());
62  throw;
63  }
64  }
65  }
66  }
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,
CurrentProcessingContext const *  iContext 
)
inlineprivatevirtual

Implements edm::UnscheduledHandler.

Definition at line 69 of file UnscheduledCallProducer.h.

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

72  {
73  std::map<std::string, Worker*>::const_iterator itFound =
74  labelToWorkers_.find(moduleLabel);
75  if(itFound != labelToWorkers_.end()) {
76  CPUTimer timer;
77  try {
78  itFound->second->doWork<OccurrenceTraits<EventPrincipal, BranchActionBegin> >(event, eventSetup, iContext, &timer);
79  }
80  catch (cms::Exception & ex) {
81  std::ostringstream ost;
82  ost << "Calling produce method for unscheduled module "
83  << itFound->second->description().moduleName() << "/'"
84  << itFound->second->description().moduleLabel() << "'";
85  ex.addContext(ost.str());
86  throw;
87  }
88  return true;
89  }
90  return false;
91  }
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 92 of file UnscheduledCallProducer.h.

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