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)
 
void doEndJob ()
 
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)
 
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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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 ()
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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 53 of file SubProcess.h.

Member Typedef Documentation

◆ ProcessBlockType

Definition at line 136 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 51 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_.

65  : EDConsumerBase(),
66  serviceToken_(),
67  parentPreg_(parentProductRegistry),
68  preg_(),
70  act_table_(),
72  historyLumiOffset_(preallocConfig.numberOfStreams()),
73  historyRunOffset_(historyLumiOffset_ + preallocConfig.numberOfLuminosityBlocks()),
74  processHistoryRegistries_(historyRunOffset_ + preallocConfig.numberOfRuns()),
75  historyAppenders_(historyRunOffset_ + preallocConfig.numberOfRuns()),
77  esp_(),
78  schedule_(),
79  subProcesses_(),
81  productSelectorRules_(parameterSet, "outputCommands", "OutputModule"),
83  wantAllEvents_(true) {
84  //Setup the event selection
85  Service<service::TriggerNamesService> tns;
86 
87  ParameterSet selectevents = parameterSet.getUntrackedParameterSet("SelectEvents", ParameterSet());
88 
89  selectevents.registerIt(); // Just in case this PSet is not registered
91  selectevents, tns->getProcessName(), getAllTriggerNames(), selectors_, consumesCollector());
92  std::map<std::string, std::vector<std::pair<std::string, int>>> outputModulePathPositions;
94  selectevents, "", outputModulePathPositions, parentProductRegistry->anyProductProduced());
95 
96  std::map<BranchID, bool> keepAssociation;
97  selectProducts(*parentProductRegistry, parentThinnedAssociationsHelper, keepAssociation);
98 
99  std::string const maxEvents("maxEvents");
100  std::string const maxLumis("maxLuminosityBlocks");
101 
102  // propagate_const<T> has no reset() function
104  std::unique_ptr<ParameterSet>(parameterSet.popParameterSet(std::string("process")).release());
105 
106  // if this process has a maxEvents or maxLuminosityBlocks parameter set, remove them.
107  if (processParameterSet_->exists(maxEvents)) {
108  processParameterSet_->popParameterSet(maxEvents);
109  }
110  if (processParameterSet_->exists(maxLumis)) {
111  processParameterSet_->popParameterSet(maxLumis);
112  }
113 
114  // if the top level process has a maxEvents or maxLuminosityBlocks parameter set, add them to this process.
115  if (topLevelParameterSet.exists(maxEvents)) {
116  processParameterSet_->addUntrackedParameter<ParameterSet>(
117  maxEvents, topLevelParameterSet.getUntrackedParameterSet(maxEvents));
118  }
119  if (topLevelParameterSet.exists(maxLumis)) {
120  processParameterSet_->addUntrackedParameter<ParameterSet>(
121  maxLumis, topLevelParameterSet.getUntrackedParameterSet(maxLumis));
122  }
123 
124  // If there are subprocesses, pop the subprocess parameter sets out of the process parameter set
125  auto subProcessVParameterSet = popSubProcessVParameterSet(*processParameterSet_);
126  bool hasSubProcesses = !subProcessVParameterSet.empty();
127 
128  // Validates the parameters in the 'options', 'maxEvents', and 'maxLuminosityBlocks'
129  // top level parameter sets. Default values are also set in here if the
130  // parameters were not explicitly set.
132 
133  processBlockHelper_ = std::make_shared<SubProcessBlockHelper>();
134 
135  ScheduleItems items(*parentProductRegistry, *this, *processBlockHelper_, parentProcessBlockHelper);
136  actReg_ = items.actReg_;
137 
138  //initialize the services
139  ServiceToken iToken;
140 
141  // get any configured services.
142  auto serviceSets = processParameterSet_->popVParameterSet(std::string("services"));
143 
144  ServiceToken newToken = items.initServices(serviceSets, *processParameterSet_, token, iLegacy, false);
145  parentActReg.connectToSubProcess(*items.actReg_);
146  serviceToken_ = items.addCPRandTNS(*processParameterSet_, newToken);
147 
148  //make the services available
150 
151  // intialize miscellaneous items
152  items.initMisc(*processParameterSet_);
153 
154  // intialize the event setup provider
155  esp_ = esController.makeProvider(*processParameterSet_, actReg_.get());
156 
157  branchIDListHelper_ = items.branchIDListHelper();
158  updateBranchIDListHelper(parentBranchIDListHelper->branchIDLists());
159 
160  thinnedAssociationsHelper_ = items.thinnedAssociationsHelper();
161  thinnedAssociationsHelper_->updateFromParentProcess(
162  parentThinnedAssociationsHelper, keepAssociation, droppedBranchIDToKeptBranchID_);
163 
164  // intialize the Schedule
165  schedule_ = items.initSchedule(*processParameterSet_,
166  hasSubProcesses,
167  preallocConfig,
169  typeResolverMaker,
171 
172  // set the items
173  act_table_ = std::move(items.act_table_);
174  preg_ = items.preg();
175 
176  subProcessParentageHelper_ = items.subProcessParentageHelper();
177  subProcessParentageHelper_->update(parentSubProcessParentageHelper, *parentProductRegistry);
178 
179  processConfiguration_ = items.processConfiguration();
181  processContext_.setParentProcessContext(parentProcessContext);
182 
184  for (unsigned int index = 0; index < preallocConfig.numberOfStreams(); ++index) {
185  auto ep = std::make_shared<EventPrincipal>(preg_,
190  index,
191  false /*not primary process*/,
194  }
195 
196  for (unsigned int index = 0; index < preallocConfig.numberOfRuns(); ++index) {
197  auto rpp = std::make_unique<RunPrincipal>(
200  }
201 
202  for (unsigned int index = 0; index < preallocConfig.numberOfLuminosityBlocks(); ++index) {
203  auto lbpp = std::make_unique<LuminosityBlockPrincipal>(
206  }
207 
208  {
209  auto pb = std::make_unique<ProcessBlockPrincipal>(preg_, *processConfiguration_, false);
211 
212  auto pbForInput = std::make_unique<ProcessBlockPrincipal>(preg_, *processConfiguration_, false);
214  }
215 
216  inUseRunPrincipals_.resize(preallocConfig.numberOfRuns());
217  inUseLumiPrincipals_.resize(preallocConfig.numberOfLuminosityBlocks());
218 
219  subProcesses_.reserve(subProcessVParameterSet.size());
220  for (auto& subProcessPSet : subProcessVParameterSet) {
221  subProcesses_.emplace_back(subProcessPSet,
222  topLevelParameterSet,
223  preg_,
228  esController,
229  *items.actReg_,
230  newToken,
231  iLegacy,
232  preallocConfig,
234  typeResolverMaker);
235  }
236  }
unsigned int historyRunOffset_
Definition: SubProcess.h:284
unsigned int historyLumiOffset_
Definition: SubProcess.h:283
ParameterSetID selector_config_id_
Definition: SubProcess.h:306
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:285
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:275
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::shared_ptr< SubProcessBlockHelper > > processBlockHelper_
Definition: SubProcess.h:274
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: SubProcess.h:258
void updateBranchIDListHelper(BranchIDLists const &)
Definition: SubProcess.cc:790
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:292
void validateTopLevelParameterSets(ParameterSet *processParameterSet)
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:289
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Definition: SubProcess.h:262
ServiceToken serviceToken_
Definition: SubProcess.h:270
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:290
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > &keepAssociation)
Definition: SubProcess.cc:328
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:301
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< ParameterSet > > processParameterSet_
Definition: SubProcess.h:294
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:277
std::vector< ParameterSet > popSubProcessVParameterSet(ParameterSet &parameterSet)
Definition: SubProcess.cc:804
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:311
ProductSelector productSelector_
Definition: SubProcess.h:302
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:307
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:269
void insertForInput(std::unique_ptr< ProcessBlockPrincipal >)
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:273
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:286
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:271
ProcessContext processContext_
Definition: SubProcess.h:279
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:272
PrincipalCache principalCache_
Definition: SubProcess.h:287
def move(src, dest)
Definition: eostools.py:511
edm::propagate_const< std::shared_ptr< SubProcessParentageHelper > > subProcessParentageHelper_
Definition: SubProcess.h:276
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:278

◆ ~SubProcess()

edm::SubProcess::~SubProcess ( )
override

Definition at line 238 of file SubProcess.cc.

238 {}

◆ 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 299 of file SubProcess.cc.

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

Referenced by doBeginJob().

299  {
300  // If event selection is being used, the SubProcess class reads TriggerResults
301  // object(s) in the parent process from the event. This next call is needed for
302  // getByToken to work properly. Normally, this is done by the worker, but since
303  // a SubProcess is not a module, it has no worker.
304  updateLookup(InEvent, *parentPreg_->productLookup(InEvent), false);
305 
306  if (!droppedBranchIDToKeptBranchID().empty()) {
308  }
310  actReg_->preBeginJobSignal_(pathsAndConsumesOfModules_, processContext_);
311  schedule_->beginJob(*preg_, esp_->recordsToProxyIndices(), *processBlockHelper_);
312  for_all(subProcesses_, [](auto& subProcess) { subProcess.doBeginJob(); });
313  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::shared_ptr< SubProcessBlockHelper > > processBlockHelper_
Definition: SubProcess.h:274
void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:280
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:254
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:270
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:269
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:271
void fixBranchIDListsForEDAliases(std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: SubProcess.cc:389
ProcessContext processContext_
Definition: SubProcess.h:279
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:272

◆ branchIDListHelper() [1/2]

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

Definition at line 258 of file SubProcess.h.

References branchIDListHelper_, and edm::get_underlying_safe().

Referenced by SubProcess().

258  {
260  }
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:273

◆ branchIDListHelper() [2/2]

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

Definition at line 261 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:273

◆ clearCounters()

void edm::SubProcess::clearCounters ( )
inline

Clear all the counters in the trigger report.

Definition at line 233 of file SubProcess.h.

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

233  {
235  schedule_->clearCounters();
236  for_all(subProcesses_, [](auto& subProcess) { subProcess.clearCounters(); });
237  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ clearLumiPrincipal()

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

Definition at line 682 of file SubProcess.cc.

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

682  {
683  //release from list but stay around till end of routine
684  auto lb = std::move(inUseLumiPrincipals_[principal.index()]);
685  for (auto& s : subProcesses_) {
686  s.clearLumiPrincipal(*lb);
687  }
688  lb->setRunPrincipal(std::shared_ptr<RunPrincipal>());
689  lb->clearPrincipal();
690  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:290
def move(src, dest)
Definition: eostools.py:511

◆ clearProcessBlockPrincipal()

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

Definition at line 623 of file SubProcess.cc.

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

623  {
624  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal(processBlockType);
625  processBlockPrincipal.clearPrincipal();
626  for (auto& s : subProcesses_) {
627  s.clearProcessBlockPrincipal(processBlockType);
628  }
629  }
void clearPrincipal()
Definition: Principal.cc:390
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
ProcessBlockPrincipal & processBlockPrincipal() const
PrincipalCache principalCache_
Definition: SubProcess.h:287

◆ clearRunPrincipal()

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

Definition at line 614 of file SubProcess.cc.

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

614  {
615  //release from list but stay around till end of routine
616  auto rp = std::move(inUseRunPrincipals_[parentPrincipal.index()]);
617  for (auto& s : subProcesses_) {
618  s.clearRunPrincipal(*rp);
619  }
620  rp->clearPrincipal();
621  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:289
def move(src, dest)
Definition: eostools.py:511

◆ closeOutputFiles()

void edm::SubProcess::closeOutputFiles ( )
inline

Definition at line 146 of file SubProcess.h.

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

146  {
148  schedule_->closeOutputFiles();
149  for_all(subProcesses_, [](auto& subProcess) { subProcess.closeOutputFiles(); });
150  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ doBeginJob()

void edm::SubProcess::doBeginJob ( )

Definition at line 295 of file SubProcess.cc.

References beginJob().

295 { this->beginJob(); }

◆ doBeginLuminosityBlockAsync()

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

Definition at line 631 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().

631  {
633 
634  LuminosityBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
635  auto aux = parentPrincipal.aux();
636  aux.setProcessHistoryID(parentPrincipal.processHistoryID());
638  lbpp->setAux(aux);
639  auto& processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_ + lbpp->index()];
640  inUseLumiPrincipals_[parentPrincipal.index()] = lbpp;
641  processHistoryRegistry.registerProcessHistory(parentPrincipal.processHistory());
642  lbpp->fillLuminosityBlockPrincipal(&parentPrincipal.processHistory(), parentPrincipal.reader());
643  lbpp->setRunPrincipal(inUseRunPrincipals_[parentPrincipal.runPrincipal().index()]);
644  LuminosityBlockPrincipal& lbp = *lbpp;
645  propagateProducts(InLumi, parentPrincipal, lbp);
646 
647  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
648  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
649  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalBegin>;
650  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
651  }
unsigned int historyLumiOffset_
Definition: SubProcess.h:283
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:285
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:289
ServiceToken serviceToken_
Definition: SubProcess.h:270
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:290
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:757
std::shared_ptr< LuminosityBlockPrincipal > getAvailableLumiPrincipalPtr()
PrincipalCache principalCache_
Definition: SubProcess.h:287
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 469 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_.

470  {
472 
473  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
474  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
475  processBlockPrincipal.fillProcessBlockPrincipal(parentPrincipal.processName(), parentPrincipal.reader());
476  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
477 
478  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
479  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionProcessBlockInput>;
480  beginGlobalTransitionAsync<Traits>(
481  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
482  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
ProcessBlockPrincipal & inputProcessBlockPrincipal() const
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
void fillProcessBlockPrincipal(std::string const &processName, DelayedReader *reader=nullptr)
ServiceToken serviceToken_
Definition: SubProcess.h:270
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:757
PrincipalCache principalCache_
Definition: SubProcess.h:287
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 485 of file SubProcess.cc.

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

486  {
488 
489  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal();
490  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
491  processBlockPrincipal.fillProcessBlockPrincipal(processConfiguration_->processName());
492  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
493 
494  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
495  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionGlobalBegin>;
496  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
497  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
void fillProcessBlockPrincipal(std::string const &processName, DelayedReader *reader=nullptr)
ProcessBlockPrincipal & processBlockPrincipal() const
ServiceToken serviceToken_
Definition: SubProcess.h:270
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:757
PrincipalCache principalCache_
Definition: SubProcess.h:287
def move(src, dest)
Definition: eostools.py:511
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:278

◆ doBeginRunAsync()

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

Definition at line 547 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().

547  {
549 
550  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
551  auto aux = parentPrincipal.aux();
552  aux.setProcessHistoryID(parentPrincipal.processHistoryID());
554  rpp->setAux(aux);
555  auto& processHistoryRegistry = processHistoryRegistries_[historyRunOffset_ + parentPrincipal.index()];
556  inUseRunPrincipals_[parentPrincipal.index()] = rpp;
557  processHistoryRegistry.registerProcessHistory(parentPrincipal.processHistory());
558  rpp->fillRunPrincipal(processHistoryRegistry, parentPrincipal.reader());
559 
560  RunPrincipal& rp = *rpp;
561  propagateProducts(InRun, parentPrincipal, rp);
562 
563  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
564  RunTransitionInfo transitionInfo(rp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
565  using Traits = OccurrenceTraits<RunPrincipal, BranchActionGlobalBegin>;
566  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
567  }
unsigned int historyRunOffset_
Definition: SubProcess.h:284
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:285
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
std::shared_ptr< RunPrincipal > getAvailableRunPrincipalPtr()
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:289
ServiceToken serviceToken_
Definition: SubProcess.h:270
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:757
PrincipalCache principalCache_
Definition: SubProcess.h:287
def move(src, dest)
Definition: eostools.py:511

◆ doBeginStream()

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

Definition at line 692 of file SubProcess.cc.

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

692  {
694  schedule_->beginStream(iID);
695  for_all(subProcesses_, [iID](auto& subProcess) { subProcess.doBeginStream(iID); });
696  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ doEndJob()

void edm::SubProcess::doEndJob ( )

Definition at line 297 of file SubProcess.cc.

References endJob().

Referenced by edm::EventProcessor::endJob().

297 { endJob(); }

◆ doEndLuminosityBlockAsync()

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

Definition at line 653 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().

655  {
656  LuminosityBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
657  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[parentPrincipal.index()];
658  propagateProducts(InLumi, parentPrincipal, lbp);
659 
660  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
661  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
662  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalEnd>;
663  endGlobalTransitionAsync<Traits>(
664  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
665  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:270
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:290
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:757
def move(src, dest)
Definition: eostools.py:511

◆ doEndProcessBlockAsync()

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

Definition at line 499 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().

501  {
502  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal();
503  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
504  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
505 
506  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
507 
508  if (parentProducedProductIsKept(parentPrincipal, processBlockPrincipal)) {
509  ProcessBlockPrincipal& inputProcessBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
510  inputProcessBlockPrincipal.fillProcessBlockPrincipal(parentPrincipal.processName(), parentPrincipal.reader());
511  propagateProducts(InProcess, parentPrincipal, inputProcessBlockPrincipal);
512  ProcessBlockTransitionInfo inputTransitionInfo(inputProcessBlockPrincipal);
513 
514  using namespace edm::waiting_task;
515  chain::first([&](const std::exception_ptr*, auto nextTask) {
516  using TraitsInput = OccurrenceTraits<ProcessBlockPrincipal, BranchActionProcessBlockInput>;
517  beginGlobalTransitionAsync<TraitsInput>(std::move(nextTask),
518  *schedule_,
519  inputTransitionInfo,
522  cleaningUpAfterException);
523  }) | chain::then([this](auto nextTask) { writeProcessBlockAsync(nextTask, ProcessBlockType::Input); }) |
524  chain::then([this, info = transitionInfo, cleaningUpAfterException](std::exception_ptr const* iPtr,
525  auto nextTask) mutable {
526  ProcessBlockPrincipal& inputProcessBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
527  inputProcessBlockPrincipal.clearPrincipal();
528  for (auto& s : subProcesses_) {
529  s.clearProcessBlockPrincipal(ProcessBlockType::Input);
530  }
531  if (iPtr) {
532  nextTask.doneWaiting(*iPtr);
533  } else {
534  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionGlobalEnd>;
535  endGlobalTransitionAsync<Traits>(
536  std::move(nextTask), *schedule_, info, serviceToken_, subProcesses_, cleaningUpAfterException);
537  }
538  }) |
539  chain::runLast(std::move(iHolder));
540  } else {
541  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionGlobalEnd>;
542  endGlobalTransitionAsync<Traits>(
543  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
544  }
545  }
void clearPrincipal()
Definition: Principal.cc:390
static const TGPicture * info(bool iBackgroundIsBlack)
bool parentProducedProductIsKept(Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:772
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
ProcessBlockPrincipal & inputProcessBlockPrincipal() const
constexpr auto then(O &&iO)
Definition: chain_first.h:277
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
void fillProcessBlockPrincipal(std::string const &processName, DelayedReader *reader=nullptr)
ProcessBlockPrincipal & processBlockPrincipal() const
ServiceToken serviceToken_
Definition: SubProcess.h:270
auto runLast(edm::WaitingTaskHolder iTask)
Definition: chain_first.h:297
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:757
void writeProcessBlockAsync(edm::WaitingTaskHolder task, ProcessBlockType)
Definition: SubProcess.cc:583
PrincipalCache principalCache_
Definition: SubProcess.h:287
def move(src, dest)
Definition: eostools.py:511

◆ doEndRunAsync()

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

Definition at line 569 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().

571  {
572  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
573  RunPrincipal& rp = *inUseRunPrincipals_[parentPrincipal.index()];
574  propagateProducts(InRun, parentPrincipal, rp);
575 
576  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
577  RunTransitionInfo transitionInfo(rp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
578  using Traits = OccurrenceTraits<RunPrincipal, BranchActionGlobalEnd>;
579  endGlobalTransitionAsync<Traits>(
580  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
581  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:289
ServiceToken serviceToken_
Definition: SubProcess.h:270
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:757
def move(src, dest)
Definition: eostools.py:511

◆ doEndStream()

void edm::SubProcess::doEndStream ( unsigned int  iID)

Definition at line 698 of file SubProcess.cc.

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

698  {
700  schedule_->endStream(iID);
701  for_all(subProcesses_, [iID](auto& subProcess) { subProcess.doEndStream(iID); });
702  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ doEventAsync()

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

Definition at line 407 of file SubProcess.cc.

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

409  {
411  /* BEGIN relevant bits from OutputModule::doEvent */
412  if (!wantAllEvents_) {
413  EventForOutput e(ep, ModuleDescription(), nullptr);
414  e.setConsumer(this);
415  if (!selectors_.wantEvent(e)) {
416  return;
417  }
418  }
419  processAsync(std::move(iHolder), ep, iEventSetupImpls);
420  /* END relevant bits from OutputModule::doEvent */
421  }
void processAsync(WaitingTaskHolder iHolder, EventPrincipal const &e, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
Definition: SubProcess.cc:423
ServiceToken serviceToken_
Definition: SubProcess.h:270
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:307
def move(src, dest)
Definition: eostools.py:511

◆ doStreamBeginLuminosityBlockAsync()

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

Definition at line 733 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().

735  {
736  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamBegin>;
737 
738  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[iTransitionInfo.principal().index()];
739  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
740  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
741  beginStreamTransitionAsync<Traits>(
742  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_);
743  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:270
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:290
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
def move(src, dest)
Definition: eostools.py:511

◆ doStreamBeginRunAsync()

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

Definition at line 704 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().

706  {
707  using Traits = OccurrenceTraits<RunPrincipal, BranchActionStreamBegin>;
708 
709  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
710  RunPrincipal& rp = *inUseRunPrincipals_[parentPrincipal.index()];
711 
712  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
713  RunTransitionInfo transitionInfo(rp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
714  beginStreamTransitionAsync<Traits>(
715  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_);
716  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:289
ServiceToken serviceToken_
Definition: SubProcess.h:270
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
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 745 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().

748  {
749  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[iTransitionInfo.principal().index()];
750  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamEnd>;
751  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
752  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
753  endStreamTransitionAsync<Traits>(
754  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
755  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:270
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:290
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
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 718 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().

721  {
722  using Traits = OccurrenceTraits<RunPrincipal, BranchActionStreamEnd>;
723 
724  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
725  RunPrincipal& rp = *inUseRunPrincipals_[parentPrincipal.index()];
726 
727  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
728  RunTransitionInfo transitionInfo(rp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
729  endStreamTransitionAsync<Traits>(
730  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
731  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:289
ServiceToken serviceToken_
Definition: SubProcess.h:270
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
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 254 of file SubProcess.h.

References droppedBranchIDToKeptBranchID_.

Referenced by beginJob(), and fixBranchIDListsForEDAliases().

254  {
256  }
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:311

◆ endJob()

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

Definition at line 315 of file SubProcess.cc.

References HltBtagPostValidation_cff::c, schedule_, serviceToken_, and subProcesses_.

Referenced by doEndJob().

315  {
317  ExceptionCollector c(
318  "Multiple exceptions were thrown while executing endJob. An exception message follows for each.");
319  schedule_->endJob(c);
320  for (auto& subProcess : subProcesses_) {
321  c.call([&subProcess]() { subProcess.doEndJob(); });
322  }
323  if (c.hasThrown()) {
324  c.rethrow();
325  }
326  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ fixBranchIDListsForEDAliases()

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

Definition at line 389 of file SubProcess.cc.

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

Referenced by beginJob().

390  {
391  // Check for branches dropped while an EDAlias was kept.
392  // Replace BranchID of each dropped branch with that of the kept alias.
393  for (BranchIDList& branchIDList : branchIDListHelper_->mutableBranchIDLists()) {
394  for (BranchID::value_type& branchID : branchIDList) {
395  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter =
396  droppedBranchIDToKeptBranchID.find(branchID);
397  if (iter != droppedBranchIDToKeptBranchID.end()) {
398  branchID = iter->second;
399  }
400  }
401  }
402  for_all(subProcesses_, [&droppedBranchIDToKeptBranchID](auto& subProcess) {
403  subProcess.fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID);
404  });
405  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:254
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:273
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 212 of file SubProcess.h.

References cuy::rep, schedule_, and serviceToken_.

212  {
214  schedule_->getTriggerReport(rep);
215  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:270
rep
Definition: cuy.py:1189

◆ keepOnlyConsumedUnscheduledModules()

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

Definition at line 240 of file SubProcess.cc.

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

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

◆ keepThisBranch()

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

Definition at line 370 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().

372  {
373  ProductSelector::checkForDuplicateKeptBranch(desc, trueBranchIDToKeptBranchDesc);
374 
375  if (desc.branchType() == InEvent) {
376  if (desc.produced()) {
377  keptProductsInEvent.insert(desc.originalBranchID());
378  } else {
379  keptProductsInEvent.insert(desc.branchID());
380  }
381  }
382  EDGetToken token = consumes(TypeToGet{desc.unwrappedTypeID(), PRODUCT_TYPE},
383  InputTag{desc.moduleLabel(), desc.productInstanceName(), desc.processName()});
384 
385  // Now put it in the list of selected branches.
386  keptProducts_[desc.branchType()].push_back(std::make_pair(&desc, token));
387  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const *> &trueBranchIDToKeptBranchDesc)
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:300

◆ keptProducts()

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

Definition at line 82 of file SubProcess.h.

References keptProducts_.

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

82 { return keptProducts_; }
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:300

◆ openOutputFiles()

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

Definition at line 153 of file SubProcess.h.

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

153  {
155  schedule_->openOutputFiles(fb);
156  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.openOutputFiles(fb); });
157  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ 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 772 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().

772  {
773  SelectedProducts const& keptVector = keptProducts()[InProcess];
774  for (auto const& item : keptVector) {
775  BranchDescription const& desc = *item.first;
776  assert(desc.branchType() == InProcess);
777  ProductResolverBase const* parentProductResolver = parentPrincipal.getProductResolver(desc.branchID());
778  if (parentProductResolver != nullptr) {
779  ProductResolverBase* productResolver = principal.getModifiableProductResolver(desc.branchID());
780  if (productResolver != nullptr) {
781  if (parentProductResolver->branchDescription().produced()) {
782  return true;
783  }
784  }
785  }
786  }
787  return false;
788  }
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:82
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 423 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().

425  {
426  EventAuxiliary aux(principal.aux());
427  aux.setProcessHistoryID(principal.processHistoryID());
428 
429  EventSelectionIDVector esids{principal.eventSelectionIDs()};
430  if (principal.productRegistry().anyProductProduced() || !wantAllEvents_) {
431  esids.push_back(selector_config_id_);
432  }
433 
434  EventPrincipal& ep = principalCache_.eventPrincipal(principal.streamID().value());
435  auto& processHistoryRegistry = processHistoryRegistries_[principal.streamID().value()];
436  processHistoryRegistry.registerProcessHistory(principal.processHistory());
437  BranchListIndexes bli(principal.branchListIndexes());
438  branchIDListHelper_->fixBranchListIndexes(bli);
439  bool deepCopyRetriever = false;
440  ep.fillEventPrincipal(
441  aux,
442  &principal.processHistory(),
443  std::move(esids),
444  std::move(bli),
445  principal.eventToProcessBlockIndexes(),
446  *(principal.productProvenanceRetrieverPtr()), //NOTE: this transfers the per product provenance
447  principal.reader(),
448  deepCopyRetriever);
449  ep.setLuminosityBlockPrincipal(inUseLumiPrincipals_[principal.luminosityBlockPrincipal().index()].get());
450  propagateProducts(InEvent, principal, ep);
451 
452  using namespace edm::waiting_task;
453  chain::first([&](auto nextTask) {
454  EventTransitionInfo info(ep, *((*iEventSetupImpls)[esp_->subProcessIndex()]));
455  schedule_->processOneEventAsync(std::move(nextTask), ep.streamID().value(), info, serviceToken_);
456  }) | chain::ifThen(not subProcesses_.empty(), [this, &ep, iEventSetupImpls](auto nextTask) {
457  for (auto& subProcess : boost::adaptors::reverse(subProcesses_)) {
458  subProcess.doEventAsync(nextTask, ep, iEventSetupImpls);
459  }
460  }) | chain::then([&ep](std::exception_ptr const* iPtr, auto nextTask) {
461  ep.clearEventPrincipal();
462  if (iPtr) {
463  nextTask.doneWaiting(*iPtr);
464  }
465  }) | chain::runLast(std::move(iHolder));
466  }
ParameterSetID selector_config_id_
Definition: SubProcess.h:306
static const TGPicture * info(bool iBackgroundIsBlack)
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:285
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
constexpr auto then(O &&iO)
Definition: chain_first.h:277
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
std::vector< EventSelectionID > EventSelectionIDVector
ServiceToken serviceToken_
Definition: SubProcess.h:270
std::vector< BranchListIndex > BranchListIndexes
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:290
auto runLast(edm::WaitingTaskHolder iTask)
Definition: chain_first.h:297
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
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:757
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:273
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
PrincipalCache principalCache_
Definition: SubProcess.h:287
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 757 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().

757  {
758  SelectedProducts const& keptVector = keptProducts()[type];
759  for (auto const& item : keptVector) {
760  BranchDescription const& desc = *item.first;
761  ProductResolverBase const* parentProductResolver = parentPrincipal.getProductResolver(desc.branchID());
762  if (parentProductResolver != nullptr) {
763  ProductResolverBase* productResolver = principal.getModifiableProductResolver(desc.branchID());
764  if (productResolver != nullptr) {
765  //Propagate the per event(run)(lumi)(processBlock) data for this product to the subprocess.
766  productResolver->connectTo(*parentProductResolver, &parentPrincipal);
767  }
768  }
769  }
770  }
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:82
std::vector< std::pair< BranchDescription const *, EDGetToken > > SelectedProducts

◆ respondToCloseInputFile()

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

Definition at line 165 of file SubProcess.h.

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

165  {
167  schedule_->respondToCloseInputFile(fb);
168  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.respondToCloseInputFile(fb); });
169  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ respondToOpenInputFile()

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

Definition at line 797 of file SubProcess.cc.

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

797  {
799  schedule_->respondToOpenInputFile(fb);
800  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.respondToOpenInputFile(fb); });
801  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ selectProducts()

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

Definition at line 328 of file SubProcess.cc.

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

Referenced by SubProcess().

330  {
332  return;
333  productSelector_.initialize(productSelectorRules_, preg.allBranchDescriptions());
334 
335  // TODO: See if we can collapse keptProducts_ and productSelector_ into a
336  // single object. See the notes in the header for ProductSelector
337  // for more information.
338 
339  std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
340  std::vector<BranchDescription const*> associationDescriptions;
341  std::set<BranchID> keptProductsInEvent;
342 
343  for (auto const& it : preg.productList()) {
344  BranchDescription const& desc = it.second;
345  if (desc.transient()) {
346  // if the class of the branch is marked transient, output nothing
347  } else if (!desc.present() && !desc.produced()) {
348  // else if the branch containing the product has been previously dropped,
349  // output nothing
350  } else if (desc.unwrappedType() == typeid(ThinnedAssociation)) {
351  associationDescriptions.push_back(&desc);
352  } else if (productSelector_.selected(desc)) {
353  keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
354  }
355  }
356 
357  parentThinnedAssociationsHelper.selectAssociationProducts(
358  associationDescriptions, keptProductsInEvent, keepAssociation);
359 
360  for (auto association : associationDescriptions) {
361  if (keepAssociation[association->branchID()]) {
362  keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
363  }
364  }
365 
366  // Now fill in a mapping needed in the case that a branch was dropped while its EDAlias was kept.
367  ProductSelector::fillDroppedToKept(preg, trueBranchIDToKeptBranchDesc, droppedBranchIDToKeptBranchID_);
368  }
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:301
bool selected(BranchDescription const &desc) const
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:311
ProductSelector productSelector_
Definition: SubProcess.h:302
bool initialized() const
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const *> &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
Definition: SubProcess.cc:370

◆ shouldWeCloseOutput()

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

Definition at line 172 of file SubProcess.h.

References schedule_, serviceToken_, and subProcesses_.

172  {
174  if (schedule_->shouldWeCloseOutput()) {
175  return true;
176  }
177  for (auto const& subProcess : subProcesses_) {
178  if (subProcess.shouldWeCloseOutput()) {
179  return true;
180  }
181  }
182  return false;
183  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ 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 219 of file SubProcess.h.

References schedule_, serviceToken_, and subProcesses_.

219  {
221  if (schedule_->terminate()) {
222  return true;
223  }
224  for (auto const& subProcess : subProcesses_) {
225  if (subProcess.terminate()) {
226  return true;
227  }
228  }
229  return false;
230  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ thinnedAssociationsHelper() [1/2]

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

Definition at line 262 of file SubProcess.h.

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

Referenced by SubProcess().

262  {
264  }
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:275
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 265 of file SubProcess.h.

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

265  {
267  }
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:275
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 195 of file SubProcess.h.

References schedule_.

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

◆ 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 205 of file SubProcess.h.

References schedule_, and serviceToken_.

205  {
207  return schedule_->totalEventsFailed();
208  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ 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 198 of file SubProcess.h.

References schedule_, and serviceToken_.

198  {
200  return schedule_->totalEventsPassed();
201  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:270

◆ updateBranchIDListHelper()

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

Definition at line 790 of file SubProcess.cc.

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

Referenced by SubProcess().

790  {
791  branchIDListHelper_->updateFromParent(branchIDLists);
793  [this](auto& subProcess) { subProcess.updateBranchIDListHelper(branchIDListHelper_->branchIDLists()); });
794  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
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:273

◆ writeLumiAsync()

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

Definition at line 667 of file SubProcess.cc.

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

667  {
668  using namespace edm::waiting_task;
669 
670  auto l = inUseLumiPrincipals_[principal.index()];
671  chain::first([&](std::exception_ptr const*, auto nextTask) {
673  schedule_->writeLumiAsync(nextTask, *l, &processContext_, actReg_.get());
674  }) | chain::ifThen(not subProcesses_.empty(), [this, l](auto nextTask) {
675  ServiceRegistry::Operate operateWriteLumi(serviceToken_);
676  for (auto& s : subProcesses_) {
677  s.writeLumiAsync(nextTask, *l);
678  }
680  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:270
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:290
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:269
ProcessContext processContext_
Definition: SubProcess.h:279
def move(src, dest)
Definition: eostools.py:511

◆ writeProcessBlockAsync()

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

Definition at line 583 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().

583  {
584  using namespace edm::waiting_task;
585  chain::first([&](std::exception_ptr const*, auto nextTask) {
587  schedule_->writeProcessBlockAsync(
588  nextTask, principalCache_.processBlockPrincipal(processBlockType), &processContext_, actReg_.get());
589  }) | chain::ifThen(not subProcesses_.empty(), [this, processBlockType](auto nextTask) {
591  for (auto& s : subProcesses_) {
592  s.writeProcessBlockAsync(nextTask, processBlockType);
593  }
595  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ProcessBlockPrincipal & processBlockPrincipal() const
ServiceToken serviceToken_
Definition: SubProcess.h:270
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:269
ProcessContext processContext_
Definition: SubProcess.h:279
PrincipalCache principalCache_
Definition: SubProcess.h:287
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 597 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.

599  {
600  using namespace edm::waiting_task;
601 
602  auto rp = inUseRunPrincipals_[principal.index()];
603  chain::first([&](std::exception_ptr const*, auto nextTask) {
605  schedule_->writeRunAsync(nextTask, *rp, &processContext_, actReg_.get(), mergeableRunProductMetadata);
606  }) | chain::ifThen(not subProcesses_.empty(), [this, rp, mergeableRunProductMetadata](auto nextTask) {
607  ServiceRegistry::Operate operateWriteRun(serviceToken_);
608  for (auto& s : subProcesses_) {
609  s.writeRunAsync(nextTask, *rp, mergeableRunProductMetadata);
610  }
612  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:293
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:289
ServiceToken serviceToken_
Definition: SubProcess.h:270
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:269
ProcessContext processContext_
Definition: SubProcess.h:279
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 277 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 311 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 286 of file SubProcess.h.

Referenced by SubProcess().

◆ historyLumiOffset_

unsigned int edm::SubProcess::historyLumiOffset_
private

Definition at line 283 of file SubProcess.h.

Referenced by doBeginLuminosityBlockAsync(), and SubProcess().

◆ historyRunOffset_

unsigned int edm::SubProcess::historyRunOffset_
private

Definition at line 284 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 300 of file SubProcess.h.

Referenced by keepThisBranch(), and keptProducts().

◆ parentPreg_

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

Definition at line 271 of file SubProcess.h.

Referenced by beginJob().

◆ pathsAndConsumesOfModules_

PathsAndConsumesOfModules edm::SubProcess::pathsAndConsumesOfModules_
private

Definition at line 280 of file SubProcess.h.

Referenced by beginJob(), and keepOnlyConsumedUnscheduledModules().

◆ preg_

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

Definition at line 272 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 274 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 285 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 294 of file SubProcess.h.

Referenced by SubProcess().

◆ productSelector_

ProductSelector edm::SubProcess::productSelector_
private

Definition at line 302 of file SubProcess.h.

Referenced by selectProducts().

◆ productSelectorRules_

ProductSelectorRules edm::SubProcess::productSelectorRules_
private

Definition at line 301 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 306 of file SubProcess.h.

Referenced by processAsync(), and SubProcess().

◆ selectors_

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

Definition at line 307 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 276 of file SubProcess.h.

Referenced by SubProcess().

◆ thinnedAssociationsHelper_

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

Definition at line 275 of file SubProcess.h.

Referenced by SubProcess(), and thinnedAssociationsHelper().

◆ wantAllEvents_

bool edm::SubProcess::wantAllEvents_
private

Definition at line 305 of file SubProcess.h.

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