CMS 3D CMS Logo

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

#include <SubProcess.h>

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

Public Member Functions

void clearCounters ()
 Clear all the counters in the trigger report. More...
 
void closeOutputFiles ()
 
void deleteLumiFromCache (LuminosityBlockPrincipal &)
 
void deleteRunFromCache (ProcessHistoryID const &parentPhID, int runNumber)
 
void doBeginJob ()
 
void doBeginLuminosityBlockAsync (WaitingTaskHolder iHolder, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
 
void doBeginRunAsync (WaitingTaskHolder iHolder, RunPrincipal const &principal, IOVSyncValue const &ts, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
 
void doBeginStream (unsigned int)
 
void doEndJob ()
 
void doEndLuminosityBlockAsync (WaitingTaskHolder iHolder, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, std::vector< std::shared_ptr< const EventSetupImpl >> const *, bool cleaningUpAfterException)
 
void doEndRunAsync (WaitingTaskHolder iHolder, RunPrincipal const &principal, IOVSyncValue const &ts, std::vector< std::shared_ptr< const EventSetupImpl >> const *, 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, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
 
void doStreamBeginRunAsync (WaitingTaskHolder iHolder, unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
 
void doStreamEndLuminosityBlockAsync (WaitingTaskHolder iHolder, unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, std::vector< std::shared_ptr< const EventSetupImpl >> const *, bool cleaningUpAfterException)
 
void doStreamEndRunAsync (WaitingTaskHolder iHolder, unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts, std::vector< std::shared_ptr< const EventSetupImpl >> const *, bool cleaningUpAfterException)
 
void enableEndPaths (bool active)
 
bool endPathsEnabled () const
 Return true if end_paths are active, and false if they are inactive. More...
 
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
 
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, 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 writeRunAsync (WaitingTaskHolder, ProcessHistoryID const &parentPhID, int runNumber, MergeableRunProductMetadata const *)
 
 ~SubProcess () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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::vector< ModuleDescription const * > &modules, 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
 
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 ()
 
void beginLuminosityBlock (LuminosityBlockPrincipal const &lb, IOVSyncValue const &ts)
 
void beginRun (RunPrincipal const &r, IOVSyncValue const &ts)
 
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 endLuminosityBlock (LuminosityBlockPrincipal const &lb, IOVSyncValue const &ts, bool cleaningUpAfterException)
 
void endRun (RunPrincipal const &r, IOVSyncValue const &ts, bool cleaningUpAfterException)
 
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)
 
void processAsync (WaitingTaskHolder iHolder, EventPrincipal const &e, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
 
void propagateProducts (BranchType type, Principal const &parentPrincipal, Principal &principal) const
 
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper () const
 
std::shared_ptr< ThinnedAssociationsHelperthinnedAssociationsHelper ()
 

Private Attributes

std::unique_ptr< ExceptionToActionTable const > act_table_
 
std::shared_ptr< ActivityRegistryactReg_
 
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
 
std::map< BranchID::value_type, BranchID::value_typedroppedBranchIDToKeptBranchID_
 
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
 
std::vector< HistoryAppenderhistoryAppenders_
 
unsigned int historyLumiOffset_
 
unsigned int historyRunOffset_
 
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
 
SelectedProductsForBranchType keptProducts_
 
std::shared_ptr< ProductRegistry const > parentPreg_
 
std::map< ProcessHistoryID, ProcessHistoryIDparentToChildPhID_
 
PathsAndConsumesOfModules pathsAndConsumesOfModules_
 
std::shared_ptr< ProductRegistry const > preg_
 
PrincipalCache principalCache_
 
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

- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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<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)
 

Detailed Description

Definition at line 46 of file SubProcess.h.

Constructor & Destructor Documentation

edm::SubProcess::SubProcess ( ParameterSet parameterSet,
ParameterSet const &  topLevelParameterSet,
std::shared_ptr< ProductRegistry const >  parentProductRegistry,
std::shared_ptr< BranchIDListHelper const >  parentBranchIDListHelper,
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 46 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(), inUseLumiPrincipals_, mps_monitormerge::items, edm::eventsetup::EventSetupsController::makeProvider(), Data_TkAlMinBias_Run2018C_PromptReco_v3_cff::maxEvents, eostools::move(), edm::PreallocationConfiguration::numberOfLuminosityBlocks(), edm::PreallocationConfiguration::numberOfStreams(), edm::ParameterSet::popParameterSet(), edm::popSubProcessVParameterSet(), preg_, principalCache_, processConfiguration_, processContext_, processHistoryRegistries_, processParameterSet_, edm::ParameterSet::registerIt(), edm::detail::registerProperSelectionInfo(), schedule_, selector_config_id_, selectors_, selectProducts(), serviceToken_, edm::PrincipalCache::setNumberOfConcurrentPrincipals(), edm::ProcessContext::setParentProcessContext(), edm::ProcessContext::setProcessConfiguration(), edm::PrincipalCache::setProcessHistoryRegistry(), AlCaHLTBitMon_QueryRunRegistry::string, subProcesses_, subProcessParentageHelper_, thinnedAssociationsHelper(), thinnedAssociationsHelper_, updateBranchIDListHelper(), edm::validateTopLevelParameterSets(), and wantAllEvents_.

58  : EDConsumerBase(),
59  serviceToken_(),
60  parentPreg_(parentProductRegistry),
61  preg_(),
63  act_table_(),
65  historyLumiOffset_(preallocConfig.numberOfStreams()),
66  historyRunOffset_(historyLumiOffset_ + preallocConfig.numberOfLuminosityBlocks()),
67  processHistoryRegistries_(historyRunOffset_ + preallocConfig.numberOfRuns()),
68  historyAppenders_(historyRunOffset_ + preallocConfig.numberOfRuns()),
70  esp_(),
71  schedule_(),
73  subProcesses_(),
75  productSelectorRules_(parameterSet, "outputCommands", "OutputModule"),
77  wantAllEvents_(true) {
78  //Setup the event selection
80 
81  ParameterSet selectevents = parameterSet.getUntrackedParameterSet("SelectEvents", ParameterSet());
82 
83  selectevents.registerIt(); // Just in case this PSet is not registered
85  selectevents, tns->getProcessName(), getAllTriggerNames(), selectors_, consumesCollector());
86  std::map<std::string, std::vector<std::pair<std::string, int>>> outputModulePathPositions;
88  selectevents, "", outputModulePathPositions, parentProductRegistry->anyProductProduced());
89 
90  std::map<BranchID, bool> keepAssociation;
91  selectProducts(*parentProductRegistry, parentThinnedAssociationsHelper, keepAssociation);
92 
93  std::string const maxEvents("maxEvents");
94  std::string const maxLumis("maxLuminosityBlocks");
95 
96  // propagate_const<T> has no reset() function
98  std::unique_ptr<ParameterSet>(parameterSet.popParameterSet(std::string("process")).release());
99 
100  // if this process has a maxEvents or maxLuminosityBlocks parameter set, remove them.
101  if (processParameterSet_->exists(maxEvents)) {
102  processParameterSet_->popParameterSet(maxEvents);
103  }
104  if (processParameterSet_->exists(maxLumis)) {
105  processParameterSet_->popParameterSet(maxLumis);
106  }
107 
108  // if the top level process has a maxEvents or maxLuminosityBlocks parameter set, add them to this process.
109  if (topLevelParameterSet.exists(maxEvents)) {
110  processParameterSet_->addUntrackedParameter<ParameterSet>(
111  maxEvents, topLevelParameterSet.getUntrackedParameterSet(maxEvents));
112  }
113  if (topLevelParameterSet.exists(maxLumis)) {
114  processParameterSet_->addUntrackedParameter<ParameterSet>(
115  maxLumis, topLevelParameterSet.getUntrackedParameterSet(maxLumis));
116  }
117 
118  // If there are subprocesses, pop the subprocess parameter sets out of the process parameter set
119  auto subProcessVParameterSet = popSubProcessVParameterSet(*processParameterSet_);
120  bool hasSubProcesses = subProcessVParameterSet.size() != 0ull;
121 
122  // Validates the parameters in the 'options', 'maxEvents', and 'maxLuminosityBlocks'
123  // top level parameter sets. Default values are also set in here if the
124  // parameters were not explicitly set.
126 
127  ScheduleItems items(*parentProductRegistry, *this);
128  actReg_ = items.actReg_;
129 
130  //initialize the services
131  ServiceToken iToken;
132 
133  // get any configured services.
134  auto serviceSets = processParameterSet_->popVParameterSet(std::string("services"));
135 
136  ServiceToken newToken = items.initServices(serviceSets, *processParameterSet_, token, iLegacy, false);
137  parentActReg.connectToSubProcess(*items.actReg_);
138  serviceToken_ = items.addCPRandTNS(*processParameterSet_, newToken);
139 
140  //make the services available
142 
143  // intialize miscellaneous items
144  items.initMisc(*processParameterSet_);
145 
146  // intialize the event setup provider
147  esp_ = esController.makeProvider(*processParameterSet_, actReg_.get());
148 
149  branchIDListHelper_ = items.branchIDListHelper();
150  updateBranchIDListHelper(parentBranchIDListHelper->branchIDLists());
151 
152  thinnedAssociationsHelper_ = items.thinnedAssociationsHelper();
153  thinnedAssociationsHelper_->updateFromParentProcess(
154  parentThinnedAssociationsHelper, keepAssociation, droppedBranchIDToKeptBranchID_);
155 
156  // intialize the Schedule
157  schedule_ = items.initSchedule(*processParameterSet_, hasSubProcesses, preallocConfig, &processContext_);
158 
159  // set the items
160  act_table_ = std::move(items.act_table_);
161  preg_ = items.preg();
162 
163  subProcessParentageHelper_ = items.subProcessParentageHelper();
164  subProcessParentageHelper_->update(parentSubProcessParentageHelper, *parentProductRegistry);
165 
166  //CMS-THREADING this only works since Run/Lumis are synchronous so when principalCache asks for
167  // the reducedProcessHistoryID from a full ProcessHistoryID that registry will not be in use by
168  // another thread. We really need to change how this is done in the PrincipalCache.
170 
171  processConfiguration_ = items.processConfiguration();
173  processContext_.setParentProcessContext(parentProcessContext);
174 
176  for (unsigned int index = 0; index < preallocConfig.numberOfStreams(); ++index) {
177  auto ep = std::make_shared<EventPrincipal>(preg_,
182  index,
183  false /*not primary process*/);
185  }
186  for (unsigned int index = 0; index < preallocConfig.numberOfLuminosityBlocks(); ++index) {
187  auto lbpp = std::make_unique<LuminosityBlockPrincipal>(
190  }
191 
192  inUseLumiPrincipals_.resize(preallocConfig.numberOfLuminosityBlocks());
193 
194  subProcesses_.reserve(subProcessVParameterSet.size());
195  for (auto& subProcessPSet : subProcessVParameterSet) {
196  subProcesses_.emplace_back(subProcessPSet,
197  topLevelParameterSet,
198  preg_,
200  *thinnedAssociationsHelper_,
202  esController,
203  *items.actReg_,
204  newToken,
205  iLegacy,
206  preallocConfig,
207  &processContext_);
208  }
209  }
unsigned int historyRunOffset_
Definition: SubProcess.h:300
unsigned int historyLumiOffset_
Definition: SubProcess.h:299
ParameterSetID selector_config_id_
Definition: SubProcess.h:322
void insert(std::shared_ptr< RunPrincipal > rp)
void setNumberOfConcurrentPrincipals(PreallocationConfiguration const &)
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: SubProcess.h:275
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:301
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:291
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
void updateBranchIDListHelper(BranchIDLists const &)
Definition: SubProcess.cc:679
void setParentProcessContext(ProcessContext const *parentProcessContext)
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
void validateTopLevelParameterSets(ParameterSet *processParameterSet)
ServiceToken serviceToken_
Definition: SubProcess.h:287
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:305
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > &keepAssociation)
Definition: SubProcess.cc:250
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:317
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:306
edm::propagate_const< std::unique_ptr< ParameterSet > > processParameterSet_
Definition: SubProcess.h:310
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector, ConsumesCollector &&iC)
void setProcessConfiguration(ProcessConfiguration const *processConfiguration)
std::unique_ptr< ExceptionToActionTable const > act_table_
Definition: SubProcess.h:293
std::vector< ParameterSet > popSubProcessVParameterSet(ParameterSet &parameterSet)
Definition: SubProcess.cc:693
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:327
ProductSelector productSelector_
Definition: SubProcess.h:318
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:323
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:308
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:286
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:290
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:302
std::vector< std::string > const & getAllTriggerNames()
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:288
ProcessContext processContext_
Definition: SubProcess.h:295
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< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Definition: SubProcess.h:279
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:289
PrincipalCache principalCache_
Definition: SubProcess.h:303
def move(src, dest)
Definition: eostools.py:511
edm::propagate_const< std::shared_ptr< SubProcessParentageHelper > > subProcessParentageHelper_
Definition: SubProcess.h:292
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:294
edm::SubProcess::~SubProcess ( )
override

Definition at line 211 of file SubProcess.cc.

211 {}
edm::SubProcess::SubProcess ( SubProcess const &  )
delete
edm::SubProcess::SubProcess ( SubProcess &&  )
default

Member Function Documentation

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

Definition at line 217 of file SubProcess.cc.

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

Referenced by doBeginJob().

217  {
218  // If event selection is being used, the SubProcess class reads TriggerResults
219  // object(s) in the parent process from the event. This next call is needed for
220  // getByToken to work properly. Normally, this is done by the worker, but since
221  // a SubProcess is not a module, it has no worker.
222  updateLookup(InEvent, *parentPreg_->productLookup(InEvent), false);
223 
224  if (!droppedBranchIDToKeptBranchID().empty()) {
226  }
228  schedule_->convertCurrentProcessAlias(processConfiguration_->processName());
230  //NOTE: this may throw
232  actReg_->preBeginJobSignal_(pathsAndConsumesOfModules_, processContext_);
233  schedule_->beginJob(*preg_, esp_->recordsToProxyIndices());
234  for_all(subProcesses_, [](auto& subProcess) { subProcess.doBeginJob(); });
235  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:296
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:271
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
void initialize(Schedule const *, std::shared_ptr< ProductRegistry const >)
ServiceToken serviceToken_
Definition: SubProcess.h:287
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:306
void checkForModuleDependencyCorrectness(edm::PathsAndConsumesOfModulesBase const &iPnC, bool iPrintDependencies)
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:286
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:288
void fixBranchIDListsForEDAliases(std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: SubProcess.cc:311
ProcessContext processContext_
Definition: SubProcess.h:295
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:289
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:294
void edm::SubProcess::beginLuminosityBlock ( LuminosityBlockPrincipal const &  lb,
IOVSyncValue const &  ts 
)
private
void edm::SubProcess::beginRun ( RunPrincipal const &  r,
IOVSyncValue const &  ts 
)
private
std::shared_ptr<BranchIDListHelper const> edm::SubProcess::branchIDListHelper ( ) const
inlineprivate

Definition at line 275 of file SubProcess.h.

References edm::get_underlying_safe().

Referenced by SubProcess().

275  {
277  }
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:290
std::shared_ptr<BranchIDListHelper>& edm::SubProcess::branchIDListHelper ( )
inlineprivate

Definition at line 278 of file SubProcess.h.

References edm::get_underlying_safe().

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:290
void edm::SubProcess::clearCounters ( )
inline

Clear all the counters in the trigger report.

Definition at line 247 of file SubProcess.h.

References bk::beginJob(), MillePedeFileConverter_cfg::e, Ecal2004TBTDCRanges_v1_cff::endRun, edm::for_all(), and alignCSCRings::r.

247  {
249  schedule_->clearCounters();
250  for_all(subProcesses_, [](auto& subProcess) { subProcess.clearCounters(); });
251  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:287
void edm::SubProcess::closeOutputFiles ( )
inline

Definition at line 146 of file SubProcess.h.

References edm::for_all().

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

Definition at line 559 of file SubProcess.cc.

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

559  {
560  //release from list but stay around till end of routine
561  auto lb = std::move(inUseLumiPrincipals_[principal.index()]);
562  for (auto& s : subProcesses_) {
563  s.deleteLumiFromCache(*lb);
564  }
565  lb->clearPrincipal();
566  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:305
def move(src, dest)
Definition: eostools.py:511
void edm::SubProcess::deleteRunFromCache ( ProcessHistoryID const &  parentPhID,
int  runNumber 
)

Definition at line 484 of file SubProcess.cc.

References edm::PrincipalCache::deleteRun(), edm::for_all(), parentToChildPhID_, principalCache_, and subProcesses_.

484  {
485  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
486  assert(it != parentToChildPhID_.end());
487  auto const& childPhID = it->second;
488  principalCache_.deleteRun(childPhID, runNumber);
490  [&childPhID, runNumber](auto& subProcess) { subProcess.deleteRunFromCache(childPhID, runNumber); });
491  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:308
void deleteRun(ProcessHistoryID const &phid, RunNumber_t run)
PrincipalCache principalCache_
Definition: SubProcess.h:303
void edm::SubProcess::doBeginJob ( )

Definition at line 213 of file SubProcess.cc.

References beginJob().

213 { this->beginJob(); }
void edm::SubProcess::doBeginLuminosityBlockAsync ( WaitingTaskHolder  iHolder,
LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls 
)

Definition at line 493 of file SubProcess.cc.

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

Referenced by edm::subProcessDoGlobalBeginTransitionAsync().

497  {
499 
500  auto aux = principal.aux();
501  aux.setProcessHistoryID(principal.processHistoryID());
503  lbpp->setAux(aux);
504  auto& processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_ + lbpp->index()];
505  inUseLumiPrincipals_[principal.index()] = lbpp;
506  processHistoryRegistry.registerProcessHistory(principal.processHistory());
507  lbpp->fillLuminosityBlockPrincipal(processHistoryRegistry, principal.reader());
508  lbpp->setRunPrincipal(principalCache_.runPrincipalPtr());
509  LuminosityBlockPrincipal& lbp = *lbpp;
510  propagateProducts(InLumi, principal, lbp);
511  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalBegin> Traits;
512  beginGlobalTransitionAsync<Traits>(std::move(iHolder),
513  *schedule_,
514  lbp,
515  ts,
516  *((*iEventSetupImpls)[esp_->subProcessIndex()]),
517  iEventSetupImpls,
519  subProcesses_);
520  }
unsigned int historyLumiOffset_
Definition: SubProcess.h:299
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:301
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:305
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:306
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:663
std::shared_ptr< LuminosityBlockPrincipal > getAvailableLumiPrincipalPtr()
PrincipalCache principalCache_
Definition: SubProcess.h:303
def move(src, dest)
Definition: eostools.py:511
void edm::SubProcess::doBeginRunAsync ( WaitingTaskHolder  iHolder,
RunPrincipal const &  principal,
IOVSyncValue const &  ts,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls 
)

Definition at line 406 of file SubProcess.cc.

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

Referenced by edm::subProcessDoGlobalBeginTransitionAsync().

409  {
411 
412  auto aux = std::make_shared<RunAuxiliary>(principal.aux());
413  aux->setProcessHistoryID(principal.processHistoryID());
414  auto rpp = std::make_shared<RunPrincipal>(aux,
415  preg_,
417  &(historyAppenders_[historyRunOffset_ + principal.index()]),
418  principal.index(),
419  false);
420  auto& processHistoryRegistry = processHistoryRegistries_[historyRunOffset_ + principal.index()];
421  processHistoryRegistry.registerProcessHistory(principal.processHistory());
422  rpp->fillRunPrincipal(processHistoryRegistry, principal.reader());
423  principalCache_.insert(rpp);
424 
425  ProcessHistoryID const& parentInputReducedPHID = principal.reducedProcessHistoryID();
426  ProcessHistoryID const& inputReducedPHID = rpp->reducedProcessHistoryID();
427 
428  parentToChildPhID_.insert(std::make_pair(parentInputReducedPHID, inputReducedPHID));
429 
430  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
431  propagateProducts(InRun, principal, rp);
432  typedef OccurrenceTraits<RunPrincipal, BranchActionGlobalBegin> Traits;
433  beginGlobalTransitionAsync<Traits>(
434  std::move(iHolder), *schedule_, rp, ts, esp_->eventSetupImpl(), iEventSetupImpls, serviceToken_, subProcesses_);
435  }
unsigned int historyRunOffset_
Definition: SubProcess.h:300
void insert(std::shared_ptr< RunPrincipal > rp)
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:301
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:306
Hash< ProcessHistoryType > ProcessHistoryID
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:308
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:302
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:663
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:289
PrincipalCache principalCache_
Definition: SubProcess.h:303
def move(src, dest)
Definition: eostools.py:511
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:294
void edm::SubProcess::doBeginStream ( unsigned int  iID)

Definition at line 568 of file SubProcess.cc.

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

568  {
570  schedule_->beginStream(iID);
571  for_all(subProcesses_, [iID](auto& subProcess) { subProcess.doBeginStream(iID); });
572  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:287
void edm::SubProcess::doEndJob ( )

Definition at line 215 of file SubProcess.cc.

References endJob().

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

215 { endJob(); }
void edm::SubProcess::doEndLuminosityBlockAsync ( WaitingTaskHolder  iHolder,
LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls,
bool  cleaningUpAfterException 
)

Definition at line 522 of file SubProcess.cc.

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

Referenced by edm::subProcessDoGlobalEndTransitionAsync().

526  {
527  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[principal.index()];
528  propagateProducts(InLumi, principal, lbp);
529  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalEnd> Traits;
530  endGlobalTransitionAsync<Traits>(std::move(iHolder),
531  *schedule_,
532  lbp,
533  ts,
534  *((*iEventSetupImpls)[esp_->subProcessIndex()]),
535  iEventSetupImpls,
538  cleaningUpAfterException);
539  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:305
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:306
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:663
def move(src, dest)
Definition: eostools.py:511
void edm::SubProcess::doEndRunAsync ( WaitingTaskHolder  iHolder,
RunPrincipal const &  principal,
IOVSyncValue const &  ts,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls,
bool  cleaningUpAfterException 
)

Definition at line 437 of file SubProcess.cc.

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

Referenced by edm::subProcessDoGlobalEndTransitionAsync().

441  {
442  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
443  propagateProducts(InRun, principal, rp);
444  typedef OccurrenceTraits<RunPrincipal, BranchActionGlobalEnd> Traits;
445  endGlobalTransitionAsync<Traits>(std::move(iHolder),
446  *schedule_,
447  rp,
448  ts,
449  esp_->eventSetupImpl(),
450  iEventSetupImpls,
453  cleaningUpAfterException);
454  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:306
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:663
PrincipalCache principalCache_
Definition: SubProcess.h:303
def move(src, dest)
Definition: eostools.py:511
void edm::SubProcess::doEndStream ( unsigned int  iID)

Definition at line 574 of file SubProcess.cc.

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

574  {
576  schedule_->endStream(iID);
577  for_all(subProcesses_, [iID](auto& subProcess) { subProcess.doEndStream(iID); });
578  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:287
void edm::SubProcess::doEventAsync ( WaitingTaskHolder  iHolder,
EventPrincipal const &  principal,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls 
)

Definition at line 329 of file SubProcess.cc.

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

331  {
333  /* BEGIN relevant bits from OutputModule::doEvent */
334  if (!wantAllEvents_) {
335  EventForOutput e(ep, ModuleDescription(), nullptr);
336  e.setConsumer(this);
337  if (!selectors_.wantEvent(e)) {
338  return;
339  }
340  }
341  processAsync(std::move(iHolder), ep, iEventSetupImpls);
342  /* END relevant bits from OutputModule::doEvent */
343  }
void processAsync(WaitingTaskHolder iHolder, EventPrincipal const &e, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
Definition: SubProcess.cc:345
ServiceToken serviceToken_
Definition: SubProcess.h:287
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:323
def move(src, dest)
Definition: eostools.py:511
void edm::SubProcess::doStreamBeginLuminosityBlockAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls 
)

Definition at line 621 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamBeginTransitionAsync().

626  {
627  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamBegin> Traits;
628 
629  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[principal.index()];
630 
631  beginStreamTransitionAsync<Traits>(std::move(iHolder),
632  *schedule_,
633  id,
634  lbp,
635  ts,
636  *((*iEventSetupImpls)[esp_->subProcessIndex()]),
637  iEventSetupImpls,
639  subProcesses_);
640  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:305
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:306
def move(src, dest)
Definition: eostools.py:511
void edm::SubProcess::doStreamBeginRunAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
RunPrincipal const &  principal,
IOVSyncValue const &  ts,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls 
)

Definition at line 580 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamBeginTransitionAsync().

584  {
585  typedef OccurrenceTraits<RunPrincipal, BranchActionStreamBegin> Traits;
586 
587  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
588 
589  beginStreamTransitionAsync<Traits>(std::move(iHolder),
590  *schedule_,
591  id,
592  rp,
593  ts,
594  esp_->eventSetupImpl(),
595  iEventSetupImpls,
597  subProcesses_);
598  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:306
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
PrincipalCache principalCache_
Definition: SubProcess.h:303
def move(src, dest)
Definition: eostools.py:511
void edm::SubProcess::doStreamEndLuminosityBlockAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls,
bool  cleaningUpAfterException 
)

Definition at line 642 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamEndTransitionAsync().

648  {
649  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[principal.index()];
650  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamEnd> Traits;
651  endStreamTransitionAsync<Traits>(std::move(iHolder),
652  *schedule_,
653  id,
654  lbp,
655  ts,
656  *((*iEventSetupImpls)[esp_->subProcessIndex()]),
657  iEventSetupImpls,
660  cleaningUpAfterException);
661  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:305
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:306
def move(src, dest)
Definition: eostools.py:511
void edm::SubProcess::doStreamEndRunAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
RunPrincipal const &  principal,
IOVSyncValue const &  ts,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls,
bool  cleaningUpAfterException 
)

Definition at line 600 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamEndTransitionAsync().

605  {
606  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
607  typedef OccurrenceTraits<RunPrincipal, BranchActionStreamEnd> Traits;
608 
609  endStreamTransitionAsync<Traits>(std::move(iHolder),
610  *schedule_,
611  id,
612  rp,
613  ts,
614  esp_->eventSetupImpl(),
615  iEventSetupImpls,
618  cleaningUpAfterException);
619  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:306
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
PrincipalCache principalCache_
Definition: SubProcess.h:303
def move(src, dest)
Definition: eostools.py:511
std::map<BranchID::value_type, BranchID::value_type> const& edm::SubProcess::droppedBranchIDToKeptBranchID ( )
inlineprivate

Definition at line 271 of file SubProcess.h.

Referenced by beginJob().

271  {
273  }
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:327
void edm::SubProcess::enableEndPaths ( bool  active)
inline

Turn end_paths "off" if "active" is false; Turn end_paths "on" if "active" is true.

Definition at line 212 of file SubProcess.h.

References edm::for_all().

212  {
214  schedule_->enableEndPaths(active);
215  for_all(subProcesses_, [active](auto& subProcess) { subProcess.enableEndPaths(active); });
216  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:287
void edm::SubProcess::endJob ( void  )
private

Definition at line 237 of file SubProcess.cc.

References HltBtagPostValidation_cff::c, edm::ExceptionCollector::call(), edm::ExceptionCollector::hasThrown(), edm::ExceptionCollector::rethrow(), schedule_, serviceToken_, and subProcesses_.

Referenced by doEndJob().

237  {
239  ExceptionCollector c(
240  "Multiple exceptions were thrown while executing endJob. An exception message follows for each.");
241  schedule_->endJob(c);
242  for (auto& subProcess : subProcesses_) {
243  c.call([&subProcess]() { subProcess.doEndJob(); });
244  }
245  if (c.hasThrown()) {
246  c.rethrow();
247  }
248  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
void edm::SubProcess::endLuminosityBlock ( LuminosityBlockPrincipal const &  lb,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)
private
bool edm::SubProcess::endPathsEnabled ( ) const
inline

Return true if end_paths are active, and false if they are inactive.

Definition at line 219 of file SubProcess.h.

219  {
221  return schedule_->endPathsEnabled();
222  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
void edm::SubProcess::endRun ( RunPrincipal const &  r,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)
private
void edm::SubProcess::fixBranchIDListsForEDAliases ( std::map< BranchID::value_type, BranchID::value_type > const &  droppedBranchIDToKeptBranchID)
private

Definition at line 311 of file SubProcess.cc.

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

Referenced by beginJob().

312  {
313  // Check for branches dropped while an EDAlias was kept.
314  // Replace BranchID of each dropped branch with that of the kept alias.
315  for (BranchIDList& branchIDList : branchIDListHelper_->mutableBranchIDLists()) {
316  for (BranchID::value_type& branchID : branchIDList) {
317  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter =
318  droppedBranchIDToKeptBranchID.find(branchID);
319  if (iter != droppedBranchIDToKeptBranchID.end()) {
320  branchID = iter->second;
321  }
322  }
323  }
324  for_all(subProcesses_, [&droppedBranchIDToKeptBranchID](auto& subProcess) {
325  subProcess.fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID);
326  });
327  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:271
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:290
std::vector< BranchID::value_type > BranchIDList
Definition: BranchIDList.h:18
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!

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

226  {
228  schedule_->getTriggerReport(rep);
229  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
rep
Definition: cuy.py:1190
void edm::SubProcess::keepThisBranch ( BranchDescription const &  desc,
std::map< BranchID, BranchDescription const * > &  trueBranchIDToKeptBranchDesc,
std::set< BranchID > &  keptProductsInEvent 
)
private

Definition at line 292 of file SubProcess.cc.

References edm::BranchDescription::branchID(), edm::BranchDescription::branchType(), edm::ProductSelector::checkForDuplicateKeptBranch(), edm::EDConsumerBase::consumes(), edm::InEvent, keptProducts_, edm::BranchDescription::moduleLabel(), edm::BranchDescription::originalBranchID(), edm::BranchDescription::processName(), edm::BranchDescription::produced(), edm::PRODUCT_TYPE, edm::BranchDescription::productInstanceName(), unpackBuffers-CaloStage2::token, and edm::BranchDescription::unwrappedTypeID().

Referenced by selectProducts().

294  {
295  ProductSelector::checkForDuplicateKeptBranch(desc, trueBranchIDToKeptBranchDesc);
296 
297  if (desc.branchType() == InEvent) {
298  if (desc.produced()) {
299  keptProductsInEvent.insert(desc.originalBranchID());
300  } else {
301  keptProductsInEvent.insert(desc.branchID());
302  }
303  }
304  EDGetToken token = consumes(TypeToGet{desc.unwrappedTypeID(), PRODUCT_TYPE},
305  InputTag{desc.moduleLabel(), desc.productInstanceName(), desc.processName()});
306 
307  // Now put it in the list of selected branches.
308  keptProducts_[desc.branchType()].push_back(std::make_pair(&desc, token));
309  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:316
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)
SelectedProductsForBranchType const& edm::SubProcess::keptProducts ( ) const
inline

Definition at line 73 of file SubProcess.h.

References convertSQLiteXML::runNumber.

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

73 { return keptProducts_; }
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:316
void edm::SubProcess::openOutputFiles ( FileBlock fb)
inline

Definition at line 153 of file SubProcess.h.

References benchmark_cfg::fb, and edm::for_all().

153  {
155  schedule_->openOutputFiles(fb);
156  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.openOutputFiles(fb); });
157  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:287
SubProcess& edm::SubProcess::operator= ( SubProcess const &  )
delete
SubProcess& edm::SubProcess::operator= ( SubProcess &&  )
delete
void edm::SubProcess::processAsync ( WaitingTaskHolder  iHolder,
EventPrincipal const &  e,
std::vector< std::shared_ptr< const EventSetupImpl >> const *  iEventSetupImpls 
)
private

Definition at line 345 of file SubProcess.cc.

References edm::ProductRegistry::anyProductProduced(), printConversionInfo::aux, edm::EventPrincipal::aux(), branchIDListHelper_, edm::EventPrincipal::branchListIndexes(), edm::EventPrincipal::clearEventPrincipal(), edm::WaitingTaskHolder::doneWaiting(), SiStripBadComponentsDQMServiceTemplate_cfg::ep, esp_, edm::PrincipalCache::eventPrincipal(), edm::EventPrincipal::eventSelectionIDs(), edm::EventPrincipal::fillEventPrincipal(), edm::LuminosityBlockPrincipal::index(), edm::InEvent, inUseLumiPrincipals_, edm::EventPrincipal::luminosityBlockPrincipal(), edm::make_waiting_task(), eostools::move(), principalCache_, edm::Principal::processHistory(), edm::Principal::processHistoryID(), processHistoryRegistries_, edm::EventPrincipal::productProvenanceRetrieverPtr(), edm::Principal::productRegistry(), propagateProducts(), edm::Principal::reader(), groupFilesInBlocks::reverse, schedule_, selector_config_id_, serviceToken_, edm::EventPrincipal::setLuminosityBlockPrincipal(), edm::EventPrincipal::streamID(), subProcesses_, edm::StreamID::value(), and wantAllEvents_.

Referenced by doEventAsync().

347  {
348  EventAuxiliary aux(principal.aux());
349  aux.setProcessHistoryID(principal.processHistoryID());
350 
351  EventSelectionIDVector esids{principal.eventSelectionIDs()};
352  if (principal.productRegistry().anyProductProduced() || !wantAllEvents_) {
353  esids.push_back(selector_config_id_);
354  }
355 
356  EventPrincipal& ep = principalCache_.eventPrincipal(principal.streamID().value());
357  auto& processHistoryRegistry = processHistoryRegistries_[principal.streamID().value()];
358  processHistoryRegistry.registerProcessHistory(principal.processHistory());
359  BranchListIndexes bli(principal.branchListIndexes());
360  branchIDListHelper_->fixBranchListIndexes(bli);
361  bool deepCopyRetriever = false;
362  ep.fillEventPrincipal(
363  aux,
364  processHistoryRegistry,
365  std::move(esids),
366  std::move(bli),
367  *(principal.productProvenanceRetrieverPtr()), //NOTE: this transfers the per product provenance
368  principal.reader(),
369  deepCopyRetriever);
370  ep.setLuminosityBlockPrincipal(inUseLumiPrincipals_[principal.luminosityBlockPrincipal().index()].get());
371  propagateProducts(InEvent, principal, ep);
372 
373  WaitingTaskHolder finalizeEventTask(
374  make_waiting_task(tbb::task::allocate_root(), [&ep, iHolder](std::exception_ptr const* iPtr) mutable {
375  ep.clearEventPrincipal();
376  if (iPtr) {
377  iHolder.doneWaiting(*iPtr);
378  } else {
379  iHolder.doneWaiting(std::exception_ptr());
380  }
381  }));
382  WaitingTaskHolder afterProcessTask;
383  if (subProcesses_.empty()) {
384  afterProcessTask = std::move(finalizeEventTask);
385  } else {
386  afterProcessTask = WaitingTaskHolder(
387  make_waiting_task(tbb::task::allocate_root(),
388  [this, &ep, finalizeEventTask, iEventSetupImpls](std::exception_ptr const* iPtr) mutable {
389  if (not iPtr) {
390  for (auto& subProcess : boost::adaptors::reverse(subProcesses_)) {
391  subProcess.doEventAsync(finalizeEventTask, ep, iEventSetupImpls);
392  }
393  } else {
394  finalizeEventTask.doneWaiting(*iPtr);
395  }
396  }));
397  }
398 
399  schedule_->processOneEventAsync(std::move(afterProcessTask),
400  ep.streamID().value(),
401  ep,
402  *((*iEventSetupImpls)[esp_->subProcessIndex()]),
403  serviceToken_);
404  }
ParameterSetID selector_config_id_
Definition: SubProcess.h:322
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:301
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
std::vector< EventSelectionID > EventSelectionIDVector
ServiceToken serviceToken_
Definition: SubProcess.h:287
std::vector< BranchListIndex > BranchListIndexes
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:305
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:306
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
Definition: WaitingTask.h:87
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:290
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:663
PrincipalCache principalCache_
Definition: SubProcess.h:303
def move(src, dest)
Definition: eostools.py:511
void edm::SubProcess::propagateProducts ( BranchType  type,
Principal const &  parentPrincipal,
Principal principal 
) const
private

Definition at line 663 of file SubProcess.cc.

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

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

663  {
664  SelectedProducts const& keptVector = keptProducts()[type];
665  for (auto const& item : keptVector) {
666  BranchDescription const& desc = *item.first;
667  ProductResolverBase const* parentProductResolver = parentPrincipal.getProductResolver(desc.branchID());
668  if (parentProductResolver != nullptr) {
669  ProductResolverBase* productResolver = principal.getModifiableProductResolver(desc.branchID());
670  if (productResolver != nullptr) {
671  //Propagate the per event(run)(lumi) data for this product to the subprocess.
672  //First, the product itself.
673  productResolver->connectTo(*parentProductResolver, &parentPrincipal);
674  }
675  }
676  }
677  }
type
Definition: HCALResponse.h:21
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:73
std::vector< std::pair< BranchDescription const *, EDGetToken > > SelectedProducts
void edm::SubProcess::respondToCloseInputFile ( FileBlock const &  fb)
inline

Definition at line 165 of file SubProcess.h.

References edm::for_all().

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

Definition at line 686 of file SubProcess.cc.

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

686  {
688  schedule_->respondToOpenInputFile(fb);
689  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.respondToOpenInputFile(fb); });
690  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ServiceToken serviceToken_
Definition: SubProcess.h:287
void edm::SubProcess::selectProducts ( ProductRegistry const &  preg,
ThinnedAssociationsHelper const &  parentThinnedAssociationsHelper,
std::map< BranchID, bool > &  keepAssociation 
)

Definition at line 250 of file SubProcess.cc.

References edm::ProductRegistry::allBranchDescriptions(), TrackValidation_cff::association, droppedBranchIDToKeptBranchID_, edm::ProductSelector::fillDroppedToKept(), edm::ProductSelector::initialize(), edm::ProductSelector::initialized(), keepThisBranch(), edm::BranchDescription::present(), edm::BranchDescription::produced(), edm::ProductRegistry::productList(), productSelector_, productSelectorRules_, edm::ThinnedAssociationsHelper::selectAssociationProducts(), edm::ProductSelector::selected(), edm::BranchDescription::transient(), and edm::BranchDescription::unwrappedType().

Referenced by SubProcess().

252  {
254  return;
255  productSelector_.initialize(productSelectorRules_, preg.allBranchDescriptions());
256 
257  // TODO: See if we can collapse keptProducts_ and productSelector_ into a
258  // single object. See the notes in the header for ProductSelector
259  // for more information.
260 
261  std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
262  std::vector<BranchDescription const*> associationDescriptions;
263  std::set<BranchID> keptProductsInEvent;
264 
265  for (auto const& it : preg.productList()) {
266  BranchDescription const& desc = it.second;
267  if (desc.transient()) {
268  // if the class of the branch is marked transient, output nothing
269  } else if (!desc.present() && !desc.produced()) {
270  // else if the branch containing the product has been previously dropped,
271  // output nothing
272  } else if (desc.unwrappedType() == typeid(ThinnedAssociation)) {
273  associationDescriptions.push_back(&desc);
274  } else if (productSelector_.selected(desc)) {
275  keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
276  }
277  }
278 
279  parentThinnedAssociationsHelper.selectAssociationProducts(
280  associationDescriptions, keptProductsInEvent, keepAssociation);
281 
282  for (auto association : associationDescriptions) {
283  if (keepAssociation[association->branchID()]) {
284  keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
285  }
286  }
287 
288  // Now fill in a mapping needed in the case that a branch was dropped while its EDAlias was kept.
289  ProductSelector::fillDroppedToKept(preg, trueBranchIDToKeptBranchDesc, droppedBranchIDToKeptBranchID_);
290  }
bool selected(BranchDescription const &desc) const
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:317
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
Definition: SubProcess.cc:292
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:327
ProductSelector productSelector_
Definition: SubProcess.h:318
bool initialized() const
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
bool edm::SubProcess::shouldWeCloseOutput ( ) const
inline

Definition at line 172 of file SubProcess.h.

172  {
174  if (schedule_->shouldWeCloseOutput()) {
175  return true;
176  }
177  for (auto const& subProcess : subProcesses_) {
178  if (subProcess.shouldWeCloseOutput()) {
179  return true;
180  }
181  }
182  return false;
183  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
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 233 of file SubProcess.h.

233  {
235  if (schedule_->terminate()) {
236  return true;
237  }
238  for (auto const& subProcess : subProcesses_) {
239  if (subProcess.terminate()) {
240  return true;
241  }
242  }
243  return false;
244  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
std::shared_ptr<ThinnedAssociationsHelper const> edm::SubProcess::thinnedAssociationsHelper ( ) const
inlineprivate

Definition at line 279 of file SubProcess.h.

References edm::get_underlying_safe().

Referenced by SubProcess().

279  {
281  }
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:291
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr<ThinnedAssociationsHelper> edm::SubProcess::thinnedAssociationsHelper ( )
inlineprivate

Definition at line 282 of file SubProcess.h.

References edm::get_underlying_safe().

282  {
284  }
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:291
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
int edm::SubProcess::totalEvents ( ) const
inline

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

Definition at line 195 of file SubProcess.h.

195 { return schedule_->totalEvents(); }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
int edm::SubProcess::totalEventsFailed ( ) const
inline

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

Definition at line 205 of file SubProcess.h.

205  {
207  return schedule_->totalEventsFailed();
208  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
int edm::SubProcess::totalEventsPassed ( ) const
inline

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

Definition at line 198 of file SubProcess.h.

198  {
200  return schedule_->totalEventsPassed();
201  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
void edm::SubProcess::updateBranchIDListHelper ( BranchIDLists const &  branchIDLists)

Definition at line 679 of file SubProcess.cc.

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

Referenced by SubProcess().

679  {
680  branchIDListHelper_->updateFromParent(branchIDLists);
682  [this](auto& subProcess) { subProcess.updateBranchIDListHelper(branchIDListHelper_->branchIDLists()); });
683  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
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:290
void edm::SubProcess::writeLumiAsync ( WaitingTaskHolder  task,
LuminosityBlockPrincipal principal 
)

Definition at line 541 of file SubProcess.cc.

References actReg_, edm::WaitingTaskHolder::doneWaiting(), edm::LuminosityBlockPrincipal::index(), inUseLumiPrincipals_, cmsLHEtoEOSManager::l, edm::make_waiting_task(), processContext_, alignCSCRings::s, schedule_, serviceToken_, and subProcesses_.

541  {
543 
544  auto l = inUseLumiPrincipals_[principal.index()];
545  auto subTasks =
546  edm::make_waiting_task(tbb::task::allocate_root(), [this, l, task](std::exception_ptr const* iExcept) mutable {
547  if (iExcept) {
548  task.doneWaiting(*iExcept);
549  } else {
550  ServiceRegistry::Operate operateWriteLumi(serviceToken_);
551  for (auto& s : subProcesses_) {
552  s.writeLumiAsync(task, *l);
553  }
554  }
555  });
556  schedule_->writeLumiAsync(WaitingTaskHolder(subTasks), *l, &processContext_, actReg_.get());
557  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:305
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
Definition: WaitingTask.h:87
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:286
ProcessContext processContext_
Definition: SubProcess.h:295
void edm::SubProcess::writeRunAsync ( edm::WaitingTaskHolder  task,
ProcessHistoryID const &  parentPhID,
int  runNumber,
MergeableRunProductMetadata const *  mergeableRunProductMetadata 
)

Definition at line 456 of file SubProcess.cc.

References actReg_, edm::WaitingTaskHolder::doneWaiting(), edm::make_waiting_task(), parentToChildPhID_, principalCache_, processContext_, edm::PrincipalCache::runPrincipal(), alignCSCRings::s, schedule_, serviceToken_, and subProcesses_.

459  {
461  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
462  assert(it != parentToChildPhID_.end());
463  auto const& childPhID = it->second;
464 
465  auto subTasks = edm::make_waiting_task(
466  tbb::task::allocate_root(),
467  [this, childPhID, runNumber, task, mergeableRunProductMetadata](std::exception_ptr const* iExcept) mutable {
468  if (iExcept) {
469  task.doneWaiting(*iExcept);
470  } else {
471  ServiceRegistry::Operate operateWriteRun(serviceToken_);
472  for (auto& s : subProcesses_) {
473  s.writeRunAsync(task, childPhID, runNumber, mergeableRunProductMetadata);
474  }
475  }
476  });
477  schedule_->writeRunAsync(WaitingTaskHolder(subTasks),
480  actReg_.get(),
481  mergeableRunProductMetadata);
482  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:309
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:307
ServiceToken serviceToken_
Definition: SubProcess.h:287
void doneWaiting(std::exception_ptr iExcept)
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:308
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
Definition: WaitingTask.h:87
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:286
ProcessContext processContext_
Definition: SubProcess.h:295
PrincipalCache principalCache_
Definition: SubProcess.h:303
RunPrincipal & runPrincipal(ProcessHistoryID const &phid, RunNumber_t run) const

Member Data Documentation

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

Definition at line 293 of file SubProcess.h.

Referenced by SubProcess().

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

Definition at line 286 of file SubProcess.h.

Referenced by beginJob(), SubProcess(), writeLumiAsync(), and writeRunAsync().

edm::propagate_const<std::shared_ptr<BranchIDListHelper> > edm::SubProcess::branchIDListHelper_
private
std::map<BranchID::value_type, BranchID::value_type> edm::SubProcess::droppedBranchIDToKeptBranchID_
private

Definition at line 327 of file SubProcess.h.

Referenced by selectProducts(), and SubProcess().

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

Definition at line 302 of file SubProcess.h.

Referenced by doBeginRunAsync(), and SubProcess().

unsigned int edm::SubProcess::historyLumiOffset_
private

Definition at line 299 of file SubProcess.h.

Referenced by doBeginLuminosityBlockAsync(), and SubProcess().

unsigned int edm::SubProcess::historyRunOffset_
private

Definition at line 300 of file SubProcess.h.

Referenced by doBeginRunAsync(), and SubProcess().

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

Definition at line 316 of file SubProcess.h.

Referenced by keepThisBranch().

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

Definition at line 288 of file SubProcess.h.

Referenced by beginJob().

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

Definition at line 308 of file SubProcess.h.

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

PathsAndConsumesOfModules edm::SubProcess::pathsAndConsumesOfModules_
private

Definition at line 296 of file SubProcess.h.

Referenced by beginJob().

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

Definition at line 289 of file SubProcess.h.

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

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

Definition at line 294 of file SubProcess.h.

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

ProcessContext edm::SubProcess::processContext_
private

Definition at line 295 of file SubProcess.h.

Referenced by beginJob(), SubProcess(), writeLumiAsync(), and writeRunAsync().

std::vector<ProcessHistoryRegistry> edm::SubProcess::processHistoryRegistries_
private
edm::propagate_const<std::unique_ptr<ParameterSet> > edm::SubProcess::processParameterSet_
private

Definition at line 310 of file SubProcess.h.

Referenced by SubProcess().

ProductSelector edm::SubProcess::productSelector_
private

Definition at line 318 of file SubProcess.h.

Referenced by selectProducts().

ProductSelectorRules edm::SubProcess::productSelectorRules_
private

Definition at line 317 of file SubProcess.h.

Referenced by selectProducts().

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

Definition at line 322 of file SubProcess.h.

Referenced by processAsync(), and SubProcess().

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

Definition at line 323 of file SubProcess.h.

Referenced by doEventAsync(), and SubProcess().

ServiceToken edm::SubProcess::serviceToken_
private
std::vector<SubProcess> edm::SubProcess::subProcesses_
private
edm::propagate_const<std::shared_ptr<SubProcessParentageHelper> > edm::SubProcess::subProcessParentageHelper_
private

Definition at line 292 of file SubProcess.h.

Referenced by SubProcess().

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

Definition at line 291 of file SubProcess.h.

Referenced by SubProcess().

bool edm::SubProcess::wantAllEvents_
private

Definition at line 321 of file SubProcess.h.

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