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 clearProcessBlockPrincipal (ProcessBlockType)
 
void closeOutputFiles ()
 
void deleteLumiFromCache (LuminosityBlockPrincipal &)
 
void deleteRunFromCache (ProcessHistoryID const &parentPhID, int runNumber)
 
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)
 
 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, ProcessHistoryID const &parentPhID, int runNumber, 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_
 
SelectedProductsForBranchType keptProducts_
 
std::shared_ptr< ProductRegistry const > parentPreg_
 
std::map< ProcessHistoryID, ProcessHistoryIDparentToChildPhID_
 
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 52 of file SubProcess.h.

Member Typedef Documentation

◆ ProcessBlockType

Definition at line 134 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 
)

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_, mps_monitormerge::items, edm::eventsetup::EventSetupsController::makeProvider(), Data_TkAlMinBias_Run2018C_PromptReco_v3_cff::maxEvents, eostools::move(), edm::PreallocationConfiguration::numberOfLuminosityBlocks(), edm::PreallocationConfiguration::numberOfStreams(), edm::parameterSet(), edm::ParameterSet::popParameterSet(), edm::popSubProcessVParameterSet(), preg_, principalCache_, processBlockHelper_, processConfiguration_, processContext_, processHistoryRegistries_, processParameterSet_, edm::ParameterSet::registerIt(), edm::detail::registerProperSelectionInfo(), schedule_, selector_config_id_, selectors_, selectProducts(), serviceToken_, edm::PrincipalCache::setNumberOfConcurrentPrincipals(), edm::ProcessContext::setParentProcessContext(), edm::ProcessContext::setProcessConfiguration(), edm::PrincipalCache::setProcessHistoryRegistry(), AlCaHLTBitMon_QueryRunRegistry::string, subProcesses_, subProcessParentageHelper_, thinnedAssociationsHelper(), thinnedAssociationsHelper_, unpackBuffers-CaloStage2::token, updateBranchIDListHelper(), edm::validateTopLevelParameterSets(), and wantAllEvents_.

64  : EDConsumerBase(),
65  serviceToken_(),
66  parentPreg_(parentProductRegistry),
67  preg_(),
69  act_table_(),
71  historyLumiOffset_(preallocConfig.numberOfStreams()),
72  historyRunOffset_(historyLumiOffset_ + preallocConfig.numberOfLuminosityBlocks()),
73  processHistoryRegistries_(historyRunOffset_ + preallocConfig.numberOfRuns()),
74  historyAppenders_(historyRunOffset_ + preallocConfig.numberOfRuns()),
76  esp_(),
77  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.size() != 0ull;
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(
166  *processParameterSet_, hasSubProcesses, preallocConfig, &processContext_, *processBlockHelper_);
167 
168  // set the items
169  act_table_ = std::move(items.act_table_);
170  preg_ = items.preg();
171 
172  subProcessParentageHelper_ = items.subProcessParentageHelper();
173  subProcessParentageHelper_->update(parentSubProcessParentageHelper, *parentProductRegistry);
174 
175  //CMS-THREADING this only works since Run/Lumis are synchronous so when principalCache asks for
176  // the reducedProcessHistoryID from a full ProcessHistoryID that registry will not be in use by
177  // another thread. We really need to change how this is done in the PrincipalCache.
179 
180  processConfiguration_ = items.processConfiguration();
182  processContext_.setParentProcessContext(parentProcessContext);
183 
185  for (unsigned int index = 0; index < preallocConfig.numberOfStreams(); ++index) {
186  auto ep = std::make_shared<EventPrincipal>(preg_,
191  index,
192  false /*not primary process*/,
195  }
196  for (unsigned int index = 0; index < preallocConfig.numberOfLuminosityBlocks(); ++index) {
197  auto lbpp = std::make_unique<LuminosityBlockPrincipal>(
200  }
201 
202  {
203  auto pb = std::make_unique<ProcessBlockPrincipal>(preg_, *processConfiguration_, false);
205 
206  auto pbForInput = std::make_unique<ProcessBlockPrincipal>(preg_, *processConfiguration_, false);
208  }
209 
210  inUseLumiPrincipals_.resize(preallocConfig.numberOfLuminosityBlocks());
211 
212  subProcesses_.reserve(subProcessVParameterSet.size());
213  for (auto& subProcessPSet : subProcessVParameterSet) {
214  subProcesses_.emplace_back(subProcessPSet,
215  topLevelParameterSet,
216  preg_,
221  esController,
222  *items.actReg_,
223  newToken,
224  iLegacy,
225  preallocConfig,
226  &processContext_);
227  }
228  }
unsigned int historyRunOffset_
Definition: SubProcess.h:285
unsigned int historyLumiOffset_
Definition: SubProcess.h:284
ParameterSetID selector_config_id_
Definition: SubProcess.h:307
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:286
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:276
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::shared_ptr< SubProcessBlockHelper > > processBlockHelper_
Definition: SubProcess.h:275
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: SubProcess.h:259
void updateBranchIDListHelper(BranchIDLists const &)
Definition: SubProcess.cc:792
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::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Definition: SubProcess.h:263
ServiceToken serviceToken_
Definition: SubProcess.h:271
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:320
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:302
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< ParameterSet > > processParameterSet_
Definition: SubProcess.h:295
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:278
std::vector< ParameterSet > popSubProcessVParameterSet(ParameterSet &parameterSet)
Definition: SubProcess.cc:806
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:312
ProductSelector productSelector_
Definition: SubProcess.h:303
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:308
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:293
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:270
void insertForInput(std::unique_ptr< ProcessBlockPrincipal >)
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:274
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:287
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:272
ProcessContext processContext_
Definition: SubProcess.h:280
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:273
PrincipalCache principalCache_
Definition: SubProcess.h:288
def move(src, dest)
Definition: eostools.py:511
edm::propagate_const< std::shared_ptr< SubProcessParentageHelper > > subProcessParentageHelper_
Definition: SubProcess.h:277
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:279

◆ ~SubProcess()

edm::SubProcess::~SubProcess ( )
override

Definition at line 230 of file SubProcess.cc.

230 {}

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

291  {
292  // If event selection is being used, the SubProcess class reads TriggerResults
293  // object(s) in the parent process from the event. This next call is needed for
294  // getByToken to work properly. Normally, this is done by the worker, but since
295  // a SubProcess is not a module, it has no worker.
296  updateLookup(InEvent, *parentPreg_->productLookup(InEvent), false);
297 
298  if (!droppedBranchIDToKeptBranchID().empty()) {
300  }
302  actReg_->preBeginJobSignal_(pathsAndConsumesOfModules_, processContext_);
303  schedule_->beginJob(*preg_, esp_->recordsToProxyIndices(), *processBlockHelper_);
304  for_all(subProcesses_, [](auto& subProcess) { subProcess.doBeginJob(); });
305  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::shared_ptr< SubProcessBlockHelper > > processBlockHelper_
Definition: SubProcess.h:275
void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:281
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:255
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:271
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:270
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:272
void fixBranchIDListsForEDAliases(std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: SubProcess.cc:381
ProcessContext processContext_
Definition: SubProcess.h:280
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:273

◆ branchIDListHelper() [1/2]

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

Definition at line 259 of file SubProcess.h.

References branchIDListHelper_, and edm::get_underlying_safe().

Referenced by SubProcess().

259  {
261  }
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:274

◆ branchIDListHelper() [2/2]

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

Definition at line 262 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:274

◆ clearCounters()

void edm::SubProcess::clearCounters ( )
inline

Clear all the counters in the trigger report.

Definition at line 234 of file SubProcess.h.

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

234  {
236  schedule_->clearCounters();
237  for_all(subProcesses_, [](auto& subProcess) { subProcess.clearCounters(); });
238  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:271

◆ clearProcessBlockPrincipal()

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

Definition at line 633 of file SubProcess.cc.

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

633  {
634  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal(processBlockType);
635  processBlockPrincipal.clearPrincipal();
636  for (auto& s : subProcesses_) {
637  s.clearProcessBlockPrincipal(processBlockType);
638  }
639  }
void clearPrincipal()
Definition: Principal.cc:382
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
ProcessBlockPrincipal & processBlockPrincipal() const
PrincipalCache principalCache_
Definition: SubProcess.h:288

◆ closeOutputFiles()

void edm::SubProcess::closeOutputFiles ( )
inline

Definition at line 147 of file SubProcess.h.

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

147  {
149  schedule_->closeOutputFiles();
150  for_all(subProcesses_, [](auto& subProcess) { subProcess.closeOutputFiles(); });
151  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:271

◆ deleteLumiFromCache()

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

Definition at line 692 of file SubProcess.cc.

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

692  {
693  //release from list but stay around till end of routine
694  auto lb = std::move(inUseLumiPrincipals_[principal.index()]);
695  for (auto& s : subProcesses_) {
696  s.deleteLumiFromCache(*lb);
697  }
698  lb->clearPrincipal();
699  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:290
def move(src, dest)
Definition: eostools.py:511

◆ deleteRunFromCache()

void edm::SubProcess::deleteRunFromCache ( ProcessHistoryID const &  parentPhID,
int  runNumber 
)

Definition at line 624 of file SubProcess.cc.

References cms::cuda::assert(), edm::PrincipalCache::deleteRun(), edm::for_all(), parentToChildPhID_, principalCache_, convertSQLiteXML::runNumber, and subProcesses_.

624  {
625  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
626  assert(it != parentToChildPhID_.end());
627  auto const& childPhID = it->second;
628  principalCache_.deleteRun(childPhID, runNumber);
630  [&childPhID, runNumber](auto& subProcess) { subProcess.deleteRunFromCache(childPhID, runNumber); });
631  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
assert(be >=bs)
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:293
void deleteRun(ProcessHistoryID const &phid, RunNumber_t run)
PrincipalCache principalCache_
Definition: SubProcess.h:288

◆ doBeginJob()

void edm::SubProcess::doBeginJob ( )

Definition at line 287 of file SubProcess.cc.

References beginJob().

287 { this->beginJob(); }

◆ doBeginLuminosityBlockAsync()

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

Definition at line 641 of file SubProcess.cc.

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

Referenced by edm::subProcessDoGlobalBeginTransitionAsync().

641  {
643 
644  LuminosityBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
645  auto aux = parentPrincipal.aux();
646  aux.setProcessHistoryID(parentPrincipal.processHistoryID());
648  lbpp->setAux(aux);
649  auto& processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_ + lbpp->index()];
650  inUseLumiPrincipals_[parentPrincipal.index()] = lbpp;
651  processHistoryRegistry.registerProcessHistory(parentPrincipal.processHistory());
652  lbpp->fillLuminosityBlockPrincipal(&parentPrincipal.processHistory(), parentPrincipal.reader());
653  lbpp->setRunPrincipal(principalCache_.runPrincipalPtr());
654  LuminosityBlockPrincipal& lbp = *lbpp;
655  propagateProducts(InLumi, parentPrincipal, lbp);
656 
657  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
658  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
659  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalBegin>;
660  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
661  }
unsigned int historyLumiOffset_
Definition: SubProcess.h:284
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:286
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:271
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:759
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
std::shared_ptr< LuminosityBlockPrincipal > getAvailableLumiPrincipalPtr()
PrincipalCache principalCache_
Definition: SubProcess.h:288
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 461 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_.

462  {
464 
465  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
466  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
467  processBlockPrincipal.fillProcessBlockPrincipal(parentPrincipal.processName(), parentPrincipal.reader());
468  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
469 
470  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
471  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionProcessBlockInput>;
472  beginGlobalTransitionAsync<Traits>(
473  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
474  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:271
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:759
PrincipalCache principalCache_
Definition: SubProcess.h:288
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 477 of file SubProcess.cc.

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

478  {
480 
481  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal();
482  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
483  processBlockPrincipal.fillProcessBlockPrincipal(processConfiguration_->processName());
484  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
485 
486  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
487  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionGlobalBegin>;
488  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
489  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:271
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:759
PrincipalCache principalCache_
Definition: SubProcess.h:288
def move(src, dest)
Definition: eostools.py:511
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:279

◆ doBeginRunAsync()

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

Definition at line 539 of file SubProcess.cc.

References printConversionInfo::aux, edm::RunPrincipal::aux(), esp_, historyAppenders_, historyRunOffset_, edm::RunPrincipal::index(), edm::InRun, edm::PrincipalCache::insert(), eostools::move(), parentToChildPhID_, preg_, edm::RunTransitionInfo::principal(), principalCache_, processConfiguration_, edm::Principal::processHistory(), edm::Principal::processHistoryID(), processHistoryRegistries_, propagateProducts(), edm::Principal::reader(), edm::RunPrincipal::reducedProcessHistoryID(), edm::PrincipalCache::runPrincipalPtr(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoGlobalBeginTransitionAsync().

539  {
541 
542  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
543  auto aux = std::make_shared<RunAuxiliary>(parentPrincipal.aux());
544  aux->setProcessHistoryID(parentPrincipal.processHistoryID());
545  auto rpp = std::make_shared<RunPrincipal>(aux,
546  preg_,
548  &(historyAppenders_[historyRunOffset_ + parentPrincipal.index()]),
549  parentPrincipal.index(),
550  false);
551  auto& processHistoryRegistry = processHistoryRegistries_[historyRunOffset_ + parentPrincipal.index()];
552  processHistoryRegistry.registerProcessHistory(parentPrincipal.processHistory());
553  rpp->fillRunPrincipal(processHistoryRegistry, parentPrincipal.reader());
554  principalCache_.insert(rpp);
555 
556  ProcessHistoryID const& parentInputReducedPHID = parentPrincipal.reducedProcessHistoryID();
557  ProcessHistoryID const& inputReducedPHID = rpp->reducedProcessHistoryID();
558 
559  parentToChildPhID_.insert(std::make_pair(parentInputReducedPHID, inputReducedPHID));
560 
561  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
562  propagateProducts(InRun, parentPrincipal, rp);
563 
564  RunTransitionInfo transitionInfo(rp, esp_->eventSetupImpl());
565  using Traits = OccurrenceTraits<RunPrincipal, BranchActionGlobalBegin>;
566  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
567  }
unsigned int historyRunOffset_
Definition: SubProcess.h:285
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:286
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:271
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:759
void insert(std::unique_ptr< ProcessBlockPrincipal >)
Hash< ProcessHistoryType > ProcessHistoryID
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:293
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:287
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:273
PrincipalCache principalCache_
Definition: SubProcess.h:288
def move(src, dest)
Definition: eostools.py:511
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:279

◆ doBeginStream()

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

Definition at line 701 of file SubProcess.cc.

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

701  {
703  schedule_->beginStream(iID);
704  for_all(subProcesses_, [iID](auto& subProcess) { subProcess.doBeginStream(iID); });
705  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:271

◆ doEndJob()

void edm::SubProcess::doEndJob ( )

Definition at line 289 of file SubProcess.cc.

References endJob().

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

289 { endJob(); }

◆ doEndLuminosityBlockAsync()

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

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

665  {
666  LuminosityBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
667  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[parentPrincipal.index()];
668  propagateProducts(InLumi, parentPrincipal, lbp);
669 
670  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
671  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
672  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalEnd>;
673  endGlobalTransitionAsync<Traits>(
674  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
675  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:271
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:759
def move(src, dest)
Definition: eostools.py:511

◆ doEndProcessBlockAsync()

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

Definition at line 491 of file SubProcess.cc.

References edm::Principal::clearPrincipal(), edm::ProcessBlockPrincipal::fillProcessBlockPrincipal(), 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().

493  {
494  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal();
495  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
496  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
497 
498  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
499 
500  if (parentProducedProductIsKept(parentPrincipal, processBlockPrincipal)) {
501  ProcessBlockPrincipal& inputProcessBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
502  inputProcessBlockPrincipal.fillProcessBlockPrincipal(parentPrincipal.processName(), parentPrincipal.reader());
503  propagateProducts(InProcess, parentPrincipal, inputProcessBlockPrincipal);
504  ProcessBlockTransitionInfo inputTransitionInfo(inputProcessBlockPrincipal);
505 
506  using namespace edm::waiting_task;
507  chain::first([&](const std::exception_ptr*, auto nextTask) {
508  using TraitsInput = OccurrenceTraits<ProcessBlockPrincipal, BranchActionProcessBlockInput>;
509  beginGlobalTransitionAsync<TraitsInput>(std::move(nextTask),
510  *schedule_,
511  inputTransitionInfo,
514  cleaningUpAfterException);
515  }) | chain::then([this](auto nextTask) { writeProcessBlockAsync(nextTask, ProcessBlockType::Input); }) |
516  chain::then([this, info = transitionInfo, cleaningUpAfterException](std::exception_ptr const* iPtr,
517  auto nextTask) mutable {
518  ProcessBlockPrincipal& inputProcessBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
519  inputProcessBlockPrincipal.clearPrincipal();
520  for (auto& s : subProcesses_) {
521  s.clearProcessBlockPrincipal(ProcessBlockType::Input);
522  }
523  if (iPtr) {
524  nextTask.doneWaiting(*iPtr);
525  } else {
526  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionGlobalEnd>;
527  endGlobalTransitionAsync<Traits>(
528  std::move(nextTask), *schedule_, info, serviceToken_, subProcesses_, cleaningUpAfterException);
529  }
530  }) |
531  chain::runLast(std::move(iHolder));
532  } else {
533  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionGlobalEnd>;
534  endGlobalTransitionAsync<Traits>(
535  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
536  }
537  }
void clearPrincipal()
Definition: Principal.cc:382
static const TGPicture * info(bool iBackgroundIsBlack)
bool parentProducedProductIsKept(Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:774
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:271
auto runLast(edm::WaitingTaskHolder iTask)
Definition: chain_first.h:297
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:759
void writeProcessBlockAsync(edm::WaitingTaskHolder task, ProcessBlockType)
Definition: SubProcess.cc:582
PrincipalCache principalCache_
Definition: SubProcess.h:288
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::InRun, eostools::move(), edm::RunTransitionInfo::principal(), principalCache_, propagateProducts(), edm::PrincipalCache::runPrincipalPtr(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoGlobalEndTransitionAsync().

571  {
572  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
573  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
574  propagateProducts(InRun, parentPrincipal, rp);
575 
576  RunTransitionInfo transitionInfo(rp, esp_->eventSetupImpl());
577  using Traits = OccurrenceTraits<RunPrincipal, BranchActionGlobalEnd>;
578  endGlobalTransitionAsync<Traits>(
579  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
580  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:271
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:759
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
PrincipalCache principalCache_
Definition: SubProcess.h:288
def move(src, dest)
Definition: eostools.py:511

◆ doEndStream()

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

Definition at line 707 of file SubProcess.cc.

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

707  {
709  schedule_->endStream(iID);
710  for_all(subProcesses_, [iID](auto& subProcess) { subProcess.doEndStream(iID); });
711  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:271

◆ doEventAsync()

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

Definition at line 399 of file SubProcess.cc.

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

401  {
403  /* BEGIN relevant bits from OutputModule::doEvent */
404  if (!wantAllEvents_) {
405  EventForOutput e(ep, ModuleDescription(), nullptr);
406  e.setConsumer(this);
407  if (!selectors_.wantEvent(e)) {
408  return;
409  }
410  }
411  processAsync(std::move(iHolder), ep, iEventSetupImpls);
412  /* END relevant bits from OutputModule::doEvent */
413  }
void processAsync(WaitingTaskHolder iHolder, EventPrincipal const &e, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
Definition: SubProcess.cc:415
ServiceToken serviceToken_
Definition: SubProcess.h:271
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:308
def move(src, dest)
Definition: eostools.py:511

◆ doStreamBeginLuminosityBlockAsync()

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

Definition at line 735 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamBeginTransitionAsync().

737  {
738  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamBegin>;
739 
740  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[iTransitionInfo.principal().index()];
741  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
742  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
743  beginStreamTransitionAsync<Traits>(
744  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_);
745  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:271
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 &   
)

Definition at line 713 of file SubProcess.cc.

References esp_, triggerObjects_cff::id, eostools::move(), principalCache_, edm::PrincipalCache::runPrincipalPtr(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoStreamBeginTransitionAsync().

713  {
714  using Traits = OccurrenceTraits<RunPrincipal, BranchActionStreamBegin>;
715 
716  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
717 
718  RunTransitionInfo transitionInfo(rp, esp_->eventSetupImpl());
719  beginStreamTransitionAsync<Traits>(
720  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_);
721  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:271
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
PrincipalCache principalCache_
Definition: SubProcess.h:288
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 747 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamEndTransitionAsync().

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

Definition at line 723 of file SubProcess.cc.

References esp_, triggerObjects_cff::id, eostools::move(), principalCache_, edm::PrincipalCache::runPrincipalPtr(), schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoStreamEndTransitionAsync().

726  {
727  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
728  using Traits = OccurrenceTraits<RunPrincipal, BranchActionStreamEnd>;
729 
730  RunTransitionInfo transitionInfo(rp, esp_->eventSetupImpl());
731  endStreamTransitionAsync<Traits>(
732  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
733  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:271
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:291
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
PrincipalCache principalCache_
Definition: SubProcess.h:288
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 255 of file SubProcess.h.

References droppedBranchIDToKeptBranchID_.

Referenced by beginJob(), and fixBranchIDListsForEDAliases().

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

◆ endJob()

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

Definition at line 307 of file SubProcess.cc.

References c, schedule_, serviceToken_, and subProcesses_.

Referenced by doEndJob().

307  {
309  ExceptionCollector c(
310  "Multiple exceptions were thrown while executing endJob. An exception message follows for each.");
311  schedule_->endJob(c);
312  for (auto& subProcess : subProcesses_) {
313  c.call([&subProcess]() { subProcess.doEndJob(); });
314  }
315  if (c.hasThrown()) {
316  c.rethrow();
317  }
318  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:271

◆ fixBranchIDListsForEDAliases()

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

Definition at line 381 of file SubProcess.cc.

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

Referenced by beginJob().

382  {
383  // Check for branches dropped while an EDAlias was kept.
384  // Replace BranchID of each dropped branch with that of the kept alias.
385  for (BranchIDList& branchIDList : branchIDListHelper_->mutableBranchIDLists()) {
386  for (BranchID::value_type& branchID : branchIDList) {
387  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter =
388  droppedBranchIDToKeptBranchID.find(branchID);
389  if (iter != droppedBranchIDToKeptBranchID.end()) {
390  branchID = iter->second;
391  }
392  }
393  }
394  for_all(subProcesses_, [&droppedBranchIDToKeptBranchID](auto& subProcess) {
395  subProcess.fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID);
396  });
397  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:255
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:274
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 213 of file SubProcess.h.

References cuy::rep, schedule_, and serviceToken_.

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

◆ keepOnlyConsumedUnscheduledModules()

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

Definition at line 232 of file SubProcess.cc.

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

232  {
233  schedule_->convertCurrentProcessAlias(processConfiguration_->processName());
235 
236  // Note: all these may throw
238 
239  // Consumes information from the child SubProcesses
240  std::vector<ModuleProcessName> consumedByChildren;
241  for_all(subProcesses_, [&consumedByChildren, deleteModules](auto& subProcess) {
242  auto c = subProcess.keepOnlyConsumedUnscheduledModules(deleteModules);
243  if (consumedByChildren.empty()) {
244  std::swap(consumedByChildren, c);
245  } else if (not c.empty()) {
246  std::vector<ModuleProcessName> tmp;
247  tmp.reserve(consumedByChildren.size() + c.size());
248  std::merge(consumedByChildren.begin(), consumedByChildren.end(), c.begin(), c.end(), std::back_inserter(tmp));
249  std::swap(consumedByChildren, tmp);
250  }
251  });
252 
253  // Non-consumed unscheduled modules in this SubProcess, take into account of the consumes from child SubProcesses
254  if (deleteModules) {
255  if (auto const unusedModules = nonConsumedUnscheduledModules(pathsAndConsumesOfModules_, consumedByChildren);
256  not unusedModules.empty()) {
258 
259  edm::LogInfo("DeleteModules").log([&unusedModules, this](auto& l) {
260  l << "Following modules are not in any Path or EndPath, nor is their output consumed by any other module, "
261  "and "
262  "therefore they are deleted from SubProcess "
263  << processConfiguration_->processName() << " before beginJob transition.";
264  for (auto const& description : unusedModules) {
265  l << "\n " << description->moduleLabel();
266  }
267  });
268  for (auto const& description : unusedModules) {
269  schedule_->deleteModule(description->moduleLabel(), actReg_.get());
270  }
271  }
272  }
273 
274  // Products possibly consumed from the parent (Sub)Process
275  for (auto const& description : pathsAndConsumesOfModules_.allModules()) {
276  for (auto const& dep :
278  auto it = std::lower_bound(consumedByChildren.begin(),
279  consumedByChildren.end(),
280  ModuleProcessName{dep.moduleLabel(), dep.processName()});
281  consumedByChildren.emplace(it, dep.moduleLabel(), dep.processName());
282  }
283  }
284  return consumedByChildren;
285  }
std::vector< ModuleDescription const * > const & allModules() const
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:281
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)
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:270
void removeModules(std::vector< ModuleDescription const *> const &modules)
tmp
align.sh
Definition: createJobs.py:716
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:273
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:279
def merge(dictlist, TELL=False)
Definition: MatrixUtil.py:205

◆ keepThisBranch()

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

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

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

◆ keptProducts()

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

Definition at line 80 of file SubProcess.h.

References keptProducts_.

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

80 { return keptProducts_; }
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:301

◆ openOutputFiles()

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

Definition at line 154 of file SubProcess.h.

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

154  {
156  schedule_->openOutputFiles(fb);
157  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.openOutputFiles(fb); });
158  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:271

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

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

417  {
418  EventAuxiliary aux(principal.aux());
419  aux.setProcessHistoryID(principal.processHistoryID());
420 
421  EventSelectionIDVector esids{principal.eventSelectionIDs()};
422  if (principal.productRegistry().anyProductProduced() || !wantAllEvents_) {
423  esids.push_back(selector_config_id_);
424  }
425 
426  EventPrincipal& ep = principalCache_.eventPrincipal(principal.streamID().value());
427  auto& processHistoryRegistry = processHistoryRegistries_[principal.streamID().value()];
428  processHistoryRegistry.registerProcessHistory(principal.processHistory());
429  BranchListIndexes bli(principal.branchListIndexes());
430  branchIDListHelper_->fixBranchListIndexes(bli);
431  bool deepCopyRetriever = false;
432  ep.fillEventPrincipal(
433  aux,
434  &principal.processHistory(),
435  std::move(esids),
436  std::move(bli),
437  principal.eventToProcessBlockIndexes(),
438  *(principal.productProvenanceRetrieverPtr()), //NOTE: this transfers the per product provenance
439  principal.reader(),
440  deepCopyRetriever);
441  ep.setLuminosityBlockPrincipal(inUseLumiPrincipals_[principal.luminosityBlockPrincipal().index()].get());
442  propagateProducts(InEvent, principal, ep);
443 
444  using namespace edm::waiting_task;
445  chain::first([&](auto nextTask) {
446  EventTransitionInfo info(ep, *((*iEventSetupImpls)[esp_->subProcessIndex()]));
447  schedule_->processOneEventAsync(std::move(nextTask), ep.streamID().value(), info, serviceToken_);
448  }) | chain::ifThen(not subProcesses_.empty(), [this, &ep, iEventSetupImpls](auto nextTask) {
449  for (auto& subProcess : boost::adaptors::reverse(subProcesses_)) {
450  subProcess.doEventAsync(nextTask, ep, iEventSetupImpls);
451  }
452  }) | chain::then([&ep](std::exception_ptr const* iPtr, auto nextTask) {
453  ep.clearEventPrincipal();
454  if (iPtr) {
455  nextTask.doneWaiting(*iPtr);
456  }
457  }) | chain::runLast(std::move(iHolder));
458  }
ParameterSetID selector_config_id_
Definition: SubProcess.h:307
static const TGPicture * info(bool iBackgroundIsBlack)
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:286
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:271
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:759
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:274
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
PrincipalCache principalCache_
Definition: SubProcess.h:288
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 759 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().

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

◆ respondToCloseInputFile()

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

Definition at line 166 of file SubProcess.h.

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

166  {
168  schedule_->respondToCloseInputFile(fb);
169  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.respondToCloseInputFile(fb); });
170  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:271

◆ respondToOpenInputFile()

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

Definition at line 799 of file SubProcess.cc.

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

799  {
801  schedule_->respondToOpenInputFile(fb);
802  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.respondToOpenInputFile(fb); });
803  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:271

◆ selectProducts()

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

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

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

◆ shouldWeCloseOutput()

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

Definition at line 173 of file SubProcess.h.

References schedule_, serviceToken_, and subProcesses_.

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

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

References schedule_, serviceToken_, and subProcesses_.

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

◆ thinnedAssociationsHelper() [1/2]

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

Definition at line 263 of file SubProcess.h.

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

Referenced by SubProcess().

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

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

266  {
268  }
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:276
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 196 of file SubProcess.h.

References schedule_.

196 { 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 206 of file SubProcess.h.

References schedule_, and serviceToken_.

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

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

References schedule_, and serviceToken_.

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

◆ updateBranchIDListHelper()

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

Definition at line 792 of file SubProcess.cc.

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

Referenced by SubProcess().

792  {
793  branchIDListHelper_->updateFromParent(branchIDLists);
795  [this](auto& subProcess) { subProcess.updateBranchIDListHelper(branchIDListHelper_->branchIDLists()); });
796  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
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:274

◆ writeLumiAsync()

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

Definition at line 677 of file SubProcess.cc.

References actReg_, 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.

677  {
678  using namespace edm::waiting_task;
679 
680  auto l = inUseLumiPrincipals_[principal.index()];
681  chain::first([&](std::exception_ptr const*, auto nextTask) {
683  schedule_->writeLumiAsync(nextTask, *l, &processContext_, actReg_.get());
684  }) | chain::ifThen(not subProcesses_.empty(), [this, l](auto nextTask) {
685  ServiceRegistry::Operate operateWriteLumi(serviceToken_);
686  for (auto& s : subProcesses_) {
687  s.writeLumiAsync(nextTask, *l);
688  }
690  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:271
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:270
ProcessContext processContext_
Definition: SubProcess.h:280
def move(src, dest)
Definition: eostools.py:511

◆ writeProcessBlockAsync()

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

Definition at line 582 of file SubProcess.cc.

References actReg_, 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().

582  {
583  using namespace edm::waiting_task;
584  chain::first([&](std::exception_ptr const*, auto nextTask) {
586  schedule_->writeProcessBlockAsync(
587  nextTask, principalCache_.processBlockPrincipal(processBlockType), &processContext_, actReg_.get());
588  }) | chain::ifThen(not subProcesses_.empty(), [this, processBlockType](auto nextTask) {
590  for (auto& s : subProcesses_) {
591  s.writeProcessBlockAsync(nextTask, processBlockType);
592  }
594  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ProcessBlockPrincipal & processBlockPrincipal() const
ServiceToken serviceToken_
Definition: SubProcess.h:271
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:270
ProcessContext processContext_
Definition: SubProcess.h:280
PrincipalCache principalCache_
Definition: SubProcess.h:288
def move(src, dest)
Definition: eostools.py:511

◆ writeRunAsync()

void edm::SubProcess::writeRunAsync ( edm::WaitingTaskHolder  task,
ProcessHistoryID const &  parentPhID,
int  runNumber,
MergeableRunProductMetadata const *  mergeableRunProductMetadata 
)

Definition at line 596 of file SubProcess.cc.

References actReg_, cms::cuda::assert(), first, edm::waiting_task::chain::ifThen(), parentToChildPhID_, principalCache_, processContext_, edm::waiting_task::chain::runLast(), convertSQLiteXML::runNumber, edm::PrincipalCache::runPrincipal(), alignCSCRings::s, schedule_, serviceToken_, subProcesses_, and TrackValidation_cff::task.

599  {
601  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
602  assert(it != parentToChildPhID_.end());
603  auto const& childPhID = it->second;
604 
605  using namespace edm::waiting_task;
606  chain::first([&](std::exception_ptr const*, auto nextTask) {
608  schedule_->writeRunAsync(nextTask,
611  actReg_.get(),
612  mergeableRunProductMetadata);
613  }) |
614  chain::ifThen(not subProcesses_.empty(),
615  [this, childPhID, runNumber, mergeableRunProductMetadata](auto nextTask) {
616  ServiceRegistry::Operate operateWriteRun(serviceToken_);
617  for (auto& s : subProcesses_) {
618  s.writeRunAsync(nextTask, childPhID, runNumber, mergeableRunProductMetadata);
619  }
620  }) |
622  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:294
RunPrincipal & runPrincipal(ProcessHistoryID const &phid, RunNumber_t run) const
assert(be >=bs)
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:292
ServiceToken serviceToken_
Definition: SubProcess.h:271
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::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:293
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:270
ProcessContext processContext_
Definition: SubProcess.h:280
PrincipalCache principalCache_
Definition: SubProcess.h:288

Member Data Documentation

◆ act_table_

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

Definition at line 278 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 312 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 287 of file SubProcess.h.

Referenced by doBeginRunAsync(), and SubProcess().

◆ historyLumiOffset_

unsigned int edm::SubProcess::historyLumiOffset_
private

Definition at line 284 of file SubProcess.h.

Referenced by doBeginLuminosityBlockAsync(), and SubProcess().

◆ historyRunOffset_

unsigned int edm::SubProcess::historyRunOffset_
private

Definition at line 285 of file SubProcess.h.

Referenced by doBeginRunAsync(), and SubProcess().

◆ inUseLumiPrincipals_

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

◆ keptProducts_

SelectedProductsForBranchType edm::SubProcess::keptProducts_
private

Definition at line 301 of file SubProcess.h.

Referenced by keepThisBranch(), and keptProducts().

◆ parentPreg_

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

Definition at line 272 of file SubProcess.h.

Referenced by beginJob().

◆ parentToChildPhID_

std::map<ProcessHistoryID, ProcessHistoryID> edm::SubProcess::parentToChildPhID_
private

Definition at line 293 of file SubProcess.h.

Referenced by deleteRunFromCache(), doBeginRunAsync(), and writeRunAsync().

◆ pathsAndConsumesOfModules_

PathsAndConsumesOfModules edm::SubProcess::pathsAndConsumesOfModules_
private

Definition at line 281 of file SubProcess.h.

Referenced by beginJob(), and keepOnlyConsumedUnscheduledModules().

◆ preg_

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

◆ principalCache_

PrincipalCache edm::SubProcess::principalCache_
private

◆ processBlockHelper_

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

Definition at line 275 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

◆ processParameterSet_

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

Definition at line 295 of file SubProcess.h.

Referenced by SubProcess().

◆ productSelector_

ProductSelector edm::SubProcess::productSelector_
private

Definition at line 303 of file SubProcess.h.

Referenced by selectProducts().

◆ productSelectorRules_

ProductSelectorRules edm::SubProcess::productSelectorRules_
private

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

Referenced by processAsync(), and SubProcess().

◆ selectors_

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

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

Referenced by SubProcess().

◆ thinnedAssociationsHelper_

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

Definition at line 276 of file SubProcess.h.

Referenced by SubProcess(), and thinnedAssociationsHelper().

◆ wantAllEvents_

bool edm::SubProcess::wantAllEvents_
private

Definition at line 306 of file SubProcess.h.

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