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 51 of file SecondaryEventProvider.cc.

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

54  : exceptionToActionTable_(new ExceptionToActionTable),
55  // no type resolver for modules in SecondaryEventProvider for now
56  workerManager_(std::make_shared<ActivityRegistry>(), *exceptionToActionTable_, nullptr) {
57  std::vector<std::string> shouldBeUsedLabels;
58  std::set<std::string> unscheduledLabels;
59  const PreallocationConfiguration preallocConfig;
60  for (auto& pset : psets) {
61  std::string label = pset.getParameter<std::string>("@module_label");
63  pset, preg, &preallocConfig, processConfiguration, label, unscheduledLabels, shouldBeUsedLabels);
64  }
65  if (!unscheduledLabels.empty()) {
66  preg.setUnscheduledProducts(unscheduledLabels);
67  }
68  } // 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 70 of file SecondaryEventProvider.cc.

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

71  {
72  ProcessBlockHelper dummyProcessBlockHelper;
73  workerManager_.beginJob(iRegistry, iIndices, dummyProcessBlockHelper);
74  }
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 89 of file SecondaryEventProvider.cc.

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

92  {
93  LumiTransitionInfo info(lumi, setup);
94  processOneOccurrence<OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalBegin>>(
96  processOneOccurrence<OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamBegin>>(
97  workerManager_, info, sContext.streamID(), &sContext, mcc);
98  }
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 78 of file SecondaryEventProvider.cc.

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

81  {
82  RunTransitionInfo info(run, setup);
83  processOneOccurrence<OccurrenceTraits<RunPrincipal, BranchActionGlobalBegin>>(
85  processOneOccurrence<OccurrenceTraits<RunPrincipal, BranchActionStreamBegin>>(
86  workerManager_, info, sContext.streamID(), &sContext, mcc);
87  }
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 158 of file SecondaryEventProvider.cc.

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

158  {
159  workerManager_.beginStream(iID, sContext);
160  }
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 111 of file SecondaryEventProvider.cc.

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

114  {
115  LumiTransitionInfo info(lumi, setup);
116  processOneOccurrence<OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamEnd>>(
117  workerManager_, info, sContext.streamID(), &sContext, mcc);
118  processOneOccurrence<OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalEnd>>(
119  workerManager_, info, StreamID::invalidStreamID(), nullptr, mcc);
120  }
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 100 of file SecondaryEventProvider.cc.

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

103  {
104  RunTransitionInfo info(run, setup);
105  processOneOccurrence<OccurrenceTraits<RunPrincipal, BranchActionStreamEnd>>(
106  workerManager_, info, sContext.streamID(), &sContext, mcc);
107  processOneOccurrence<OccurrenceTraits<RunPrincipal, BranchActionGlobalEnd>>(
108  workerManager_, info, StreamID::invalidStreamID(), nullptr, mcc);
109  }
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 162 of file SecondaryEventProvider.cc.

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

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

◆ setupPileUpEvent()

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

Definition at line 122 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().

124  {
126  EventTransitionInfo info(ep, setup);
128 
129  if (workerManager_.unscheduledWorkers().empty()) {
130  return;
131  }
133  //we need the arena to guarantee that the syncWait will return to this thread
134  // and not cause this callstack to possibly be moved to a new thread
135  ParentContext pc(&sContext);
136  std::exception_ptr exceptPtr = tbb::this_task_arena::isolate([&]() {
137  return edm::syncWait([&](edm::WaitingTaskHolder&& iHolder) {
138  for (auto& worker : workerManager_.unscheduledWorkers()) {
139  worker->doWorkAsync<OccurrenceTraits<EventPrincipal, BranchActionStreamBegin>>(
140  iHolder, info, token, sContext.streamID(), pc, &sContext);
141  }
142  });
143  });
144  if (exceptPtr) {
145  try {
146  edm::convertException::wrap([&]() { std::rethrow_exception(exceptPtr); });
147  } catch (cms::Exception& ex) {
148  if (ex.context().empty()) {
149  edm::addContextAndPrintException("Calling SecondaryEventProvider", ex, false);
150  } else {
151  edm::addContextAndPrintException("", ex, false);
152  }
153  throw;
154  }
155  }
156  }
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:89
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