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) :
48  serviceToken_(),
49  parentPreg_(parentProductRegistry),
50  preg_(),
51  branchIDListHelper_(),
52  act_table_(),
53  processConfiguration_(),
54  historyLumiOffset_(preallocConfig.numberOfStreams()),
55  historyRunOffset_(historyLumiOffset_+preallocConfig.numberOfLuminosityBlocks()),
56  processHistoryRegistries_(historyRunOffset_+ preallocConfig.numberOfRuns()),
57  historyAppenders_(historyRunOffset_+preallocConfig.numberOfRuns()),
58  principalCache_(),
59  esp_(),
60  schedule_(),
61  parentToChildPhID_(),
62  subProcesses_(),
63  processParameterSet_(),
64  productSelectorRules_(parameterSet, "outputCommands", "OutputModule"),
65  productSelector_(),
66  wantAllEvents_(true) {
67 
68  //Setup the event selection
70 
71  ParameterSet selectevents =
72  parameterSet.getUntrackedParameterSet("SelectEvents", ParameterSet());
73 
74  selectevents.registerIt(); // Just in case this PSet is not registered
76  tns->getProcessName(),
78  selectors_);
79  std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
81  "",
82  outputModulePathPositions,
83  parentProductRegistry->anyProductProduced());
84 
85  std::map<BranchID, bool> keepAssociation;
86  selectProducts(*parentProductRegistry, parentThinnedAssociationsHelper, keepAssociation);
87 
88  std::string const maxEvents("maxEvents");
89  std::string const maxLumis("maxLuminosityBlocks");
90 
91  // propagate_const<T> has no reset() function
92  processParameterSet_ = std::unique_ptr<ParameterSet>(parameterSet.popParameterSet(std::string("process")).release());
93 
94  // if this process has a maxEvents or maxLuminosityBlocks parameter set, remove them.
95  if(processParameterSet_->exists(maxEvents)) {
96  processParameterSet_->popParameterSet(maxEvents);
97  }
98  if(processParameterSet_->exists(maxLumis)) {
99  processParameterSet_->popParameterSet(maxLumis);
100  }
101 
102  // if the top level process has a maxEvents or maxLuminosityBlocks parameter set, add them to this process.
103  if(topLevelParameterSet.exists(maxEvents)) {
104  processParameterSet_->addUntrackedParameter<ParameterSet>(maxEvents, topLevelParameterSet.getUntrackedParameterSet(maxEvents));
105  }
106  if(topLevelParameterSet.exists(maxLumis)) {
107  processParameterSet_->addUntrackedParameter<ParameterSet>(maxLumis, topLevelParameterSet.getUntrackedParameterSet(maxLumis));
108  }
109 
110  // If there are subprocesses, pop the subprocess parameter sets out of the process parameter set
111  std::unique_ptr<std::vector<ParameterSet> > subProcessVParameterSet(popSubProcessVParameterSet(*processParameterSet_));
112  bool hasSubProcesses = subProcessVParameterSet.get() != nullptr;
113 
114  ScheduleItems items(*parentProductRegistry, *this);
115  actReg_ = items.actReg_;
116 
117  ParameterSet const& optionsPset(processParameterSet_->getUntrackedParameterSet("options", ParameterSet()));
118  IllegalParameters::setThrowAnException(optionsPset.getUntrackedParameter<bool>("throwIfIllegalParameter", true));
119 
120  //initialize the services
121  ServiceToken iToken;
122 
123  // get any configured services.
124  std::unique_ptr<std::vector<ParameterSet> > serviceSets = processParameterSet_->popVParameterSet(std::string("services"));
125 
126  ServiceToken newToken = items.initServices(*serviceSets, *processParameterSet_, token, iLegacy, false);
127  parentActReg.connectToSubProcess(*items.actReg_);
128  serviceToken_ = items.addCPRandTNS(*processParameterSet_, newToken);
129 
130 
131  //make the services available
133 
134  // intialize miscellaneous items
136 
137  // intialize the event setup provider
138  esp_ = esController.makeProvider(*processParameterSet_);
139 
141  updateBranchIDListHelper(parentBranchIDListHelper->branchIDLists());
142 
144  thinnedAssociationsHelper_->updateFromParentProcess(parentThinnedAssociationsHelper, keepAssociation, droppedBranchIDToKeptBranchID_);
145 
146  // intialize the Schedule
147  schedule_ = items.initSchedule(*processParameterSet_,hasSubProcesses,preallocConfig,&processContext_);
148 
149  // set the items
151  preg_ = items.preg();
152  //CMS-THREADING this only works since Run/Lumis are synchronous so when principalCache asks for
153  // the reducedProcessHistoryID from a full ProcessHistoryID that registry will not be in use by
154  // another thread. We really need to change how this is done in the PrincipalCache.
156 
157 
160  processContext_.setParentProcessContext(parentProcessContext);
161 
163  for(unsigned int index = 0; index < preallocConfig.numberOfStreams(); ++index) {
164  auto ep = std::make_shared<EventPrincipal>(preg_,
169  index);
170  ep->preModuleDelayedGetSignal_.connect(std::cref(items.actReg_->preModuleEventDelayedGetSignal_));
171  ep->postModuleDelayedGetSignal_.connect(std::cref(items.actReg_->postModuleEventDelayedGetSignal_));
173  }
174  if(hasSubProcesses) {
175  if(subProcesses_ == nullptr) {
176  subProcesses_ = std::make_unique<std::vector<SubProcess> >();
177  }
178  subProcesses_->reserve(subProcessVParameterSet->size());
179  for(auto& subProcessPSet : *subProcessVParameterSet) {
180  subProcesses_->emplace_back(subProcessPSet,
181  topLevelParameterSet,
182  preg_,
184  *thinnedAssociationsHelper_,
185  esController,
186  *items.actReg_,
187  newToken,
188  iLegacy,
189  preallocConfig,
190  &processContext_);
191  }
192  }
193  }
194 
196 
197  void
199  this->beginJob();
200  }
201 
202  void
204  endJob();
205  }
206 
207 
208  void
212  }
215  actReg_->preBeginJobSignal_(pathsAndConsumesOfModules_, processContext_);
216  schedule_->beginJob(*preg_);
217  if(hasSubProcesses()) {
218  for(auto& subProcess : *subProcesses_) {
219  subProcess.doBeginJob();
220  }
221  }
222  }
223 
224  void
227  ExceptionCollector c("Multiple exceptions were thrown while executing endJob. An exception message follows for each.");
228  schedule_->endJob(c);
229  if(hasSubProcesses()) {
230  for(auto& subProcess : *subProcesses_) {
231  c.call([&subProcess](){ subProcess.doEndJob();});
232  }
233  }
234  if(c.hasThrown()) {
235  c.rethrow();
236  }
237  }
238 
239  void
241  ThinnedAssociationsHelper const& parentThinnedAssociationsHelper,
242  std::map<BranchID, bool>& keepAssociation) {
243  if(productSelector_.initialized()) return;
245 
246  // TODO: See if we can collapse keptProducts_ and productSelector_ into a
247  // single object. See the notes in the header for ProductSelector
248  // for more information.
249 
250  std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
251  std::vector<BranchDescription const*> associationDescriptions;
252  std::set<BranchID> keptProductsInEvent;
253 
254  for(auto const& it : preg.productList()) {
255  BranchDescription const& desc = it.second;
256  if(desc.transient()) {
257  // if the class of the branch is marked transient, output nothing
258  } else if(!desc.present() && !desc.produced()) {
259  // else if the branch containing the product has been previously dropped,
260  // output nothing
261  } else if(desc.unwrappedType() == typeid(ThinnedAssociation)) {
262  associationDescriptions.push_back(&desc);
263  } else if(productSelector_.selected(desc)) {
264  keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
265  }
266  }
267 
268  parentThinnedAssociationsHelper.selectAssociationProducts(associationDescriptions,
269  keptProductsInEvent,
270  keepAssociation);
271 
272  for(auto association : associationDescriptions) {
273  if(keepAssociation[association->branchID()]) {
274  keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
275  }
276  }
277 
278  // Now fill in a mapping needed in the case that a branch was dropped while its EDAlias was kept.
279  ProductSelector::fillDroppedToKept(preg, trueBranchIDToKeptBranchDesc, droppedBranchIDToKeptBranchID_);
280  }
281 
283  std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
284  std::set<BranchID>& keptProductsInEvent) {
285 
287  trueBranchIDToKeptBranchDesc);
288 
289  if(desc.branchType() == InEvent) {
290  if(desc.produced()) {
291  keptProductsInEvent.insert(desc.originalBranchID());
292  } else {
293  keptProductsInEvent.insert(desc.branchID());
294  }
295  }
296  // Now put it in the list of selected branches.
297  keptProducts_[desc.branchType()].push_back(&desc);
298  }
299 
300  void
301  SubProcess::fixBranchIDListsForEDAliases(std::map<BranchID::value_type, BranchID::value_type> const& droppedBranchIDToKeptBranchID) {
302  // Check for branches dropped while an EDAlias was kept.
303  // Replace BranchID of each dropped branch with that of the kept alias.
304  for(BranchIDList& branchIDList : branchIDListHelper_->mutableBranchIDLists()) {
305  for(BranchID::value_type& branchID : branchIDList) {
306  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter = droppedBranchIDToKeptBranchID.find(branchID);
307  if(iter != droppedBranchIDToKeptBranchID.end()) {
308  branchID = iter->second;
309  }
310  }
311  }
312  if(hasSubProcesses()) {
313  for(auto& subProcess : *subProcesses_) {
314  subProcess.fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID);
315  }
316  }
317  }
318 
319  void
322  /* BEGIN relevant bits from OutputModule::doEvent */
323  if(!wantAllEvents_) {
324  // use module description and const_cast unless interface to
325  // event is changed to just take a const EventPrincipal
326  if(!selectors_.wantEvent(ep, nullptr)) {
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);
358  schedule_->processOneEvent<Traits>(ep.streamID().value(),ep, esp_->eventSetup());
359  if(hasSubProcesses()) {
360  for(auto& subProcess : *subProcesses_) {
361  subProcess.doEvent(ep);
362  }
363  }
364  ep.clearEventPrincipal();
365  }
366 
367  void
370  beginRun(principal,ts);
371  }
372 
373  void
375  auto aux = std::make_shared<RunAuxiliary>(principal.aux());
376  aux->setProcessHistoryID(principal.processHistoryID());
377  auto rpp = std::make_shared<RunPrincipal>(aux, preg_, *processConfiguration_, &(historyAppenders_[historyRunOffset_+principal.index()]),principal.index());
378  auto & processHistoryRegistry = processHistoryRegistries_[historyRunOffset_+principal.index()];
379  processHistoryRegistry.registerProcessHistory(principal.processHistory());
380  rpp->fillRunPrincipal(processHistoryRegistry, principal.reader());
381  principalCache_.insert(rpp);
382 
383  ProcessHistoryID const& parentInputReducedPHID = principal.reducedProcessHistoryID();
384  ProcessHistoryID const& inputReducedPHID = rpp->reducedProcessHistoryID();
385 
386  parentToChildPhID_.insert(std::make_pair(parentInputReducedPHID,inputReducedPHID));
387 
389  propagateProducts(InRun, principal, rp);
391  schedule_->processOneGlobal<Traits>(rp, esp_->eventSetupForInstance(ts));
392  if(hasSubProcesses()) {
393  for(auto& subProcess : *subProcesses_) {
394  subProcess.doBeginRun(rp, ts);
395  }
396  }
397  }
398 
399  void
400  SubProcess::doEndRun(RunPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
402  endRun(principal,ts,cleaningUpAfterException);
403  }
404 
405  void
406  SubProcess::endRun(RunPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
408  propagateProducts(InRun, principal, rp);
410  schedule_->processOneGlobal<Traits>(rp, esp_->eventSetupForInstance(ts), cleaningUpAfterException);
411  if(hasSubProcesses()) {
412  for(auto& subProcess : *subProcesses_) {
413  subProcess.doEndRun(rp, ts, cleaningUpAfterException);
414  }
415  }
416  }
417 
418  void
421  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
422  assert(it != parentToChildPhID_.end());
423  schedule_->writeRun(principalCache_.runPrincipal(it->second, runNumber), &processContext_);
424  if(hasSubProcesses()) {
425  for(auto& subProcess : *subProcesses_) {
426  subProcess.writeRun(it->second, runNumber);
427  }
428  }
429  }
430 
431  void
433  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
434  assert(it != parentToChildPhID_.end());
435  principalCache_.deleteRun(it->second, runNumber);
436  if(hasSubProcesses()) {
437  for(auto& subProcess : *subProcesses_) {
438  subProcess.deleteRunFromCache(it->second, runNumber);
439  }
440  }
441  }
442 
443  void
446  beginLuminosityBlock(principal,ts);
447  }
448 
449  void
451  auto aux = std::make_shared<LuminosityBlockAuxiliary>(principal.aux());
452  aux->setProcessHistoryID(principal.processHistoryID());
453  auto lbpp = std::make_shared<LuminosityBlockPrincipal>(aux, preg_, *processConfiguration_, &(historyAppenders_[historyLumiOffset_+principal.index()]),principal.index());
454  auto & processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_+principal.index()];
455  processHistoryRegistry.registerProcessHistory(principal.processHistory());
456  lbpp->fillLuminosityBlockPrincipal(processHistoryRegistry, principal.reader());
457  lbpp->setRunPrincipal(principalCache_.runPrincipalPtr());
458  principalCache_.insert(lbpp);
460  propagateProducts(InLumi, principal, lbp);
462  schedule_->processOneGlobal<Traits>(lbp, esp_->eventSetupForInstance(ts));
463  if(hasSubProcesses()) {
464  for(auto& subProcess : *subProcesses_) {
465  subProcess.doBeginLuminosityBlock(lbp, ts);
466  }
467  }
468  }
469 
470  void
471  SubProcess::doEndLuminosityBlock(LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
473  endLuminosityBlock(principal,ts,cleaningUpAfterException);
474  }
475 
476  void
477  SubProcess::endLuminosityBlock(LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
479  propagateProducts(InLumi, principal, lbp);
481  schedule_->processOneGlobal<Traits>(lbp, esp_->eventSetupForInstance(ts), cleaningUpAfterException);
482  if(hasSubProcesses()) {
483  for(auto& subProcess : *subProcesses_) {
484  subProcess.doEndLuminosityBlock(lbp, ts, cleaningUpAfterException);
485  }
486  }
487  }
488 
489  void
490  SubProcess::writeLumi(ProcessHistoryID const& parentPhID, int runNumber, int lumiNumber) {
492  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
493  assert(it != parentToChildPhID_.end());
494  schedule_->writeLumi(principalCache_.lumiPrincipal(it->second, runNumber, lumiNumber), &processContext_);
495  if(hasSubProcesses()) {
496  for(auto& subProcess : *subProcesses_) {
497  subProcess.writeLumi(it->second, runNumber, lumiNumber);
498  }
499  }
500  }
501 
502  void
503  SubProcess::deleteLumiFromCache(ProcessHistoryID const& parentPhID, int runNumber, int lumiNumber) {
504  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
505  assert(it != parentToChildPhID_.end());
506  principalCache_.deleteLumi(it->second, runNumber, lumiNumber);
507  if(hasSubProcesses()) {
508  for(auto& subProcess : *subProcesses_) {
509  subProcess.deleteLumiFromCache(it->second, runNumber, lumiNumber);
510  }
511  }
512  }
513 
514  void
515  SubProcess::doBeginStream(unsigned int iID) {
517  schedule_->beginStream(iID);
518  if(hasSubProcesses()) {
519  for(auto& subProcess : *subProcesses_) {
520  subProcess.doBeginStream(iID);
521  }
522  }
523  }
524 
525  void
526  SubProcess::doEndStream(unsigned int iID) {
528  schedule_->endStream(iID);
529  if(hasSubProcesses()) {
530  for(auto& subProcess : *subProcesses_) {
531  subProcess.doEndStream(iID);
532  }
533  }
534  }
535 
536  void
537  SubProcess::doStreamBeginRun(unsigned int id, RunPrincipal const& principal, IOVSyncValue const& ts) {
539  {
542  schedule_->processOneStream<Traits>(id,rp, esp_->eventSetupForInstance(ts));
543  if(hasSubProcesses()) {
544  for(auto& subProcess : *subProcesses_) {
545  subProcess.doStreamBeginRun(id,rp, ts);
546  }
547  }
548  }
549  }
550 
551  void
552  SubProcess::doStreamEndRun(unsigned int id, RunPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
554  {
557  schedule_->processOneStream<Traits>(id,rp, esp_->eventSetupForInstance(ts),cleaningUpAfterException);
558  if(hasSubProcesses()) {
559  for(auto& subProcess : *subProcesses_) {
560  subProcess.doStreamEndRun(id,rp, ts,cleaningUpAfterException);
561  }
562  }
563  }
564  }
565 
566  void
569  {
572  schedule_->processOneStream<Traits>(id,lbp, esp_->eventSetupForInstance(ts));
573  if(hasSubProcesses()) {
574  for(auto& subProcess : *subProcesses_) {
575  subProcess.doStreamBeginLuminosityBlock(id,lbp, ts);
576  }
577  }
578  }
579  }
580 
581  void
582  SubProcess::doStreamEndLuminosityBlock(unsigned int id, LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
584  {
587  schedule_->processOneStream<Traits>(id,lbp, esp_->eventSetupForInstance(ts),cleaningUpAfterException);
588  if(hasSubProcesses()) {
589  for(auto& subProcess : *subProcesses_) {
590  subProcess.doStreamEndLuminosityBlock(id,lbp, ts,cleaningUpAfterException);
591  }
592  }
593  }
594  }
595 
596 
597  void
599  SelectedProducts const& keptVector = keptProducts()[type];
600  for(auto const& item : keptVector) {
601  ProductHolderBase const* parentProductHolder = parentPrincipal.getProductHolder(item->branchID());
602  if(parentProductHolder != nullptr) {
603  ProductData const& parentData = parentProductHolder->productData();
604  ProductHolderBase* productHolder = principal.getModifiableProductHolder(item->branchID());
605  if(productHolder != nullptr) {
606  ProductData& thisData = productHolder->productData();
607  //Propagate the per event(run)(lumi) data for this product to the subprocess.
608  //First, the product itself.
609  thisData.connectTo(parentData);
610  // Sets unavailable flag, if known that product is not available
611  (void)productHolder->productUnavailable();
612  }
613  }
614  }
615  }
616 
618  branchIDListHelper_->updateFromParent(branchIDLists);
619  if(hasSubProcesses()) {
620  for(auto& subProcess : *subProcesses_) {
621  subProcess.updateBranchIDListHelper(branchIDListHelper_->branchIDLists());
622  }
623  }
624  }
625 
626  // Call respondToOpenInputFile() on all Modules
627  void
630  schedule_->respondToOpenInputFile(fb);
631  if(hasSubProcesses()) {
632  for(auto& subProcess : *subProcesses_) {
633  subProcess.respondToOpenInputFile(fb);
634  }
635  }
636  }
637 
638  // free function
639  std::unique_ptr<std::vector<ParameterSet> >
641  std::vector<std::string> subProcesses = parameterSet.getUntrackedParameter<std::vector<std::string> >("@all_subprocesses");
642  if(!subProcesses.empty()) {
643  return parameterSet.popVParameterSet("subProcesses");
644  }
645  return std::unique_ptr<std::vector<ParameterSet> >(nullptr);
646  }
647 }
648 
unsigned int historyRunOffset_
Definition: SubProcess.h:308
unsigned int historyLumiOffset_
Definition: SubProcess.h:307
ParameterSetID selector_config_id_
Definition: SubProcess.h:329
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:154
T getUntrackedParameter(std::string const &, T const &) const
bool selected(BranchDescription const &desc) const
std::unique_ptr< std::vector< ParameterSet > > popVParameterSet(std::string const &name)
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:628
void doStreamEndLuminosityBlock(unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:582
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
ProcessHistoryID const & reducedProcessHistoryID() const
Definition: RunPrincipal.h:65
ConstProductHolderPtr getProductHolder(BranchID const &oid) const
Definition: Principal.cc:460
void doBeginRun(RunPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:368
void deleteLumi(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi)
void writeLumi(ProcessHistoryID const &parentPhID, int runNumber, int lumiNumber)
Definition: SubProcess.cc:490
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:290
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Definition: ScheduleItems.h:61
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:309
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:300
void beginRun(RunPrincipal const &r, IOVSyncValue const &ts)
Definition: SubProcess.cc:374
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:304
virtual ~SubProcess()
Definition: SubProcess.cc:195
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:617
LuminosityBlockAuxiliary const & aux() const
std::unique_ptr< std::vector< ParameterSet > > popSubProcessVParameterSet(ParameterSet &parameterSet)
Definition: SubProcess.cc:640
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:65
ProductHolderBase * getModifiableProductHolder(BranchID const &oid)
Definition: Principal.h:161
LuminosityBlockIndex index() const
void doEndStream(unsigned int)
Definition: SubProcess.cc:526
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void doEvent(EventPrincipal const &principal)
Definition: SubProcess.cc:320
void setParentProcessContext(ProcessContext const *parentProcessContext)
edm::propagate_const< std::unique_ptr< std::vector< SubProcess > > > subProcesses_
Definition: SubProcess.h:315
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:444
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:282
BranchListIndexes const & branchListIndexes() const
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:313
ProcessHistory const & processHistory() const
Definition: Principal.h:144
BranchType
Definition: BranchType.h:11
std::vector< EventSelectionID > EventSelectionIDVector
std::auto_ptr< Schedule > initSchedule(ParameterSet &parameterSet, bool hasSubprocesses, PreallocationConfiguration const &iAllocConfig, ProcessContext const *)
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 >)
ServiceToken serviceToken_
Definition: SubProcess.h:296
void deleteRunFromCache(ProcessHistoryID const &parentPhID, int runNumber)
Definition: SubProcess.cc:432
std::vector< BranchListIndex > BranchListIndexes
unsigned int value_type
Definition: BranchID.h:16
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:148
std::shared_ptr< CommonParams > initMisc(ParameterSet &parameterSet)
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:322
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > &keepAssociation)
Definition: SubProcess.cc:240
static void setThrowAnException(bool v)
void process(EventPrincipal const &e)
Definition: SubProcess.cc:335
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:323
def move
Definition: eostools.py:510
StreamID streamID() const
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:312
std::vector< BranchDescription const * > allBranchDescriptions() const
edm::propagate_const< std::unique_ptr< ParameterSet > > processParameterSet_
Definition: SubProcess.h:316
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:282
ProductData const & productData() const
Definition: ProductHolder.h:41
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
void beginLuminosityBlock(LuminosityBlockPrincipal const &lb, IOVSyncValue const &ts)
Definition: SubProcess.cc:450
void setProcessConfiguration(ProcessConfiguration const *processConfiguration)
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
std::unique_ptr< ExceptionToActionTable const > act_table_
Definition: SubProcess.h:301
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
DelayedReader * reader() const
Definition: Principal.h:185
void doEndRun(RunPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:400
std::shared_ptr< ProcessConfiguration const > processConfiguration() const
Definition: ScheduleItems.h:63
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:334
ProductSelector productSelector_
Definition: SubProcess.h:324
unsigned int value() const
Definition: StreamID.h:46
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:330
void doStreamBeginLuminosityBlock(unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:567
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:552
void connectToSubProcess(ActivityRegistry &iOther)
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:314
void deleteRun(ProcessHistoryID const &phid, RunNumber_t run)
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:295
void deleteLumiFromCache(ProcessHistoryID const &parentPhID, int runNumber, int lumiNumber)
Definition: SubProcess.cc:503
ServiceToken addCPRandTNS(ParameterSet const &parameterSet, ServiceToken const &token)
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:299
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:406
RunIndex index() const
Definition: RunPrincipal.h:53
bool anyProductProduced() const
bool wantEvent(EventPrincipal const &e, ModuleCallingContext const *)
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:310
std::vector< BranchID::value_type > BranchIDList
Definition: BranchIDList.h:18
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
void endLuminosityBlock(LuminosityBlockPrincipal const &lb, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:477
bool initialized() const
std::vector< std::string > const & getAllTriggerNames()
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
std::vector< BranchDescription const * > SelectedProducts
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:598
void doBeginStream(unsigned int)
Definition: SubProcess.cc:515
bool hasSubProcesses() const
Definition: SubProcess.h:286
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
void fixBranchIDListsForEDAliases(std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: SubProcess.cc:301
ProcessContext processContext_
Definition: SubProcess.h:303
void writeRun(ProcessHistoryID const &parentPhID, int runNumber)
Definition: SubProcess.cc:419
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:292
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:374
EventAuxiliary const & aux() const
void connectTo(ProductData const &iOther)
Definition: ProductData.h:69
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector)
ParameterSet const & registerIt()
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:298
PrincipalCache principalCache_
Definition: SubProcess.h:311
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11
void doStreamBeginRun(unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts)
Definition: SubProcess.cc:537
void doEndLuminosityBlock(LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:471
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:302
RunPrincipal & runPrincipal(ProcessHistoryID const &phid, RunNumber_t run) const
bool productUnavailable() const
Definition: ProductHolder.h:73