CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
edm::EDLooperBase Class Referenceabstract

#include <EDLooperBase.h>

Inheritance diagram for edm::EDLooperBase:
edm::EDConsumerBase edm::EDLooper edm::NavigateEventsLooper FWFFLooper EcalEleCalibLooper edm::ESProducerLooper edm::IterateNTimesLooper InvRingCalib MuScleFit __class__< T > AlignmentProducer Pi0FixedMassWindowCalibration ZeeCalibration

Public Types

enum  Status { kContinue, kStop }
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

virtual void attachTo (ActivityRegistry &)
 Override this method if you need to monitor the state of the processing. More...
 
virtual void beginOfJob ()
 
virtual void beginOfJob (EventSetup const &)
 
void beginOfJob (EventSetupImpl const &)
 
void copyInfo (ScheduleInfo const &)
 
void doBeginLuminosityBlock (LuminosityBlockPrincipal &, EventSetupImpl const &, ProcessContext *)
 
void doBeginRun (RunPrincipal &, EventSetupImpl const &, ProcessContext *)
 
Status doDuringLoop (EventPrincipal &eventPrincipal, EventSetupImpl const &es, ProcessingController &, StreamContext *)
 
void doEndLuminosityBlock (LuminosityBlockPrincipal &, EventSetupImpl const &, ProcessContext *)
 
Status doEndOfLoop (EventSetupImpl const &es)
 
void doEndRun (RunPrincipal &, EventSetupImpl const &, ProcessContext *)
 
void doStartingNewLoop ()
 
 EDLooperBase ()
 
 EDLooperBase (EDLooperBase const &)=delete
 
virtual void endOfJob ()
 
void esPrefetchAsync (WaitingTaskHolder iTask, EventSetupImpl const &iImpl, Transition iTrans, ServiceToken const &iToken) const
 
virtual std::set< eventsetup::EventSetupRecordKeymodifyingRecords () const
 
EDLooperBaseoperator= (EDLooperBase const &)=delete
 
void prefetchAsync (WaitingTaskHolder iTask, ServiceToken const &token, Transition iTrans, Principal const &iPrincipal, EventSetupImpl const &iImpl) const
 
void prepareForNextLoop (eventsetup::EventSetupProvider *esp)
 
void setActionTable (ExceptionToActionTable const *actionTable)
 
void setModuleChanger (ModuleChanger *)
 
 ~EDLooperBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

ModuleChangermoduleChanger ()
 This only returns a non-zero value during the call to endOfLoop. More...
 
ScheduleInfo const * scheduleInfo () const
 This returns a non-zero value after the constructor has been called. More...
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Private Member Functions

virtual void beginLuminosityBlock (LuminosityBlock const &, EventSetup const &)
 Called after all event modules have processed the begin of a LuminosityBlock. More...
 
virtual void beginRun (Run const &, EventSetup const &)
 Called after all event modules have processed the begin of a Run. More...
 
virtual Status duringLoop (Event const &, EventSetup const &, ProcessingController &)=0
 
void edPrefetchAsync (WaitingTaskHolder iTask, ServiceToken const &token, Principal const &iPrincipal) const
 
virtual void endLuminosityBlock (LuminosityBlock const &, EventSetup const &)
 Called after all event modules have processed the end of a LuminosityBlock. More...
 
virtual Status endOfLoop (EventSetup const &, unsigned int iCounter)=0
 
virtual void endRun (Run const &, EventSetup const &)
 Called after all event modules have processed the end of a Run. More...
 
virtual void startingNewLoop (unsigned int)=0
 

Private Attributes

ExceptionToActionTable const * act_table_
 
unsigned int iCounter_
 
ModuleCallingContext moduleCallingContext_
 
edm::propagate_const< ModuleChanger * > moduleChanger_
 
ModuleDescription moduleDescription_
 
edm::propagate_const< std::unique_ptr< ScheduleInfo > > scheduleInfo_
 

Detailed Description

Definition at line 80 of file EDLooperBase.h.

Member Enumeration Documentation

◆ Status

Enumerator
kContinue 
kStop 

Definition at line 82 of file EDLooperBase.h.

82 { kContinue, kStop };

Constructor & Destructor Documentation

◆ EDLooperBase() [1/2]

EDLooperBase::EDLooperBase ( )

Definition at line 39 of file EDLooperBase.cc.

40  : iCounter_(0),
41  act_table_(nullptr),
42  moduleChanger_(nullptr),
43  moduleDescription_("Looper", "looper"),

◆ ~EDLooperBase()

EDLooperBase::~EDLooperBase ( )
overridenoexcept

Definition at line 45 of file EDLooperBase.cc.

45 {}

◆ EDLooperBase() [2/2]

edm::EDLooperBase::EDLooperBase ( EDLooperBase const &  )
delete

Member Function Documentation

◆ attachTo()

void EDLooperBase::attachTo ( ActivityRegistry )
virtual

Override this method if you need to monitor the state of the processing.

Reimplemented in FWFFLooper.

Definition at line 190 of file EDLooperBase.cc.

190 {}

◆ beginLuminosityBlock()

void EDLooperBase::beginLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &   
)
privatevirtual

Called after all event modules have processed the begin of a LuminosityBlock.

Reimplemented in AlignmentProducer.

Definition at line 187 of file EDLooperBase.cc.

187 {}

Referenced by doBeginLuminosityBlock().

◆ beginOfJob() [1/3]

void EDLooperBase::beginOfJob ( )
virtual

Reimplemented in ZeeCalibration, Pi0FixedMassWindowCalibration, __class__< T >, EcalEleCalibLooper, and InvRingCalib.

Definition at line 105 of file EDLooperBase.cc.

105 {}

Referenced by beginOfJob().

◆ beginOfJob() [2/3]

void EDLooperBase::beginOfJob ( EventSetup const &  )
virtual

Reimplemented in AlignmentProducer.

Definition at line 104 of file EDLooperBase.cc.

104 { beginOfJob(); }

References beginOfJob().

◆ beginOfJob() [3/3]

void EDLooperBase::beginOfJob ( EventSetupImpl const &  iImpl)

Definition at line 96 of file EDLooperBase.cc.

96  {
97  ESParentContext parentC(&moduleCallingContext_);
98  beginOfJob(EventSetup{iImpl,
99  static_cast<unsigned int>(Transition::BeginRun),
101  parentC,
102  false});
103  }

References beginOfJob(), edm::BeginRun, edm::EDConsumerBase::esGetTokenIndices(), and moduleCallingContext_.

◆ beginRun()

void EDLooperBase::beginRun ( Run const &  ,
EventSetup const &   
)
privatevirtual

Called after all event modules have processed the begin of a Run.

Reimplemented in FWFFLooper, and AlignmentProducer.

Definition at line 185 of file EDLooperBase.cc.

185 {}

Referenced by doBeginRun().

◆ copyInfo()

void EDLooperBase::copyInfo ( ScheduleInfo const &  iInfo)

Definition at line 294 of file EDLooperBase.cc.

294 { scheduleInfo_ = std::make_unique<ScheduleInfo>(iInfo); }

References scheduleInfo_.

◆ doBeginLuminosityBlock()

void EDLooperBase::doBeginLuminosityBlock ( LuminosityBlockPrincipal iLB,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 142 of file EDLooperBase.cc.

144  {
145  GlobalContext globalContext(GlobalContext::Transition::kBeginLuminosityBlock,
146  iLB.id(),
147  iLB.runPrincipal().index(),
148  iLB.index(),
149  iLB.beginTime(),
150  processContext);
151  ParentContext parentContext(&globalContext);
152  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
153  LuminosityBlock luminosityBlock(iLB, moduleDescription_, &moduleCallingContext_, false);
154  luminosityBlock.setConsumer(this);
155  ESParentContext parentC(&moduleCallingContext_);
156  const EventSetup es{iES,
157  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
159  parentC,
160  false};
161  beginLuminosityBlock(luminosityBlock, es);
162  }

References edm::BeginLuminosityBlock, beginLuminosityBlock(), edm::LuminosityBlockPrincipal::beginTime(), edm::EDConsumerBase::esGetTokenIndices(), edm::LuminosityBlockPrincipal::id(), edm::LuminosityBlockPrincipal::index(), edm::RunPrincipal::index(), edm::GlobalContext::kBeginLuminosityBlock, moduleCallingContext_, moduleDescription_, edm::LuminosityBlockPrincipal::runPrincipal(), and edm::LuminosityBlock::setConsumer().

◆ doBeginRun()

void EDLooperBase::doBeginRun ( RunPrincipal iRP,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 109 of file EDLooperBase.cc.

109  {
110  GlobalContext globalContext(GlobalContext::Transition::kBeginRun,
111  LuminosityBlockID(iRP.run(), 0),
112  iRP.index(),
114  iRP.beginTime(),
115  processContext);
116  ParentContext parentContext(&globalContext);
117  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
119  run.setConsumer(this);
120  ESParentContext parentC(&moduleCallingContext_);
121  const EventSetup es{
122  iES, static_cast<unsigned int>(Transition::BeginRun), esGetTokenIndices(Transition::BeginRun), parentC, false};
123  beginRun(run, es);
124  }

References edm::BeginRun, beginRun(), edm::RunPrincipal::beginTime(), edm::EDConsumerBase::esGetTokenIndices(), edm::RunPrincipal::index(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::GlobalContext::kBeginRun, moduleCallingContext_, moduleDescription_, writedatasetfile::run, and edm::RunPrincipal::run().

◆ doDuringLoop()

EDLooperBase::Status EDLooperBase::doDuringLoop ( edm::EventPrincipal eventPrincipal,
EventSetupImpl const &  es,
edm::ProcessingController ioController,
StreamContext streamContext 
)

Definition at line 49 of file EDLooperBase.cc.

52  {
53  streamContext->setTransition(StreamContext::Transition::kEvent);
54  streamContext->setEventID(eventPrincipal.id());
55  streamContext->setRunIndex(eventPrincipal.luminosityBlockPrincipal().runPrincipal().index());
56  streamContext->setLuminosityBlockIndex(eventPrincipal.luminosityBlockPrincipal().index());
57  streamContext->setTimestamp(eventPrincipal.time());
58  ParentContext parentContext(streamContext);
59  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
61  event.setConsumer(this);
62 
64  try {
65  ESParentContext parentC(&moduleCallingContext_);
66  const EventSetup es{
67  esi, static_cast<unsigned int>(Transition::Event), esGetTokenIndices(Transition::Event), parentC, false};
68  status = duringLoop(event, es, ioController);
69  } catch (cms::Exception& e) {
70  e.addContext("Calling the 'duringLoop' method of a looper");
73  edm::printCmsExceptionWarning("SkipEvent", e);
74  } else {
75  throw;
76  }
77  }
78  return status;
79  }

References act_table_, writedatasetfile::action, duringLoop(), MillePedeFileConverter_cfg::e, edm::EDConsumerBase::esGetTokenIndices(), edm::Event, edmPickEvents::event, edm::ExceptionToActionTable::find(), edm::EventPrincipal::id(), edm::LuminosityBlockPrincipal::index(), edm::RunPrincipal::index(), kContinue, edm::StreamContext::kEvent, edm::EventPrincipal::luminosityBlockPrincipal(), moduleCallingContext_, moduleDescription_, edm::printCmsExceptionWarning(), edm::exception_actions::Rethrow, edm::LuminosityBlockPrincipal::runPrincipal(), edm::StreamContext::setEventID(), edm::StreamContext::setLuminosityBlockIndex(), edm::StreamContext::setRunIndex(), edm::StreamContext::setTimestamp(), edm::StreamContext::setTransition(), mps_update::status, and edm::EventPrincipal::time().

◆ doEndLuminosityBlock()

void EDLooperBase::doEndLuminosityBlock ( LuminosityBlockPrincipal iLB,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 163 of file EDLooperBase.cc.

165  {
166  GlobalContext globalContext(GlobalContext::Transition::kEndLuminosityBlock,
167  iLB.id(),
168  iLB.runPrincipal().index(),
169  iLB.index(),
170  iLB.beginTime(),
171  processContext);
172  ParentContext parentContext(&globalContext);
173  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
174  LuminosityBlock luminosityBlock(iLB, moduleDescription_, &moduleCallingContext_, true);
175  luminosityBlock.setConsumer(this);
176  ESParentContext parentC(&moduleCallingContext_);
177  const EventSetup es{iES,
178  static_cast<unsigned int>(Transition::EndLuminosityBlock),
180  parentC,
181  false};
182  endLuminosityBlock(luminosityBlock, es);
183  }

References edm::LuminosityBlockPrincipal::beginTime(), edm::EndLuminosityBlock, endLuminosityBlock(), edm::EDConsumerBase::esGetTokenIndices(), edm::LuminosityBlockPrincipal::id(), edm::LuminosityBlockPrincipal::index(), edm::RunPrincipal::index(), edm::GlobalContext::kEndLuminosityBlock, moduleCallingContext_, moduleDescription_, edm::LuminosityBlockPrincipal::runPrincipal(), and edm::LuminosityBlock::setConsumer().

◆ doEndOfLoop()

EDLooperBase::Status EDLooperBase::doEndOfLoop ( EventSetupImpl const &  es)

Definition at line 81 of file EDLooperBase.cc.

81  {
82  ESParentContext parentC(&moduleCallingContext_);
83  const EventSetup es{
84  esi, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC, false};
85  return endOfLoop(es, iCounter_);
86  }

References endOfLoop(), edm::EndRun, edm::EDConsumerBase::esGetTokenIndices(), iCounter_, and moduleCallingContext_.

◆ doEndRun()

void EDLooperBase::doEndRun ( RunPrincipal iRP,
EventSetupImpl const &  iES,
ProcessContext processContext 
)

Definition at line 126 of file EDLooperBase.cc.

126  {
127  GlobalContext globalContext(GlobalContext::Transition::kEndRun,
128  LuminosityBlockID(iRP.run(), 0),
129  iRP.index(),
131  iRP.endTime(),
132  processContext);
133  ParentContext parentContext(&globalContext);
134  ModuleContextSentry moduleContextSentry(&moduleCallingContext_, parentContext);
136  run.setConsumer(this);
137  ESParentContext parentC(&moduleCallingContext_);
138  const EventSetup es{
139  iES, static_cast<unsigned int>(Transition::EndRun), esGetTokenIndices(Transition::EndRun), parentC, false};
140  endRun(run, es);
141  }

References edm::EndRun, endRun(), edm::RunPrincipal::endTime(), edm::EDConsumerBase::esGetTokenIndices(), edm::RunPrincipal::index(), edm::LuminosityBlockIndex::invalidLuminosityBlockIndex(), edm::GlobalContext::kEndRun, moduleCallingContext_, moduleDescription_, writedatasetfile::run, and edm::RunPrincipal::run().

◆ doStartingNewLoop()

void EDLooperBase::doStartingNewLoop ( )

Definition at line 47 of file EDLooperBase.cc.

References iCounter_, and startingNewLoop().

◆ duringLoop()

virtual Status edm::EDLooperBase::duringLoop ( Event const &  ,
EventSetup const &  ,
ProcessingController  
)
privatepure virtual

Called after all event modules have had a chance to process the Event.

Implemented in edm::NavigateEventsLooper, edm::EDLooper, and FWFFLooper.

Referenced by doDuringLoop().

◆ edPrefetchAsync()

void EDLooperBase::edPrefetchAsync ( WaitingTaskHolder  iTask,
ServiceToken const &  token,
Principal const &  iPrincipal 
) const
private

Definition at line 201 of file EDLooperBase.cc.

203  {
204  //Based on Worker edPrefetchAsync
205 
206  // Prefetch products the module declares it consumes
207  std::vector<ProductResolverIndexAndSkipBit> const& items = itemsToGetFrom(iPrincipal.branchType());
208 
209  for (auto const& item : items) {
210  ProductResolverIndex productResolverIndex = item.productResolverIndex();
211  bool skipCurrentProcess = item.skipCurrentProcess();
212  if (productResolverIndex != ProductResolverIndexAmbiguous) {
213  iPrincipal.prefetchAsync(iTask, productResolverIndex, skipCurrentProcess, token, &moduleCallingContext_);
214  }
215  }
216  }

References edm::Principal::branchType(), B2GTnPMonitor_cfi::item, mps_monitormerge::items, edm::EDConsumerBase::itemsToGetFrom(), moduleCallingContext_, edm::Principal::prefetchAsync(), edm::ProductResolverIndexAmbiguous, and unpackBuffers-CaloStage2::token.

Referenced by prefetchAsync().

◆ endLuminosityBlock()

void EDLooperBase::endLuminosityBlock ( LuminosityBlock const &  ,
EventSetup const &   
)
privatevirtual

Called after all event modules have processed the end of a LuminosityBlock.

Reimplemented in AlignmentProducer.

Definition at line 188 of file EDLooperBase.cc.

188 {}

Referenced by doEndLuminosityBlock().

◆ endOfJob()

void EDLooperBase::endOfJob ( )
virtual

◆ endOfLoop()

virtual Status edm::EDLooperBase::endOfLoop ( EventSetup const &  ,
unsigned int  iCounter 
)
privatepure virtual

Called after the system has finished one loop over the events. Thar argument is a count of how many loops have been processed before this loo. For the first time through the events the argument will be 0.

Implemented in edm::NavigateEventsLooper, edm::IterateNTimesLooper, MuScleFit, FWFFLooper, ZeeCalibration, Pi0FixedMassWindowCalibration, AlignmentProducer, EcalEleCalibLooper, and InvRingCalib.

Referenced by doEndOfLoop().

◆ endRun()

void EDLooperBase::endRun ( Run const &  ,
EventSetup const &   
)
privatevirtual

Called after all event modules have processed the end of a Run.

Reimplemented in AlignmentProducer.

Definition at line 186 of file EDLooperBase.cc.

186 {}

Referenced by doEndRun().

◆ esPrefetchAsync()

void EDLooperBase::esPrefetchAsync ( WaitingTaskHolder  iTask,
EventSetupImpl const &  iImpl,
Transition  iTrans,
ServiceToken const &  iToken 
) const

Definition at line 218 of file EDLooperBase.cc.

221  {
222  //Based on Worker::esPrefetchAsync
224  return;
225  }
226  auto const& recs = esGetTokenRecordIndicesVector(iTrans);
227  auto const& items = esGetTokenIndicesVector(iTrans);
228 
229  assert(items.size() == recs.size());
230  if (items.empty()) {
231  return;
232  }
233 
234  //Thread case of 1 thread special. The master thread is doing a wait_for_all on the
235  // default tbb arena. It will not process any tasks on the es arena. We need to add a
236  // task that will synchronously do a wait_for_all in the es arena to be sure prefetching
237  // will work.
238 
239  if UNLIKELY (tbb::global_control::active_value(tbb::global_control::max_allowed_parallelism) == 1) {
240  auto taskGroup = iTask.group();
241  ServiceWeakToken weakToken = iToken;
242  taskGroup->run([this, task = std::move(iTask), iTrans, &iImpl, weakToken]() {
243  std::exception_ptr exceptPtr{};
244  iImpl.taskArena()->execute([this, iTrans, &iImpl, weakToken, &exceptPtr]() {
245  exceptPtr = syncWait([&](WaitingTaskHolder&& iHolder) {
246  auto const& recs = esGetTokenRecordIndicesVector(iTrans);
247  auto const& items = esGetTokenIndicesVector(iTrans);
248  auto hWaitTask = std::move(iHolder);
249  auto token = weakToken.lock();
250  for (size_t i = 0; i != items.size(); ++i) {
251  if (recs[i] != ESRecordIndex{}) {
252  auto rec = iImpl.findImpl(recs[i]);
253  if (rec) {
254  rec->prefetchAsync(hWaitTask, items[i], &iImpl, token, ESParentContext(&moduleCallingContext_));
255  }
256  }
257  }
258  }); //syncWait
259  }); //esTaskArena().execute
260  //note use of a copy gets around declaring the lambda as mutable
261  auto tempTask = task;
262  tempTask.doneWaiting(exceptPtr);
263  }); //group.run
264  } else {
265  auto group = iTask.group();
266  //We need iTask to run in the default arena since it is not an ES task
267  auto task = make_waiting_task(
268  [holder = WaitingTaskWithArenaHolder(std::move(iTask))](std::exception_ptr const* iExcept) mutable {
269  if (iExcept) {
270  holder.doneWaiting(*iExcept);
271  } else {
272  holder.doneWaiting(std::exception_ptr{});
273  }
274  });
275 
276  WaitingTaskHolder tempH(*group, task);
277  iImpl.taskArena()->execute([&]() {
278  for (size_t i = 0; i != items.size(); ++i) {
279  if (recs[i] != ESRecordIndex{}) {
280  auto rec = iImpl.findImpl(recs[i]);
281  if (rec) {
282  rec->prefetchAsync(tempH, items[i], &iImpl, iToken, ESParentContext(&moduleCallingContext_));
283  }
284  }
285  }
286  });
287  }
288  }

References cms::cuda::assert(), edm::EDConsumerBase::esGetTokenIndicesVector(), edm::EDConsumerBase::esGetTokenRecordIndicesVector(), edm::EventSetupImpl::findImpl(), edm::WaitingTaskHolder::group(), watchdog::group, mps_fire::i, mps_monitormerge::items, edm::ServiceWeakToken::lock(), edm::make_waiting_task(), moduleCallingContext_, eostools::move(), edm::NumberOfEventSetupTransitions, edm::eventsetup::EventSetupRecordImpl::prefetchAsync(), edm::syncWait(), TrackValidation_cff::task, edm::EventSetupImpl::taskArena(), unpackBuffers-CaloStage2::token, and UNLIKELY.

Referenced by prefetchAsync().

◆ modifyingRecords()

std::set< eventsetup::EventSetupRecordKey > EDLooperBase::modifyingRecords ( ) const
virtual

Reimplemented in edm::ESProducerLooper.

Definition at line 290 of file EDLooperBase.cc.

290  {
291  return std::set<eventsetup::EventSetupRecordKey>();
292  }

Referenced by prepareForNextLoop().

◆ moduleChanger()

ModuleChanger * EDLooperBase::moduleChanger ( )
protected

This only returns a non-zero value during the call to endOfLoop.

Definition at line 297 of file EDLooperBase.cc.

297 { return moduleChanger_; }

References moduleChanger_.

Referenced by FWFFLooper::endOfLoop().

◆ operator=()

EDLooperBase& edm::EDLooperBase::operator= ( EDLooperBase const &  )
delete

◆ prefetchAsync()

void EDLooperBase::prefetchAsync ( WaitingTaskHolder  iTask,
ServiceToken const &  token,
Transition  iTrans,
Principal const &  iPrincipal,
EventSetupImpl const &  iImpl 
) const

Definition at line 192 of file EDLooperBase.cc.

196  {
197  esPrefetchAsync(iTask, iImpl, iTrans, token);
198  edPrefetchAsync(std::move(iTask), token, iPrincipal);
199  }

References edPrefetchAsync(), esPrefetchAsync(), eostools::move(), and unpackBuffers-CaloStage2::token.

◆ prepareForNextLoop()

void EDLooperBase::prepareForNextLoop ( eventsetup::EventSetupProvider esp)

Definition at line 88 of file EDLooperBase.cc.

88  {
89  ++iCounter_;
90 
91  std::set<edm::eventsetup::EventSetupRecordKey> const& keys = modifyingRecords();
92  for_all(keys,
93  std::bind(&eventsetup::EventSetupProvider::resetRecordPlusDependentRecords, esp, std::placeholders::_1));
94  }

References edm::for_all(), iCounter_, relativeConstraints::keys, modifyingRecords(), and edm::eventsetup::EventSetupProvider::resetRecordPlusDependentRecords().

◆ scheduleInfo()

const ScheduleInfo * EDLooperBase::scheduleInfo ( ) const
protected

This returns a non-zero value after the constructor has been called.

Definition at line 298 of file EDLooperBase.cc.

298 { return scheduleInfo_.get(); }

References scheduleInfo_.

Referenced by FWFFLooper::startingNewLoop().

◆ setActionTable()

void edm::EDLooperBase::setActionTable ( ExceptionToActionTable const *  actionTable)
inline

Definition at line 120 of file EDLooperBase.h.

120 { act_table_ = actionTable; }

References act_table_.

◆ setModuleChanger()

void EDLooperBase::setModuleChanger ( ModuleChanger iChanger)

Definition at line 295 of file EDLooperBase.cc.

295 { moduleChanger_ = iChanger; }

References moduleChanger_.

◆ startingNewLoop()

virtual void edm::EDLooperBase::startingNewLoop ( unsigned int  )
privatepure virtual

Called before system starts to loop over the events. The argument is a count of how many loops have been processed. For the first time through the events the argument will be 0.

Implemented in FWFFLooper, __class__< T >, EcalEleCalibLooper, InvRingCalib, edm::IterateNTimesLooper, MuScleFit, ZeeCalibration, Pi0FixedMassWindowCalibration, AlignmentProducer, and edm::NavigateEventsLooper.

Referenced by doStartingNewLoop().

Member Data Documentation

◆ act_table_

ExceptionToActionTable const* edm::EDLooperBase::act_table_
private

Definition at line 165 of file EDLooperBase.h.

Referenced by doDuringLoop(), and setActionTable().

◆ iCounter_

unsigned int edm::EDLooperBase::iCounter_
private

Definition at line 164 of file EDLooperBase.h.

Referenced by doEndOfLoop(), doStartingNewLoop(), and prepareForNextLoop().

◆ moduleCallingContext_

ModuleCallingContext edm::EDLooperBase::moduleCallingContext_
private

◆ moduleChanger_

edm::propagate_const<ModuleChanger*> edm::EDLooperBase::moduleChanger_
private

Definition at line 168 of file EDLooperBase.h.

Referenced by moduleChanger(), and setModuleChanger().

◆ moduleDescription_

ModuleDescription edm::EDLooperBase::moduleDescription_
private

◆ scheduleInfo_

edm::propagate_const<std::unique_ptr<ScheduleInfo> > edm::EDLooperBase::scheduleInfo_
private

Definition at line 167 of file EDLooperBase.h.

Referenced by copyInfo(), and scheduleInfo().

edm::EDLooperBase::Status
Status
Definition: EDLooperBase.h:82
edm::LuminosityBlockPrincipal::runPrincipal
RunPrincipal const & runPrincipal() const
Definition: LuminosityBlockPrincipal.h:45
edm::ProductResolverIndex
unsigned int ProductResolverIndex
Definition: ProductResolverIndex.h:8
mps_fire.i
i
Definition: mps_fire.py:428
edm::EventPrincipal::luminosityBlockPrincipal
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
Definition: EventPrincipal.h:85
edm::exception_actions::Rethrow
Definition: ExceptionActions.h:11
mps_update.status
status
Definition: mps_update.py:68
edm::Transition::Event
edm::printCmsExceptionWarning
void printCmsExceptionWarning(char const *behavior, cms::Exception const &e)
Definition: ExceptionMessages.cc:25
cms::cuda::assert
assert(be >=bs)
edm::EDConsumerBase::esGetTokenIndicesVector
std::vector< ESProxyIndex > const & esGetTokenIndicesVector(edm::Transition iTrans) const
Definition: EDConsumerBase.h:135
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
edm::EDConsumerBase::itemsToGetFrom
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType iType) const
Definition: EDConsumerBase.h:91
edm::EventPrincipal::id
EventID const & id() const
Definition: EventPrincipal.h:96
edm::GlobalContext::Transition::kEndRun
edm::eventsetup::EventSetupProvider::resetRecordPlusDependentRecords
void resetRecordPlusDependentRecords(EventSetupRecordKey const &)
Used when we need to force a Record to reset all its proxies.
Definition: EventSetupProvider.cc:369
mps_monitormerge.items
list items
Definition: mps_monitormerge.py:29
edm::for_all
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
edm::EDLooperBase::act_table_
ExceptionToActionTable const * act_table_
Definition: EDLooperBase.h:165
edm::EDLooperBase::iCounter_
unsigned int iCounter_
Definition: EDLooperBase.h:164
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
edm::EventPrincipal::time
Timestamp const & time() const
Definition: EventPrincipal.h:98
edm::EDLooperBase::moduleChanger_
edm::propagate_const< ModuleChanger * > moduleChanger_
Definition: EDLooperBase.h:168
edm::EDConsumerBase::esGetTokenRecordIndicesVector
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector(edm::Transition iTrans) const
Definition: EDConsumerBase.h:140
edm::EDLooperBase::kStop
Definition: EDLooperBase.h:82
ESRecordIndex
edm::EDLooperBase::endRun
virtual void endRun(Run const &, EventSetup const &)
Called after all event modules have processed the end of a Run.
Definition: EDLooperBase.cc:186
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:253
edm::EDLooperBase::beginRun
virtual void beginRun(Run const &, EventSetup const &)
Called after all event modules have processed the begin of a Run.
Definition: EDLooperBase.cc:185
edm::EDLooperBase::startingNewLoop
virtual void startingNewLoop(unsigned int)=0
LuminosityBlock
WaitingTaskHolder
Event
edm::GlobalContext::Transition::kEndLuminosityBlock
edm::Transition::BeginLuminosityBlock
edm::EDLooperBase::edPrefetchAsync
void edPrefetchAsync(WaitingTaskHolder iTask, ServiceToken const &token, Principal const &iPrincipal) const
Definition: EDLooperBase.cc:201
edm::RunPrincipal::index
RunIndex index() const
Definition: RunPrincipal.h:57
edm::EDLooperBase::endLuminosityBlock
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Called after all event modules have processed the end of a LuminosityBlock.
Definition: EDLooperBase.cc:188
edm::EDLooperBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDLooperBase.h:170
edm::make_waiting_task
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:101
edm::LuminosityBlockIndex::invalidLuminosityBlockIndex
static LuminosityBlockIndex invalidLuminosityBlockIndex()
Definition: LuminosityBlockIndex.cc:9
edm::EDLooperBase::endOfLoop
virtual Status endOfLoop(EventSetup const &, unsigned int iCounter)=0
edm::EDLooperBase::moduleCallingContext_
ModuleCallingContext moduleCallingContext_
Definition: EDLooperBase.h:171
edmPickEvents.event
event
Definition: edmPickEvents.py:273
edm::GlobalContext::Transition::kBeginLuminosityBlock
writedatasetfile.action
action
Definition: writedatasetfile.py:8
edm::StreamContext::Transition::kEvent
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::EDLooperBase::kContinue
Definition: EDLooperBase.h:82
edm::ProductResolverIndexAmbiguous
Definition: ProductResolverIndex.h:18
edm::Transition::EndLuminosityBlock
eostools.move
def move(src, dest)
Definition: eostools.py:511
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::EDConsumerBase::esGetTokenIndices
ESProxyIndex const * esGetTokenIndices(edm::Transition iTrans) const
Definition: EDConsumerBase.h:124
edm::Transition::BeginRun
edm::EDLooperBase::duringLoop
virtual Status duringLoop(Event const &, EventSetup const &, ProcessingController &)=0
edm::ExceptionToActionTable::find
exception_actions::ActionCodes find(const std::string &category) const
Definition: ExceptionActions.cc:85
edm::EDLooperBase::modifyingRecords
virtual std::set< eventsetup::EventSetupRecordKey > modifyingRecords() const
Definition: EDLooperBase.cc:290
edm::syncWait
std::exception_ptr syncWait(F &&iFunc)
Definition: include_first_syncWait.h:17
cms::Exception
Definition: Exception.h:70
EventSetup
edm::LuminosityBlockPrincipal::index
LuminosityBlockIndex index() const
Definition: LuminosityBlockPrincipal.h:51
event
Definition: event.py:1
edm::Transition::EndRun
edm::EDLooperBase::scheduleInfo_
edm::propagate_const< std::unique_ptr< ScheduleInfo > > scheduleInfo_
Definition: EDLooperBase.h:167
edm::GlobalContext::Transition::kBeginRun
edm::exception_actions::ActionCodes
ActionCodes
Definition: ExceptionActions.h:11
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::EDLooperBase::beginOfJob
virtual void beginOfJob()
Definition: EDLooperBase.cc:105
watchdog.group
group
Definition: watchdog.py:82
edm::Transition::NumberOfEventSetupTransitions
edm::EDLooperBase::esPrefetchAsync
void esPrefetchAsync(WaitingTaskHolder iTask, EventSetupImpl const &iImpl, Transition iTrans, ServiceToken const &iToken) const
Definition: EDLooperBase.cc:218
edm::EDLooperBase::beginLuminosityBlock
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Called after all event modules have processed the begin of a LuminosityBlock.
Definition: EDLooperBase.cc:187
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316
Run