test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SubProcess.cc
Go to the documentation of this file.
2 
30 
31 #include <cassert>
32 #include <string>
33 #include <vector>
34 
35 namespace edm {
36 
38  ParameterSet const& topLevelParameterSet,
39  std::shared_ptr<ProductRegistry const> parentProductRegistry,
40  std::shared_ptr<BranchIDListHelper const> parentBranchIDListHelper,
41  ThinnedAssociationsHelper const& parentThinnedAssociationsHelper,
43  ActivityRegistry& parentActReg,
44  ServiceToken const& token,
46  PreallocationConfiguration const& preallocConfig,
47  ProcessContext const* parentProcessContext) :
49  serviceToken_(),
50  parentPreg_(parentProductRegistry),
51  preg_(),
52  branchIDListHelper_(),
53  act_table_(),
54  processConfiguration_(),
55  historyLumiOffset_(preallocConfig.numberOfStreams()),
56  historyRunOffset_(historyLumiOffset_+preallocConfig.numberOfLuminosityBlocks()),
57  processHistoryRegistries_(historyRunOffset_+ preallocConfig.numberOfRuns()),
58  historyAppenders_(historyRunOffset_+preallocConfig.numberOfRuns()),
59  principalCache_(),
60  esp_(),
61  schedule_(),
62  parentToChildPhID_(),
63  subProcesses_(),
64  processParameterSet_(),
65  productSelectorRules_(parameterSet, "outputCommands", "OutputModule"),
66  productSelector_(),
67  wantAllEvents_(true) {
68 
69  //Setup the event selection
71 
72  ParameterSet selectevents =
73  parameterSet.getUntrackedParameterSet("SelectEvents", ParameterSet());
74 
75  selectevents.registerIt(); // Just in case this PSet is not registered
77  tns->getProcessName(),
79  selectors_,
81  std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
83  "",
84  outputModulePathPositions,
85  parentProductRegistry->anyProductProduced());
86 
87  std::map<BranchID, bool> keepAssociation;
88  selectProducts(*parentProductRegistry, parentThinnedAssociationsHelper, keepAssociation);
89 
90  std::string const maxEvents("maxEvents");
91  std::string const maxLumis("maxLuminosityBlocks");
92 
93  // propagate_const<T> has no reset() function
94  processParameterSet_ = std::unique_ptr<ParameterSet>(parameterSet.popParameterSet(std::string("process")).release());
95 
96  // if this process has a maxEvents or maxLuminosityBlocks parameter set, remove them.
97  if(processParameterSet_->exists(maxEvents)) {
98  processParameterSet_->popParameterSet(maxEvents);
99  }
100  if(processParameterSet_->exists(maxLumis)) {
101  processParameterSet_->popParameterSet(maxLumis);
102  }
103 
104  // if the top level process has a maxEvents or maxLuminosityBlocks parameter set, add them to this process.
105  if(topLevelParameterSet.exists(maxEvents)) {
106  processParameterSet_->addUntrackedParameter<ParameterSet>(maxEvents, topLevelParameterSet.getUntrackedParameterSet(maxEvents));
107  }
108  if(topLevelParameterSet.exists(maxLumis)) {
109  processParameterSet_->addUntrackedParameter<ParameterSet>(maxLumis, topLevelParameterSet.getUntrackedParameterSet(maxLumis));
110  }
111 
112  // If there are subprocesses, pop the subprocess parameter sets out of the process parameter set
113  auto subProcessVParameterSet = popSubProcessVParameterSet(*processParameterSet_);
114  bool hasSubProcesses = subProcessVParameterSet.size() != 0ull;
115 
116  ScheduleItems items(*parentProductRegistry, *this);
117  actReg_ = items.actReg_;
118 
119  ParameterSet const& optionsPset(processParameterSet_->getUntrackedParameterSet("options", ParameterSet()));
120  IllegalParameters::setThrowAnException(optionsPset.getUntrackedParameter<bool>("throwIfIllegalParameter", true));
121 
122  //initialize the services
123  ServiceToken iToken;
124 
125  // get any configured services.
126  auto serviceSets = processParameterSet_->popVParameterSet(std::string("services"));
127 
128  ServiceToken newToken = items.initServices(serviceSets, *processParameterSet_, token, iLegacy, false);
129  parentActReg.connectToSubProcess(*items.actReg_);
130  serviceToken_ = items.addCPRandTNS(*processParameterSet_, newToken);
131 
132 
133  //make the services available
135 
136  // intialize miscellaneous items
138 
139  // intialize the event setup provider
140  esp_ = esController.makeProvider(*processParameterSet_);
141 
143  updateBranchIDListHelper(parentBranchIDListHelper->branchIDLists());
144 
146  thinnedAssociationsHelper_->updateFromParentProcess(parentThinnedAssociationsHelper, keepAssociation, droppedBranchIDToKeptBranchID_);
147 
148  // intialize the Schedule
149  schedule_ = items.initSchedule(*processParameterSet_,hasSubProcesses,preallocConfig,&processContext_);
150 
151  // set the items
153  preg_ = items.preg();
154  //CMS-THREADING this only works since Run/Lumis are synchronous so when principalCache asks for
155  // the reducedProcessHistoryID from a full ProcessHistoryID that registry will not be in use by
156  // another thread. We really need to change how this is done in the PrincipalCache.
158 
159 
162  processContext_.setParentProcessContext(parentProcessContext);
163 
165  for(unsigned int index = 0; index < preallocConfig.numberOfStreams(); ++index) {
166  auto ep = std::make_shared<EventPrincipal>(preg_,
171  index,
172  false /*not primary process*/);
174  }
175 
176  subProcesses_.reserve(subProcessVParameterSet.size());
177  for(auto& subProcessPSet : subProcessVParameterSet) {
178  subProcesses_.emplace_back(subProcessPSet,
179  topLevelParameterSet,
180  preg_,
182  *thinnedAssociationsHelper_,
183  esController,
184  *items.actReg_,
185  newToken,
186  iLegacy,
187  preallocConfig,
188  &processContext_);
189  }
190  }
191 
193 
194  void
196  this->beginJob();
197  }
198 
199  void
201  endJob();
202  }
203 
204 
205  void
207  // If event selection is being used, the SubProcess class reads TriggerResults
208  // object(s) in the parent process from the event. This next call is needed for
209  // getByToken to work properly. Normally, this is done by the worker, but since
210  // a SubProcess is not a module, it has no worker.
211  updateLookup(InEvent, *parentPreg_->productLookup(InEvent),false);
212 
213  if(!droppedBranchIDToKeptBranchID().empty()) {
215  }
218  //NOTE: this may throw
220  actReg_->preBeginJobSignal_(pathsAndConsumesOfModules_, processContext_);
221  schedule_->beginJob(*preg_);
222  for_all(subProcesses_, [](auto& subProcess){ subProcess.doBeginJob(); });
223  }
224 
225  void
228  ExceptionCollector c("Multiple exceptions were thrown while executing endJob. An exception message follows for each.");
229  schedule_->endJob(c);
230  for(auto& subProcess : subProcesses_) {
231  c.call([&subProcess](){ subProcess.doEndJob();});
232  }
233  if(c.hasThrown()) {
234  c.rethrow();
235  }
236  }
237 
238  void
240  ThinnedAssociationsHelper const& parentThinnedAssociationsHelper,
241  std::map<BranchID, bool>& keepAssociation) {
242  if(productSelector_.initialized()) return;
244 
245  // TODO: See if we can collapse keptProducts_ and productSelector_ into a
246  // single object. See the notes in the header for ProductSelector
247  // for more information.
248 
249  std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
250  std::vector<BranchDescription const*> associationDescriptions;
251  std::set<BranchID> keptProductsInEvent;
252 
253  for(auto const& it : preg.productList()) {
254  BranchDescription const& desc = it.second;
255  if(desc.transient()) {
256  // if the class of the branch is marked transient, output nothing
257  } else if(!desc.present() && !desc.produced()) {
258  // else if the branch containing the product has been previously dropped,
259  // output nothing
260  } else if(desc.unwrappedType() == typeid(ThinnedAssociation)) {
261  associationDescriptions.push_back(&desc);
262  } else if(productSelector_.selected(desc)) {
263  keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
264  }
265  }
266 
267  parentThinnedAssociationsHelper.selectAssociationProducts(associationDescriptions,
268  keptProductsInEvent,
269  keepAssociation);
270 
271  for(auto association : associationDescriptions) {
272  if(keepAssociation[association->branchID()]) {
273  keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
274  }
275  }
276 
277  // Now fill in a mapping needed in the case that a branch was dropped while its EDAlias was kept.
278  ProductSelector::fillDroppedToKept(preg, trueBranchIDToKeptBranchDesc, droppedBranchIDToKeptBranchID_);
279  }
280 
282  std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
283  std::set<BranchID>& keptProductsInEvent) {
284 
286  trueBranchIDToKeptBranchDesc);
287 
288  if(desc.branchType() == InEvent) {
289  if(desc.produced()) {
290  keptProductsInEvent.insert(desc.originalBranchID());
291  } else {
292  keptProductsInEvent.insert(desc.branchID());
293  }
294  }
296  InputTag{desc.moduleLabel(),
297  desc.productInstanceName(),
298  desc.processName()});
299 
300  // Now put it in the list of selected branches.
301  keptProducts_[desc.branchType()].push_back(std::make_pair(&desc, token));
302  }
303 
304  void
305  SubProcess::fixBranchIDListsForEDAliases(std::map<BranchID::value_type, BranchID::value_type> const& droppedBranchIDToKeptBranchID) {
306  // Check for branches dropped while an EDAlias was kept.
307  // Replace BranchID of each dropped branch with that of the kept alias.
308  for(BranchIDList& branchIDList : branchIDListHelper_->mutableBranchIDLists()) {
309  for(BranchID::value_type& branchID : branchIDList) {
310  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter = droppedBranchIDToKeptBranchID.find(branchID);
311  if(iter != droppedBranchIDToKeptBranchID.end()) {
312  branchID = iter->second;
313  }
314  }
315  }
316  for_all(subProcesses_, [&droppedBranchIDToKeptBranchID](auto& subProcess){ subProcess.fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID); });
317  }
318 
319  void
322  /* BEGIN relevant bits from OutputModule::doEvent */
323  if(!wantAllEvents_) {
324  EventForOutput e(ep, ModuleDescription(), nullptr);
325  e.setConsumer(this);
326  if(!selectors_.wantEvent(e)) {
327  return;
328  }
329  }
330  process(ep);
331  /* END relevant bits from OutputModule::doEvent */
332  }
333 
334  void
336  EventAuxiliary aux(principal.aux());
337  aux.setProcessHistoryID(principal.processHistoryID());
338 
339  EventSelectionIDVector esids{principal.eventSelectionIDs()};
340  if (principal.productRegistry().anyProductProduced() || !wantAllEvents_) {
341  esids.push_back(selector_config_id_);
342  }
343 
345  auto & processHistoryRegistry = processHistoryRegistries_[principal.streamID().value()];
346  processHistoryRegistry.registerProcessHistory(principal.processHistory());
347  BranchListIndexes bli(principal.branchListIndexes());
348  branchIDListHelper_->fixBranchListIndexes(bli);
350  processHistoryRegistry,
351  std::move(esids),
352  std::move(bli),
353  *(principal.productProvenanceRetrieverPtr()),//NOTE: this transfers the per product provenance
354  principal.reader());
356  propagateProducts(InEvent, principal, ep);
357  schedule_->processOneEvent(ep.streamID().value(),ep, esp_->eventSetup());
358  for_all(subProcesses_, [&ep](auto& subProcess){ subProcess.doEvent(ep); });
359  ep.clearEventPrincipal();
360  }
361 
362  void
365  beginRun(principal,ts);
366  }
367 
368  void
370  auto aux = std::make_shared<RunAuxiliary>(principal.aux());
371  aux->setProcessHistoryID(principal.processHistoryID());
372  auto rpp = std::make_shared<RunPrincipal>(aux, preg_, *processConfiguration_, &(historyAppenders_[historyRunOffset_+principal.index()]),principal.index(),false);
373  auto & processHistoryRegistry = processHistoryRegistries_[historyRunOffset_+principal.index()];
374  processHistoryRegistry.registerProcessHistory(principal.processHistory());
375  rpp->fillRunPrincipal(processHistoryRegistry, principal.reader());
376  principalCache_.insert(rpp);
377 
378  ProcessHistoryID const& parentInputReducedPHID = principal.reducedProcessHistoryID();
379  ProcessHistoryID const& inputReducedPHID = rpp->reducedProcessHistoryID();
380 
381  parentToChildPhID_.insert(std::make_pair(parentInputReducedPHID,inputReducedPHID));
382 
384  propagateProducts(InRun, principal, rp);
386  schedule_->processOneGlobal<Traits>(rp, esp_->eventSetupForInstance(ts));
387  for_all(subProcesses_, [&rp, &ts](auto& subProcess){ subProcess.doBeginRun(rp, ts); });
388  }
389 
390  void
391  SubProcess::doEndRun(RunPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
393  endRun(principal,ts,cleaningUpAfterException);
394  }
395 
396  void
397  SubProcess::endRun(RunPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
399  rp.setComplete();
400  propagateProducts(InRun, principal, rp);
402  schedule_->processOneGlobal<Traits>(rp, esp_->eventSetupForInstance(ts), cleaningUpAfterException);
403  for_all(subProcesses_, [&rp, &ts, cleaningUpAfterException](auto& subProcess){ subProcess.doEndRun(rp, ts, cleaningUpAfterException); });
404  }
405 
406  void
409  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
410  assert(it != parentToChildPhID_.end());
411  auto const& childPhID = it->second;
412  schedule_->writeRun(principalCache_.runPrincipal(childPhID, runNumber), &processContext_);
413  for_all(subProcesses_, [&childPhID, runNumber](auto& subProcess){ subProcess.writeRun(childPhID, runNumber); });
414  }
415 
416  void
418  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
419  assert(it != parentToChildPhID_.end());
420  auto const& childPhID = it->second;
421  principalCache_.deleteRun(childPhID, runNumber);
422  for_all(subProcesses_, [&childPhID, runNumber](auto& subProcess){ subProcess.deleteRunFromCache(childPhID, runNumber); });
423  }
424 
425  void
428  beginLuminosityBlock(principal,ts);
429  }
430 
431  void
433  auto aux = std::make_shared<LuminosityBlockAuxiliary>(principal.aux());
434  aux->setProcessHistoryID(principal.processHistoryID());
435  auto lbpp = std::make_shared<LuminosityBlockPrincipal>(aux, preg_, *processConfiguration_, &(historyAppenders_[historyLumiOffset_+principal.index()]),principal.index(),false);
436  auto & processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_+principal.index()];
437  processHistoryRegistry.registerProcessHistory(principal.processHistory());
438  lbpp->fillLuminosityBlockPrincipal(processHistoryRegistry, principal.reader());
439  lbpp->setRunPrincipal(principalCache_.runPrincipalPtr());
440  principalCache_.insert(lbpp);
442  propagateProducts(InLumi, principal, lbp);
444  schedule_->processOneGlobal<Traits>(lbp, esp_->eventSetupForInstance(ts));
445  for_all(subProcesses_, [&lbp, &ts](auto& subProcess){ subProcess.doBeginLuminosityBlock(lbp, ts); });
446  }
447 
448  void
449  SubProcess::doEndLuminosityBlock(LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
451  endLuminosityBlock(principal,ts,cleaningUpAfterException);
452  }
453 
454  void
455  SubProcess::endLuminosityBlock(LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
457  lbp.setComplete();
458  propagateProducts(InLumi, principal, lbp);
460  schedule_->processOneGlobal<Traits>(lbp, esp_->eventSetupForInstance(ts), cleaningUpAfterException);
461  for_all(subProcesses_, [&lbp, &ts, cleaningUpAfterException](auto& subProcess){ subProcess.doEndLuminosityBlock(lbp, ts, cleaningUpAfterException); });
462  }
463 
464  void
465  SubProcess::writeLumi(ProcessHistoryID const& parentPhID, int runNumber, int lumiNumber) {
467  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
468  assert(it != parentToChildPhID_.end());
469  auto const& childPhID = it->second;
470  schedule_->writeLumi(principalCache_.lumiPrincipal(childPhID, runNumber, lumiNumber), &processContext_);
471  for_all(subProcesses_, [&childPhID, runNumber, lumiNumber](auto& subProcess){ subProcess.writeLumi(childPhID, runNumber, lumiNumber); });
472  }
473 
474  void
475  SubProcess::deleteLumiFromCache(ProcessHistoryID const& parentPhID, int runNumber, int lumiNumber) {
476  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
477  assert(it != parentToChildPhID_.end());
478  auto const& childPhID = it->second;
479  principalCache_.deleteLumi(childPhID, runNumber, lumiNumber);
480  for_all(subProcesses_, [&childPhID, runNumber, lumiNumber](auto& subProcess){ subProcess.deleteLumiFromCache(childPhID, runNumber, lumiNumber); });
481  }
482 
483  void
484  SubProcess::doBeginStream(unsigned int iID) {
486  schedule_->beginStream(iID);
487  for_all(subProcesses_, [iID](auto& subProcess){ subProcess.doBeginStream(iID); });
488  }
489 
490  void
491  SubProcess::doEndStream(unsigned int iID) {
493  schedule_->endStream(iID);
494  for_all(subProcesses_, [iID](auto& subProcess){ subProcess.doEndStream(iID); });
495  }
496 
497  void
498  SubProcess::doStreamBeginRun(unsigned int id, RunPrincipal const& principal, IOVSyncValue const& ts) {
500  {
503  schedule_->processOneStream<Traits>(id,rp, esp_->eventSetupForInstance(ts));
504  for_all(subProcesses_, [id, &rp, &ts](auto& subProcess){ subProcess.doStreamBeginRun(id,rp, ts); });
505  }
506  }
507 
508  void
509  SubProcess::doStreamEndRun(unsigned int id, RunPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
511  {
514  schedule_->processOneStream<Traits>(id,rp, esp_->eventSetupForInstance(ts),cleaningUpAfterException);
515  for_all(subProcesses_, [id, &rp, &ts, cleaningUpAfterException](auto& subProcess){ subProcess.doStreamEndRun(id,rp, ts,cleaningUpAfterException); });
516  }
517  }
518 
519  void
522  {
525  schedule_->processOneStream<Traits>(id,lbp, esp_->eventSetupForInstance(ts));
526  for_all(subProcesses_, [id, &lbp, &ts](auto& subProcess){ subProcess.doStreamBeginLuminosityBlock(id,lbp, ts); });
527  }
528  }
529 
530  void
531  SubProcess::doStreamEndLuminosityBlock(unsigned int id, LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
533  {
536  schedule_->processOneStream<Traits>(id,lbp, esp_->eventSetupForInstance(ts),cleaningUpAfterException);
537  for_all(subProcesses_, [id, &lbp, &ts, cleaningUpAfterException](auto& subProcess){ subProcess.doStreamEndLuminosityBlock(id,lbp, ts,cleaningUpAfterException); });
538  }
539  }
540 
541 
542  void
544  SelectedProducts const& keptVector = keptProducts()[type];
545  for(auto const& item : keptVector) {
546  BranchDescription const& desc = *item.first;
547  ProductResolverBase const* parentProductResolver = parentPrincipal.getProductResolver(desc.branchID());
548  if(parentProductResolver != nullptr) {
549  ProductResolverBase* productResolver = principal.getModifiableProductResolver(desc.branchID());
550  if(productResolver != nullptr) {
551  //Propagate the per event(run)(lumi) data for this product to the subprocess.
552  //First, the product itself.
553  productResolver->connectTo(*parentProductResolver, &parentPrincipal);
554  }
555  }
556  }
557  }
558 
560  branchIDListHelper_->updateFromParent(branchIDLists);
561  for_all(subProcesses_, [this](auto& subProcess){ subProcess.updateBranchIDListHelper(branchIDListHelper_->branchIDLists()); });
562  }
563 
564  // Call respondToOpenInputFile() on all Modules
565  void
568  schedule_->respondToOpenInputFile(fb);
569  for_all(subProcesses_, [&fb](auto& subProcess){ subProcess.respondToOpenInputFile(fb); });
570  }
571 
572  // free function
573  std::vector<ParameterSet>
575  std::vector<std::string> subProcesses = parameterSet.getUntrackedParameter<std::vector<std::string>>("@all_subprocesses");
576  if(!subProcesses.empty()) {
577  return parameterSet.popVParameterSet("subProcesses");
578  }
579  return {};
580  }
581 }
unsigned int historyRunOffset_
Definition: SubProcess.h:270
unsigned int historyLumiOffset_
Definition: SubProcess.h:269
ParameterSetID selector_config_id_
Definition: SubProcess.h:290
std::shared_ptr< ActivityRegistry > actReg_
Definition: ScheduleItems.h:66
void insert(std::shared_ptr< RunPrincipal > rp)
type
Definition: HCALResponse.h:21
ProductRegistry const & productRegistry() const
Definition: Principal.h:145
ProductResolverBase * getModifiableProductResolver(BranchID const &oid)
Definition: Principal.h:152
T getUntrackedParameter(std::string const &, T const &) const
bool selected(BranchDescription const &desc) const
std::shared_ptr< EventSetupProvider > makeProvider(ParameterSet &)
void setLuminosityBlockPrincipal(std::shared_ptr< LuminosityBlockPrincipal > const &lbp)
EventSelectionIDVector const & eventSelectionIDs() const
void respondToOpenInputFile(FileBlock const &fb)
Definition: SubProcess.cc:566
void doStreamEndLuminosityBlock(unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:531
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
ProcessHistoryID const & reducedProcessHistoryID() const
Definition: RunPrincipal.h:65
void doBeginRun(RunPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:363
void deleteLumi(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi)
void writeLumi(ProcessHistoryID const &parentPhID, int runNumber, int lumiNumber)
Definition: SubProcess.cc:465
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::unique_ptr< ExceptionToActionTable const > act_table_
Definition: ScheduleItems.h:70
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: SubProcess.h:252
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Definition: ScheduleItems.h:61
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:271
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:262
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:277
Definition: Hash.h:42
void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
void beginRun(RunPrincipal const &r, IOVSyncValue const &ts)
Definition: SubProcess.cc:369
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:266
virtual ~SubProcess()
Definition: SubProcess.cc:192
assert(m_qm.get())
LuminosityBlockPrincipal & lumiPrincipal(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
void updateBranchIDListHelper(BranchIDLists const &)
Definition: SubProcess.cc:559
LuminosityBlockAuxiliary const & aux() const
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:67
std::string const & processName() const
LuminosityBlockIndex index() const
void doEndStream(unsigned int)
Definition: SubProcess.cc:491
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void doEvent(EventPrincipal const &principal)
Definition: SubProcess.cc:320
void setParentProcessContext(ProcessContext const *parentProcessContext)
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:426
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:248
BranchListIndexes const & branchListIndexes() const
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:275
ProcessHistory const & processHistory() const
Definition: Principal.h:135
BranchType
Definition: BranchType.h:11
std::vector< EventSelectionID > EventSelectionIDVector
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
#define ull
Definition: vppc_sim_lib.h:15
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:258
void deleteRunFromCache(ProcessHistoryID const &parentPhID, int runNumber)
Definition: SubProcess.cc:417
std::vector< BranchListIndex > BranchListIndexes
std::string const & moduleLabel() const
unsigned int value_type
Definition: BranchID.h:16
std::string const & productInstanceName() const
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:139
std::shared_ptr< CommonParams > initMisc(ParameterSet &parameterSet)
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:284
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > &keepAssociation)
Definition: SubProcess.cc:239
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
static void setThrowAnException(bool v)
void process(EventPrincipal const &e)
Definition: SubProcess.cc:335
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:285
def move
Definition: eostools.py:510
StreamID streamID() const
TypeID unwrappedTypeID() const
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:274
std::vector< BranchDescription const * > allBranchDescriptions() const
edm::propagate_const< std::unique_ptr< ParameterSet > > processParameterSet_
Definition: SubProcess.h:278
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:281
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
void beginLuminosityBlock(LuminosityBlockPrincipal const &lb, IOVSyncValue const &ts)
Definition: SubProcess.cc:432
void setProcessConfiguration(ProcessConfiguration const *processConfiguration)
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
std::unique_ptr< ExceptionToActionTable const > act_table_
Definition: SubProcess.h:263
std::vector< ParameterSet > popSubProcessVParameterSet(ParameterSet &parameterSet)
Definition: SubProcess.cc:574
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
DelayedReader * reader() const
Definition: Principal.h:178
void doEndRun(RunPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:391
std::shared_ptr< ProcessConfiguration const > processConfiguration() const
Definition: ScheduleItems.h:63
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:295
ProductSelector productSelector_
Definition: SubProcess.h:286
unsigned int value() const
Definition: StreamID.h:46
void checkForModuleDependencyCorrectness(edm::PathsAndConsumesOfModulesBase const &iPnC, bool iPrintDependencies)
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:291
void doStreamBeginLuminosityBlock(unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:520
ServiceToken initServices(std::vector< ParameterSet > &servicePSets, ParameterSet &processPSet, ServiceToken const &iToken, serviceregistry::ServiceLegacy iLegacy, bool associate)
void doStreamEndRun(unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:509
void connectToSubProcess(ActivityRegistry &iOther)
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:276
void deleteRun(ProcessHistoryID const &phid, RunNumber_t run)
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:257
void deleteLumiFromCache(ProcessHistoryID const &parentPhID, int runNumber, int lumiNumber)
Definition: SubProcess.cc:475
ServiceToken addCPRandTNS(ParameterSet const &parameterSet, ServiceToken const &token)
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:261
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
void endRun(RunPrincipal const &r, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:397
RunIndex index() const
Definition: RunPrincipal.h:53
bool anyProductProduced() const
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:272
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)
void endLuminosityBlock(LuminosityBlockPrincipal const &lb, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:455
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:543
void doBeginStream(unsigned int)
Definition: SubProcess.cc:484
void setConsumer(EDConsumerBase const *iConsumer)
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:259
std::shared_ptr< SignallingProductRegistry const > preg() const
Definition: ScheduleItems.h:57
std::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
ConstProductResolverPtr getProductResolver(BranchID const &oid) const
Definition: Principal.cc:433
void fixBranchIDListsForEDAliases(std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: SubProcess.cc:305
ProcessContext processContext_
Definition: SubProcess.h:265
void writeRun(ProcessHistoryID const &parentPhID, int runNumber)
Definition: SubProcess.cc:407
BranchID const & originalBranchID() const
void call(std::function< void(void)>)
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: ScheduleItems.h:59
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:254
SubProcess(ParameterSet &parameterSet, ParameterSet const &topLevelParameterSet, std::shared_ptr< ProductRegistry const > parentProductRegistry, std::shared_ptr< BranchIDListHelper const > parentBranchIDListHelper, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, eventsetup::EventSetupsController &esController, ActivityRegistry &parentActReg, ServiceToken const &token, serviceregistry::ServiceLegacy iLegacy, PreallocationConfiguration const &preallocConfig, ProcessContext const *parentProcessContext)
Definition: SubProcess.cc:37
preg
Definition: Schedule.cc:383
EventAuxiliary const & aux() const
std::unique_ptr< Schedule > initSchedule(ParameterSet &parameterSet, bool hasSubprocesses, PreallocationConfiguration const &iAllocConfig, ProcessContext const *)
ParameterSet const & registerIt()
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:260
PrincipalCache principalCache_
Definition: SubProcess.h:273
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11
void doStreamBeginRun(unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:498
void doEndLuminosityBlock(LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:449
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:264
RunPrincipal & runPrincipal(ProcessHistoryID const &phid, RunNumber_t run) const