CMS 3D CMS Logo

SubProcess.cc
Go to the documentation of this file.
2 
37 
38 #include "boost/range/adaptor/reversed.hpp"
39 
40 #include <cassert>
41 #include <string>
42 #include <vector>
43 
44 namespace edm {
45 
47  ParameterSet const& topLevelParameterSet,
48  std::shared_ptr<ProductRegistry const> parentProductRegistry,
49  std::shared_ptr<BranchIDListHelper const> parentBranchIDListHelper,
50  ThinnedAssociationsHelper const& parentThinnedAssociationsHelper,
51  SubProcessParentageHelper const& parentSubProcessParentageHelper,
53  ActivityRegistry& parentActReg,
54  ServiceToken const& token,
56  PreallocationConfiguration const& preallocConfig,
57  ProcessContext const* parentProcessContext)
58  : EDConsumerBase(),
59  serviceToken_(),
60  parentPreg_(parentProductRegistry),
61  preg_(),
62  branchIDListHelper_(),
63  act_table_(),
64  processConfiguration_(),
65  historyLumiOffset_(preallocConfig.numberOfStreams()),
66  historyRunOffset_(historyLumiOffset_ + preallocConfig.numberOfLuminosityBlocks()),
67  processHistoryRegistries_(historyRunOffset_ + preallocConfig.numberOfRuns()),
68  historyAppenders_(historyRunOffset_ + preallocConfig.numberOfRuns()),
69  principalCache_(),
70  esp_(),
71  schedule_(),
72  parentToChildPhID_(),
73  subProcesses_(),
74  processParameterSet_(),
75  productSelectorRules_(parameterSet, "outputCommands", "OutputModule"),
76  productSelector_(),
77  wantAllEvents_(true) {
78  //Setup the event selection
80 
81  ParameterSet selectevents = parameterSet.getUntrackedParameterSet("SelectEvents", ParameterSet());
82 
83  selectevents.registerIt(); // Just in case this PSet is not registered
85  selectevents, tns->getProcessName(), getAllTriggerNames(), selectors_, consumesCollector());
86  std::map<std::string, std::vector<std::pair<std::string, int>>> outputModulePathPositions;
88  selectevents, "", outputModulePathPositions, parentProductRegistry->anyProductProduced());
89 
90  std::map<BranchID, bool> keepAssociation;
91  selectProducts(*parentProductRegistry, parentThinnedAssociationsHelper, keepAssociation);
92 
93  std::string const maxEvents("maxEvents");
94  std::string const maxLumis("maxLuminosityBlocks");
95 
96  // propagate_const<T> has no reset() function
98  std::unique_ptr<ParameterSet>(parameterSet.popParameterSet(std::string("process")).release());
99 
100  // if this process has a maxEvents or maxLuminosityBlocks parameter set, remove them.
101  if (processParameterSet_->exists(maxEvents)) {
102  processParameterSet_->popParameterSet(maxEvents);
103  }
104  if (processParameterSet_->exists(maxLumis)) {
105  processParameterSet_->popParameterSet(maxLumis);
106  }
107 
108  // if the top level process has a maxEvents or maxLuminosityBlocks parameter set, add them to this process.
109  if (topLevelParameterSet.exists(maxEvents)) {
110  processParameterSet_->addUntrackedParameter<ParameterSet>(
111  maxEvents, topLevelParameterSet.getUntrackedParameterSet(maxEvents));
112  }
113  if (topLevelParameterSet.exists(maxLumis)) {
114  processParameterSet_->addUntrackedParameter<ParameterSet>(
115  maxLumis, topLevelParameterSet.getUntrackedParameterSet(maxLumis));
116  }
117 
118  // If there are subprocesses, pop the subprocess parameter sets out of the process parameter set
119  auto subProcessVParameterSet = popSubProcessVParameterSet(*processParameterSet_);
120  bool hasSubProcesses = subProcessVParameterSet.size() != 0ull;
121 
122  // Validates the parameters in the 'options', 'maxEvents', and 'maxLuminosityBlocks'
123  // top level parameter sets. Default values are also set in here if the
124  // parameters were not explicitly set.
126 
127  ScheduleItems items(*parentProductRegistry, *this);
128  actReg_ = items.actReg_;
129 
130  //initialize the services
131  ServiceToken iToken;
132 
133  // get any configured services.
134  auto serviceSets = processParameterSet_->popVParameterSet(std::string("services"));
135 
136  ServiceToken newToken = items.initServices(serviceSets, *processParameterSet_, token, iLegacy, false);
137  parentActReg.connectToSubProcess(*items.actReg_);
138  serviceToken_ = items.addCPRandTNS(*processParameterSet_, newToken);
139 
140  //make the services available
142 
143  // intialize miscellaneous items
144  items.initMisc(*processParameterSet_);
145 
146  // intialize the event setup provider
147  esp_ = esController.makeProvider(*processParameterSet_, actReg_.get());
148 
149  branchIDListHelper_ = items.branchIDListHelper();
150  updateBranchIDListHelper(parentBranchIDListHelper->branchIDLists());
151 
152  thinnedAssociationsHelper_ = items.thinnedAssociationsHelper();
153  thinnedAssociationsHelper_->updateFromParentProcess(
154  parentThinnedAssociationsHelper, keepAssociation, droppedBranchIDToKeptBranchID_);
155 
156  // intialize the Schedule
157  schedule_ = items.initSchedule(*processParameterSet_, hasSubProcesses, preallocConfig, &processContext_);
158 
159  // set the items
160  act_table_ = std::move(items.act_table_);
161  preg_ = items.preg();
162 
163  subProcessParentageHelper_ = items.subProcessParentageHelper();
164  subProcessParentageHelper_->update(parentSubProcessParentageHelper, *parentProductRegistry);
165 
166  //CMS-THREADING this only works since Run/Lumis are synchronous so when principalCache asks for
167  // the reducedProcessHistoryID from a full ProcessHistoryID that registry will not be in use by
168  // another thread. We really need to change how this is done in the PrincipalCache.
170 
171  processConfiguration_ = items.processConfiguration();
173  processContext_.setParentProcessContext(parentProcessContext);
174 
176  for (unsigned int index = 0; index < preallocConfig.numberOfStreams(); ++index) {
177  auto ep = std::make_shared<EventPrincipal>(preg_,
182  index,
183  false /*not primary process*/);
185  }
186  for (unsigned int index = 0; index < preallocConfig.numberOfLuminosityBlocks(); ++index) {
187  auto lbpp = std::make_unique<LuminosityBlockPrincipal>(
190  }
191 
192  inUseLumiPrincipals_.resize(preallocConfig.numberOfLuminosityBlocks());
193 
194  subProcesses_.reserve(subProcessVParameterSet.size());
195  for (auto& subProcessPSet : subProcessVParameterSet) {
196  subProcesses_.emplace_back(subProcessPSet,
197  topLevelParameterSet,
198  preg_,
200  *thinnedAssociationsHelper_,
202  esController,
203  *items.actReg_,
204  newToken,
205  iLegacy,
206  preallocConfig,
207  &processContext_);
208  }
209  }
210 
212 
213  void SubProcess::doBeginJob() { this->beginJob(); }
214 
216 
218  // If event selection is being used, the SubProcess class reads TriggerResults
219  // object(s) in the parent process from the event. This next call is needed for
220  // getByToken to work properly. Normally, this is done by the worker, but since
221  // a SubProcess is not a module, it has no worker.
222  updateLookup(InEvent, *parentPreg_->productLookup(InEvent), false);
223 
224  if (!droppedBranchIDToKeptBranchID().empty()) {
226  }
228  schedule_->convertCurrentProcessAlias(processConfiguration_->processName());
230  //NOTE: this may throw
232  actReg_->preBeginJobSignal_(pathsAndConsumesOfModules_, processContext_);
233  schedule_->beginJob(*preg_, esp_->recordsToProxyIndices());
234  for_all(subProcesses_, [](auto& subProcess) { subProcess.doBeginJob(); });
235  }
236 
240  "Multiple exceptions were thrown while executing endJob. An exception message follows for each.");
241  schedule_->endJob(c);
242  for (auto& subProcess : subProcesses_) {
243  c.call([&subProcess]() { subProcess.doEndJob(); });
244  }
245  if (c.hasThrown()) {
246  c.rethrow();
247  }
248  }
249 
251  ThinnedAssociationsHelper const& parentThinnedAssociationsHelper,
252  std::map<BranchID, bool>& keepAssociation) {
254  return;
256 
257  // TODO: See if we can collapse keptProducts_ and productSelector_ into a
258  // single object. See the notes in the header for ProductSelector
259  // for more information.
260 
261  std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
262  std::vector<BranchDescription const*> associationDescriptions;
263  std::set<BranchID> keptProductsInEvent;
264 
265  for (auto const& it : preg.productList()) {
266  BranchDescription const& desc = it.second;
267  if (desc.transient()) {
268  // if the class of the branch is marked transient, output nothing
269  } else if (!desc.present() && !desc.produced()) {
270  // else if the branch containing the product has been previously dropped,
271  // output nothing
272  } else if (desc.unwrappedType() == typeid(ThinnedAssociation)) {
273  associationDescriptions.push_back(&desc);
274  } else if (productSelector_.selected(desc)) {
275  keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
276  }
277  }
278 
279  parentThinnedAssociationsHelper.selectAssociationProducts(
280  associationDescriptions, keptProductsInEvent, keepAssociation);
281 
282  for (auto association : associationDescriptions) {
283  if (keepAssociation[association->branchID()]) {
284  keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
285  }
286  }
287 
288  // Now fill in a mapping needed in the case that a branch was dropped while its EDAlias was kept.
289  ProductSelector::fillDroppedToKept(preg, trueBranchIDToKeptBranchDesc, droppedBranchIDToKeptBranchID_);
290  }
291 
293  std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
294  std::set<BranchID>& keptProductsInEvent) {
295  ProductSelector::checkForDuplicateKeptBranch(desc, trueBranchIDToKeptBranchDesc);
296 
297  if (desc.branchType() == InEvent) {
298  if (desc.produced()) {
299  keptProductsInEvent.insert(desc.originalBranchID());
300  } else {
301  keptProductsInEvent.insert(desc.branchID());
302  }
303  }
305  InputTag{desc.moduleLabel(), desc.productInstanceName(), desc.processName()});
306 
307  // Now put it in the list of selected branches.
308  keptProducts_[desc.branchType()].push_back(std::make_pair(&desc, token));
309  }
310 
312  std::map<BranchID::value_type, BranchID::value_type> const& droppedBranchIDToKeptBranchID) {
313  // Check for branches dropped while an EDAlias was kept.
314  // Replace BranchID of each dropped branch with that of the kept alias.
315  for (BranchIDList& branchIDList : branchIDListHelper_->mutableBranchIDLists()) {
316  for (BranchID::value_type& branchID : branchIDList) {
317  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter =
318  droppedBranchIDToKeptBranchID.find(branchID);
319  if (iter != droppedBranchIDToKeptBranchID.end()) {
320  branchID = iter->second;
321  }
322  }
323  }
324  for_all(subProcesses_, [&droppedBranchIDToKeptBranchID](auto& subProcess) {
325  subProcess.fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID);
326  });
327  }
328 
331  /* BEGIN relevant bits from OutputModule::doEvent */
332  if (!wantAllEvents_) {
333  EventForOutput e(ep, ModuleDescription(), nullptr);
334  e.setConsumer(this);
335  if (!selectors_.wantEvent(e)) {
336  return;
337  }
338  }
339  processAsync(std::move(iHolder), ep);
340  /* END relevant bits from OutputModule::doEvent */
341  }
342 
344  EventAuxiliary aux(principal.aux());
345  aux.setProcessHistoryID(principal.processHistoryID());
346 
347  EventSelectionIDVector esids{principal.eventSelectionIDs()};
348  if (principal.productRegistry().anyProductProduced() || !wantAllEvents_) {
349  esids.push_back(selector_config_id_);
350  }
351 
353  auto& processHistoryRegistry = processHistoryRegistries_[principal.streamID().value()];
354  processHistoryRegistry.registerProcessHistory(principal.processHistory());
355  BranchListIndexes bli(principal.branchListIndexes());
356  branchIDListHelper_->fixBranchListIndexes(bli);
357  bool deepCopyRetriever = false;
359  aux,
360  processHistoryRegistry,
361  std::move(esids),
362  std::move(bli),
363  *(principal.productProvenanceRetrieverPtr()), //NOTE: this transfers the per product provenance
364  principal.reader(),
365  deepCopyRetriever);
367  propagateProducts(InEvent, principal, ep);
368 
369  WaitingTaskHolder finalizeEventTask(
370  make_waiting_task(tbb::task::allocate_root(), [&ep, iHolder](std::exception_ptr const* iPtr) mutable {
371  ep.clearEventPrincipal();
372  if (iPtr) {
373  iHolder.doneWaiting(*iPtr);
374  } else {
375  iHolder.doneWaiting(std::exception_ptr());
376  }
377  }));
378  WaitingTaskHolder afterProcessTask;
379  if (subProcesses_.empty()) {
380  afterProcessTask = std::move(finalizeEventTask);
381  } else {
382  afterProcessTask = WaitingTaskHolder(make_waiting_task(
383  tbb::task::allocate_root(), [this, &ep, finalizeEventTask](std::exception_ptr const* iPtr) mutable {
384  if (not iPtr) {
385  for (auto& subProcess : boost::adaptors::reverse(subProcesses_)) {
386  subProcess.doEventAsync(finalizeEventTask, ep);
387  }
388  } else {
389  finalizeEventTask.doneWaiting(*iPtr);
390  }
391  }));
392  }
393 
394  schedule_->processOneEventAsync(
395  std::move(afterProcessTask), ep.streamID().value(), ep, esp_->eventSetup(), serviceToken_);
396  }
397 
400 
401  auto aux = std::make_shared<RunAuxiliary>(principal.aux());
402  aux->setProcessHistoryID(principal.processHistoryID());
403  auto rpp = std::make_shared<RunPrincipal>(aux,
404  preg_,
406  &(historyAppenders_[historyRunOffset_ + principal.index()]),
407  principal.index(),
408  false);
409  auto& processHistoryRegistry = processHistoryRegistries_[historyRunOffset_ + principal.index()];
410  processHistoryRegistry.registerProcessHistory(principal.processHistory());
411  rpp->fillRunPrincipal(processHistoryRegistry, principal.reader());
412  principalCache_.insert(rpp);
413 
414  ProcessHistoryID const& parentInputReducedPHID = principal.reducedProcessHistoryID();
415  ProcessHistoryID const& inputReducedPHID = rpp->reducedProcessHistoryID();
416 
417  parentToChildPhID_.insert(std::make_pair(parentInputReducedPHID, inputReducedPHID));
418 
420  propagateProducts(InRun, principal, rp);
422  beginGlobalTransitionAsync<Traits>(
423  std::move(iHolder), *schedule_, rp, ts, esp_->eventSetup(), serviceToken_, subProcesses_);
424  }
425 
427  RunPrincipal const& principal,
428  IOVSyncValue const& ts,
429  bool cleaningUpAfterException) {
431  propagateProducts(InRun, principal, rp);
433  endGlobalTransitionAsync<Traits>(std::move(iHolder),
434  *schedule_,
435  rp,
436  ts,
437  esp_->eventSetup(),
440  cleaningUpAfterException);
441  }
442 
444  ProcessHistoryID const& parentPhID,
445  int runNumber,
446  MergeableRunProductMetadata const* mergeableRunProductMetadata) {
448  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
449  assert(it != parentToChildPhID_.end());
450  auto const& childPhID = it->second;
451 
452  auto subTasks = edm::make_waiting_task(
453  tbb::task::allocate_root(),
454  [this, childPhID, runNumber, task, mergeableRunProductMetadata](std::exception_ptr const* iExcept) mutable {
455  if (iExcept) {
456  task.doneWaiting(*iExcept);
457  } else {
459  for (auto& s : subProcesses_) {
460  s.writeRunAsync(task, childPhID, runNumber, mergeableRunProductMetadata);
461  }
462  }
463  });
464  schedule_->writeRunAsync(WaitingTaskHolder(subTasks),
465  principalCache_.runPrincipal(childPhID, runNumber),
467  actReg_.get(),
468  mergeableRunProductMetadata);
469  }
470 
472  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
473  assert(it != parentToChildPhID_.end());
474  auto const& childPhID = it->second;
475  principalCache_.deleteRun(childPhID, runNumber);
477  [&childPhID, runNumber](auto& subProcess) { subProcess.deleteRunFromCache(childPhID, runNumber); });
478  }
479 
482  IOVSyncValue const& ts) {
484 
485  auto aux = principal.aux();
486  aux.setProcessHistoryID(principal.processHistoryID());
488  lbpp->setAux(aux);
489  auto& processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_ + lbpp->index()];
490  inUseLumiPrincipals_[principal.index()] = lbpp;
491  processHistoryRegistry.registerProcessHistory(principal.processHistory());
492  lbpp->fillLuminosityBlockPrincipal(processHistoryRegistry, principal.reader());
493  lbpp->setRunPrincipal(principalCache_.runPrincipalPtr());
494  LuminosityBlockPrincipal& lbp = *lbpp;
495  propagateProducts(InLumi, principal, lbp);
497  beginGlobalTransitionAsync<Traits>(
498  std::move(iHolder), *schedule_, lbp, ts, esp_->eventSetup(), serviceToken_, subProcesses_);
499  }
500 
503  IOVSyncValue const& ts,
504  bool cleaningUpAfterException) {
506  propagateProducts(InLumi, principal, lbp);
508  endGlobalTransitionAsync<Traits>(std::move(iHolder),
509  *schedule_,
510  lbp,
511  ts,
512  esp_->eventSetup(),
515  cleaningUpAfterException);
516  }
517 
520 
521  auto l = inUseLumiPrincipals_[principal.index()];
522  auto subTasks =
523  edm::make_waiting_task(tbb::task::allocate_root(), [this, l, task](std::exception_ptr const* iExcept) mutable {
524  if (iExcept) {
525  task.doneWaiting(*iExcept);
526  } else {
528  for (auto& s : subProcesses_) {
529  s.writeLumiAsync(task, *l);
530  }
531  }
532  });
533  schedule_->writeLumiAsync(WaitingTaskHolder(subTasks), *l, &processContext_, actReg_.get());
534  }
535 
537  //release from list but stay around till end of routine
538  auto lb = std::move(inUseLumiPrincipals_[principal.index()]);
539  for (auto& s : subProcesses_) {
540  s.deleteLumiFromCache(*lb);
541  }
542  lb->clearPrincipal();
543  }
544 
545  void SubProcess::doBeginStream(unsigned int iID) {
547  schedule_->beginStream(iID);
548  for_all(subProcesses_, [iID](auto& subProcess) { subProcess.doBeginStream(iID); });
549  }
550 
551  void SubProcess::doEndStream(unsigned int iID) {
553  schedule_->endStream(iID);
554  for_all(subProcesses_, [iID](auto& subProcess) { subProcess.doEndStream(iID); });
555  }
556 
558  unsigned int id,
559  RunPrincipal const& principal,
560  IOVSyncValue const& ts) {
562 
564 
565  beginStreamTransitionAsync<Traits>(
566  std::move(iHolder), *schedule_, id, rp, ts, esp_->eventSetup(), serviceToken_, subProcesses_);
567  }
568 
570  unsigned int id,
571  RunPrincipal const& principal,
572  IOVSyncValue const& ts,
573  bool cleaningUpAfterException) {
576 
577  endStreamTransitionAsync<Traits>(std::move(iHolder),
578  *schedule_,
579  id,
580  rp,
581  ts,
582  esp_->eventSetup(),
585  cleaningUpAfterException);
586  }
587 
589  unsigned int id,
591  IOVSyncValue const& ts) {
593 
595 
596  beginStreamTransitionAsync<Traits>(
597  std::move(iHolder), *schedule_, id, lbp, ts, esp_->eventSetup(), serviceToken_, subProcesses_);
598  }
599 
601  unsigned int id,
603  IOVSyncValue const& ts,
604  bool cleaningUpAfterException) {
607  endStreamTransitionAsync<Traits>(std::move(iHolder),
608  *schedule_,
609  id,
610  lbp,
611  ts,
612  esp_->eventSetup(),
615  cleaningUpAfterException);
616  }
617 
619  SelectedProducts const& keptVector = keptProducts()[type];
620  for (auto const& item : keptVector) {
621  BranchDescription const& desc = *item.first;
622  ProductResolverBase const* parentProductResolver = parentPrincipal.getProductResolver(desc.branchID());
623  if (parentProductResolver != nullptr) {
624  ProductResolverBase* productResolver = principal.getModifiableProductResolver(desc.branchID());
625  if (productResolver != nullptr) {
626  //Propagate the per event(run)(lumi) data for this product to the subprocess.
627  //First, the product itself.
628  productResolver->connectTo(*parentProductResolver, &parentPrincipal);
629  }
630  }
631  }
632  }
633 
635  branchIDListHelper_->updateFromParent(branchIDLists);
637  [this](auto& subProcess) { subProcess.updateBranchIDListHelper(branchIDListHelper_->branchIDLists()); });
638  }
639 
640  // Call respondToOpenInputFile() on all Modules
643  schedule_->respondToOpenInputFile(fb);
644  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.respondToOpenInputFile(fb); });
645  }
646 
647  // free function
649  std::vector<std::string> subProcesses =
650  parameterSet.getUntrackedParameter<std::vector<std::string>>("@all_subprocesses");
651  if (!subProcesses.empty()) {
652  return parameterSet.popVParameterSet("subProcesses");
653  }
654  return {};
655  }
656 } // namespace edm
unsigned int historyRunOffset_
Definition: SubProcess.h:284
unsigned int historyLumiOffset_
Definition: SubProcess.h:283
ParameterSetID selector_config_id_
Definition: SubProcess.h:306
void insert(std::shared_ptr< RunPrincipal > rp)
type
Definition: HCALResponse.h:21
void setLuminosityBlockPrincipal(LuminosityBlockPrincipal *lbp)
ProductRegistry const & productRegistry() const
Definition: Principal.h:146
ProductResolverBase * getModifiableProductResolver(BranchID const &oid)
Definition: Principal.h:153
void doEventAsync(WaitingTaskHolder iHolder, EventPrincipal const &principal)
Definition: SubProcess.cc:329
T getUntrackedParameter(std::string const &, T const &) const
bool selected(BranchDescription const &desc) const
EventSelectionIDVector const & eventSelectionIDs() const
void respondToOpenInputFile(FileBlock const &fb)
Definition: SubProcess.cc:641
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
ProcessHistoryID const & reducedProcessHistoryID() const
Definition: RunPrincipal.h:62
void doStreamBeginRunAsync(WaitingTaskHolder iHolder, unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:557
std::unique_ptr< ParameterSet > popParameterSet(std::string const &name)
static void fillDroppedToKept(ProductRegistry const &preg, std::map< BranchID, BranchDescription const * > const &trueBranchIDToKeptBranchDesc, std::map< BranchID::value_type, BranchID::value_type > &droppedBranchIDToKeptBranchID_)
void setNumberOfConcurrentPrincipals(PreallocationConfiguration const &)
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: SubProcess.h:259
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:285
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:275
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
Definition: Hash.h:43
void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
void doStreamEndRunAsync(WaitingTaskHolder iHolder, unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:569
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:280
bool exists(std::string const &parameterName) const
checks if a parameter exists
void updateBranchIDListHelper(BranchIDLists const &)
Definition: SubProcess.cc:634
LuminosityBlockAuxiliary const & aux() const
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:71
std::string const & processName() const
LuminosityBlockIndex index() const
void doEndStream(unsigned int)
Definition: SubProcess.cc:551
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void doStreamEndLuminosityBlockAsync(WaitingTaskHolder iHolder, unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:600
std::shared_ptr< EventSetupProvider > makeProvider(ParameterSet &, ActivityRegistry *)
void setParentProcessContext(ProcessContext const *parentProcessContext)
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:255
BranchListIndexes const & branchListIndexes() const
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:291
ProcessHistory const & processHistory() const
Definition: Principal.h:140
BranchType
Definition: BranchType.h:11
std::vector< EventSelectionID > EventSelectionIDVector
void validateTopLevelParameterSets(ParameterSet *processParameterSet)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< std::pair< BranchDescription const *, EDGetToken > > SelectedProducts
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ProductList const & productList() const
void selectAssociationProducts(std::vector< BranchDescription const * > const &associationDescriptions, std::set< BranchID > const &keptProductsInEvent, std::map< BranchID, bool > &keepAssociation) const
void initialize(Schedule const *, std::shared_ptr< ProductRegistry const >)
virtual void connectTo(ProductResolverBase const &, Principal const *)=0
ServiceToken serviceToken_
Definition: SubProcess.h:271
void deleteRunFromCache(ProcessHistoryID const &parentPhID, int runNumber)
Definition: SubProcess.cc:471
def principal(options)
std::vector< BranchListIndex > BranchListIndexes
void doneWaiting(std::exception_ptr iExcept)
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:289
void processAsync(WaitingTaskHolder iHolder, EventPrincipal const &e)
Definition: SubProcess.cc:343
void doEndRunAsync(WaitingTaskHolder iHolder, RunPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:426
~SubProcess() override
Definition: SubProcess.cc:211
std::string const & moduleLabel() const
void doBeginLuminosityBlockAsync(WaitingTaskHolder iHolder, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:480
unsigned int value_type
Definition: BranchID.h:16
std::string const & productInstanceName() const
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:142
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:300
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > &keepAssociation)
Definition: SubProcess.cc:250
void doBeginRunAsync(WaitingTaskHolder iHolder, RunPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:398
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void deleteLumiFromCache(LuminosityBlockPrincipal &)
Definition: SubProcess.cc:536
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:301
StreamID streamID() const
TypeID unwrappedTypeID() const
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:290
std::vector< BranchDescription const * > allBranchDescriptions() const
edm::propagate_const< std::unique_ptr< ParameterSet > > processParameterSet_
Definition: SubProcess.h:294
void doEndLuminosityBlockAsync(WaitingTaskHolder iHolder, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:501
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector, ConsumesCollector &&iC)
BranchID const & branchID() const
TypeWithDict const & unwrappedType() const
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:58
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
Definition: SubProcess.cc:292
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
void setProcessConfiguration(ProcessConfiguration const *processConfiguration)
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
void doStreamBeginLuminosityBlockAsync(WaitingTaskHolder iHolder, unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:588
std::unique_ptr< ExceptionToActionTable const > act_table_
Definition: SubProcess.h:277
std::vector< ParameterSet > popSubProcessVParameterSet(ParameterSet &parameterSet)
Definition: SubProcess.cc:648
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
DelayedReader * reader() const
Definition: Principal.h:186
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:311
void writeRunAsync(WaitingTaskHolder, ProcessHistoryID const &parentPhID, int runNumber, MergeableRunProductMetadata const *)
Definition: SubProcess.cc:443
ProductSelector productSelector_
Definition: SubProcess.h:302
unsigned int value() const
Definition: StreamID.h:42
void checkForModuleDependencyCorrectness(edm::PathsAndConsumesOfModulesBase const &iPnC, bool iPrintDependencies)
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:307
void connectToSubProcess(ActivityRegistry &iOther)
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:292
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
Definition: WaitingTask.h:87
void deleteRun(ProcessHistoryID const &phid, RunNumber_t run)
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:270
SubProcess(ParameterSet &parameterSet, ParameterSet const &topLevelParameterSet, std::shared_ptr< ProductRegistry const > parentProductRegistry, std::shared_ptr< BranchIDListHelper const > parentBranchIDListHelper, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, SubProcessParentageHelper const &parentSubProcessParentageHelper, eventsetup::EventSetupsController &esController, ActivityRegistry &parentActReg, ServiceToken const &token, serviceregistry::ServiceLegacy iLegacy, PreallocationConfiguration const &preallocConfig, ProcessContext const *parentProcessContext)
Definition: SubProcess.cc:46
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:274
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
RunIndex index() const
Definition: RunPrincipal.h:56
bool anyProductProduced() const
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:286
std::vector< BranchID::value_type > BranchIDList
Definition: BranchIDList.h:18
std::vector< ParameterSet > popVParameterSet(std::string const &name)
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
HLT enums.
bool initialized() const
std::vector< std::string > const & getAllTriggerNames()
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:618
void doBeginStream(unsigned int)
Definition: SubProcess.cc:545
void setConsumer(EDConsumerBase const *iConsumer)
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:272
ConstProductResolverPtr getProductResolver(BranchID const &oid) const
Definition: Principal.cc:527
void fixBranchIDListsForEDAliases(std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: SubProcess.cc:311
ProcessContext processContext_
Definition: SubProcess.h:279
std::shared_ptr< LuminosityBlockPrincipal > getAvailableLumiPrincipalPtr()
BranchID const & originalBranchID() const
void call(std::function< void(void)>)
ParameterSetID registerProperSelectionInfo(edm::ParameterSet const &iInitial, std::string const &iLabel, std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Definition: SubProcess.h:263
EventAuxiliary const & aux() const
ParameterSet const & registerIt()
void writeLumiAsync(WaitingTaskHolder, LuminosityBlockPrincipal &)
Definition: SubProcess.cc:518
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:273
PrincipalCache principalCache_
Definition: SubProcess.h:287
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11
def move(src, dest)
Definition: eostools.py:511
edm::propagate_const< std::shared_ptr< SubProcessParentageHelper > > subProcessParentageHelper_
Definition: SubProcess.h:276
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:278
RunPrincipal & runPrincipal(ProcessHistoryID const &phid, RunNumber_t run) const
def operate(timelog, memlog, json_f, num)