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  subProcess_(),
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  processParameterSet_.reset(parameterSet.popParameterSet(std::string("process")).release());
92 
93  // if this process has a maxEvents or maxLuminosityBlocks parameter set, remove them.
94  if(processParameterSet_->exists(maxEvents)) {
95  processParameterSet_->popParameterSet(maxEvents);
96  }
97  if(processParameterSet_->exists(maxLumis)) {
98  processParameterSet_->popParameterSet(maxLumis);
99  }
100 
101  // if the top level process has a maxEvents or maxLuminosityBlocks parameter set, add them to this process.
102  if(topLevelParameterSet.exists(maxEvents)) {
103  processParameterSet_->addUntrackedParameter<ParameterSet>(maxEvents, topLevelParameterSet.getUntrackedParameterSet(maxEvents));
104  }
105  if(topLevelParameterSet.exists(maxLumis)) {
106  processParameterSet_->addUntrackedParameter<ParameterSet>(maxLumis, topLevelParameterSet.getUntrackedParameterSet(maxLumis));
107  }
108 
109  // If this process has a subprocess, pop the subprocess parameter set out of the process parameter set
110 
111  std::shared_ptr<ParameterSet> subProcessParameterSet(popSubProcessParameterSet(*processParameterSet_).release());
112 
113  ScheduleItems items(*parentProductRegistry, *this);
114  actReg_ = items.actReg_;
115 
116  ParameterSet const& optionsPset(processParameterSet_->getUntrackedParameterSet("options", ParameterSet()));
117  IllegalParameters::setThrowAnException(optionsPset.getUntrackedParameter<bool>("throwIfIllegalParameter", true));
118 
119  //initialize the services
120  ServiceToken iToken;
121 
122  // get any configured services.
123  std::auto_ptr<std::vector<ParameterSet> > serviceSets = processParameterSet_->popVParameterSet(std::string("services"));
124 
125  ServiceToken newToken = items.initServices(*serviceSets, *processParameterSet_, token, iLegacy, false);
126  parentActReg.connectToSubProcess(*items.actReg_);
127  serviceToken_ = items.addCPRandTNS(*processParameterSet_, newToken);
128 
129 
130  //make the services available
132 
133  // intialize miscellaneous items
134  items.initMisc(*processParameterSet_);
135 
136  // intialize the event setup provider
137  esp_ = esController.makeProvider(*processParameterSet_);
138 
139  branchIDListHelper_ = items.branchIDListHelper_;
140  updateBranchIDListHelper(parentBranchIDListHelper->branchIDLists());
141 
142  thinnedAssociationsHelper_ = items.thinnedAssociationsHelper_;
143  thinnedAssociationsHelper_->updateFromParentProcess(parentThinnedAssociationsHelper, keepAssociation, droppedBranchIDToKeptBranchID_);
144 
145  // intialize the Schedule
146  schedule_ = items.initSchedule(*processParameterSet_,subProcessParameterSet.get(),preallocConfig,&processContext_);
147 
148  // set the items
149  act_table_ = std::move(items.act_table_);
150  preg_.reset(items.preg_.release());
151  //CMS-THREADING this only works since Run/Lumis are synchronous so when principalCache asks for
152  // the reducedProcessHistoryID from a full ProcessHistoryID that registry will not be in use by
153  // another thread. We really need to change how this is done in the PrincipalCache.
155 
156 
157  processConfiguration_ = items.processConfiguration_;
159  processContext_.setParentProcessContext(parentProcessContext);
160 
162  for(unsigned int index = 0; index < preallocConfig.numberOfStreams(); ++index) {
163  auto ep = std::make_shared<EventPrincipal>(preg_, branchIDListHelper_, thinnedAssociationsHelper_, *processConfiguration_, &(historyAppenders_[index]), index);
164  ep->preModuleDelayedGetSignal_.connect(std::cref(items.actReg_->preModuleEventDelayedGetSignal_));
165  ep->postModuleDelayedGetSignal_.connect(std::cref(items.actReg_->postModuleEventDelayedGetSignal_));
167  }
168  if(subProcessParameterSet) {
169  subProcess_.reset(new SubProcess(*subProcessParameterSet,
170  topLevelParameterSet,
171  preg_,
173  *thinnedAssociationsHelper_,
174  esController,
175  *items.actReg_,
176  newToken,
177  iLegacy,
178  preallocConfig,
179  &processContext_));
180  }
181  }
182 
184 
185  void
187  this->beginJob();
188  }
189 
190  void
192  endJob();
193  }
194 
195 
196  void
200  }
203  actReg_->preBeginJobSignal_(pathsAndConsumesOfModules_, processContext_);
204  schedule_->beginJob(*preg_);
205  if(subProcess_.get()) subProcess_->doBeginJob();
206  }
207 
208  void
211  ExceptionCollector c("Multiple exceptions were thrown while executing endJob. An exception message follows for each.");
212  schedule_->endJob(c);
213  if(subProcess_.get()) c.call([this](){ this->subProcess_->doEndJob();});
214  if(c.hasThrown()) {
215  c.rethrow();
216  }
217  }
218 
219  void
220  SubProcess::selectProducts(ProductRegistry const& preg,
221  ThinnedAssociationsHelper const& parentThinnedAssociationsHelper,
222  std::map<BranchID, bool>& keepAssociation) {
223  if(productSelector_.initialized()) return;
224  productSelector_.initialize(productSelectorRules_, preg.allBranchDescriptions());
225 
226  // TODO: See if we can collapse keptProducts_ and productSelector_ into a
227  // single object. See the notes in the header for ProductSelector
228  // for more information.
229 
230  std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
231  std::vector<BranchDescription const*> associationDescriptions;
232  std::set<BranchID> keptProductsInEvent;
233 
234  for(auto const& it : preg.productList()) {
235  BranchDescription const& desc = it.second;
236  if(desc.transient()) {
237  // if the class of the branch is marked transient, output nothing
238  } else if(!desc.present() && !desc.produced()) {
239  // else if the branch containing the product has been previously dropped,
240  // output nothing
241  } else if(desc.unwrappedType() == typeid(ThinnedAssociation)) {
242  associationDescriptions.push_back(&desc);
243  } else if(productSelector_.selected(desc)) {
244  keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
245  }
246  }
247 
248  parentThinnedAssociationsHelper.selectAssociationProducts(associationDescriptions,
249  keptProductsInEvent,
250  keepAssociation);
251 
252  for(auto association : associationDescriptions) {
253  if(keepAssociation[association->branchID()]) {
254  keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
255  }
256  }
257 
258  // Now fill in a mapping needed in the case that a branch was dropped while its EDAlias was kept.
259  ProductSelector::fillDroppedToKept(preg, trueBranchIDToKeptBranchDesc, droppedBranchIDToKeptBranchID_);
260  }
261 
262  void SubProcess::keepThisBranch(BranchDescription const& desc,
263  std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
264  std::set<BranchID>& keptProductsInEvent) {
265 
266  ProductSelector::checkForDuplicateKeptBranch(desc,
267  trueBranchIDToKeptBranchDesc);
268 
269  if(desc.branchType() == InEvent) {
270  if(desc.produced()) {
271  keptProductsInEvent.insert(desc.originalBranchID());
272  } else {
273  keptProductsInEvent.insert(desc.branchID());
274  }
275  }
276  // Now put it in the list of selected branches.
277  keptProducts_[desc.branchType()].push_back(&desc);
278  }
279 
280  void
281  SubProcess::fixBranchIDListsForEDAliases(std::map<BranchID::value_type, BranchID::value_type> const& droppedBranchIDToKeptBranchID) {
282  // Check for branches dropped while an EDAlias was kept.
283  // Replace BranchID of each dropped branch with that of the kept alias.
284  for(BranchIDList& branchIDList : branchIDListHelper_->mutableBranchIDLists()) {
285  for(BranchID::value_type& branchID : branchIDList) {
286  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter = droppedBranchIDToKeptBranchID.find(branchID);
287  if(iter != droppedBranchIDToKeptBranchID.end()) {
288  branchID = iter->second;
289  }
290  }
291  }
292  if(subProcess_.get()) subProcess_->fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID);
293  }
294 
295  void
296  SubProcess::doEvent(EventPrincipal const& ep) {
297  ServiceRegistry::Operate operate(serviceToken_);
298  /* BEGIN relevant bits from OutputModule::doEvent */
299  detail::TRBESSentry products_sentry(selectors_);
300 
301 
302  if(!wantAllEvents_) {
303  // use module description and const_cast unless interface to
304  // event is changed to just take a const EventPrincipal
305  if(!selectors_.wantEvent(ep, nullptr)) {
306  return;
307  }
308  }
309  process(ep);
310  /* END relevant bits from OutputModule::doEvent */
311  }
312 
313  void
315  EventAuxiliary aux(principal.aux());
316  aux.setProcessHistoryID(principal.processHistoryID());
317 
318  EventSelectionIDVector esids{principal.eventSelectionIDs()};
319  if (principal.productRegistry().anyProductProduced() || !wantAllEvents_) {
320  esids.push_back(selector_config_id_);
321  }
322 
323  EventPrincipal& ep = principalCache_.eventPrincipal(principal.streamID().value());
324  auto & processHistoryRegistry = processHistoryRegistries_[principal.streamID().value()];
325  processHistoryRegistry.registerProcessHistory(principal.processHistory());
326  BranchListIndexes bli(principal.branchListIndexes());
327  branchIDListHelper_->fixBranchListIndexes(bli);
329  processHistoryRegistry,
330  std::move(esids),
331  std::move(bli),
332  *(principal.productProvenanceRetrieverPtr()),//NOTE: this transfers the per product provenance
333  principal.reader());
334  ep.setLuminosityBlockPrincipal(principalCache_.lumiPrincipalPtr());
335  propagateProducts(InEvent, principal, ep);
337  schedule_->processOneEvent<Traits>(ep.streamID().value(),ep, esp_->eventSetup());
338  if(subProcess_.get()) subProcess_->doEvent(ep);
339  ep.clearEventPrincipal();
340  }
341 
342  void
343  SubProcess::doBeginRun(RunPrincipal const& principal, IOVSyncValue const& ts) {
344  ServiceRegistry::Operate operate(serviceToken_);
345  beginRun(principal,ts);
346  }
347 
348  void
349  SubProcess::beginRun(RunPrincipal const& principal, IOVSyncValue const& ts) {
350  auto aux = std::make_shared<RunAuxiliary>(principal.aux());
351  aux->setProcessHistoryID(principal.processHistoryID());
352  auto rpp = std::make_shared<RunPrincipal>(aux, preg_, *processConfiguration_, &(historyAppenders_[historyRunOffset_+principal.index()]),principal.index());
353  auto & processHistoryRegistry = processHistoryRegistries_[historyRunOffset_+principal.index()];
354  processHistoryRegistry.registerProcessHistory(principal.processHistory());
355  rpp->fillRunPrincipal(processHistoryRegistry, principal.reader());
356  principalCache_.insert(rpp);
357 
358  ProcessHistoryID const& parentInputReducedPHID = principal.reducedProcessHistoryID();
359  ProcessHistoryID const& inputReducedPHID = rpp->reducedProcessHistoryID();
360 
361  parentToChildPhID_.insert(std::make_pair(parentInputReducedPHID,inputReducedPHID));
362 
363  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
364  propagateProducts(InRun, principal, rp);
366  schedule_->processOneGlobal<Traits>(rp, esp_->eventSetupForInstance(ts));
367  if(subProcess_.get()) subProcess_->doBeginRun(rp, ts);
368  }
369 
370  void
371  SubProcess::doEndRun(RunPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
372  ServiceRegistry::Operate operate(serviceToken_);
373  endRun(principal,ts,cleaningUpAfterException);
374  }
375 
376  void
377  SubProcess::endRun(RunPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
378  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
379  propagateProducts(InRun, principal, rp);
381  schedule_->processOneGlobal<Traits>(rp, esp_->eventSetupForInstance(ts), cleaningUpAfterException);
382  if(subProcess_.get()) subProcess_->doEndRun(rp, ts, cleaningUpAfterException);
383  }
384 
385  void
386  SubProcess::writeRun(ProcessHistoryID const& parentPhID, int runNumber) {
387  ServiceRegistry::Operate operate(serviceToken_);
388  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
389  assert(it != parentToChildPhID_.end());
390  schedule_->writeRun(principalCache_.runPrincipal(it->second, runNumber), &processContext_);
391  if(subProcess_.get()) subProcess_->writeRun(it->second, runNumber);
392  }
393 
394  void
395  SubProcess::deleteRunFromCache(ProcessHistoryID const& parentPhID, int runNumber) {
396  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
397  assert(it != parentToChildPhID_.end());
398  principalCache_.deleteRun(it->second, runNumber);
399  if(subProcess_.get()) subProcess_->deleteRunFromCache(it->second, runNumber);
400  }
401 
402  void
403  SubProcess::doBeginLuminosityBlock(LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts) {
404  ServiceRegistry::Operate operate(serviceToken_);
405  beginLuminosityBlock(principal,ts);
406  }
407 
408  void
409  SubProcess::beginLuminosityBlock(LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts) {
410  auto aux = std::make_shared<LuminosityBlockAuxiliary>(principal.aux());
411  aux->setProcessHistoryID(principal.processHistoryID());
412  auto lbpp = std::make_shared<LuminosityBlockPrincipal>(aux, preg_, *processConfiguration_, &(historyAppenders_[historyLumiOffset_+principal.index()]),principal.index());
413  auto & processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_+principal.index()];
414  processHistoryRegistry.registerProcessHistory(principal.processHistory());
415  lbpp->fillLuminosityBlockPrincipal(processHistoryRegistry, principal.reader());
416  lbpp->setRunPrincipal(principalCache_.runPrincipalPtr());
417  principalCache_.insert(lbpp);
418  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
419  propagateProducts(InLumi, principal, lbp);
421  schedule_->processOneGlobal<Traits>(lbp, esp_->eventSetupForInstance(ts));
422  if(subProcess_.get()) subProcess_->doBeginLuminosityBlock(lbp, ts);
423  }
424 
425  void
426  SubProcess::doEndLuminosityBlock(LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
427  ServiceRegistry::Operate operate(serviceToken_);
428  endLuminosityBlock(principal,ts,cleaningUpAfterException);
429  }
430 
431  void
432  SubProcess::endLuminosityBlock(LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
433  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
434  propagateProducts(InLumi, principal, lbp);
436  schedule_->processOneGlobal<Traits>(lbp, esp_->eventSetupForInstance(ts), cleaningUpAfterException);
437  if(subProcess_.get()) subProcess_->doEndLuminosityBlock(lbp, ts, cleaningUpAfterException);
438  }
439 
440  void
441  SubProcess::writeLumi(ProcessHistoryID const& parentPhID, int runNumber, int lumiNumber) {
442  ServiceRegistry::Operate operate(serviceToken_);
443  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
444  assert(it != parentToChildPhID_.end());
445  schedule_->writeLumi(principalCache_.lumiPrincipal(it->second, runNumber, lumiNumber), &processContext_);
446  if(subProcess_.get()) subProcess_->writeLumi(it->second, runNumber, lumiNumber);
447  }
448 
449  void
450  SubProcess::deleteLumiFromCache(ProcessHistoryID const& parentPhID, int runNumber, int lumiNumber) {
451  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
452  assert(it != parentToChildPhID_.end());
453  principalCache_.deleteLumi(it->second, runNumber, lumiNumber);
454  if(subProcess_.get()) subProcess_->deleteLumiFromCache(it->second, runNumber, lumiNumber);
455  }
456 
457  void
458  SubProcess::doBeginStream(unsigned int iID) {
459  ServiceRegistry::Operate operate(serviceToken_);
460  schedule_->beginStream(iID);
461  if(subProcess_.get()) subProcess_->doBeginStream(iID);
462  }
463 
464  void
465  SubProcess::doEndStream(unsigned int iID) {
466  ServiceRegistry::Operate operate(serviceToken_);
467  schedule_->endStream(iID);
468  if(subProcess_.get()) subProcess_->doEndStream(iID);
469  }
470 
471  void
472  SubProcess::doStreamBeginRun(unsigned int id, RunPrincipal const& principal, IOVSyncValue const& ts) {
473  ServiceRegistry::Operate operate(serviceToken_);
474  {
475  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
477  schedule_->processOneStream<Traits>(id,rp, esp_->eventSetupForInstance(ts));
478  if(subProcess_.get()) subProcess_->doStreamBeginRun(id,rp, ts);
479  }
480  }
481 
482  void
483  SubProcess::doStreamEndRun(unsigned int id, RunPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
484  ServiceRegistry::Operate operate(serviceToken_);
485  {
486  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
488  schedule_->processOneStream<Traits>(id,rp, esp_->eventSetupForInstance(ts),cleaningUpAfterException);
489  if(subProcess_.get()) subProcess_->doStreamEndRun(id,rp, ts,cleaningUpAfterException);
490  }
491  }
492 
493  void
494  SubProcess::doStreamBeginLuminosityBlock(unsigned int id, LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts) {
495  ServiceRegistry::Operate operate(serviceToken_);
496  {
497  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
499  schedule_->processOneStream<Traits>(id,lbp, esp_->eventSetupForInstance(ts));
500  if(subProcess_.get()) subProcess_->doStreamBeginLuminosityBlock(id,lbp, ts);
501  }
502  }
503 
504  void
505  SubProcess::doStreamEndLuminosityBlock(unsigned int id, LuminosityBlockPrincipal const& principal, IOVSyncValue const& ts, bool cleaningUpAfterException) {
506  ServiceRegistry::Operate operate(serviceToken_);
507  {
508  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
510  schedule_->processOneStream<Traits>(id,lbp, esp_->eventSetupForInstance(ts),cleaningUpAfterException);
511  if(subProcess_.get()) subProcess_->doStreamEndLuminosityBlock(id,lbp, ts,cleaningUpAfterException);
512  }
513  }
514 
515 
516  void
517  SubProcess::propagateProducts(BranchType type, Principal const& parentPrincipal, Principal& principal) const {
518  SelectedProducts const& keptVector = keptProducts()[type];
519  for(auto const& item : keptVector) {
520  ProductHolderBase const* parentProductHolder = parentPrincipal.getProductHolder(item->branchID());
521  if(parentProductHolder != nullptr) {
522  ProductData const& parentData = parentProductHolder->productData();
523  ProductHolderBase const* productHolder = principal.getProductHolder(item->branchID());
524  if(productHolder != nullptr) {
525  ProductData& thisData = const_cast<ProductData&>(productHolder->productData());
526  //Propagate the per event(run)(lumi) data for this product to the subprocess.
527  //First, the product itself.
528  thisData.wrapper_ = parentData.wrapper_;
529  // Then the product ID and the ProcessHistory
530  thisData.prov_.setProductID(parentData.prov_.productID());
531  thisData.prov_.setProcessHistory(parentData.prov_.processHistory());
532  // Then the store, in case the product needs reading in a subprocess.
533  thisData.prov_.setStore(parentData.prov_.store());
534  // And last, the other per event provenance.
535  if(parentData.prov_.productProvenanceValid()) {
536  thisData.prov_.setProductProvenance(*parentData.prov_.productProvenance());
537  } else {
538  thisData.prov_.resetProductProvenance();
539  }
540  // Sets unavailable flag, if known that product is not available
541  (void)productHolder->productUnavailable();
542  }
543  }
544  }
545  }
546 
547  void SubProcess::updateBranchIDListHelper(BranchIDLists const& branchIDLists) {
548  branchIDListHelper_->updateFromParent(branchIDLists);
549  if(subProcess_.get()) {
550  subProcess_->updateBranchIDListHelper(branchIDListHelper_->branchIDLists());
551  }
552  }
553 
554  // Call respondToOpenInputFile() on all Modules
555  void
556  SubProcess::respondToOpenInputFile(FileBlock const& fb) {
557  ServiceRegistry::Operate operate(serviceToken_);
558  schedule_->respondToOpenInputFile(fb);
559  if(subProcess_.get()) subProcess_->respondToOpenInputFile(fb);
560  }
561 
562  // free function
563  std::auto_ptr<ParameterSet>
565  std::vector<std::string> subProcesses = parameterSet.getUntrackedParameter<std::vector<std::string> >("@all_subprocesses");
566  if(!subProcesses.empty()) {
567  assert(subProcesses.size() == 1U);
568  assert(subProcesses[0] == "@sub_process");
569  return parameterSet.popParameterSet(subProcesses[0]);
570  }
571  return std::auto_ptr<ParameterSet>(nullptr);
572  }
573 }
574 
unsigned int historyRunOffset_
Definition: SubProcess.h:247
ParameterSetID selector_config_id_
Definition: SubProcess.h:268
void insert(std::shared_ptr< RunPrincipal > rp)
bool productProvenanceValid() const
Definition: Provenance.h:53
type
Definition: HCALResponse.h:21
ProductRegistry const & productRegistry() const
Definition: Principal.h:147
T getUntrackedParameter(std::string const &, T const &) const
void setLuminosityBlockPrincipal(std::shared_ptr< LuminosityBlockPrincipal > const &lbp)
EventSelectionIDVector const & eventSelectionIDs() const
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:439
void setNumberOfConcurrentPrincipals(PreallocationConfiguration const &)
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:248
std::auto_ptr< ParameterSet > popSubProcessParameterSet(ParameterSet &parameterSet)
Definition: SubProcess.cc:564
Definition: Hash.h:42
boost::shared_ptr< eventsetup::EventSetupProvider > esp_
Definition: SubProcess.h:251
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:243
virtual ~SubProcess()
Definition: SubProcess.cc:183
assert(m_qm.get())
bool exists(std::string const &parameterName) const
checks if a parameter exists
void updateBranchIDListHelper(BranchIDLists const &)
Definition: SubProcess.cc:547
ProductProvenance * productProvenance() const
Definition: Provenance.h:49
LuminosityBlockAuxiliary const & aux() const
LuminosityBlockIndex index() const
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void setParentProcessContext(ProcessContext const *parentProcessContext)
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:229
BranchListIndexes const & branchListIndexes() const
void resetProductProvenance() const
Definition: Provenance.cc:72
ProcessHistory const & processHistory() const
Definition: Principal.h:137
BranchType
Definition: BranchType.h:11
std::vector< EventSelectionID > EventSelectionIDVector
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:235
Provenance prov_
Definition: ProductData.h:47
std::vector< BranchListIndex > BranchListIndexes
unsigned int value_type
Definition: BranchID.h:16
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:141
std::shared_ptr< ProductProvenanceRetriever > productProvenanceRetrieverPtr() const
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > &keepAssociation)
Definition: SubProcess.cc:220
ProcessHistory const & processHistory() const
Definition: Provenance.h:65
static void setThrowAnException(bool v)
std::shared_ptr< ProductProvenanceRetriever > const & store() const
Definition: Provenance.h:64
StreamID streamID() const
std::shared_ptr< WrapperBase > wrapper_
Definition: ProductData.h:46
std::vector< BranchDescription const * > allBranchDescriptions() const
std::auto_ptr< ParameterSet > popParameterSet(std::string const &name)
BranchID const & branchID() const
TypeWithDict const & unwrappedType() const
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:57
ProductData const & productData() const
Definition: ProductHolder.h:40
std::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: SubProcess.h:238
void setProcessConfiguration(ProcessConfiguration const *processConfiguration)
std::unique_ptr< ExceptionToActionTable const > act_table_
Definition: SubProcess.h:240
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
DelayedReader * reader() const
Definition: Principal.h:171
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:273
unsigned int value() const
Definition: StreamID.h:46
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:269
boost::shared_ptr< EventSetupProvider > makeProvider(ParameterSet &)
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:252
void connectToSubProcess(ActivityRegistry &iOther)
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:234
RunIndex index() const
Definition: RunPrincipal.h:53
bool anyProductProduced() const
void setProductID(ProductID const &pid)
Definition: Provenance.h:82
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:249
std::shared_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper_
Definition: SubProcess.h:239
std::vector< BranchID::value_type > BranchIDList
Definition: BranchIDList.h:18
void setStore(std::shared_ptr< ProductProvenanceRetriever > store) const
Definition: Provenance.h:74
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
std::unique_ptr< ParameterSet > processParameterSet_
Definition: SubProcess.h:255
std::vector< std::string > const & getAllTriggerNames()
void setProcessHistory(ProcessHistory const &ph)
Definition: Provenance.h:76
std::vector< BranchDescription const * > SelectedProducts
void fixBranchIDListsForEDAliases(std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: SubProcess.cc:281
void setProductProvenance(ProductProvenance const &prov) const
Definition: Provenance.cc:78
ProcessContext processContext_
Definition: SubProcess.h:242
BranchID const & originalBranchID() const
ProductID const & productID() const
Definition: Provenance.h:78
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)
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:370
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:254
tuple process
Definition: LaserDQM_cfg.py:3
EventAuxiliary const & aux() const
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:237
PrincipalCache principalCache_
Definition: SubProcess.h:250
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:241
bool productUnavailable() const
Definition: ProductHolder.h:69