CMS 3D CMS Logo

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

#include <SubProcess.h>

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

Public Types

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

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

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

Detailed Description

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

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

◆ ~SubProcess()

edm::SubProcess::~SubProcess ( )
override

Definition at line 232 of file SubProcess.cc.

232 {}

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

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

◆ branchIDListHelper() [1/2]

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

Definition at line 256 of file SubProcess.h.

References branchIDListHelper_, and edm::get_underlying_safe().

Referenced by SubProcess().

256  {
258  }
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:271

◆ branchIDListHelper() [2/2]

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

Definition at line 259 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:271

◆ clearCounters()

void edm::SubProcess::clearCounters ( )
inline

Clear all the counters in the trigger report.

Definition at line 231 of file SubProcess.h.

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

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

◆ clearLumiPrincipal()

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

Definition at line 676 of file SubProcess.cc.

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

676  {
677  //release from list but stay around till end of routine
678  auto lb = std::move(inUseLumiPrincipals_[principal.index()]);
679  for (auto& s : subProcesses_) {
680  s.clearLumiPrincipal(*lb);
681  }
682  lb->setRunPrincipal(std::shared_ptr<RunPrincipal>());
683  lb->clearPrincipal();
684  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:288
def move(src, dest)
Definition: eostools.py:511

◆ clearProcessBlockPrincipal()

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

Definition at line 617 of file SubProcess.cc.

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

617  {
618  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal(processBlockType);
619  processBlockPrincipal.clearPrincipal();
620  for (auto& s : subProcesses_) {
621  s.clearProcessBlockPrincipal(processBlockType);
622  }
623  }
void clearPrincipal()
Definition: Principal.cc:390
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
ProcessBlockPrincipal & processBlockPrincipal() const
PrincipalCache principalCache_
Definition: SubProcess.h:285

◆ clearRunPrincipal()

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

Definition at line 608 of file SubProcess.cc.

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

608  {
609  //release from list but stay around till end of routine
610  auto rp = std::move(inUseRunPrincipals_[parentPrincipal.index()]);
611  for (auto& s : subProcesses_) {
612  s.clearRunPrincipal(*rp);
613  }
614  rp->clearPrincipal();
615  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:287
def move(src, dest)
Definition: eostools.py:511

◆ closeOutputFiles()

void edm::SubProcess::closeOutputFiles ( )
inline

Definition at line 144 of file SubProcess.h.

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

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

◆ doBeginJob()

void edm::SubProcess::doBeginJob ( )

Definition at line 289 of file SubProcess.cc.

References beginJob().

289 { this->beginJob(); }

◆ doBeginLuminosityBlockAsync()

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

Definition at line 625 of file SubProcess.cc.

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

Referenced by edm::subProcessDoGlobalBeginTransitionAsync().

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

464  {
466 
467  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
468  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
469  processBlockPrincipal.fillProcessBlockPrincipal(parentPrincipal.processName(), parentPrincipal.reader());
470  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
471 
472  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
473  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionProcessBlockInput>;
474  beginGlobalTransitionAsync<Traits>(
475  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
476  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
ProcessBlockPrincipal & inputProcessBlockPrincipal() const
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
void fillProcessBlockPrincipal(std::string const &processName, DelayedReader *reader=nullptr)
ServiceToken serviceToken_
Definition: SubProcess.h:268
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:751
PrincipalCache principalCache_
Definition: SubProcess.h:285
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 479 of file SubProcess.cc.

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

480  {
482 
483  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal();
484  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
485  processBlockPrincipal.fillProcessBlockPrincipal(processConfiguration_->processName());
486  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
487 
488  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
489  using Traits = OccurrenceTraits<ProcessBlockPrincipal, BranchActionGlobalBegin>;
490  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
491  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
void fillProcessBlockPrincipal(std::string const &processName, DelayedReader *reader=nullptr)
ProcessBlockPrincipal & processBlockPrincipal() const
ServiceToken serviceToken_
Definition: SubProcess.h:268
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:751
PrincipalCache principalCache_
Definition: SubProcess.h:285
def move(src, dest)
Definition: eostools.py:511
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:276

◆ doBeginRunAsync()

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

Definition at line 541 of file SubProcess.cc.

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

Referenced by edm::subProcessDoGlobalBeginTransitionAsync().

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

◆ doBeginStream()

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

Definition at line 686 of file SubProcess.cc.

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

686  {
688  schedule_->beginStream(iID);
689  for_all(subProcesses_, [iID](auto& subProcess) { subProcess.doBeginStream(iID); });
690  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:268

◆ doEndJob()

void edm::SubProcess::doEndJob ( )

Definition at line 291 of file SubProcess.cc.

References endJob().

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

291 { endJob(); }

◆ doEndLuminosityBlockAsync()

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

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

649  {
650  LuminosityBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
651  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[parentPrincipal.index()];
652  propagateProducts(InLumi, parentPrincipal, lbp);
653 
654  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
655  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
656  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalEnd>;
657  endGlobalTransitionAsync<Traits>(
658  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
659  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
ServiceToken serviceToken_
Definition: SubProcess.h:268
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:288
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:289
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:751
def move(src, dest)
Definition: eostools.py:511

◆ doEndProcessBlockAsync()

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

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

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

◆ doEndRunAsync()

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

Definition at line 563 of file SubProcess.cc.

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

Referenced by edm::subProcessDoGlobalEndTransitionAsync().

565  {
566  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
567  RunPrincipal& rp = *inUseRunPrincipals_[parentPrincipal.index()];
568  propagateProducts(InRun, parentPrincipal, rp);
569 
570  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
571  RunTransitionInfo transitionInfo(rp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
572  using Traits = OccurrenceTraits<RunPrincipal, BranchActionGlobalEnd>;
573  endGlobalTransitionAsync<Traits>(
574  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
575  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:287
ServiceToken serviceToken_
Definition: SubProcess.h:268
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:289
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:751
def move(src, dest)
Definition: eostools.py:511

◆ doEndStream()

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

Definition at line 692 of file SubProcess.cc.

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

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

◆ doEventAsync()

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

Definition at line 401 of file SubProcess.cc.

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

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

◆ doStreamBeginLuminosityBlockAsync()

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

Definition at line 727 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamBeginTransitionAsync().

729  {
730  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamBegin>;
731 
732  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[iTransitionInfo.principal().index()];
733  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
734  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
735  beginStreamTransitionAsync<Traits>(
736  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_);
737  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
ServiceToken serviceToken_
Definition: SubProcess.h:268
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:288
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:289
def move(src, dest)
Definition: eostools.py:511

◆ doStreamBeginRunAsync()

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

Definition at line 698 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamBeginTransitionAsync().

700  {
701  using Traits = OccurrenceTraits<RunPrincipal, BranchActionStreamBegin>;
702 
703  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
704  RunPrincipal& rp = *inUseRunPrincipals_[parentPrincipal.index()];
705 
706  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
707  RunTransitionInfo transitionInfo(rp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
708  beginStreamTransitionAsync<Traits>(
709  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_);
710  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:287
ServiceToken serviceToken_
Definition: SubProcess.h:268
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:289
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 739 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamEndTransitionAsync().

742  {
743  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[iTransitionInfo.principal().index()];
744  using Traits = OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamEnd>;
745  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
746  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
747  endStreamTransitionAsync<Traits>(
748  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
749  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
ServiceToken serviceToken_
Definition: SubProcess.h:268
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:288
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:289
def move(src, dest)
Definition: eostools.py:511

◆ doStreamEndRunAsync()

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

Definition at line 712 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamEndTransitionAsync().

715  {
716  using Traits = OccurrenceTraits<RunPrincipal, BranchActionStreamEnd>;
717 
718  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
719  RunPrincipal& rp = *inUseRunPrincipals_[parentPrincipal.index()];
720 
721  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
722  RunTransitionInfo transitionInfo(rp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
723  endStreamTransitionAsync<Traits>(
724  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
725  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:287
ServiceToken serviceToken_
Definition: SubProcess.h:268
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:289
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 252 of file SubProcess.h.

References droppedBranchIDToKeptBranchID_.

Referenced by beginJob(), and fixBranchIDListsForEDAliases().

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

◆ endJob()

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

Definition at line 309 of file SubProcess.cc.

References c, schedule_, serviceToken_, and subProcesses_.

Referenced by doEndJob().

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

◆ fixBranchIDListsForEDAliases()

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

Definition at line 383 of file SubProcess.cc.

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

Referenced by beginJob().

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

References cuy::rep, schedule_, and serviceToken_.

210  {
212  schedule_->getTriggerReport(rep);
213  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
ServiceToken serviceToken_
Definition: SubProcess.h:268
rep
Definition: cuy.py:1189

◆ keepOnlyConsumedUnscheduledModules()

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

Definition at line 234 of file SubProcess.cc.

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

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

◆ keepThisBranch()

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

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

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

◆ 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:298

◆ openOutputFiles()

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

Definition at line 151 of file SubProcess.h.

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

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

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

766  {
767  SelectedProducts const& keptVector = keptProducts()[InProcess];
768  for (auto const& item : keptVector) {
769  BranchDescription const& desc = *item.first;
770  assert(desc.branchType() == InProcess);
771  ProductResolverBase const* parentProductResolver = parentPrincipal.getProductResolver(desc.branchID());
772  if (parentProductResolver != nullptr) {
773  ProductResolverBase* productResolver = principal.getModifiableProductResolver(desc.branchID());
774  if (productResolver != nullptr) {
775  if (parentProductResolver->branchDescription().produced()) {
776  return true;
777  }
778  }
779  }
780  }
781  return false;
782  }
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 417 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().

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

751  {
752  SelectedProducts const& keptVector = keptProducts()[type];
753  for (auto const& item : keptVector) {
754  BranchDescription const& desc = *item.first;
755  ProductResolverBase const* parentProductResolver = parentPrincipal.getProductResolver(desc.branchID());
756  if (parentProductResolver != nullptr) {
757  ProductResolverBase* productResolver = principal.getModifiableProductResolver(desc.branchID());
758  if (productResolver != nullptr) {
759  //Propagate the per event(run)(lumi)(processBlock) data for this product to the subprocess.
760  productResolver->connectTo(*parentProductResolver, &parentPrincipal);
761  }
762  }
763  }
764  }
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 163 of file SubProcess.h.

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

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

◆ respondToOpenInputFile()

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

Definition at line 791 of file SubProcess.cc.

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

791  {
793  schedule_->respondToOpenInputFile(fb);
794  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.respondToOpenInputFile(fb); });
795  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:268

◆ selectProducts()

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

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

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

◆ shouldWeCloseOutput()

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

Definition at line 170 of file SubProcess.h.

References schedule_, serviceToken_, and subProcesses_.

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

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

References schedule_, serviceToken_, and subProcesses_.

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

◆ thinnedAssociationsHelper() [1/2]

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

Definition at line 260 of file SubProcess.h.

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

Referenced by SubProcess().

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

References edm::get_underlying_safe(), and thinnedAssociationsHelper_.

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

References schedule_.

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

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

References schedule_, and serviceToken_.

203  {
205  return schedule_->totalEventsFailed();
206  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
ServiceToken serviceToken_
Definition: SubProcess.h:268

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

References schedule_, and serviceToken_.

196  {
198  return schedule_->totalEventsPassed();
199  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
ServiceToken serviceToken_
Definition: SubProcess.h:268

◆ updateBranchIDListHelper()

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

Definition at line 784 of file SubProcess.cc.

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

Referenced by SubProcess().

784  {
785  branchIDListHelper_->updateFromParent(branchIDLists);
787  [this](auto& subProcess) { subProcess.updateBranchIDListHelper(branchIDListHelper_->branchIDLists()); });
788  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
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:271

◆ writeLumiAsync()

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

Definition at line 661 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.

661  {
662  using namespace edm::waiting_task;
663 
664  auto l = inUseLumiPrincipals_[principal.index()];
665  chain::first([&](std::exception_ptr const*, auto nextTask) {
667  schedule_->writeLumiAsync(nextTask, *l, &processContext_, actReg_.get());
668  }) | chain::ifThen(not subProcesses_.empty(), [this, l](auto nextTask) {
669  ServiceRegistry::Operate operateWriteLumi(serviceToken_);
670  for (auto& s : subProcesses_) {
671  s.writeLumiAsync(nextTask, *l);
672  }
674  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
ServiceToken serviceToken_
Definition: SubProcess.h:268
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:288
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:267
ProcessContext processContext_
Definition: SubProcess.h:277
def move(src, dest)
Definition: eostools.py:511

◆ writeProcessBlockAsync()

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

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

577  {
578  using namespace edm::waiting_task;
579  chain::first([&](std::exception_ptr const*, auto nextTask) {
581  schedule_->writeProcessBlockAsync(
582  nextTask, principalCache_.processBlockPrincipal(processBlockType), &processContext_, actReg_.get());
583  }) | chain::ifThen(not subProcesses_.empty(), [this, processBlockType](auto nextTask) {
585  for (auto& s : subProcesses_) {
586  s.writeProcessBlockAsync(nextTask, processBlockType);
587  }
589  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
ProcessBlockPrincipal & processBlockPrincipal() const
ServiceToken serviceToken_
Definition: SubProcess.h:268
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:267
ProcessContext processContext_
Definition: SubProcess.h:277
PrincipalCache principalCache_
Definition: SubProcess.h:285
def move(src, dest)
Definition: eostools.py:511

◆ writeRunAsync()

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

Definition at line 591 of file SubProcess.cc.

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

593  {
594  using namespace edm::waiting_task;
595 
596  auto rp = inUseRunPrincipals_[principal.index()];
597  chain::first([&](std::exception_ptr const*, auto nextTask) {
599  schedule_->writeRunAsync(nextTask, *rp, &processContext_, actReg_.get(), mergeableRunProductMetadata);
600  }) | chain::ifThen(not subProcesses_.empty(), [this, rp, mergeableRunProductMetadata](auto nextTask) {
601  ServiceRegistry::Operate operateWriteRun(serviceToken_);
602  for (auto& s : subProcesses_) {
603  s.writeRunAsync(nextTask, *rp, mergeableRunProductMetadata);
604  }
606  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:291
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:290
std::vector< std::shared_ptr< RunPrincipal > > inUseRunPrincipals_
Definition: SubProcess.h:287
ServiceToken serviceToken_
Definition: SubProcess.h:268
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:267
ProcessContext processContext_
Definition: SubProcess.h:277
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ act_table_

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

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

Referenced by SubProcess().

◆ historyLumiOffset_

unsigned int edm::SubProcess::historyLumiOffset_
private

Definition at line 281 of file SubProcess.h.

Referenced by doBeginLuminosityBlockAsync(), and SubProcess().

◆ historyRunOffset_

unsigned int edm::SubProcess::historyRunOffset_
private

Definition at line 282 of file SubProcess.h.

Referenced by doBeginRunAsync(), and SubProcess().

◆ inUseLumiPrincipals_

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

◆ inUseRunPrincipals_

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

◆ keptProducts_

SelectedProductsForBranchType edm::SubProcess::keptProducts_
private

Definition at line 298 of file SubProcess.h.

Referenced by keepThisBranch(), and keptProducts().

◆ parentPreg_

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

Definition at line 269 of file SubProcess.h.

Referenced by beginJob().

◆ pathsAndConsumesOfModules_

PathsAndConsumesOfModules edm::SubProcess::pathsAndConsumesOfModules_
private

Definition at line 278 of file SubProcess.h.

Referenced by beginJob(), and keepOnlyConsumedUnscheduledModules().

◆ preg_

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

Definition at line 270 of file SubProcess.h.

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

◆ principalCache_

PrincipalCache edm::SubProcess::principalCache_
private

◆ processBlockHelper_

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

Definition at line 272 of file SubProcess.h.

Referenced by beginJob(), and SubProcess().

◆ processConfiguration_

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

◆ processContext_

ProcessContext edm::SubProcess::processContext_
private

◆ processHistoryRegistries_

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

Definition at line 283 of file SubProcess.h.

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

◆ processParameterSet_

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

Definition at line 292 of file SubProcess.h.

Referenced by SubProcess().

◆ productSelector_

ProductSelector edm::SubProcess::productSelector_
private

Definition at line 300 of file SubProcess.h.

Referenced by selectProducts().

◆ productSelectorRules_

ProductSelectorRules edm::SubProcess::productSelectorRules_
private

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

Referenced by processAsync(), and SubProcess().

◆ selectors_

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

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

Referenced by SubProcess().

◆ thinnedAssociationsHelper_

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

Definition at line 273 of file SubProcess.h.

Referenced by SubProcess(), and thinnedAssociationsHelper().

◆ wantAllEvents_

bool edm::SubProcess::wantAllEvents_
private

Definition at line 303 of file SubProcess.h.

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