CMS 3D CMS Logo

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