CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::SubProcess Class Reference

#include <SubProcess.h>

Inheritance diagram for edm::SubProcess:
edm::EDConsumerBase

Public Types

using ProcessBlockType = PrincipalCache::ProcessBlockType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

void clearCounters ()
 Clear all the counters in the trigger report. More...
 
void clearLumiPrincipal (LuminosityBlockPrincipal &)
 
void clearProcessBlockPrincipal (ProcessBlockType)
 
void clearRunPrincipal (RunPrincipal &)
 
void closeOutputFiles ()
 
void doBeginJob ()
 
void doBeginLuminosityBlockAsync (WaitingTaskHolder iHolder, LumiTransitionInfo const &iTransitionInfo)
 
template<typename Traits >
void doBeginProcessBlockAsync (WaitingTaskHolder iHolder, ProcessBlockTransitionInfo const &iTransitionInfo, bool cleaningUpAfterException)
 
template<>
void doBeginProcessBlockAsync (WaitingTaskHolder iHolder, ProcessBlockTransitionInfo const &iTransitionInfo, bool cleaningUpAfterException)
 
template<>
void doBeginProcessBlockAsync (WaitingTaskHolder iHolder, ProcessBlockTransitionInfo const &iTransitionInfo, bool)
 
void doBeginRunAsync (WaitingTaskHolder iHolder, RunTransitionInfo const &iTransitionInfo)
 
void doBeginStream (unsigned int streamID)
 
void doEndJob (ExceptionCollector &)
 
void doEndLuminosityBlockAsync (WaitingTaskHolder iHolder, LumiTransitionInfo const &iTransitionInfo, bool cleaningUpAfterException)
 
void doEndProcessBlockAsync (WaitingTaskHolder iHolder, ProcessBlockTransitionInfo const &iTransitionInfo, bool cleaningUpAfterException)
 
void doEndRunAsync (WaitingTaskHolder iHolder, RunTransitionInfo const &iTransitionInfo, bool cleaningUpAfterException)
 
void doEndStream (unsigned int streamID, ExceptionCollector &collector, std::mutex &collectorMutex) noexcept
 
void doEventAsync (WaitingTaskHolder iHolder, EventPrincipal const &principal, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
 
void doStreamBeginLuminosityBlockAsync (WaitingTaskHolder iHolder, unsigned int iID, LumiTransitionInfo const &)
 
void doStreamBeginRunAsync (WaitingTaskHolder iHolder, unsigned int iID, RunTransitionInfo const &)
 
void doStreamEndLuminosityBlockAsync (WaitingTaskHolder iHolder, unsigned int iID, LumiTransitionInfo const &, bool cleaningUpAfterException)
 
void doStreamEndRunAsync (WaitingTaskHolder iHolder, unsigned int iID, RunTransitionInfo const &, bool cleaningUpAfterException)
 
std::vector< ModuleDescription const * > getAllModuleDescriptions () const
 Return a vector allowing const access to all the ModuleDescriptions for this SubProcess. More...
 
void getTriggerReport (TriggerReport &rep) const
 
std::vector< ModuleProcessNamekeepOnlyConsumedUnscheduledModules (bool deleteModules)
 
SelectedProductsForBranchType const & keptProducts () const
 
void openOutputFiles (FileBlock &fb)
 
SubProcessoperator= (SubProcess const &)=delete
 
SubProcessoperator= (SubProcess &&)=delete
 
void respondToCloseInputFile (FileBlock const &fb)
 
void respondToOpenInputFile (FileBlock const &fb)
 
void selectProducts (ProductRegistry const &preg, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > &keepAssociation)
 
bool shouldWeCloseOutput () const
 
 SubProcess (ParameterSet &parameterSet, ParameterSet const &topLevelParameterSet, std::shared_ptr< ProductRegistry const > parentProductRegistry, std::shared_ptr< BranchIDListHelper const > parentBranchIDListHelper, ProcessBlockHelperBase const &parentProcessBlockHelper, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, SubProcessParentageHelper const &parentSubProcessParentageHelper, eventsetup::EventSetupsController &esController, ActivityRegistry &parentActReg, ServiceToken const &token, serviceregistry::ServiceLegacy iLegacy, PreallocationConfiguration const &preallocConfig, ProcessContext const *parentProcessContext, ModuleTypeResolverMaker const *typeResolverMaker)
 
 SubProcess (SubProcess const &)=delete
 
 SubProcess (SubProcess &&)=default
 
bool terminate () const
 
int totalEvents () const
 
int totalEventsFailed () const
 
int totalEventsPassed () const
 Return the number of events which have been passed by one or more trigger paths. More...
 
void updateBranchIDListHelper (BranchIDLists const &)
 
void writeLumiAsync (WaitingTaskHolder, LuminosityBlockPrincipal &)
 
void writeProcessBlockAsync (edm::WaitingTaskHolder task, ProcessBlockType)
 
void writeRunAsync (WaitingTaskHolder, RunPrincipal const &, MergeableRunProductMetadata const *)
 
 ~SubProcess () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob ()
 
std::shared_ptr< BranchIDListHelper const > branchIDListHelper () const
 
std::shared_ptr< BranchIDListHelper > & branchIDListHelper ()
 
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID ()
 
void endJob (ExceptionCollector &)
 
void fixBranchIDListsForEDAliases (std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
 
void keepThisBranch (BranchDescription const &desc, std::map< BranchID, BranchDescription const *> &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
 
bool parentProducedProductIsKept (Principal const &parentPrincipal, Principal &principal) const
 
void processAsync (WaitingTaskHolder iHolder, EventPrincipal const &e, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
 
void propagateProducts (BranchType type, Principal const &parentPrincipal, Principal &principal) const
 
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper () const
 
std::shared_ptr< ThinnedAssociationsHelperthinnedAssociationsHelper ()
 

Private Attributes

std::unique_ptr< ExceptionToActionTable const > act_table_
 
std::shared_ptr< ActivityRegistryactReg_
 
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
 
std::map< BranchID::value_type, BranchID::value_typedroppedBranchIDToKeptBranchID_
 
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
 
std::vector< HistoryAppenderhistoryAppenders_
 
unsigned int historyLumiOffset_
 
unsigned int historyRunOffset_
 
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
 
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
 
SelectedProductsForBranchType keptProducts_
 
std::shared_ptr< ProductRegistry const > parentPreg_
 
PathsAndConsumesOfModules pathsAndConsumesOfModules_
 
std::shared_ptr< ProductRegistry const > preg_
 
PrincipalCache principalCache_
 
edm::propagate_const< std::shared_ptr< SubProcessBlockHelper > > processBlockHelper_
 
std::shared_ptr< ProcessConfiguration const > processConfiguration_
 
ProcessContext processContext_
 
std::vector< ProcessHistoryRegistryprocessHistoryRegistries_
 
edm::propagate_const< std::unique_ptr< ParameterSet > > processParameterSet_
 
ProductSelector productSelector_
 
ProductSelectorRules productSelectorRules_
 
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
 
ParameterSetID selector_config_id_
 
detail::TriggerResultsBasedEventSelector selectors_
 
ServiceToken serviceToken_
 
std::vector< SubProcesssubProcesses_
 
edm::propagate_const< std::shared_ptr< SubProcessParentageHelper > > subProcessParentageHelper_
 
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
 
bool wantAllEvents_
 

Additional Inherited Members

- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 56 of file SubProcess.h.

Member Typedef Documentation

◆ ProcessBlockType

Definition at line 139 of file SubProcess.h.

Constructor & Destructor Documentation

◆ SubProcess() [1/3]

edm::SubProcess::SubProcess ( ParameterSet parameterSet,
ParameterSet const &  topLevelParameterSet,
std::shared_ptr< ProductRegistry const >  parentProductRegistry,
std::shared_ptr< BranchIDListHelper const >  parentBranchIDListHelper,
ProcessBlockHelperBase const &  parentProcessBlockHelper,
ThinnedAssociationsHelper const &  parentThinnedAssociationsHelper,
SubProcessParentageHelper const &  parentSubProcessParentageHelper,
eventsetup::EventSetupsController esController,
ActivityRegistry parentActReg,
ServiceToken const &  token,
serviceregistry::ServiceLegacy  iLegacy,
PreallocationConfiguration const &  preallocConfig,
ProcessContext const *  parentProcessContext,
ModuleTypeResolverMaker const *  typeResolverMaker 
)

Definition at line 53 of file SubProcess.cc.

References act_table_, actReg_, branchIDListHelper(), branchIDListHelper_, edm::detail::configureEventSelector(), edm::ActivityRegistry::connectToSubProcess(), edm::EDConsumerBase::consumesCollector(), droppedBranchIDToKeptBranchID_, SiStripBadComponentsDQMServiceTemplate_cfg::ep, esp_, edm::ParameterSet::exists(), edm::getAllTriggerNames(), edm::ParameterSet::getUntrackedParameterSet(), historyAppenders_, historyLumiOffset_, historyRunOffset_, edm::PrincipalCache::insert(), edm::PrincipalCache::insertForInput(), inUseLumiPrincipals_, inUseRunPrincipals_, mps_monitormerge::items, edm::eventsetup::EventSetupsController::makeProvider(), Data_TkAlMinBias_Run2018C_PromptReco_v3_cff::maxEvents, eostools::move(), edm::PreallocationConfiguration::numberOfLuminosityBlocks(), edm::PreallocationConfiguration::numberOfRuns(), edm::PreallocationConfiguration::numberOfStreams(), edm::parameterSet(), edm::ParameterSet::popParameterSet(), edm::popSubProcessVParameterSet(), preg_, principalCache_, processBlockHelper_, processConfiguration_, processContext_, processParameterSet_, edm::ParameterSet::registerIt(), edm::detail::registerProperSelectionInfo(), schedule_, selector_config_id_, selectors_, selectProducts(), serviceToken_, edm::PrincipalCache::setNumberOfConcurrentPrincipals(), edm::ProcessContext::setParentProcessContext(), edm::ProcessContext::setProcessConfiguration(), AlCaHLTBitMon_QueryRunRegistry::string, subProcesses_, subProcessParentageHelper_, thinnedAssociationsHelper(), thinnedAssociationsHelper_, unpackBuffers-CaloStage2::token, updateBranchIDListHelper(), edm::validateTopLevelParameterSets(), and wantAllEvents_.

67  : EDConsumerBase(),
68  serviceToken_(),
69  parentPreg_(parentProductRegistry),
70  preg_(),
72  act_table_(),
74  historyLumiOffset_(preallocConfig.numberOfStreams()),
75  historyRunOffset_(historyLumiOffset_ + preallocConfig.numberOfLuminosityBlocks()),
76  processHistoryRegistries_(historyRunOffset_ + preallocConfig.numberOfRuns()),
77  historyAppenders_(historyRunOffset_ + preallocConfig.numberOfRuns()),
79  esp_(),
80  schedule_(),
81  subProcesses_(),
83  productSelectorRules_(parameterSet, "outputCommands", "OutputModule"),
85  wantAllEvents_(true) {
86  //Setup the event selection
87  Service<service::TriggerNamesService> tns;
88 
89  ParameterSet selectevents = parameterSet.getUntrackedParameterSet("SelectEvents", ParameterSet());
90 
91  selectevents.registerIt(); // Just in case this PSet is not registered
93  selectevents, tns->getProcessName(), getAllTriggerNames(), selectors_, consumesCollector());
94  std::map<std::string, std::vector<std::pair<std::string, int>>> outputModulePathPositions;
96  selectevents, "", outputModulePathPositions, parentProductRegistry->anyProductProduced());
97 
98  std::map<BranchID, bool> keepAssociation;
99  selectProducts(*parentProductRegistry, parentThinnedAssociationsHelper, keepAssociation);
100 
101  std::string const maxEvents("maxEvents");
102  std::string const maxLumis("maxLuminosityBlocks");
103 
104  // propagate_const<T> has no reset() function
106  std::unique_ptr<ParameterSet>(parameterSet.popParameterSet(std::string("process")).release());
107 
108  // if this process has a maxEvents or maxLuminosityBlocks parameter set, remove them.
109  if (processParameterSet_->exists(maxEvents)) {
110  processParameterSet_->popParameterSet(maxEvents);
111  }
112  if (processParameterSet_->exists(maxLumis)) {
113  processParameterSet_->popParameterSet(maxLumis);
114  }
115 
116  // if the top level process has a maxEvents or maxLuminosityBlocks parameter set, add them to this process.
117  if (topLevelParameterSet.exists(maxEvents)) {
118  processParameterSet_->addUntrackedParameter<ParameterSet>(
119  maxEvents, topLevelParameterSet.getUntrackedParameterSet(maxEvents));
120  }
121  if (topLevelParameterSet.exists(maxLumis)) {
122  processParameterSet_->addUntrackedParameter<ParameterSet>(
123  maxLumis, topLevelParameterSet.getUntrackedParameterSet(maxLumis));
124  }
125 
126  // If there are subprocesses, pop the subprocess parameter sets out of the process parameter set
127  auto subProcessVParameterSet = popSubProcessVParameterSet(*processParameterSet_);
128  bool hasSubProcesses = !subProcessVParameterSet.empty();
129 
130  // Validates the parameters in the 'options', 'maxEvents', and 'maxLuminosityBlocks'
131  // top level parameter sets. Default values are also set in here if the
132  // parameters were not explicitly set.
134 
135  processBlockHelper_ = std::make_shared<SubProcessBlockHelper>();
136 
137  ScheduleItems items(*parentProductRegistry, *this, *processBlockHelper_, parentProcessBlockHelper);
138  actReg_ = items.actReg_;
139 
140  //initialize the services
141  ServiceToken iToken;
142 
143  // get any configured services.
144  auto serviceSets = processParameterSet_->popVParameterSet(std::string("services"));
145 
146  ServiceToken newToken = items.initServices(serviceSets, *processParameterSet_, token, iLegacy, false);
147  parentActReg.connectToSubProcess(*items.actReg_);
148  serviceToken_ = items.addCPRandTNS(*processParameterSet_, newToken);
149 
150  //make the services available
152 
153  // intialize miscellaneous items
154  items.initMisc(*processParameterSet_);
155 
156  // intialize the event setup provider
157  esp_ = esController.makeProvider(*processParameterSet_, actReg_.get());
158 
159  branchIDListHelper_ = items.branchIDListHelper();
160  updateBranchIDListHelper(parentBranchIDListHelper->branchIDLists());
161 
162  thinnedAssociationsHelper_ = items.thinnedAssociationsHelper();
163  thinnedAssociationsHelper_->updateFromParentProcess(
164  parentThinnedAssociationsHelper, keepAssociation, droppedBranchIDToKeptBranchID_);
165 
166  // intialize the Schedule
167  schedule_ = items.initSchedule(*processParameterSet_,
168  hasSubProcesses,
169  preallocConfig,
171  typeResolverMaker,
173 
174  // set the items
175  act_table_ = std::move(items.act_table_);
176  preg_ = items.preg();
177 
178  subProcessParentageHelper_ = items.subProcessParentageHelper();
179  subProcessParentageHelper_->update(parentSubProcessParentageHelper, *parentProductRegistry);
180 
181  processConfiguration_ = items.processConfiguration();
183  processContext_.setParentProcessContext(parentProcessContext);
184 
186  for (unsigned int index = 0; index < preallocConfig.numberOfStreams(); ++index) {
187  auto ep = std::make_shared<EventPrincipal>(preg_,
192  index,
193  false /*not primary process*/,
196  }
197 
198  for (unsigned int index = 0; index < preallocConfig.numberOfRuns(); ++index) {
199  auto rpp = std::make_unique<RunPrincipal>(
202  }
203 
204  for (unsigned int index = 0; index < preallocConfig.numberOfLuminosityBlocks(); ++index) {
205  auto lbpp = std::make_unique<LuminosityBlockPrincipal>(
208  }
209 
210  {
211  auto pb = std::make_unique<ProcessBlockPrincipal>(preg_, *processConfiguration_, false);
213 
214  auto pbForInput = std::make_unique<ProcessBlockPrincipal>(preg_, *processConfiguration_, false);
216  }
217 
218  inUseRunPrincipals_.resize(preallocConfig.numberOfRuns());
219  inUseLumiPrincipals_.resize(preallocConfig.numberOfLuminosityBlocks());
220 
221  subProcesses_.reserve(subProcessVParameterSet.size());
222  for (auto& subProcessPSet : subProcessVParameterSet) {
223  subProcesses_.emplace_back(subProcessPSet,
224  topLevelParameterSet,
225  preg_,
230  esController,
231  *items.actReg_,
232  newToken,
233  iLegacy,
234  preallocConfig,
236  typeResolverMaker);
237  }
238  }
unsigned int historyRunOffset_
Definition: SubProcess.h:287
unsigned int historyLumiOffset_
Definition: SubProcess.h:286
ParameterSetID selector_config_id_
Definition: SubProcess.h:309
std::unique_ptr< ParameterSet > popParameterSet(std::string const &name)
std::vector< std::string > const & getAllTriggerNames()
void setNumberOfConcurrentPrincipals(PreallocationConfiguration const &)
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:288
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:278
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::shared_ptr< SubProcessBlockHelper > > processBlockHelper_
Definition: SubProcess.h:277
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: SubProcess.h:261
void updateBranchIDListHelper(BranchIDLists const &)
Definition: SubProcess.cc:823
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void setParentProcessContext(ProcessContext const *parentProcessContext)
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
void validateTopLevelParameterSets(ParameterSet *processParameterSet)
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:292
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Definition: SubProcess.h:265
ServiceToken serviceToken_
Definition: SubProcess.h:273
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:293
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > &keepAssociation)
Definition: SubProcess.cc:344
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:304
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:294
edm::propagate_const< std::unique_ptr< ParameterSet > > processParameterSet_
Definition: SubProcess.h:297
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector, ConsumesCollector &&iC)
void insert(std::unique_ptr< ProcessBlockPrincipal >)
void setProcessConfiguration(ProcessConfiguration const *processConfiguration)
std::unique_ptr< ExceptionToActionTable const > act_table_
Definition: SubProcess.h:280
std::vector< ParameterSet > popSubProcessVParameterSet(ParameterSet &parameterSet)
Definition: SubProcess.cc:837
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:314
ProductSelector productSelector_
Definition: SubProcess.h:305
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:310
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:272
void insertForInput(std::unique_ptr< ProcessBlockPrincipal >)
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:276
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:289
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:274
ProcessContext processContext_
Definition: SubProcess.h:282
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< ProductRegistry const > preg_
Definition: SubProcess.h:275
PrincipalCache principalCache_
Definition: SubProcess.h:290
def move(src, dest)
Definition: eostools.py:511
edm::propagate_const< std::shared_ptr< SubProcessParentageHelper > > subProcessParentageHelper_
Definition: SubProcess.h:279
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:281

◆ ~SubProcess()

edm::SubProcess::~SubProcess ( )
override

Definition at line 240 of file SubProcess.cc.

240 {}

◆ SubProcess() [2/3]

edm::SubProcess::SubProcess ( SubProcess const &  )
delete

◆ SubProcess() [3/3]

edm::SubProcess::SubProcess ( SubProcess &&  )
default

Member Function Documentation

◆ beginJob()

void edm::SubProcess::beginJob ( void  )
private

Definition at line 301 of file SubProcess.cc.

References CMS_SA_ALLOW, droppedBranchIDToKeptBranchID(), esp_, fixBranchIDListsForEDAliases(), edm::InEvent, parentPreg_, pathsAndConsumesOfModules_, preg_, processBlockHelper_, processContext_, schedule_, serviceToken_, subProcesses_, and edm::EDConsumerBase::updateLookup().

Referenced by doBeginJob().

301  {
302  // If event selection is being used, the SubProcess class reads TriggerResults
303  // object(s) in the parent process from the event. This next call is needed for
304  // getByToken to work properly. Normally, this is done by the worker, but since
305  // a SubProcess is not a module, it has no worker.
306  updateLookup(InEvent, *parentPreg_->productLookup(InEvent), false);
307 
308  if (!droppedBranchIDToKeptBranchID().empty()) {
310  }
312 
313  std::exception_ptr firstException;
314  CMS_SA_ALLOW try {
315  schedule_->beginJob(
316  *preg_, esp_->recordsToResolverIndices(), *processBlockHelper_, pathsAndConsumesOfModules_, processContext_);
317  } catch (...) {
318  firstException = std::current_exception();
319  }
320  for (auto& subProcess : subProcesses_) {
321  CMS_SA_ALLOW try { subProcess.doBeginJob(); } catch (...) {
322  if (!firstException) {
323  firstException = std::current_exception();
324  }
325  }
326  }
327  if (firstException) {
328  std::rethrow_exception(firstException);
329  }
330  }
#define CMS_SA_ALLOW
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::shared_ptr< SubProcessBlockHelper > > processBlockHelper_
Definition: SubProcess.h:277
void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:283
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:257
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:294
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:274
void fixBranchIDListsForEDAliases(std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: SubProcess.cc:405
ProcessContext processContext_
Definition: SubProcess.h:282
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:275

◆ branchIDListHelper() [1/2]

std::shared_ptr<BranchIDListHelper const> edm::SubProcess::branchIDListHelper ( ) const
inlineprivate

Definition at line 261 of file SubProcess.h.

References branchIDListHelper_, and edm::get_underlying_safe().

Referenced by SubProcess().

261  {
263  }
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:276

◆ branchIDListHelper() [2/2]

std::shared_ptr<BranchIDListHelper>& edm::SubProcess::branchIDListHelper ( )
inlineprivate

Definition at line 264 of file SubProcess.h.

References branchIDListHelper_, and edm::get_underlying_safe().

constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:276

◆ clearCounters()

void edm::SubProcess::clearCounters ( )
inline

Clear all the counters in the trigger report.

Definition at line 236 of file SubProcess.h.

References edm::for_all(), schedule_, serviceToken_, and subProcesses_.

236  {
238  schedule_->clearCounters();
239  for_all(subProcesses_, [](auto& subProcess) { subProcess.clearCounters(); });
240  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:273

◆ clearLumiPrincipal()

void edm::SubProcess::clearLumiPrincipal ( LuminosityBlockPrincipal principal)

Definition at line 698 of file SubProcess.cc.

References edm::LuminosityBlockPrincipal::index(), inUseLumiPrincipals_, eostools::move(), alignCSCRings::s, and subProcesses_.

698  {
699  //release from list but stay around till end of routine
700  auto lb = std::move(inUseLumiPrincipals_[principal.index()]);
701  for (auto& s : subProcesses_) {
702  s.clearLumiPrincipal(*lb);
703  }
704  lb->setRunPrincipal(std::shared_ptr<RunPrincipal>());
705  lb->clearPrincipal();
706  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:293
def move(src, dest)
Definition: eostools.py:511

◆ clearProcessBlockPrincipal()

void edm::SubProcess::clearProcessBlockPrincipal ( ProcessBlockType  processBlockType)

Definition at line 639 of file SubProcess.cc.

References edm::Principal::clearPrincipal(), principalCache_, edm::PrincipalCache::processBlockPrincipal(), alignCSCRings::s, and subProcesses_.

639  {
640  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal(processBlockType);
641  processBlockPrincipal.clearPrincipal();
642  for (auto& s : subProcesses_) {
643  s.clearProcessBlockPrincipal(processBlockType);
644  }
645  }
void clearPrincipal()
Definition: Principal.cc:386
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
ProcessBlockPrincipal & processBlockPrincipal() const
PrincipalCache principalCache_
Definition: SubProcess.h:290

◆ clearRunPrincipal()

void edm::SubProcess::clearRunPrincipal ( RunPrincipal parentPrincipal)

Definition at line 630 of file SubProcess.cc.

References edm::RunPrincipal::index(), inUseRunPrincipals_, eostools::move(), alignCSCRings::s, and subProcesses_.

630  {
631  //release from list but stay around till end of routine
632  auto rp = std::move(inUseRunPrincipals_[parentPrincipal.index()]);
633  for (auto& s : subProcesses_) {
634  s.clearRunPrincipal(*rp);
635  }
636  rp->clearPrincipal();
637  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:292
def move(src, dest)
Definition: eostools.py:511

◆ closeOutputFiles()

void edm::SubProcess::closeOutputFiles ( )
inline

Definition at line 149 of file SubProcess.h.

References edm::for_all(), schedule_, serviceToken_, and subProcesses_.

149  {
151  schedule_->closeOutputFiles();
152  for_all(subProcesses_, [](auto& subProcess) { subProcess.closeOutputFiles(); });
153  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:273

◆ doBeginJob()

void edm::SubProcess::doBeginJob ( )

Definition at line 297 of file SubProcess.cc.

References beginJob().

297 { beginJob(); }

◆ doBeginLuminosityBlockAsync()

void edm::SubProcess::doBeginLuminosityBlockAsync ( WaitingTaskHolder  iHolder,
LumiTransitionInfo const &  iTransitionInfo 
)

Definition at line 647 of file SubProcess.cc.

References printConversionInfo::aux, edm::LuminosityBlockPrincipal::aux(), esp_, edm::LumiTransitionInfo::eventSetupImpls(), edm::PrincipalCache::getAvailableLumiPrincipalPtr(), historyLumiOffset_, edm::LuminosityBlockPrincipal::index(), edm::RunPrincipal::index(), edm::InLumi, inUseLumiPrincipals_, inUseRunPrincipals_, eostools::move(), edm::LumiTransitionInfo::principal(), principalCache_, edm::Principal::processHistory(), edm::Principal::processHistoryID(), processHistoryRegistries_, propagateProducts(), edm::Principal::reader(), edm::LuminosityBlockPrincipal::runPrincipal(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoGlobalBeginTransitionAsync().

647  {
649 
650  LuminosityBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
651  auto aux = parentPrincipal.aux();
652  aux.setProcessHistoryID(parentPrincipal.processHistoryID());
654  lbpp->setAux(aux);
655  auto& processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_ + lbpp->index()];
656  inUseLumiPrincipals_[parentPrincipal.index()] = lbpp;
657  processHistoryRegistry.registerProcessHistory(parentPrincipal.processHistory());
658  lbpp->fillLuminosityBlockPrincipal(&parentPrincipal.processHistory(), parentPrincipal.reader());
659  lbpp->setRunPrincipal(inUseRunPrincipals_[parentPrincipal.runPrincipal().index()]);
660  LuminosityBlockPrincipal& lbp = *lbpp;
661  propagateProducts(InLumi, parentPrincipal, lbp);
662 
663  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
664  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
665  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalBegin>;
666  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
667  }
unsigned int historyLumiOffset_
Definition: SubProcess.h:286
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:288
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:273
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:293
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:294
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:790
std::shared_ptr< LuminosityBlockPrincipal > getAvailableLumiPrincipalPtr()
PrincipalCache principalCache_
Definition: SubProcess.h:290
def move(src, dest)
Definition: eostools.py:511

◆ doBeginProcessBlockAsync() [1/3]

template<typename Traits >
void edm::SubProcess::doBeginProcessBlockAsync ( WaitingTaskHolder  iHolder,
ProcessBlockTransitionInfo const &  iTransitionInfo,
bool  cleaningUpAfterException 
)

◆ doBeginProcessBlockAsync() [2/3]

template<>
void edm::SubProcess::doBeginProcessBlockAsync ( WaitingTaskHolder  iHolder,
ProcessBlockTransitionInfo const &  iTransitionInfo,
bool  cleaningUpAfterException 
)

Definition at line 485 of file SubProcess.cc.

References edm::ProcessBlockPrincipal::fillProcessBlockPrincipal(), edm::InProcess, edm::PrincipalCache::inputProcessBlockPrincipal(), eostools::move(), principalCache_, edm::ProcessBlockPrincipal::processName(), propagateProducts(), edm::Principal::reader(), schedule_, serviceToken_, and subProcesses_.

486  {
488 
489  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
490  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
491  processBlockPrincipal.fillProcessBlockPrincipal(parentPrincipal.processName(), parentPrincipal.reader());
492  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
493 
494  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
495  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionProcessBlockInput>;
496  beginGlobalTransitionAsync<Traits>(
497  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
498  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
ProcessBlockPrincipal & inputProcessBlockPrincipal() const
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
void fillProcessBlockPrincipal(std::string const &processName, DelayedReader *reader=nullptr)
ServiceToken serviceToken_
Definition: SubProcess.h:273
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:790
PrincipalCache principalCache_
Definition: SubProcess.h:290
def move(src, dest)
Definition: eostools.py:511

◆ doBeginProcessBlockAsync() [3/3]

template<>
void edm::SubProcess::doBeginProcessBlockAsync ( WaitingTaskHolder  iHolder,
ProcessBlockTransitionInfo const &  iTransitionInfo,
bool   
)

Definition at line 501 of file SubProcess.cc.

References edm::ProcessBlockPrincipal::fillProcessBlockPrincipal(), edm::InProcess, eostools::move(), principalCache_, edm::PrincipalCache::processBlockPrincipal(), processConfiguration_, propagateProducts(), schedule_, serviceToken_, and subProcesses_.

502  {
504 
505  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal();
506  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
507  processBlockPrincipal.fillProcessBlockPrincipal(processConfiguration_->processName());
508  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
509 
510  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
511  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionGlobalBegin>;
512  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
513  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
void fillProcessBlockPrincipal(std::string const &processName, DelayedReader *reader=nullptr)
ProcessBlockPrincipal & processBlockPrincipal() const
ServiceToken serviceToken_
Definition: SubProcess.h:273
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:790
PrincipalCache principalCache_
Definition: SubProcess.h:290
def move(src, dest)
Definition: eostools.py:511
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:281

◆ doBeginRunAsync()

void edm::SubProcess::doBeginRunAsync ( WaitingTaskHolder  iHolder,
RunTransitionInfo const &  iTransitionInfo 
)

Definition at line 563 of file SubProcess.cc.

References printConversionInfo::aux, edm::RunPrincipal::aux(), esp_, edm::RunTransitionInfo::eventSetupImpls(), edm::PrincipalCache::getAvailableRunPrincipalPtr(), historyRunOffset_, edm::RunPrincipal::index(), edm::InRun, inUseRunPrincipals_, eostools::move(), edm::RunTransitionInfo::principal(), principalCache_, edm::Principal::processHistory(), edm::Principal::processHistoryID(), processHistoryRegistries_, propagateProducts(), edm::Principal::reader(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoGlobalBeginTransitionAsync().

563  {
565 
566  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
567  auto aux = parentPrincipal.aux();
568  aux.setProcessHistoryID(parentPrincipal.processHistoryID());
570  rpp->setAux(aux);
571  auto& processHistoryRegistry = processHistoryRegistries_[historyRunOffset_ + parentPrincipal.index()];
572  inUseRunPrincipals_[parentPrincipal.index()] = rpp;
573  processHistoryRegistry.registerProcessHistory(parentPrincipal.processHistory());
574  rpp->fillRunPrincipal(processHistoryRegistry, parentPrincipal.reader());
575 
576  RunPrincipal& rp = *rpp;
577  propagateProducts(InRun, parentPrincipal, rp);
578 
579  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
580  RunTransitionInfo transitionInfo(rp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
581  using Traits = OccurrenceTraits<RunPrincipal, BranchActionGlobalBegin>;
582  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
583  }
unsigned int historyRunOffset_
Definition: SubProcess.h:287
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:288
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
std::shared_ptr< RunPrincipal > getAvailableRunPrincipalPtr()
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:273
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:294
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:790
PrincipalCache principalCache_
Definition: SubProcess.h:290
def move(src, dest)
Definition: eostools.py:511

◆ doBeginStream()

void edm::SubProcess::doBeginStream ( unsigned int  streamID)

Definition at line 708 of file SubProcess.cc.

References CMS_SA_ALLOW, schedule_, serviceToken_, and subProcesses_.

708  {
710  std::exception_ptr exceptionPtr;
711  CMS_SA_ALLOW try { schedule_->beginStream(streamID); } catch (...) {
712  exceptionPtr = std::current_exception();
713  }
714 
715  for (auto& subProcess : subProcesses_) {
716  CMS_SA_ALLOW try { subProcess.doBeginStream(streamID); } catch (...) {
717  if (!exceptionPtr) {
718  exceptionPtr = std::current_exception();
719  }
720  }
721  }
722  if (exceptionPtr) {
723  std::rethrow_exception(exceptionPtr);
724  }
725  }
#define CMS_SA_ALLOW
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273

◆ doEndJob()

void edm::SubProcess::doEndJob ( ExceptionCollector collector)

Definition at line 299 of file SubProcess.cc.

References endJob().

299 { endJob(collector); }
void endJob(ExceptionCollector &)
Definition: SubProcess.cc:332

◆ doEndLuminosityBlockAsync()

void edm::SubProcess::doEndLuminosityBlockAsync ( WaitingTaskHolder  iHolder,
LumiTransitionInfo const &  iTransitionInfo,
bool  cleaningUpAfterException 
)

Definition at line 669 of file SubProcess.cc.

References esp_, edm::LumiTransitionInfo::eventSetupImpls(), edm::LuminosityBlockPrincipal::index(), edm::InLumi, inUseLumiPrincipals_, eostools::move(), edm::LumiTransitionInfo::principal(), propagateProducts(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoGlobalEndTransitionAsync().

671  {
672  LuminosityBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
673  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[parentPrincipal.index()];
674  propagateProducts(InLumi, parentPrincipal, lbp);
675 
676  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
677  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
678  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalEnd>;
679  endGlobalTransitionAsync<Traits>(
680  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
681  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:293
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:294
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:790
def move(src, dest)
Definition: eostools.py:511

◆ doEndProcessBlockAsync()

void edm::SubProcess::doEndProcessBlockAsync ( WaitingTaskHolder  iHolder,
ProcessBlockTransitionInfo const &  iTransitionInfo,
bool  cleaningUpAfterException 
)

Definition at line 515 of file SubProcess.cc.

References edm::Principal::clearPrincipal(), edm::ProcessBlockPrincipal::fillProcessBlockPrincipal(), dqmdumpme::first, info(), edm::InProcess, edm::PrincipalCache::Input, edm::PrincipalCache::inputProcessBlockPrincipal(), eostools::move(), parentProducedProductIsKept(), edm::ProcessBlockTransitionInfo::principal(), principalCache_, edm::PrincipalCache::processBlockPrincipal(), edm::ProcessBlockPrincipal::processName(), propagateProducts(), edm::Principal::reader(), edm::waiting_task::chain::runLast(), alignCSCRings::s, schedule_, serviceToken_, subProcesses_, edm::waiting_task::chain::then(), and writeProcessBlockAsync().

Referenced by edm::subProcessDoGlobalEndTransitionAsync().

517  {
518  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal();
519  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
520  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
521 
522  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
523 
524  if (parentProducedProductIsKept(parentPrincipal, processBlockPrincipal)) {
525  ProcessBlockPrincipal& inputProcessBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
526  inputProcessBlockPrincipal.fillProcessBlockPrincipal(parentPrincipal.processName(), parentPrincipal.reader());
527  propagateProducts(InProcess, parentPrincipal, inputProcessBlockPrincipal);
528  ProcessBlockTransitionInfo inputTransitionInfo(inputProcessBlockPrincipal);
529 
530  using namespace edm::waiting_task;
531  chain::first([&](const std::exception_ptr*, auto nextTask) {
532  using TraitsInput = OccurrenceTraits<ProcessBlockPrincipal, BranchActionProcessBlockInput>;
533  beginGlobalTransitionAsync<TraitsInput>(std::move(nextTask),
534  *schedule_,
535  inputTransitionInfo,
538  cleaningUpAfterException);
539  }) | chain::then([this](auto nextTask) { writeProcessBlockAsync(nextTask, ProcessBlockType::Input); }) |
540  chain::then([this, info = transitionInfo, cleaningUpAfterException](std::exception_ptr const* iPtr,
541  auto nextTask) mutable {
542  ProcessBlockPrincipal& inputProcessBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
543  inputProcessBlockPrincipal.clearPrincipal();
544  for (auto& s : subProcesses_) {
545  s.clearProcessBlockPrincipal(ProcessBlockType::Input);
546  }
547  if (iPtr) {
548  nextTask.doneWaiting(*iPtr);
549  } else {
550  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionGlobalEnd>;
551  endGlobalTransitionAsync<Traits>(
552  std::move(nextTask), *schedule_, info, serviceToken_, subProcesses_, cleaningUpAfterException);
553  }
554  }) |
555  chain::runLast(std::move(iHolder));
556  } else {
557  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionGlobalEnd>;
558  endGlobalTransitionAsync<Traits>(
559  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
560  }
561  }
void clearPrincipal()
Definition: Principal.cc:386
static const TGPicture * info(bool iBackgroundIsBlack)
bool parentProducedProductIsKept(Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:805
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
ProcessBlockPrincipal & inputProcessBlockPrincipal() const
constexpr auto then(O &&iO)
Definition: chain_first.h:277
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
void fillProcessBlockPrincipal(std::string const &processName, DelayedReader *reader=nullptr)
ProcessBlockPrincipal & processBlockPrincipal() const
ServiceToken serviceToken_
Definition: SubProcess.h:273
auto runLast(edm::WaitingTaskHolder iTask)
Definition: chain_first.h:297
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:790
void writeProcessBlockAsync(edm::WaitingTaskHolder task, ProcessBlockType)
Definition: SubProcess.cc:599
PrincipalCache principalCache_
Definition: SubProcess.h:290
def move(src, dest)
Definition: eostools.py:511

◆ doEndRunAsync()

void edm::SubProcess::doEndRunAsync ( WaitingTaskHolder  iHolder,
RunTransitionInfo const &  iTransitionInfo,
bool  cleaningUpAfterException 
)

Definition at line 585 of file SubProcess.cc.

References esp_, edm::RunTransitionInfo::eventSetupImpls(), edm::RunPrincipal::index(), edm::InRun, inUseRunPrincipals_, eostools::move(), edm::RunTransitionInfo::principal(), propagateProducts(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoGlobalEndTransitionAsync().

587  {
588  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
589  RunPrincipal& rp = *inUseRunPrincipals_[parentPrincipal.index()];
590  propagateProducts(InRun, parentPrincipal, rp);
591 
592  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
593  RunTransitionInfo transitionInfo(rp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
594  using Traits = OccurrenceTraits<RunPrincipal, BranchActionGlobalEnd>;
595  endGlobalTransitionAsync<Traits>(
596  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
597  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:273
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:294
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:790
def move(src, dest)
Definition: eostools.py:511

◆ doEndStream()

void edm::SubProcess::doEndStream ( unsigned int  streamID,
ExceptionCollector collector,
std::mutex collectorMutex 
)
noexcept

Definition at line 727 of file SubProcess.cc.

References schedule_, serviceToken_, and subProcesses_.

729  {
731  schedule_->endStream(streamID, collector, collectorMutex);
732  for (auto& subProcess : subProcesses_) {
733  subProcess.doEndStream(streamID, collector, collectorMutex);
734  }
735  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273

◆ doEventAsync()

void edm::SubProcess::doEventAsync ( WaitingTaskHolder  iHolder,
EventPrincipal const &  principal,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls 
)

Definition at line 423 of file SubProcess.cc.

References MillePedeFileConverter_cfg::e, SiStripBadComponentsDQMServiceTemplate_cfg::ep, eostools::move(), processAsync(), selectors_, serviceToken_, wantAllEvents_, and edm::detail::TriggerResultsBasedEventSelector::wantEvent().

425  {
427  /* BEGIN relevant bits from OutputModule::doEvent */
428  if (!wantAllEvents_) {
429  EventForOutput e(ep, ModuleDescription(), nullptr);
430  e.setConsumer(this);
431  if (!selectors_.wantEvent(e)) {
432  return;
433  }
434  }
435  processAsync(std::move(iHolder), ep, iEventSetupImpls);
436  /* END relevant bits from OutputModule::doEvent */
437  }
void processAsync(WaitingTaskHolder iHolder, EventPrincipal const &e, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
Definition: SubProcess.cc:439
ServiceToken serviceToken_
Definition: SubProcess.h:273
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:310
def move(src, dest)
Definition: eostools.py:511

◆ doStreamBeginLuminosityBlockAsync()

void edm::SubProcess::doStreamBeginLuminosityBlockAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
LumiTransitionInfo const &  iTransitionInfo 
)

Definition at line 766 of file SubProcess.cc.

References esp_, edm::LumiTransitionInfo::eventSetupImpls(), l1ctLayer2EG_cff::id, edm::LuminosityBlockPrincipal::index(), inUseLumiPrincipals_, eostools::move(), edm::LumiTransitionInfo::principal(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoStreamBeginTransitionAsync().

768  {
769  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamBegin>;
770 
771  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[iTransitionInfo.principal().index()];
772  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
773  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
774  beginStreamTransitionAsync<Traits>(
775  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_);
776  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:293
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:294
def move(src, dest)
Definition: eostools.py:511

◆ doStreamBeginRunAsync()

void edm::SubProcess::doStreamBeginRunAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
RunTransitionInfo const &  iTransitionInfo 
)

Definition at line 737 of file SubProcess.cc.

References esp_, edm::RunTransitionInfo::eventSetupImpls(), l1ctLayer2EG_cff::id, edm::RunPrincipal::index(), inUseRunPrincipals_, eostools::move(), edm::RunTransitionInfo::principal(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoStreamBeginTransitionAsync().

739  {
740  using Traits = OccurrenceTraits<RunPrincipal, BranchActionStreamBegin>;
741 
742  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
743  RunPrincipal& rp = *inUseRunPrincipals_[parentPrincipal.index()];
744 
745  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
746  RunTransitionInfo transitionInfo(rp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
747  beginStreamTransitionAsync<Traits>(
748  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_);
749  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:273
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:294
def move(src, dest)
Definition: eostools.py:511

◆ doStreamEndLuminosityBlockAsync()

void edm::SubProcess::doStreamEndLuminosityBlockAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
LumiTransitionInfo const &  iTransitionInfo,
bool  cleaningUpAfterException 
)

Definition at line 778 of file SubProcess.cc.

References esp_, edm::LumiTransitionInfo::eventSetupImpls(), l1ctLayer2EG_cff::id, edm::LuminosityBlockPrincipal::index(), inUseLumiPrincipals_, eostools::move(), edm::LumiTransitionInfo::principal(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoStreamEndTransitionAsync().

781  {
782  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[iTransitionInfo.principal().index()];
783  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamEnd>;
784  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
785  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
786  endStreamTransitionAsync<Traits>(
787  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
788  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:293
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:294
def move(src, dest)
Definition: eostools.py:511

◆ doStreamEndRunAsync()

void edm::SubProcess::doStreamEndRunAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
RunTransitionInfo const &  iTransitionInfo,
bool  cleaningUpAfterException 
)

Definition at line 751 of file SubProcess.cc.

References esp_, edm::RunTransitionInfo::eventSetupImpls(), l1ctLayer2EG_cff::id, edm::RunPrincipal::index(), inUseRunPrincipals_, eostools::move(), edm::RunTransitionInfo::principal(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoStreamEndTransitionAsync().

754  {
755  using Traits = OccurrenceTraits<RunPrincipal, BranchActionStreamEnd>;
756 
757  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
758  RunPrincipal& rp = *inUseRunPrincipals_[parentPrincipal.index()];
759 
760  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
761  RunTransitionInfo transitionInfo(rp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
762  endStreamTransitionAsync<Traits>(
763  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
764  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:273
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:294
def move(src, dest)
Definition: eostools.py:511

◆ droppedBranchIDToKeptBranchID()

std::map<BranchID::value_type, BranchID::value_type> const& edm::SubProcess::droppedBranchIDToKeptBranchID ( )
inlineprivate

Definition at line 257 of file SubProcess.h.

References droppedBranchIDToKeptBranchID_.

Referenced by beginJob(), and fixBranchIDListsForEDAliases().

257  {
259  }
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:314

◆ endJob()

void edm::SubProcess::endJob ( ExceptionCollector collector)
private

Definition at line 332 of file SubProcess.cc.

References edm::ExceptionCollector::addException(), schedule_, serviceToken_, subProcesses_, and edm::convertException::wrap().

Referenced by doEndJob().

332  {
334  try {
335  convertException::wrap([this, &collector]() { schedule_->endJob(collector); });
336  } catch (cms::Exception const& ex) {
337  collector.addException(ex);
338  }
339  for (auto& subProcess : subProcesses_) {
340  subProcess.doEndJob(collector);
341  }
342  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273
auto wrap(F iFunc) -> decltype(iFunc())

◆ fixBranchIDListsForEDAliases()

void edm::SubProcess::fixBranchIDListsForEDAliases ( std::map< BranchID::value_type, BranchID::value_type > const &  droppedBranchIDToKeptBranchID)
private

Definition at line 405 of file SubProcess.cc.

References branchIDListHelper_, droppedBranchIDToKeptBranchID(), edm::for_all(), and subProcesses_.

Referenced by beginJob().

406  {
407  // Check for branches dropped while an EDAlias was kept.
408  // Replace BranchID of each dropped branch with that of the kept alias.
409  for (BranchIDList& branchIDList : branchIDListHelper_->mutableBranchIDLists()) {
410  for (BranchID::value_type& branchID : branchIDList) {
411  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter =
412  droppedBranchIDToKeptBranchID.find(branchID);
413  if (iter != droppedBranchIDToKeptBranchID.end()) {
414  branchID = iter->second;
415  }
416  }
417  }
418  for_all(subProcesses_, [&droppedBranchIDToKeptBranchID](auto& subProcess) {
419  subProcess.fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID);
420  });
421  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:257
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
unsigned int value_type
Definition: BranchID.h:16
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:276
std::vector< BranchID::value_type > BranchIDList
Definition: BranchIDList.h:18

◆ getAllModuleDescriptions()

std::vector<ModuleDescription const*> edm::SubProcess::getAllModuleDescriptions ( ) const

Return a vector allowing const access to all the ModuleDescriptions for this SubProcess.

*** N.B. *** Ownership of the ModuleDescriptions is not *** passed to the caller. Do not call delete on these *** pointers!

◆ getTriggerReport()

void edm::SubProcess::getTriggerReport ( TriggerReport rep) const
inline

Return the trigger report information on paths, modules-in-path, modules-in-endpath, and modules.

Definition at line 215 of file SubProcess.h.

References cuy::rep, schedule_, and serviceToken_.

215  {
217  schedule_->getTriggerReport(rep);
218  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273
rep
Definition: cuy.py:1189

◆ keepOnlyConsumedUnscheduledModules()

std::vector< ModuleProcessName > edm::SubProcess::keepOnlyConsumedUnscheduledModules ( bool  deleteModules)

Definition at line 242 of file SubProcess.cc.

References actReg_, edm::PathsAndConsumesOfModulesBase::allModules(), DummyCfis::c, edm::checkForModuleDependencyCorrectness(), makeListRunsInFiles::description, edm::for_all(), edm::PathsAndConsumesOfModules::initialize(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, MainPageGenerator::l, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, merge(), edm::ModuleProcessName::moduleLabel(), edm::PathsAndConsumesOfModules::modulesInPreviousProcessesWhoseProductsAreConsumedBy(), edm::nonConsumedUnscheduledModules(), pathsAndConsumesOfModules_, preg_, processConfiguration_, edm::PathsAndConsumesOfModules::removeModules(), schedule_, subProcesses_, edm::swap(), and createJobs::tmp.

242  {
243  schedule_->convertCurrentProcessAlias(processConfiguration_->processName());
245 
246  // Note: all these may throw
248 
249  // Consumes information from the child SubProcesses
250  std::vector<ModuleProcessName> consumedByChildren;
251  for_all(subProcesses_, [&consumedByChildren, deleteModules](auto& subProcess) {
252  auto c = subProcess.keepOnlyConsumedUnscheduledModules(deleteModules);
253  if (consumedByChildren.empty()) {
254  std::swap(consumedByChildren, c);
255  } else if (not c.empty()) {
256  std::vector<ModuleProcessName> tmp;
257  tmp.reserve(consumedByChildren.size() + c.size());
258  std::merge(consumedByChildren.begin(), consumedByChildren.end(), c.begin(), c.end(), std::back_inserter(tmp));
259  std::swap(consumedByChildren, tmp);
260  }
261  });
262 
263  // Non-consumed unscheduled modules in this SubProcess, take into account of the consumes from child SubProcesses
264  if (deleteModules) {
265  if (auto const unusedModules = nonConsumedUnscheduledModules(pathsAndConsumesOfModules_, consumedByChildren);
266  not unusedModules.empty()) {
268 
269  edm::LogInfo("DeleteModules").log([&unusedModules, this](auto& l) {
270  l << "Following modules are not in any Path or EndPath, nor is their output consumed by any other module, "
271  "and "
272  "therefore they are deleted from SubProcess "
273  << processConfiguration_->processName() << " before beginJob transition.";
274  for (auto const& description : unusedModules) {
275  l << "\n " << description->moduleLabel();
276  }
277  });
278  for (auto const& description : unusedModules) {
279  schedule_->deleteModule(description->moduleLabel(), actReg_.get());
280  }
281  }
282  }
283 
284  // Products possibly consumed from the parent (Sub)Process
285  for (auto const& description : pathsAndConsumesOfModules_.allModules()) {
286  for (auto const& dep :
288  auto it = std::lower_bound(consumedByChildren.begin(),
289  consumedByChildren.end(),
290  ModuleProcessName{dep.moduleLabel(), dep.processName()});
291  consumedByChildren.emplace(it, dep.moduleLabel(), dep.processName());
292  }
293  }
294  return consumedByChildren;
295  }
std::vector< ModuleDescription const * > const & allModules() const
int merge(int argc, char *argv[])
Definition: DiMuonVmerge.cc:28
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:283
std::vector< ModuleProcessName > const & modulesInPreviousProcessesWhoseProductsAreConsumedBy(unsigned int moduleID) const
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
void initialize(Schedule const *, std::shared_ptr< ProductRegistry const >)
std::vector< ModuleDescription const * > nonConsumedUnscheduledModules(edm::PathsAndConsumesOfModulesBase const &iPnC, std::vector< ModuleProcessName > &consumedByChildren)
Log< level::Info, false > LogInfo
void checkForModuleDependencyCorrectness(edm::PathsAndConsumesOfModulesBase const &iPnC, bool iPrintDependencies)
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:272
void removeModules(std::vector< ModuleDescription const *> const &modules)
tmp
align.sh
Definition: createJobs.py:716
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:275
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:281

◆ keepThisBranch()

void edm::SubProcess::keepThisBranch ( BranchDescription const &  desc,
std::map< BranchID, BranchDescription const *> &  trueBranchIDToKeptBranchDesc,
std::set< BranchID > &  keptProductsInEvent 
)
private

Definition at line 386 of file SubProcess.cc.

References edm::ProductSelector::checkForDuplicateKeptBranch(), edm::EDConsumerBase::consumes(), submitPVResolutionJobs::desc, edm::InEvent, keptProducts_, edm::PRODUCT_TYPE, and unpackBuffers-CaloStage2::token.

Referenced by selectProducts().

388  {
389  ProductSelector::checkForDuplicateKeptBranch(desc, trueBranchIDToKeptBranchDesc);
390 
391  if (desc.branchType() == InEvent) {
392  if (desc.produced()) {
393  keptProductsInEvent.insert(desc.originalBranchID());
394  } else {
395  keptProductsInEvent.insert(desc.branchID());
396  }
397  }
398  EDGetToken token = consumes(TypeToGet{desc.unwrappedTypeID(), PRODUCT_TYPE},
399  InputTag{desc.moduleLabel(), desc.productInstanceName(), desc.processName()});
400 
401  // Now put it in the list of selected branches.
402  keptProducts_[desc.branchType()].push_back(std::make_pair(&desc, token));
403  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const *> &trueBranchIDToKeptBranchDesc)
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:303

◆ keptProducts()

SelectedProductsForBranchType const& edm::SubProcess::keptProducts ( ) const
inline

Definition at line 85 of file SubProcess.h.

References keptProducts_.

Referenced by parentProducedProductIsKept(), propagateProducts(), and edm::ScheduleItems::ScheduleItems().

85 { return keptProducts_; }
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:303

◆ openOutputFiles()

void edm::SubProcess::openOutputFiles ( FileBlock fb)
inline

Definition at line 156 of file SubProcess.h.

References edm::for_all(), schedule_, serviceToken_, and subProcesses_.

156  {
158  schedule_->openOutputFiles(fb);
159  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.openOutputFiles(fb); });
160  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:273

◆ operator=() [1/2]

SubProcess& edm::SubProcess::operator= ( SubProcess const &  )
delete

◆ operator=() [2/2]

SubProcess& edm::SubProcess::operator= ( SubProcess &&  )
delete

◆ parentProducedProductIsKept()

bool edm::SubProcess::parentProducedProductIsKept ( Principal const &  parentPrincipal,
Principal principal 
) const
private

Definition at line 805 of file SubProcess.cc.

References cms::cuda::assert(), submitPVResolutionJobs::desc, edm::Principal::getModifiableProductResolver(), edm::Principal::getProductResolver(), edm::InProcess, B2GTnPMonitor_cfi::item, and keptProducts().

Referenced by doEndProcessBlockAsync().

805  {
806  SelectedProducts const& keptVector = keptProducts()[InProcess];
807  for (auto const& item : keptVector) {
808  BranchDescription const& desc = *item.first;
809  assert(desc.branchType() == InProcess);
810  ProductResolverBase const* parentProductResolver = parentPrincipal.getProductResolver(desc.branchID());
811  if (parentProductResolver != nullptr) {
812  ProductResolverBase* productResolver = principal.getModifiableProductResolver(desc.branchID());
813  if (productResolver != nullptr) {
814  if (parentProductResolver->branchDescription().produced()) {
815  return true;
816  }
817  }
818  }
819  }
820  return false;
821  }
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:85
assert(be >=bs)
std::vector< std::pair< BranchDescription const *, EDGetToken > > SelectedProducts

◆ processAsync()

void edm::SubProcess::processAsync ( WaitingTaskHolder  iHolder,
EventPrincipal const &  e,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls 
)
private

Definition at line 439 of file SubProcess.cc.

References edm::ProductRegistry::anyProductProduced(), printConversionInfo::aux, edm::EventPrincipal::aux(), branchIDListHelper_, edm::EventPrincipal::branchListIndexes(), SiStripBadComponentsDQMServiceTemplate_cfg::ep, esp_, edm::PrincipalCache::eventPrincipal(), edm::EventPrincipal::eventSelectionIDs(), edm::EventPrincipal::eventToProcessBlockIndexes(), dqmdumpme::first, edm::waiting_task::chain::ifThen(), edm::LuminosityBlockPrincipal::index(), edm::InEvent, info(), inUseLumiPrincipals_, edm::EventPrincipal::luminosityBlockPrincipal(), eostools::move(), principalCache_, edm::Principal::processHistory(), edm::Principal::processHistoryID(), processHistoryRegistries_, edm::EventPrincipal::productProvenanceRetrieverPtr(), edm::Principal::productRegistry(), propagateProducts(), edm::Principal::reader(), groupFilesInBlocks::reverse, edm::waiting_task::chain::runLast(), schedule_, selector_config_id_, serviceToken_, edm::EventPrincipal::streamID(), subProcesses_, edm::waiting_task::chain::then(), edm::StreamID::value(), and wantAllEvents_.

Referenced by doEventAsync().

441  {
442  EventAuxiliary aux(principal.aux());
443  aux.setProcessHistoryID(principal.processHistoryID());
444 
445  EventSelectionIDVector esids{principal.eventSelectionIDs()};
446  if (principal.productRegistry().anyProductProduced() || !wantAllEvents_) {
447  esids.push_back(selector_config_id_);
448  }
449 
450  EventPrincipal& ep = principalCache_.eventPrincipal(principal.streamID().value());
451  auto& processHistoryRegistry = processHistoryRegistries_[principal.streamID().value()];
452  processHistoryRegistry.registerProcessHistory(principal.processHistory());
453  BranchListIndexes bli(principal.branchListIndexes());
454  branchIDListHelper_->fixBranchListIndexes(bli);
455  bool deepCopyRetriever = false;
456  ep.fillEventPrincipal(
457  aux,
458  &principal.processHistory(),
459  std::move(esids),
460  std::move(bli),
461  principal.eventToProcessBlockIndexes(),
462  *(principal.productProvenanceRetrieverPtr()), //NOTE: this transfers the per product provenance
463  principal.reader(),
464  deepCopyRetriever);
465  ep.setLuminosityBlockPrincipal(inUseLumiPrincipals_[principal.luminosityBlockPrincipal().index()].get());
466  propagateProducts(InEvent, principal, ep);
467 
468  using namespace edm::waiting_task;
469  chain::first([&](auto nextTask) {
470  EventTransitionInfo info(ep, *((*iEventSetupImpls)[esp_->subProcessIndex()]));
471  schedule_->processOneEventAsync(std::move(nextTask), ep.streamID().value(), info, serviceToken_);
472  }) | chain::ifThen(not subProcesses_.empty(), [this, &ep, iEventSetupImpls](auto nextTask) {
473  for (auto& subProcess : boost::adaptors::reverse(subProcesses_)) {
474  subProcess.doEventAsync(nextTask, ep, iEventSetupImpls);
475  }
476  }) | chain::then([&ep](std::exception_ptr const* iPtr, auto nextTask) {
477  ep.clearEventPrincipal();
478  if (iPtr) {
479  nextTask.doneWaiting(*iPtr);
480  }
481  }) | chain::runLast(std::move(iHolder));
482  }
ParameterSetID selector_config_id_
Definition: SubProcess.h:309
static const TGPicture * info(bool iBackgroundIsBlack)
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:288
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
constexpr auto then(O &&iO)
Definition: chain_first.h:277
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
std::vector< EventSelectionID > EventSelectionIDVector
ServiceToken serviceToken_
Definition: SubProcess.h:273
std::vector< BranchListIndex > BranchListIndexes
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:293
auto runLast(edm::WaitingTaskHolder iTask)
Definition: chain_first.h:297
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:294
constexpr auto ifThen(bool iValue, O &&iO)
Only runs this task if the condition (which is known at the call time) is true. If false...
Definition: chain_first.h:288
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:790
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:276
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
PrincipalCache principalCache_
Definition: SubProcess.h:290
def move(src, dest)
Definition: eostools.py:511

◆ propagateProducts()

void edm::SubProcess::propagateProducts ( BranchType  type,
Principal const &  parentPrincipal,
Principal principal 
) const
private

Definition at line 790 of file SubProcess.cc.

References edm::ProductResolverBase::connectTo(), submitPVResolutionJobs::desc, edm::Principal::getModifiableProductResolver(), edm::Principal::getProductResolver(), B2GTnPMonitor_cfi::item, and keptProducts().

Referenced by doBeginLuminosityBlockAsync(), doBeginProcessBlockAsync(), doBeginRunAsync(), doEndLuminosityBlockAsync(), doEndProcessBlockAsync(), doEndRunAsync(), and processAsync().

790  {
791  SelectedProducts const& keptVector = keptProducts()[type];
792  for (auto const& item : keptVector) {
793  BranchDescription const& desc = *item.first;
794  ProductResolverBase const* parentProductResolver = parentPrincipal.getProductResolver(desc.branchID());
795  if (parentProductResolver != nullptr) {
796  ProductResolverBase* productResolver = principal.getModifiableProductResolver(desc.branchID());
797  if (productResolver != nullptr) {
798  //Propagate the per event(run)(lumi)(processBlock) data for this product to the subprocess.
799  productResolver->connectTo(*parentProductResolver, &parentPrincipal);
800  }
801  }
802  }
803  }
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:85
std::vector< std::pair< BranchDescription const *, EDGetToken > > SelectedProducts

◆ respondToCloseInputFile()

void edm::SubProcess::respondToCloseInputFile ( FileBlock const &  fb)
inline

Definition at line 168 of file SubProcess.h.

References edm::for_all(), schedule_, serviceToken_, and subProcesses_.

168  {
170  schedule_->respondToCloseInputFile(fb);
171  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.respondToCloseInputFile(fb); });
172  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:273

◆ respondToOpenInputFile()

void edm::SubProcess::respondToOpenInputFile ( FileBlock const &  fb)

Definition at line 830 of file SubProcess.cc.

References edm::for_all(), schedule_, serviceToken_, and subProcesses_.

830  {
832  schedule_->respondToOpenInputFile(fb);
833  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.respondToOpenInputFile(fb); });
834  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:273

◆ selectProducts()

void edm::SubProcess::selectProducts ( ProductRegistry const &  preg,
ThinnedAssociationsHelper const &  parentThinnedAssociationsHelper,
std::map< BranchID, bool > &  keepAssociation 
)

Definition at line 344 of file SubProcess.cc.

References edm::ProductRegistry::allBranchDescriptions(), submitPVResolutionJobs::desc, droppedBranchIDToKeptBranchID_, edm::ProductSelector::fillDroppedToKept(), edm::ProductSelector::initialize(), edm::ProductSelector::initialized(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, keepThisBranch(), edm::ProductRegistry::productList(), productSelector_, productSelectorRules_, edm::ThinnedAssociationsHelper::selectAssociationProducts(), and edm::ProductSelector::selected().

Referenced by SubProcess().

346  {
348  return;
349  productSelector_.initialize(productSelectorRules_, preg.allBranchDescriptions());
350 
351  // TODO: See if we can collapse keptProducts_ and productSelector_ into a
352  // single object. See the notes in the header for ProductSelector
353  // for more information.
354 
355  std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
356  std::vector<BranchDescription const*> associationDescriptions;
357  std::set<BranchID> keptProductsInEvent;
358 
359  for (auto const& it : preg.productList()) {
360  BranchDescription const& desc = it.second;
361  if (desc.transient()) {
362  // if the class of the branch is marked transient, output nothing
363  } else if (!desc.present() && !desc.produced()) {
364  // else if the branch containing the product has been previously dropped,
365  // output nothing
366  } else if (desc.unwrappedType() == typeid(ThinnedAssociation)) {
367  associationDescriptions.push_back(&desc);
368  } else if (productSelector_.selected(desc)) {
369  keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
370  }
371  }
372 
373  parentThinnedAssociationsHelper.selectAssociationProducts(
374  associationDescriptions, keptProductsInEvent, keepAssociation);
375 
376  for (auto association : associationDescriptions) {
377  if (keepAssociation[association->branchID()]) {
378  keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
379  }
380  }
381 
382  // Now fill in a mapping needed in the case that a branch was dropped while its EDAlias was kept.
383  ProductSelector::fillDroppedToKept(preg, trueBranchIDToKeptBranchDesc, droppedBranchIDToKeptBranchID_);
384  }
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const *> const &branchDescriptions)
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
static void fillDroppedToKept(ProductRegistry const &preg, std::map< BranchID, BranchDescription const *> const &trueBranchIDToKeptBranchDesc, std::map< BranchID::value_type, BranchID::value_type > &droppedBranchIDToKeptBranchID_)
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:304
bool selected(BranchDescription const &desc) const
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:314
ProductSelector productSelector_
Definition: SubProcess.h:305
bool initialized() const
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const *> &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
Definition: SubProcess.cc:386

◆ shouldWeCloseOutput()

bool edm::SubProcess::shouldWeCloseOutput ( ) const
inline

Definition at line 175 of file SubProcess.h.

References schedule_, serviceToken_, and subProcesses_.

175  {
177  if (schedule_->shouldWeCloseOutput()) {
178  return true;
179  }
180  for (auto const& subProcess : subProcesses_) {
181  if (subProcess.shouldWeCloseOutput()) {
182  return true;
183  }
184  }
185  return false;
186  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273

◆ terminate()

bool edm::SubProcess::terminate ( void  ) const
inline

Return whether each output module has reached its maximum count. If there is a subprocess, get this information from the subprocess.

Definition at line 222 of file SubProcess.h.

References schedule_, serviceToken_, and subProcesses_.

222  {
224  if (schedule_->terminate()) {
225  return true;
226  }
227  for (auto const& subProcess : subProcesses_) {
228  if (subProcess.terminate()) {
229  return true;
230  }
231  }
232  return false;
233  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273

◆ thinnedAssociationsHelper() [1/2]

std::shared_ptr<ThinnedAssociationsHelper const> edm::SubProcess::thinnedAssociationsHelper ( ) const
inlineprivate

Definition at line 265 of file SubProcess.h.

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

Referenced by SubProcess().

265  {
267  }
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:278
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)

◆ thinnedAssociationsHelper() [2/2]

std::shared_ptr<ThinnedAssociationsHelper> edm::SubProcess::thinnedAssociationsHelper ( )
inlineprivate

Definition at line 268 of file SubProcess.h.

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

268  {
270  }
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:278
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)

◆ totalEvents()

int edm::SubProcess::totalEvents ( ) const
inline

Return the number of events this SubProcess has tried to process (inclues both successes and failures, including failures due to exceptions during processing).

Definition at line 198 of file SubProcess.h.

References schedule_.

198 { return schedule_->totalEvents(); }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295

◆ totalEventsFailed()

int edm::SubProcess::totalEventsFailed ( ) const
inline

Return the number of events that have not passed any trigger. (N.B. totalEventsFailed() + totalEventsPassed() == totalEvents()

Definition at line 208 of file SubProcess.h.

References schedule_, and serviceToken_.

208  {
210  return schedule_->totalEventsFailed();
211  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273

◆ totalEventsPassed()

int edm::SubProcess::totalEventsPassed ( ) const
inline

Return the number of events which have been passed by one or more trigger paths.

Definition at line 201 of file SubProcess.h.

References schedule_, and serviceToken_.

201  {
203  return schedule_->totalEventsPassed();
204  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273

◆ updateBranchIDListHelper()

void edm::SubProcess::updateBranchIDListHelper ( BranchIDLists const &  branchIDLists)

Definition at line 823 of file SubProcess.cc.

References branchIDListHelper_, edm::for_all(), and subProcesses_.

Referenced by SubProcess().

823  {
824  branchIDListHelper_->updateFromParent(branchIDLists);
826  [this](auto& subProcess) { subProcess.updateBranchIDListHelper(branchIDListHelper_->branchIDLists()); });
827  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:276

◆ writeLumiAsync()

void edm::SubProcess::writeLumiAsync ( WaitingTaskHolder  task,
LuminosityBlockPrincipal principal 
)

Definition at line 683 of file SubProcess.cc.

References actReg_, dqmdumpme::first, edm::waiting_task::chain::ifThen(), edm::LuminosityBlockPrincipal::index(), inUseLumiPrincipals_, MainPageGenerator::l, eostools::move(), processContext_, edm::waiting_task::chain::runLast(), alignCSCRings::s, schedule_, serviceToken_, subProcesses_, and TrackValidation_cff::task.

683  {
684  using namespace edm::waiting_task;
685 
686  auto l = inUseLumiPrincipals_[principal.index()];
687  chain::first([&](std::exception_ptr const*, auto nextTask) {
689  schedule_->writeLumiAsync(nextTask, *l, &processContext_, actReg_.get());
690  }) | chain::ifThen(not subProcesses_.empty(), [this, l](auto nextTask) {
691  ServiceRegistry::Operate operateWriteLumi(serviceToken_);
692  for (auto& s : subProcesses_) {
693  s.writeLumiAsync(nextTask, *l);
694  }
696  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ServiceToken serviceToken_
Definition: SubProcess.h:273
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:293
auto runLast(edm::WaitingTaskHolder iTask)
Definition: chain_first.h:297
constexpr auto ifThen(bool iValue, O &&iO)
Only runs this task if the condition (which is known at the call time) is true. If false...
Definition: chain_first.h:288
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:272
ProcessContext processContext_
Definition: SubProcess.h:282
def move(src, dest)
Definition: eostools.py:511

◆ writeProcessBlockAsync()

void edm::SubProcess::writeProcessBlockAsync ( edm::WaitingTaskHolder  task,
ProcessBlockType  processBlockType 
)

Definition at line 599 of file SubProcess.cc.

References actReg_, dqmdumpme::first, edm::waiting_task::chain::ifThen(), eostools::move(), principalCache_, edm::PrincipalCache::processBlockPrincipal(), processContext_, edm::waiting_task::chain::runLast(), alignCSCRings::s, schedule_, serviceToken_, subProcesses_, and TrackValidation_cff::task.

Referenced by doEndProcessBlockAsync().

599  {
600  using namespace edm::waiting_task;
601  chain::first([&](std::exception_ptr const*, auto nextTask) {
603  schedule_->writeProcessBlockAsync(
604  nextTask, principalCache_.processBlockPrincipal(processBlockType), &processContext_, actReg_.get());
605  }) | chain::ifThen(not subProcesses_.empty(), [this, processBlockType](auto nextTask) {
607  for (auto& s : subProcesses_) {
608  s.writeProcessBlockAsync(nextTask, processBlockType);
609  }
611  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
ProcessBlockPrincipal & processBlockPrincipal() const
ServiceToken serviceToken_
Definition: SubProcess.h:273
auto runLast(edm::WaitingTaskHolder iTask)
Definition: chain_first.h:297
constexpr auto ifThen(bool iValue, O &&iO)
Only runs this task if the condition (which is known at the call time) is true. If false...
Definition: chain_first.h:288
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:272
ProcessContext processContext_
Definition: SubProcess.h:282
PrincipalCache principalCache_
Definition: SubProcess.h:290
def move(src, dest)
Definition: eostools.py:511

◆ writeRunAsync()

void edm::SubProcess::writeRunAsync ( edm::WaitingTaskHolder  task,
RunPrincipal const &  principal,
MergeableRunProductMetadata const *  mergeableRunProductMetadata 
)

Definition at line 613 of file SubProcess.cc.

References actReg_, dqmdumpme::first, edm::waiting_task::chain::ifThen(), edm::RunPrincipal::index(), inUseRunPrincipals_, eostools::move(), processContext_, edm::waiting_task::chain::runLast(), alignCSCRings::s, schedule_, serviceToken_, subProcesses_, and TrackValidation_cff::task.

615  {
616  using namespace edm::waiting_task;
617 
618  auto rp = inUseRunPrincipals_[principal.index()];
619  chain::first([&](std::exception_ptr const*, auto nextTask) {
621  schedule_->writeRunAsync(nextTask, *rp, &processContext_, actReg_.get(), mergeableRunProductMetadata);
622  }) | chain::ifThen(not subProcesses_.empty(), [this, rp, mergeableRunProductMetadata](auto nextTask) {
623  ServiceRegistry::Operate operateWriteRun(serviceToken_);
624  for (auto& s : subProcesses_) {
625  s.writeRunAsync(nextTask, *rp, mergeableRunProductMetadata);
626  }
628  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:295
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:273
auto runLast(edm::WaitingTaskHolder iTask)
Definition: chain_first.h:297
constexpr auto ifThen(bool iValue, O &&iO)
Only runs this task if the condition (which is known at the call time) is true. If false...
Definition: chain_first.h:288
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:272
ProcessContext processContext_
Definition: SubProcess.h:282
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ act_table_

std::unique_ptr<ExceptionToActionTable const> edm::SubProcess::act_table_
private

Definition at line 280 of file SubProcess.h.

Referenced by SubProcess().

◆ actReg_

std::shared_ptr<ActivityRegistry> edm::SubProcess::actReg_
private

◆ branchIDListHelper_

edm::propagate_const<std::shared_ptr<BranchIDListHelper> > edm::SubProcess::branchIDListHelper_
private

◆ droppedBranchIDToKeptBranchID_

std::map<BranchID::value_type, BranchID::value_type> edm::SubProcess::droppedBranchIDToKeptBranchID_
private

Definition at line 314 of file SubProcess.h.

Referenced by droppedBranchIDToKeptBranchID(), selectProducts(), and SubProcess().

◆ esp_

edm::propagate_const<std::shared_ptr<eventsetup::EventSetupProvider> > edm::SubProcess::esp_
private

◆ historyAppenders_

std::vector<HistoryAppender> edm::SubProcess::historyAppenders_
private

Definition at line 289 of file SubProcess.h.

Referenced by SubProcess().

◆ historyLumiOffset_

unsigned int edm::SubProcess::historyLumiOffset_
private

Definition at line 286 of file SubProcess.h.

Referenced by doBeginLuminosityBlockAsync(), and SubProcess().

◆ historyRunOffset_

unsigned int edm::SubProcess::historyRunOffset_
private

Definition at line 287 of file SubProcess.h.

Referenced by doBeginRunAsync(), and SubProcess().

◆ inUseLumiPrincipals_

std::vector<std::shared_ptr<LuminosityBlockPrincipal> > edm::SubProcess::inUseLumiPrincipals_
private

◆ inUseRunPrincipals_

std::vector<std::shared_ptr<RunPrincipal> > edm::SubProcess::inUseRunPrincipals_
private

◆ keptProducts_

SelectedProductsForBranchType edm::SubProcess::keptProducts_
private

Definition at line 303 of file SubProcess.h.

Referenced by keepThisBranch(), and keptProducts().

◆ parentPreg_

std::shared_ptr<ProductRegistry const> edm::SubProcess::parentPreg_
private

Definition at line 274 of file SubProcess.h.

Referenced by beginJob().

◆ pathsAndConsumesOfModules_

PathsAndConsumesOfModules edm::SubProcess::pathsAndConsumesOfModules_
private

Definition at line 283 of file SubProcess.h.

Referenced by beginJob(), and keepOnlyConsumedUnscheduledModules().

◆ preg_

std::shared_ptr<ProductRegistry const> edm::SubProcess::preg_
private

Definition at line 275 of file SubProcess.h.

Referenced by beginJob(), keepOnlyConsumedUnscheduledModules(), and SubProcess().

◆ principalCache_

PrincipalCache edm::SubProcess::principalCache_
private

◆ processBlockHelper_

edm::propagate_const<std::shared_ptr<SubProcessBlockHelper> > edm::SubProcess::processBlockHelper_
private

Definition at line 277 of file SubProcess.h.

Referenced by beginJob(), and SubProcess().

◆ processConfiguration_

std::shared_ptr<ProcessConfiguration const> edm::SubProcess::processConfiguration_
private

◆ processContext_

ProcessContext edm::SubProcess::processContext_
private

◆ processHistoryRegistries_

std::vector<ProcessHistoryRegistry> edm::SubProcess::processHistoryRegistries_
private

Definition at line 288 of file SubProcess.h.

Referenced by doBeginLuminosityBlockAsync(), doBeginRunAsync(), and processAsync().

◆ processParameterSet_

edm::propagate_const<std::unique_ptr<ParameterSet> > edm::SubProcess::processParameterSet_
private

Definition at line 297 of file SubProcess.h.

Referenced by SubProcess().

◆ productSelector_

ProductSelector edm::SubProcess::productSelector_
private

Definition at line 305 of file SubProcess.h.

Referenced by selectProducts().

◆ productSelectorRules_

ProductSelectorRules edm::SubProcess::productSelectorRules_
private

Definition at line 304 of file SubProcess.h.

Referenced by selectProducts().

◆ schedule_

edm::propagate_const<std::unique_ptr<Schedule> > edm::SubProcess::schedule_
private

◆ selector_config_id_

ParameterSetID edm::SubProcess::selector_config_id_
private

Definition at line 309 of file SubProcess.h.

Referenced by processAsync(), and SubProcess().

◆ selectors_

detail::TriggerResultsBasedEventSelector edm::SubProcess::selectors_
mutableprivate

Definition at line 310 of file SubProcess.h.

Referenced by doEventAsync(), and SubProcess().

◆ serviceToken_

ServiceToken edm::SubProcess::serviceToken_
private

◆ subProcesses_

std::vector<SubProcess> edm::SubProcess::subProcesses_
private

◆ subProcessParentageHelper_

edm::propagate_const<std::shared_ptr<SubProcessParentageHelper> > edm::SubProcess::subProcessParentageHelper_
private

Definition at line 279 of file SubProcess.h.

Referenced by SubProcess().

◆ thinnedAssociationsHelper_

edm::propagate_const<std::shared_ptr<ThinnedAssociationsHelper> > edm::SubProcess::thinnedAssociationsHelper_
private

Definition at line 278 of file SubProcess.h.

Referenced by SubProcess(), and thinnedAssociationsHelper().

◆ wantAllEvents_

bool edm::SubProcess::wantAllEvents_
private

Definition at line 308 of file SubProcess.h.

Referenced by doEventAsync(), processAsync(), and SubProcess().