CMS 3D CMS Logo

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

#include <SecondaryEventProvider.h>

Public Member Functions

void beginJob (ProductRegistry const &iRegistry, eventsetup::ESRecordsToProductResolverIndices const &)
 
void beginLuminosityBlock (LuminosityBlockPrincipal &lumi, const edm::EventSetupImpl &setup, ModuleCallingContext const *, StreamContext &sContext)
 
void beginRun (RunPrincipal &run, const edm::EventSetupImpl &setup, ModuleCallingContext const *, StreamContext &sContext)
 
void beginStream (edm::StreamID iID, StreamContext &sContext)
 
void endJob ()
 
void endLuminosityBlock (LuminosityBlockPrincipal &lumi, const edm::EventSetupImpl &setup, ModuleCallingContext const *, StreamContext &sContext)
 
void endRun (RunPrincipal &run, const edm::EventSetupImpl &setup, ModuleCallingContext const *, StreamContext &sContext)
 
void endStream (edm::StreamID iID, StreamContext &sContext)
 
 SecondaryEventProvider (std::vector< ParameterSet > &psets, ProductRegistry &pregistry, std::shared_ptr< ProcessConfiguration > processConfiguration)
 
void setupPileUpEvent (EventPrincipal &ep, const EventSetupImpl &setup, StreamContext &sContext)
 

Private Attributes

std::unique_ptr< ExceptionToActionTableexceptionToActionTable_
 
WorkerManager workerManager_
 

Detailed Description

Definition at line 14 of file SecondaryEventProvider.h.

Constructor & Destructor Documentation

◆ SecondaryEventProvider()

edm::SecondaryEventProvider::SecondaryEventProvider ( std::vector< ParameterSet > &  psets,
ProductRegistry pregistry,
std::shared_ptr< ProcessConfiguration processConfiguration 
)

Definition at line 52 of file SecondaryEventProvider.cc.

References edm::WorkerManager::addToUnscheduledWorkers(), label, muonDTDigis_cfi::pset, edm::ProductRegistry::setUnscheduledProducts(), AlCaHLTBitMon_QueryRunRegistry::string, and workerManager_.

55  : exceptionToActionTable_(new ExceptionToActionTable),
56  // no type resolver for modules in SecondaryEventProvider for now
57  workerManager_(std::make_shared<ActivityRegistry>(), *exceptionToActionTable_, nullptr) {
58  std::vector<std::string> shouldBeUsedLabels;
59  std::set<std::string> unscheduledLabels;
60  const PreallocationConfiguration preallocConfig;
61  for (auto& pset : psets) {
62  std::string label = pset.getParameter<std::string>("@module_label");
64  pset, preg, &preallocConfig, processConfiguration, label, unscheduledLabels, shouldBeUsedLabels);
65  }
66  if (!unscheduledLabels.empty()) {
67  preg.setUnscheduledProducts(unscheduledLabels);
68  }
69  } // SecondaryEventProvider::SecondaryEventProvider
std::unique_ptr< ExceptionToActionTable > exceptionToActionTable_
char const * label
void addToUnscheduledWorkers(ParameterSet &pset, ProductRegistry &preg, PreallocationConfiguration const *prealloc, std::shared_ptr< ProcessConfiguration const > processConfiguration, std::string label, std::set< std::string > &unscheduledLabels, std::vector< std::string > &shouldBeUsedLabels)

Member Function Documentation

◆ beginJob()

void edm::SecondaryEventProvider::beginJob ( ProductRegistry const &  iRegistry,
eventsetup::ESRecordsToProductResolverIndices const &  iIndices 
)

Definition at line 71 of file SecondaryEventProvider.cc.

References edm::WorkerManager::beginJob(), and workerManager_.

72  {
73  ProcessBlockHelper dummyProcessBlockHelper;
74  workerManager_.beginJob(iRegistry, iIndices, dummyProcessBlockHelper);
75  }
void beginJob(ProductRegistry const &iRegistry, eventsetup::ESRecordsToProductResolverIndices const &, ProcessBlockHelperBase const &)

◆ beginLuminosityBlock()

void edm::SecondaryEventProvider::beginLuminosityBlock ( LuminosityBlockPrincipal lumi,
const edm::EventSetupImpl setup,
ModuleCallingContext const *  mcc,
StreamContext sContext 
)

Definition at line 90 of file SecondaryEventProvider.cc.

References info(), edm::StreamID::invalidStreamID(), singleTopDQM_cfi::setup, edm::StreamContext::streamID(), and workerManager_.

93  {
94  LumiTransitionInfo info(lumi, setup);
95  processOneOccurrence<OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalBegin>>(
97  processOneOccurrence<OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamBegin>>(
98  workerManager_, info, sContext.streamID(), &sContext, mcc);
99  }
static const TGPicture * info(bool iBackgroundIsBlack)
static StreamID invalidStreamID()
Definition: StreamID.h:45

◆ beginRun()

void edm::SecondaryEventProvider::beginRun ( RunPrincipal run,
const edm::EventSetupImpl setup,
ModuleCallingContext const *  mcc,
StreamContext sContext 
)

Definition at line 79 of file SecondaryEventProvider.cc.

References info(), edm::StreamID::invalidStreamID(), writedatasetfile::run, singleTopDQM_cfi::setup, edm::StreamContext::streamID(), and workerManager_.

82  {
83  RunTransitionInfo info(run, setup);
84  processOneOccurrence<OccurrenceTraits<RunPrincipal, BranchActionGlobalBegin>>(
86  processOneOccurrence<OccurrenceTraits<RunPrincipal, BranchActionStreamBegin>>(
87  workerManager_, info, sContext.streamID(), &sContext, mcc);
88  }
static const TGPicture * info(bool iBackgroundIsBlack)
static StreamID invalidStreamID()
Definition: StreamID.h:45

◆ beginStream()

void edm::SecondaryEventProvider::beginStream ( edm::StreamID  iID,
StreamContext sContext 
)

Definition at line 159 of file SecondaryEventProvider.cc.

References edm::WorkerManager::beginStream(), and workerManager_.

159  {
160  workerManager_.beginStream(iID, sContext);
161  }
void beginStream(StreamID iID, StreamContext &streamContext)

◆ endJob()

void edm::SecondaryEventProvider::endJob ( void  )
inline

◆ endLuminosityBlock()

void edm::SecondaryEventProvider::endLuminosityBlock ( LuminosityBlockPrincipal lumi,
const edm::EventSetupImpl setup,
ModuleCallingContext const *  mcc,
StreamContext sContext 
)

Definition at line 112 of file SecondaryEventProvider.cc.

References info(), edm::StreamID::invalidStreamID(), singleTopDQM_cfi::setup, edm::StreamContext::streamID(), and workerManager_.

115  {
116  LumiTransitionInfo info(lumi, setup);
117  processOneOccurrence<OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamEnd>>(
118  workerManager_, info, sContext.streamID(), &sContext, mcc);
119  processOneOccurrence<OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalEnd>>(
120  workerManager_, info, StreamID::invalidStreamID(), nullptr, mcc);
121  }
static const TGPicture * info(bool iBackgroundIsBlack)
static StreamID invalidStreamID()
Definition: StreamID.h:45

◆ endRun()

void edm::SecondaryEventProvider::endRun ( RunPrincipal run,
const edm::EventSetupImpl setup,
ModuleCallingContext const *  mcc,
StreamContext sContext 
)

Definition at line 101 of file SecondaryEventProvider.cc.

References info(), edm::StreamID::invalidStreamID(), writedatasetfile::run, singleTopDQM_cfi::setup, edm::StreamContext::streamID(), and workerManager_.

104  {
105  RunTransitionInfo info(run, setup);
106  processOneOccurrence<OccurrenceTraits<RunPrincipal, BranchActionStreamEnd>>(
107  workerManager_, info, sContext.streamID(), &sContext, mcc);
108  processOneOccurrence<OccurrenceTraits<RunPrincipal, BranchActionGlobalEnd>>(
109  workerManager_, info, StreamID::invalidStreamID(), nullptr, mcc);
110  }
static const TGPicture * info(bool iBackgroundIsBlack)
static StreamID invalidStreamID()
Definition: StreamID.h:45

◆ endStream()

void edm::SecondaryEventProvider::endStream ( edm::StreamID  iID,
StreamContext sContext 
)

Definition at line 163 of file SecondaryEventProvider.cc.

References edm::WorkerManager::endStream(), and workerManager_.

163  {
164  workerManager_.endStream(iID, sContext);
165  }
void endStream(StreamID iID, StreamContext &streamContext)

◆ setupPileUpEvent()

void edm::SecondaryEventProvider::setupPileUpEvent ( EventPrincipal ep,
const EventSetupImpl setup,
StreamContext sContext 
)

Definition at line 123 of file SecondaryEventProvider.cc.

References edm::addContextAndPrintException(), cms::Exception::context(), SiStripBadComponentsDQMServiceTemplate_cfg::ep, info(), edm::ServiceRegistry::instance(), edm::ServiceRegistry::presentToken(), singleTopDQM_cfi::setup, edm::WorkerManager::setupOnDemandSystem(), edm::WorkerManager::setupResolvers(), edm::StreamContext::streamID(), edm::syncWait(), unpackBuffers-CaloStage2::token, edm::WorkerManager::unscheduledWorkers(), workerManager_, and edm::convertException::wrap().

125  {
127  EventTransitionInfo info(ep, setup);
129 
130  if (workerManager_.unscheduledWorkers().empty()) {
131  return;
132  }
134  //we need the arena to guarantee that the syncWait will return to this thread
135  // and not cause this callstack to possibly be moved to a new thread
136  ParentContext pc(&sContext);
137  std::exception_ptr exceptPtr = tbb::this_task_arena::isolate([&]() {
138  return edm::syncWait([&](edm::WaitingTaskHolder&& iHolder) {
139  for (auto& worker : workerManager_.unscheduledWorkers()) {
140  worker->doWorkAsync<OccurrenceTraits<EventPrincipal, BranchActionStreamBegin>>(
141  iHolder, info, token, sContext.streamID(), pc, &sContext);
142  }
143  });
144  });
145  if (exceptPtr) {
146  try {
147  edm::convertException::wrap([&]() { std::rethrow_exception(exceptPtr); });
148  } catch (cms::Exception& ex) {
149  if (ex.context().empty()) {
150  edm::addContextAndPrintException("Calling SecondaryEventProvider", ex, false);
151  } else {
152  edm::addContextAndPrintException("", ex, false);
153  }
154  throw;
155  }
156  }
157  }
static const TGPicture * info(bool iBackgroundIsBlack)
std::exception_ptr syncWait(F &&iFunc)
void setupOnDemandSystem(EventTransitionInfo const &)
void addContextAndPrintException(char const *context, cms::Exception &ex, bool disablePrint)
AllWorkers const & unscheduledWorkers() const
Definition: WorkerManager.h:81
static ServiceRegistry & instance()
void setupResolvers(Principal &principal)
auto wrap(F iFunc) -> decltype(iFunc())
std::list< std::string > const & context() const
Definition: Exception.cc:151
ServiceToken presentToken() const

Member Data Documentation

◆ exceptionToActionTable_

std::unique_ptr<ExceptionToActionTable> edm::SecondaryEventProvider::exceptionToActionTable_
private

Definition at line 47 of file SecondaryEventProvider.h.

◆ workerManager_

WorkerManager edm::SecondaryEventProvider::workerManager_
private