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 (ProcessHistoryID const &parentPhID, int runNumber, int lumiNumber)
 
void deleteRunFromCache (ProcessHistoryID const &parentPhID, int runNumber)
 
void doBeginJob ()
 
void doBeginLuminosityBlock (LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts)
 
void doBeginRun (RunPrincipal const &principal, IOVSyncValue const &ts)
 
void doBeginStream (unsigned int)
 
void doEndJob ()
 
void doEndLuminosityBlock (LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
 
void doEndRun (RunPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
 
void doEndStream (unsigned int)
 
void doEventAsync (WaitingTaskHolder iHolder, EventPrincipal const &principal)
 
void doStreamBeginLuminosityBlock (unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts)
 
void doStreamBeginLuminosityBlockAsync (WaitingTaskHolder iHolder, unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts)
 
void doStreamBeginRun (unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts)
 
void doStreamBeginRunAsync (WaitingTaskHolder iHolder, unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts)
 
void doStreamEndLuminosityBlock (unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
 
void doStreamEndLuminosityBlockAsync (WaitingTaskHolder iHolder, unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
 
void doStreamEndRun (unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
 
void doStreamEndRunAsync (WaitingTaskHolder iHolder, unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts, 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 openNewOutputFilesIfNeeded ()
 
void openOutputFiles (FileBlock &fb)
 
SubProcessoperator= (SubProcess const &)=delete
 
SubProcessoperator= (SubProcess &&)=default
 
void postForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)
 
void preForkReleaseResources ()
 
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 writeLumi (ProcessHistoryID const &parentPhID, int runNumber, int lumiNumber)
 
void writeRun (ProcessHistoryID const &parentPhID, int runNumber)
 
virtual ~SubProcess ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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)
 
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_
 
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 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 43 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 43 of file SubProcess.cc.

References edm::ScheduleItems::act_table_, act_table_, edm::ScheduleItems::actReg_, actReg_, edm::ScheduleItems::addCPRandTNS(), edm::ScheduleItems::branchIDListHelper(), branchIDListHelper(), branchIDListHelper_, edm::detail::configureEventSelector(), edm::ActivityRegistry::connectToSubProcess(), edm::EDConsumerBase::consumesCollector(), droppedBranchIDToKeptBranchID_, esp_, edm::ParameterSet::exists(), edm::getAllTriggerNames(), edm::ParameterSet::getUntrackedParameterSet(), historyAppenders_, historyRunOffset_, diffTreeTool::index, edm::ScheduleItems::initMisc(), edm::ScheduleItems::initSchedule(), edm::ScheduleItems::initServices(), edm::PrincipalCache::insert(), mps_monitormerge::items, edm::eventsetup::EventSetupsController::makeProvider(), Data_TkAlMuonIsolated_Run2015B_PromptReco_v1_cff::maxEvents, eostools::move(), edm::PreallocationConfiguration::numberOfStreams(), cmsPerfStripChart::operate(), edm::ParameterSet::popParameterSet(), edm::popSubProcessVParameterSet(), edm::ScheduleItems::preg(), preg_, principalCache_, edm::ScheduleItems::processConfiguration(), 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(), edm::IllegalParameters::setThrowAnException(), AlCaHLTBitMon_QueryRunRegistry::string, subProcesses_, edm::ScheduleItems::subProcessParentageHelper(), subProcessParentageHelper_, edm::ScheduleItems::thinnedAssociationsHelper(), thinnedAssociationsHelper(), thinnedAssociationsHelper_, ull, updateBranchIDListHelper(), and wantAllEvents_.

54  :
56  serviceToken_(),
57  parentPreg_(parentProductRegistry),
58  preg_(),
60  act_table_(),
62  historyLumiOffset_(preallocConfig.numberOfStreams()),
63  historyRunOffset_(historyLumiOffset_+preallocConfig.numberOfLuminosityBlocks()),
64  processHistoryRegistries_(historyRunOffset_+ preallocConfig.numberOfRuns()),
65  historyAppenders_(historyRunOffset_+preallocConfig.numberOfRuns()),
67  esp_(),
68  schedule_(),
70  subProcesses_(),
72  productSelectorRules_(parameterSet, "outputCommands", "OutputModule"),
74  wantAllEvents_(true) {
75 
76  //Setup the event selection
78 
79  ParameterSet selectevents =
80  parameterSet.getUntrackedParameterSet("SelectEvents", ParameterSet());
81 
82  selectevents.registerIt(); // Just in case this PSet is not registered
84  tns->getProcessName(),
86  selectors_,
88  std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
90  "",
91  outputModulePathPositions,
92  parentProductRegistry->anyProductProduced());
93 
94  std::map<BranchID, bool> keepAssociation;
95  selectProducts(*parentProductRegistry, parentThinnedAssociationsHelper, keepAssociation);
96 
97  std::string const maxEvents("maxEvents");
98  std::string const maxLumis("maxLuminosityBlocks");
99 
100  // propagate_const<T> has no reset() function
101  processParameterSet_ = std::unique_ptr<ParameterSet>(parameterSet.popParameterSet(std::string("process")).release());
102 
103  // if this process has a maxEvents or maxLuminosityBlocks parameter set, remove them.
104  if(processParameterSet_->exists(maxEvents)) {
105  processParameterSet_->popParameterSet(maxEvents);
106  }
107  if(processParameterSet_->exists(maxLumis)) {
108  processParameterSet_->popParameterSet(maxLumis);
109  }
110 
111  // if the top level process has a maxEvents or maxLuminosityBlocks parameter set, add them to this process.
112  if(topLevelParameterSet.exists(maxEvents)) {
113  processParameterSet_->addUntrackedParameter<ParameterSet>(maxEvents, topLevelParameterSet.getUntrackedParameterSet(maxEvents));
114  }
115  if(topLevelParameterSet.exists(maxLumis)) {
116  processParameterSet_->addUntrackedParameter<ParameterSet>(maxLumis, topLevelParameterSet.getUntrackedParameterSet(maxLumis));
117  }
118 
119  // If there are subprocesses, pop the subprocess parameter sets out of the process parameter set
120  auto subProcessVParameterSet = popSubProcessVParameterSet(*processParameterSet_);
121  bool hasSubProcesses = subProcessVParameterSet.size() != 0ull;
122 
123  ScheduleItems items(*parentProductRegistry, *this);
124  actReg_ = items.actReg_;
125 
126  ParameterSet const& optionsPset(processParameterSet_->getUntrackedParameterSet("options", ParameterSet()));
127  IllegalParameters::setThrowAnException(optionsPset.getUntrackedParameter<bool>("throwIfIllegalParameter", true));
128 
129  //initialize the services
130  ServiceToken iToken;
131 
132  // get any configured services.
133  auto serviceSets = processParameterSet_->popVParameterSet(std::string("services"));
134 
135  ServiceToken newToken = items.initServices(serviceSets, *processParameterSet_, token, iLegacy, false);
136  parentActReg.connectToSubProcess(*items.actReg_);
137  serviceToken_ = items.addCPRandTNS(*processParameterSet_, newToken);
138 
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_);
148 
149  branchIDListHelper_ = items.branchIDListHelper();
150  updateBranchIDListHelper(parentBranchIDListHelper->branchIDLists());
151 
152  thinnedAssociationsHelper_ = items.thinnedAssociationsHelper();
153  thinnedAssociationsHelper_->updateFromParentProcess(parentThinnedAssociationsHelper, keepAssociation, droppedBranchIDToKeptBranchID_);
154 
155  // intialize the Schedule
156  schedule_ = items.initSchedule(*processParameterSet_,hasSubProcesses,preallocConfig,&processContext_);
157 
158  // set the items
159  act_table_ = std::move(items.act_table_);
160  preg_ = items.preg();
161 
162  subProcessParentageHelper_ = items.subProcessParentageHelper();
163  subProcessParentageHelper_->update(parentSubProcessParentageHelper, *parentProductRegistry);
164 
165  //CMS-THREADING this only works since Run/Lumis are synchronous so when principalCache asks for
166  // the reducedProcessHistoryID from a full ProcessHistoryID that registry will not be in use by
167  // another thread. We really need to change how this is done in the PrincipalCache.
169 
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 
187  subProcesses_.reserve(subProcessVParameterSet.size());
188  for(auto& subProcessPSet : subProcessVParameterSet) {
189  subProcesses_.emplace_back(subProcessPSet,
190  topLevelParameterSet,
191  preg_,
193  *thinnedAssociationsHelper_,
195  esController,
196  *items.actReg_,
197  newToken,
198  iLegacy,
199  preallocConfig,
200  &processContext_);
201  }
202  }
unsigned int historyRunOffset_
Definition: SubProcess.h:292
unsigned int historyLumiOffset_
Definition: SubProcess.h:291
ParameterSetID selector_config_id_
Definition: SubProcess.h:312
void insert(std::shared_ptr< RunPrincipal > rp)
void setNumberOfConcurrentPrincipals(PreallocationConfiguration const &)
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: SubProcess.h:273
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:293
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:283
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
void updateBranchIDListHelper(BranchIDLists const &)
Definition: SubProcess.cc:677
void setParentProcessContext(ProcessContext const *parentProcessContext)
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
#define ull
Definition: vppc_sim_lib.h:15
ServiceToken serviceToken_
Definition: SubProcess.h:279
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > &keepAssociation)
Definition: SubProcess.cc:251
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
static void setThrowAnException(bool v)
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:307
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
edm::propagate_const< std::unique_ptr< ParameterSet > > processParameterSet_
Definition: SubProcess.h:300
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:285
std::vector< ParameterSet > popSubProcessVParameterSet(ParameterSet &parameterSet)
Definition: SubProcess.cc:692
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:317
ProductSelector productSelector_
Definition: SubProcess.h:308
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:313
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:298
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:278
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:282
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:294
std::vector< std::string > const & getAllTriggerNames()
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:280
ProcessContext processContext_
Definition: SubProcess.h:287
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:275
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:281
PrincipalCache principalCache_
Definition: SubProcess.h:295
def move(src, dest)
Definition: eostools.py:510
edm::propagate_const< std::shared_ptr< SubProcessParentageHelper > > subProcessParentageHelper_
Definition: SubProcess.h:284
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:286
def operate(timelog, memlog, json_f, num)
edm::SubProcess::~SubProcess ( )
virtual

Definition at line 204 of file SubProcess.cc.

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

Member Function Documentation

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

Definition at line 218 of file SubProcess.cc.

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

Referenced by doBeginJob().

218  {
219  // If event selection is being used, the SubProcess class reads TriggerResults
220  // object(s) in the parent process from the event. This next call is needed for
221  // getByToken to work properly. Normally, this is done by the worker, but since
222  // a SubProcess is not a module, it has no worker.
223  updateLookup(InEvent, *parentPreg_->productLookup(InEvent),false);
224 
225  if(!droppedBranchIDToKeptBranchID().empty()) {
227  }
230  //NOTE: this may throw
232  actReg_->preBeginJobSignal_(pathsAndConsumesOfModules_, processContext_);
233  schedule_->beginJob(*preg_);
234  for_all(subProcesses_, [](auto& subProcess){ subProcess.doBeginJob(); });
235  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:288
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:269
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
void initialize(Schedule const *, std::shared_ptr< ProductRegistry const >)
ServiceToken serviceToken_
Definition: SubProcess.h:279
void checkForModuleDependencyCorrectness(edm::PathsAndConsumesOfModulesBase const &iPnC, bool iPrintDependencies)
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:278
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:280
void fixBranchIDListsForEDAliases(std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: SubProcess.cc:317
ProcessContext processContext_
Definition: SubProcess.h:287
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:281
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::beginLuminosityBlock ( LuminosityBlockPrincipal const &  lb,
IOVSyncValue const &  ts 
)
private

Definition at line 478 of file SubProcess.cc.

References printConversionInfo::aux, edm::LuminosityBlockPrincipal::aux(), esp_, edm::for_all(), historyAppenders_, historyLumiOffset_, edm::LuminosityBlockPrincipal::index(), edm::InLumi, edm::PrincipalCache::insert(), edm::PrincipalCache::lumiPrincipalPtr(), preg_, principalCache_, processConfiguration_, edm::Principal::processHistory(), edm::Principal::processHistoryID(), processHistoryRegistries_, propagateProducts(), edm::Principal::reader(), edm::PrincipalCache::runPrincipalPtr(), schedule_, and subProcesses_.

Referenced by doBeginLuminosityBlock().

478  {
479  auto aux = std::make_shared<LuminosityBlockAuxiliary>(principal.aux());
480  aux->setProcessHistoryID(principal.processHistoryID());
481  auto lbpp = std::make_shared<LuminosityBlockPrincipal>(aux, preg_, *processConfiguration_, &(historyAppenders_[historyLumiOffset_+principal.index()]),principal.index(),false);
482  auto & processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_+principal.index()];
483  processHistoryRegistry.registerProcessHistory(principal.processHistory());
484  lbpp->fillLuminosityBlockPrincipal(processHistoryRegistry, principal.reader());
485  lbpp->setRunPrincipal(principalCache_.runPrincipalPtr());
486  principalCache_.insert(lbpp);
487  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
489  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalBegin> Traits;
490  schedule_->processOneGlobal<Traits>(lbp, esp_->eventSetupForInstance(ts));
491  for_all(subProcesses_, [&lbp, &ts](auto& subProcess){ subProcess.doBeginLuminosityBlock(lbp, ts); });
492  }
unsigned int historyLumiOffset_
Definition: SubProcess.h:291
void insert(std::shared_ptr< RunPrincipal > rp)
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:293
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
def principal(options)
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:294
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:661
std::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:281
PrincipalCache principalCache_
Definition: SubProcess.h:295
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:286
void edm::SubProcess::beginRun ( RunPrincipal const &  r,
IOVSyncValue const &  ts 
)
private

Definition at line 415 of file SubProcess.cc.

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

Referenced by doBeginRun().

415  {
416  auto aux = std::make_shared<RunAuxiliary>(principal.aux());
417  aux->setProcessHistoryID(principal.processHistoryID());
418  auto rpp = std::make_shared<RunPrincipal>(aux, preg_, *processConfiguration_, &(historyAppenders_[historyRunOffset_+principal.index()]),principal.index(),false);
419  auto & processHistoryRegistry = processHistoryRegistries_[historyRunOffset_+principal.index()];
420  processHistoryRegistry.registerProcessHistory(principal.processHistory());
421  rpp->fillRunPrincipal(processHistoryRegistry, principal.reader());
422  principalCache_.insert(rpp);
423 
424  ProcessHistoryID const& parentInputReducedPHID = principal.reducedProcessHistoryID();
425  ProcessHistoryID const& inputReducedPHID = rpp->reducedProcessHistoryID();
426 
427  parentToChildPhID_.insert(std::make_pair(parentInputReducedPHID,inputReducedPHID));
428 
429  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
431  typedef OccurrenceTraits<RunPrincipal, BranchActionGlobalBegin> Traits;
432  schedule_->processOneGlobal<Traits>(rp, esp_->eventSetupForInstance(ts));
433  for_all(subProcesses_, [&rp, &ts](auto& subProcess){ subProcess.doBeginRun(rp, ts); });
434  }
unsigned int historyRunOffset_
Definition: SubProcess.h:292
void insert(std::shared_ptr< RunPrincipal > rp)
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:293
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
def principal(options)
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
Hash< ProcessHistoryType > ProcessHistoryID
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:298
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:294
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:661
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:281
PrincipalCache principalCache_
Definition: SubProcess.h:295
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:286
std::shared_ptr<BranchIDListHelper const> edm::SubProcess::branchIDListHelper ( ) const
inlineprivate

Definition at line 273 of file SubProcess.h.

References edm::get_underlying_safe().

Referenced by SubProcess().

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:282
std::shared_ptr<BranchIDListHelper>& edm::SubProcess::branchIDListHelper ( )
inlineprivate

Definition at line 274 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:282
void edm::SubProcess::clearCounters ( )
inline

Clear all the counters in the trigger report.

Definition at line 248 of file SubProcess.h.

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

248  {
250  schedule_->clearCounters();
251  for_all(subProcesses_, [](auto& subProcess){ subProcess.clearCounters(); });
252  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::closeOutputFiles ( )
inline

Definition at line 126 of file SubProcess.h.

References edm::for_all(), and cmsPerfStripChart::operate().

126  {
128  schedule_->closeOutputFiles();
129  for_all(subProcesses_, [](auto& subProcess) { subProcess.closeOutputFiles(); });
130  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::deleteLumiFromCache ( ProcessHistoryID const &  parentPhID,
int  runNumber,
int  lumiNumber 
)

Definition at line 521 of file SubProcess.cc.

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

521  {
522  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
523  assert(it != parentToChildPhID_.end());
524  auto const& childPhID = it->second;
525  principalCache_.deleteLumi(childPhID, runNumber, lumiNumber);
526  for_all(subProcesses_, [&childPhID, runNumber, lumiNumber](auto& subProcess){ subProcess.deleteLumiFromCache(childPhID, runNumber, lumiNumber); });
527  }
void deleteLumi(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi)
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:298
PrincipalCache principalCache_
Definition: SubProcess.h:295
void edm::SubProcess::deleteRunFromCache ( ProcessHistoryID const &  parentPhID,
int  runNumber 
)

Definition at line 463 of file SubProcess.cc.

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

463  {
464  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
465  assert(it != parentToChildPhID_.end());
466  auto const& childPhID = it->second;
467  principalCache_.deleteRun(childPhID, runNumber);
468  for_all(subProcesses_, [&childPhID, runNumber](auto& subProcess){ subProcess.deleteRunFromCache(childPhID, runNumber); });
469  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:298
void deleteRun(ProcessHistoryID const &phid, RunNumber_t run)
PrincipalCache principalCache_
Definition: SubProcess.h:295
void edm::SubProcess::doBeginJob ( )

Definition at line 207 of file SubProcess.cc.

References beginJob().

207  {
208  this->beginJob();
209  }
void edm::SubProcess::doBeginLuminosityBlock ( LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 472 of file SubProcess.cc.

References beginLuminosityBlock(), cmsPerfStripChart::operate(), and serviceToken_.

472  {
475  }
ServiceToken serviceToken_
Definition: SubProcess.h:279
def principal(options)
void beginLuminosityBlock(LuminosityBlockPrincipal const &lb, IOVSyncValue const &ts)
Definition: SubProcess.cc:478
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doBeginRun ( RunPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 409 of file SubProcess.cc.

References beginRun(), cmsPerfStripChart::operate(), and serviceToken_.

409  {
411  beginRun(principal,ts);
412  }
void beginRun(RunPrincipal const &r, IOVSyncValue const &ts)
Definition: SubProcess.cc:415
ServiceToken serviceToken_
Definition: SubProcess.h:279
def principal(options)
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doBeginStream ( unsigned int  iID)

Definition at line 530 of file SubProcess.cc.

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

530  {
532  schedule_->beginStream(iID);
533  for_all(subProcesses_, [iID](auto& subProcess){ subProcess.doBeginStream(iID); });
534  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doEndJob ( )

Definition at line 212 of file SubProcess.cc.

References endJob().

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

212  {
213  endJob();
214  }
void edm::SubProcess::doEndLuminosityBlock ( LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 495 of file SubProcess.cc.

References endLuminosityBlock(), cmsPerfStripChart::operate(), and serviceToken_.

495  {
497  endLuminosityBlock(principal,ts,cleaningUpAfterException);
498  }
ServiceToken serviceToken_
Definition: SubProcess.h:279
def principal(options)
void endLuminosityBlock(LuminosityBlockPrincipal const &lb, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:501
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doEndRun ( RunPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 437 of file SubProcess.cc.

References endRun(), cmsPerfStripChart::operate(), and serviceToken_.

437  {
439  endRun(principal,ts,cleaningUpAfterException);
440  }
ServiceToken serviceToken_
Definition: SubProcess.h:279
def principal(options)
void endRun(RunPrincipal const &r, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:443
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doEndStream ( unsigned int  iID)

Definition at line 537 of file SubProcess.cc.

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

537  {
539  schedule_->endStream(iID);
540  for_all(subProcesses_, [iID](auto& subProcess){ subProcess.doEndStream(iID); });
541  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doEventAsync ( WaitingTaskHolder  iHolder,
EventPrincipal const &  principal 
)

Definition at line 332 of file SubProcess.cc.

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

333  {
335  /* BEGIN relevant bits from OutputModule::doEvent */
336  if(!wantAllEvents_) {
337  EventForOutput e(ep, ModuleDescription(), nullptr);
338  e.setConsumer(this);
339  if(!selectors_.wantEvent(e)) {
340  return;
341  }
342  }
343  processAsync(std::move(iHolder),ep);
344  /* END relevant bits from OutputModule::doEvent */
345  }
ServiceToken serviceToken_
Definition: SubProcess.h:279
void processAsync(WaitingTaskHolder iHolder, EventPrincipal const &e)
Definition: SubProcess.cc:348
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:313
def move(src, dest)
Definition: eostools.py:510
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doStreamBeginLuminosityBlock ( unsigned int  iID,
LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 602 of file SubProcess.cc.

References esp_, edm::for_all(), hcalTTPDigis_cfi::id, edm::PrincipalCache::lumiPrincipalPtr(), cmsPerfStripChart::operate(), principalCache_, schedule_, serviceToken_, and subProcesses_.

602  {
604  {
605  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
606  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamBegin> Traits;
607  schedule_->processOneStream<Traits>(id,lbp, esp_->eventSetupForInstance(ts));
608  for_all(subProcesses_, [id, &lbp, &ts](auto& subProcess){ subProcess.doStreamBeginLuminosityBlock(id,lbp, ts); });
609  }
610  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
std::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
PrincipalCache principalCache_
Definition: SubProcess.h:295
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doStreamBeginLuminosityBlockAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 612 of file SubProcess.cc.

References esp_, hcalTTPDigis_cfi::id, edm::PrincipalCache::lumiPrincipalPtr(), eostools::move(), cmsPerfStripChart::operate(), principalCache_, schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoStreamBeginTransitionAsync().

613  {
615 
616  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamBegin> Traits;
617 
618  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
619 
620  beginStreamTransitionAsync<Traits>(std::move(iHolder),
621  *schedule_,
622  id,
623  lbp,
624  ts,
625  esp_->eventSetupForInstance(ts),
626  subProcesses_);
627  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
ServiceToken serviceToken_
Definition: SubProcess.h:279
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
std::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
PrincipalCache principalCache_
Definition: SubProcess.h:295
def move(src, dest)
Definition: eostools.py:510
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doStreamBeginRun ( unsigned int  iID,
RunPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 544 of file SubProcess.cc.

References esp_, edm::for_all(), hcalTTPDigis_cfi::id, cmsPerfStripChart::operate(), principalCache_, edm::PrincipalCache::runPrincipalPtr(), schedule_, serviceToken_, and subProcesses_.

544  {
546  {
547  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
548  typedef OccurrenceTraits<RunPrincipal, BranchActionStreamBegin> Traits;
549  schedule_->processOneStream<Traits>(id,rp, esp_->eventSetupForInstance(ts));
550  for_all(subProcesses_, [id, &rp, &ts](auto& subProcess){ subProcess.doStreamBeginRun(id,rp, ts); });
551  }
552  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
PrincipalCache principalCache_
Definition: SubProcess.h:295
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doStreamBeginRunAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
RunPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 554 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamBeginTransitionAsync().

555  {
557 
558  typedef OccurrenceTraits<RunPrincipal, BranchActionStreamBegin> Traits;
559 
560  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
561 
562  beginStreamTransitionAsync<Traits>(std::move(iHolder),
563  *schedule_,
564  id,
565  rp,
566  ts,
567  esp_->eventSetupForInstance(ts),
568  subProcesses_);
569 
570  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
ServiceToken serviceToken_
Definition: SubProcess.h:279
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
PrincipalCache principalCache_
Definition: SubProcess.h:295
def move(src, dest)
Definition: eostools.py:510
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doStreamEndLuminosityBlock ( unsigned int  iID,
LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 632 of file SubProcess.cc.

References esp_, edm::for_all(), hcalTTPDigis_cfi::id, edm::PrincipalCache::lumiPrincipalPtr(), cmsPerfStripChart::operate(), principalCache_, schedule_, serviceToken_, and subProcesses_.

632  {
634  {
635  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
636  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamEnd> Traits;
637  schedule_->processOneStream<Traits>(id,lbp, esp_->eventSetupForInstance(ts),cleaningUpAfterException);
638  for_all(subProcesses_, [id, &lbp, &ts, cleaningUpAfterException](auto& subProcess){ subProcess.doStreamEndLuminosityBlock(id,lbp, ts,cleaningUpAfterException); });
639  }
640  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
std::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
PrincipalCache principalCache_
Definition: SubProcess.h:295
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doStreamEndLuminosityBlockAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 643 of file SubProcess.cc.

References esp_, hcalTTPDigis_cfi::id, edm::PrincipalCache::lumiPrincipalPtr(), eostools::move(), cmsPerfStripChart::operate(), principalCache_, schedule_, serviceToken_, and subProcesses_.

Referenced by edm::subProcessDoStreamEndTransitionAsync().

644  {
646 
647  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
648  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamEnd> Traits;
649  endStreamTransitionAsync<Traits>(std::move(iHolder),
650  *schedule_,
651  id,
652  lbp,
653  ts,
654  esp_->eventSetupForInstance(ts),
656  cleaningUpAfterException);
657  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
ServiceToken serviceToken_
Definition: SubProcess.h:279
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
std::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
PrincipalCache principalCache_
Definition: SubProcess.h:295
def move(src, dest)
Definition: eostools.py:510
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doStreamEndRun ( unsigned int  iID,
RunPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 574 of file SubProcess.cc.

References esp_, edm::for_all(), hcalTTPDigis_cfi::id, cmsPerfStripChart::operate(), principalCache_, edm::PrincipalCache::runPrincipalPtr(), schedule_, serviceToken_, and subProcesses_.

574  {
576  {
577  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
578  typedef OccurrenceTraits<RunPrincipal, BranchActionStreamEnd> Traits;
579  schedule_->processOneStream<Traits>(id,rp, esp_->eventSetupForInstance(ts),cleaningUpAfterException);
580  for_all(subProcesses_, [id, &rp, &ts, cleaningUpAfterException](auto& subProcess){ subProcess.doStreamEndRun(id,rp, ts,cleaningUpAfterException); });
581  }
582  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
PrincipalCache principalCache_
Definition: SubProcess.h:295
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::doStreamEndRunAsync ( WaitingTaskHolder  iHolder,
unsigned int  iID,
RunPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 585 of file SubProcess.cc.

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

Referenced by edm::subProcessDoStreamEndTransitionAsync().

586  {
588  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
589  typedef OccurrenceTraits<RunPrincipal, BranchActionStreamEnd> Traits;
590 
591  endStreamTransitionAsync<Traits>(std::move(iHolder),
592  *schedule_,
593  id,
594  rp,
595  ts,
596  esp_->eventSetupForInstance(ts),
598  cleaningUpAfterException);
599  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
ServiceToken serviceToken_
Definition: SubProcess.h:279
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
PrincipalCache principalCache_
Definition: SubProcess.h:295
def move(src, dest)
Definition: eostools.py:510
def operate(timelog, memlog, json_f, num)
std::map<BranchID::value_type, BranchID::value_type> const& edm::SubProcess::droppedBranchIDToKeptBranchID ( )
inlineprivate

Definition at line 269 of file SubProcess.h.

Referenced by beginJob().

269  {
271  }
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:317
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 213 of file SubProcess.h.

References edm::for_all(), and cmsPerfStripChart::operate().

213  {
215  schedule_->enableEndPaths(active);
216  for_all(subProcesses_, [active](auto& subProcess){ subProcess.enableEndPaths(active); });
217  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::endJob ( void  )
private

Definition at line 238 of file SubProcess.cc.

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

Referenced by doEndJob().

238  {
240  ExceptionCollector c("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:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::endLuminosityBlock ( LuminosityBlockPrincipal const &  lb,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)
private

Definition at line 501 of file SubProcess.cc.

References esp_, edm::for_all(), edm::InLumi, edm::PrincipalCache::lumiPrincipalPtr(), principalCache_, propagateProducts(), schedule_, edm::LuminosityBlockPrincipal::setComplete(), and subProcesses_.

Referenced by doEndLuminosityBlock().

501  {
502  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
503  lbp.setComplete();
505  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalEnd> Traits;
506  schedule_->processOneGlobal<Traits>(lbp, esp_->eventSetupForInstance(ts), cleaningUpAfterException);
507  for_all(subProcesses_, [&lbp, &ts, cleaningUpAfterException](auto& subProcess){ subProcess.doEndLuminosityBlock(lbp, ts, cleaningUpAfterException); });
508  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
def principal(options)
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:661
std::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
PrincipalCache principalCache_
Definition: SubProcess.h:295
bool edm::SubProcess::endPathsEnabled ( ) const
inline

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

Definition at line 220 of file SubProcess.h.

References cmsPerfStripChart::operate().

220  {
222  return schedule_->endPathsEnabled();
223  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::endRun ( RunPrincipal const &  r,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)
private

Definition at line 443 of file SubProcess.cc.

References esp_, edm::for_all(), edm::InRun, principalCache_, propagateProducts(), edm::PrincipalCache::runPrincipalPtr(), schedule_, edm::RunPrincipal::setComplete(), and subProcesses_.

Referenced by doEndRun().

443  {
444  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
445  rp.setComplete();
447  typedef OccurrenceTraits<RunPrincipal, BranchActionGlobalEnd> Traits;
448  schedule_->processOneGlobal<Traits>(rp, esp_->eventSetupForInstance(ts), cleaningUpAfterException);
449  for_all(subProcesses_, [&rp, &ts, cleaningUpAfterException](auto& subProcess){ subProcess.doEndRun(rp, ts, cleaningUpAfterException); });
450  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
def principal(options)
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:296
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:661
PrincipalCache principalCache_
Definition: SubProcess.h:295
void edm::SubProcess::fixBranchIDListsForEDAliases ( std::map< BranchID::value_type, BranchID::value_type > const &  droppedBranchIDToKeptBranchID)
private

Definition at line 317 of file SubProcess.cc.

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

Referenced by beginJob().

317  {
318  // Check for branches dropped while an EDAlias was kept.
319  // Replace BranchID of each dropped branch with that of the kept alias.
320  for(BranchIDList& branchIDList : branchIDListHelper_->mutableBranchIDLists()) {
321  for(BranchID::value_type& branchID : branchIDList) {
322  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter = droppedBranchIDToKeptBranchID.find(branchID);
323  if(iter != droppedBranchIDToKeptBranchID.end()) {
324  branchID = iter->second;
325  }
326  }
327  }
328  for_all(subProcesses_, [&droppedBranchIDToKeptBranchID](auto& subProcess){ subProcess.fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID); });
329  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:269
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
unsigned int value_type
Definition: BranchID.h:16
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:282
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 227 of file SubProcess.h.

References cmsPerfStripChart::operate().

227  {
229  schedule_->getTriggerReport(rep);
230  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
ServiceToken serviceToken_
Definition: SubProcess.h:279
rep
Definition: cuy.py:1188
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::keepThisBranch ( BranchDescription const &  desc,
std::map< BranchID, BranchDescription const * > &  trueBranchIDToKeptBranchDesc,
std::set< BranchID > &  keptProductsInEvent 
)
private

Definition at line 293 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(), and edm::BranchDescription::unwrappedTypeID().

Referenced by selectProducts().

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

Definition at line 70 of file SubProcess.h.

References cmsRelvalreport::principal(), and convertSQLiteXML::runNumber.

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

70 {return keptProducts_;}
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:306
void edm::SubProcess::openNewOutputFilesIfNeeded ( )
inline

Definition at line 133 of file SubProcess.h.

References edm::for_all(), and cmsPerfStripChart::operate().

133  {
135  schedule_->openNewOutputFilesIfNeeded();
136  for_all(subProcesses_, [](auto& subProcess) { subProcess.openNewOutputFilesIfNeeded(); });
137  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::openOutputFiles ( FileBlock fb)
inline

Definition at line 140 of file SubProcess.h.

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

140  {
142  schedule_->openOutputFiles(fb);
143  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.openOutputFiles(fb); });
144  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
SubProcess& edm::SubProcess::operator= ( SubProcess const &  )
delete
SubProcess& edm::SubProcess::operator= ( SubProcess &&  )
default
void edm::SubProcess::postForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
)
inline

Definition at line 178 of file SubProcess.h.

References edm::for_all(), and cmsPerfStripChart::operate().

178  {
180  schedule_->postForkReacquireResources(iChildIndex, iNumberOfChildren);
181  for_all(subProcesses_, [iChildIndex, iNumberOfChildren](auto& subProcess){ subProcess.postForkReacquireResources(iChildIndex, iNumberOfChildren); });
182  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::preForkReleaseResources ( )
inline

Definition at line 172 of file SubProcess.h.

References edm::for_all(), and cmsPerfStripChart::operate().

172  {
174  schedule_->preForkReleaseResources();
175  for_all(subProcesses_, [](auto& subProcess){ subProcess.preForkReleaseResources(); });
176  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::processAsync ( WaitingTaskHolder  iHolder,
EventPrincipal const &  e 
)
private

Definition at line 348 of file SubProcess.cc.

References edm::ProductRegistry::anyProductProduced(), printConversionInfo::aux, edm::EventPrincipal::aux(), branchIDListHelper_, edm::EventPrincipal::branchListIndexes(), edm::EventPrincipal::clearEventPrincipal(), edm::WaitingTaskHolder::doneWaiting(), esp_, edm::PrincipalCache::eventPrincipal(), edm::EventPrincipal::eventSelectionIDs(), edm::EventPrincipal::fillEventPrincipal(), edm::InEvent, edm::PrincipalCache::lumiPrincipalPtr(), 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_, edm::EventPrincipal::setLuminosityBlockPrincipal(), edm::EventPrincipal::streamID(), subProcesses_, edm::StreamID::value(), and wantAllEvents_.

Referenced by doEventAsync().

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

Definition at line 661 of file SubProcess.cc.

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

Referenced by beginLuminosityBlock(), beginRun(), endLuminosityBlock(), endRun(), and processAsync().

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

Definition at line 152 of file SubProcess.h.

References edm::for_all(), and cmsPerfStripChart::operate().

152  {
154  schedule_->respondToCloseInputFile(fb);
155  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.respondToCloseInputFile(fb); });
156  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::respondToOpenInputFile ( FileBlock const &  fb)

Definition at line 684 of file SubProcess.cc.

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

684  {
686  schedule_->respondToOpenInputFile(fb);
687  for_all(subProcesses_, [&fb](auto& subProcess){ subProcess.respondToOpenInputFile(fb); });
688  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::selectProducts ( ProductRegistry const &  preg,
ThinnedAssociationsHelper const &  parentThinnedAssociationsHelper,
std::map< BranchID, bool > &  keepAssociation 
)

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

253  {
254  if(productSelector_.initialized()) 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(associationDescriptions,
280  keptProductsInEvent,
281  keepAssociation);
282 
283  for(auto association : associationDescriptions) {
284  if(keepAssociation[association->branchID()]) {
285  keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
286  }
287  }
288 
289  // Now fill in a mapping needed in the case that a branch was dropped while its EDAlias was kept.
290  ProductSelector::fillDroppedToKept(preg, trueBranchIDToKeptBranchDesc, droppedBranchIDToKeptBranchID_);
291  }
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:307
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
Definition: SubProcess.cc:293
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:317
ProductSelector productSelector_
Definition: SubProcess.h:308
bool initialized() const
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
bool edm::SubProcess::shouldWeCloseOutput ( ) const
inline

Definition at line 159 of file SubProcess.h.

References cmsPerfStripChart::operate().

159  {
161  if(schedule_->shouldWeCloseOutput()) {
162  return true;
163  }
164  for(auto const& subProcess : subProcesses_) {
165  if(subProcess.shouldWeCloseOutput()) {
166  return true;
167  }
168  }
169  return false;
170  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
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 234 of file SubProcess.h.

References cmsPerfStripChart::operate().

234  {
236  if(schedule_->terminate()) {
237  return true;
238  }
239  for(auto const& subProcess : subProcesses_) {
240  if(subProcess.terminate()) {
241  return true;
242  }
243  }
244  return false;
245  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
std::shared_ptr<ThinnedAssociationsHelper const> edm::SubProcess::thinnedAssociationsHelper ( ) const
inlineprivate

Definition at line 275 of file SubProcess.h.

References edm::get_underlying_safe().

Referenced by SubProcess().

edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:283
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 276 of file SubProcess.h.

References edm::get_underlying_safe().

edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:283
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 194 of file SubProcess.h.

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

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

Definition at line 206 of file SubProcess.h.

References cmsPerfStripChart::operate().

206  {
208  return schedule_->totalEventsFailed();
209  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
int edm::SubProcess::totalEventsPassed ( ) const
inline

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

Definition at line 199 of file SubProcess.h.

References cmsPerfStripChart::operate().

199  {
201  return schedule_->totalEventsPassed();
202  }
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
ServiceToken serviceToken_
Definition: SubProcess.h:279
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::updateBranchIDListHelper ( BranchIDLists const &  branchIDLists)

Definition at line 677 of file SubProcess.cc.

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

Referenced by SubProcess().

677  {
678  branchIDListHelper_->updateFromParent(branchIDLists);
679  for_all(subProcesses_, [this](auto& subProcess){ subProcess.updateBranchIDListHelper(branchIDListHelper_->branchIDLists()); });
680  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:282
void edm::SubProcess::writeLumi ( ProcessHistoryID const &  parentPhID,
int  runNumber,
int  lumiNumber 
)

Definition at line 511 of file SubProcess.cc.

References edm::for_all(), edm::PrincipalCache::lumiPrincipal(), cmsPerfStripChart::operate(), parentToChildPhID_, principalCache_, processContext_, schedule_, serviceToken_, and subProcesses_.

511  {
513  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
514  assert(it != parentToChildPhID_.end());
515  auto const& childPhID = it->second;
516  schedule_->writeLumi(principalCache_.lumiPrincipal(childPhID, runNumber, lumiNumber), &processContext_);
517  for_all(subProcesses_, [&childPhID, runNumber, lumiNumber](auto& subProcess){ subProcess.writeLumi(childPhID, runNumber, lumiNumber); });
518  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
LuminosityBlockPrincipal & lumiPrincipal(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:298
ProcessContext processContext_
Definition: SubProcess.h:287
PrincipalCache principalCache_
Definition: SubProcess.h:295
def operate(timelog, memlog, json_f, num)
void edm::SubProcess::writeRun ( ProcessHistoryID const &  parentPhID,
int  runNumber 
)

Definition at line 453 of file SubProcess.cc.

References edm::for_all(), cmsPerfStripChart::operate(), parentToChildPhID_, principalCache_, processContext_, edm::PrincipalCache::runPrincipal(), schedule_, serviceToken_, and subProcesses_.

453  {
455  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
456  assert(it != parentToChildPhID_.end());
457  auto const& childPhID = it->second;
459  for_all(subProcesses_, [&childPhID, runNumber](auto& subProcess){ subProcess.writeRun(childPhID, runNumber); });
460  }
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:299
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:297
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
ServiceToken serviceToken_
Definition: SubProcess.h:279
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:298
ProcessContext processContext_
Definition: SubProcess.h:287
PrincipalCache principalCache_
Definition: SubProcess.h:295
RunPrincipal & runPrincipal(ProcessHistoryID const &phid, RunNumber_t run) const
def operate(timelog, memlog, json_f, num)

Member Data Documentation

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

Definition at line 285 of file SubProcess.h.

Referenced by SubProcess().

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

Definition at line 278 of file SubProcess.h.

Referenced by beginJob(), and SubProcess().

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

Referenced by beginLuminosityBlock(), beginRun(), and SubProcess().

unsigned int edm::SubProcess::historyLumiOffset_
private

Definition at line 291 of file SubProcess.h.

Referenced by beginLuminosityBlock().

unsigned int edm::SubProcess::historyRunOffset_
private

Definition at line 292 of file SubProcess.h.

Referenced by beginRun(), and SubProcess().

SelectedProductsForBranchType edm::SubProcess::keptProducts_
private

Definition at line 306 of file SubProcess.h.

Referenced by keepThisBranch().

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

Definition at line 280 of file SubProcess.h.

Referenced by beginJob().

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

Definition at line 298 of file SubProcess.h.

Referenced by beginRun(), deleteLumiFromCache(), deleteRunFromCache(), writeLumi(), and writeRun().

PathsAndConsumesOfModules edm::SubProcess::pathsAndConsumesOfModules_
private

Definition at line 288 of file SubProcess.h.

Referenced by beginJob().

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

Definition at line 281 of file SubProcess.h.

Referenced by beginJob(), beginLuminosityBlock(), beginRun(), and SubProcess().

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

Definition at line 286 of file SubProcess.h.

Referenced by beginLuminosityBlock(), beginRun(), and SubProcess().

ProcessContext edm::SubProcess::processContext_
private

Definition at line 287 of file SubProcess.h.

Referenced by beginJob(), SubProcess(), writeLumi(), and writeRun().

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

Definition at line 293 of file SubProcess.h.

Referenced by beginLuminosityBlock(), beginRun(), processAsync(), and SubProcess().

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

Definition at line 300 of file SubProcess.h.

Referenced by SubProcess().

ProductSelector edm::SubProcess::productSelector_
private

Definition at line 308 of file SubProcess.h.

Referenced by selectProducts().

ProductSelectorRules edm::SubProcess::productSelectorRules_
private

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

Referenced by processAsync(), and SubProcess().

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

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

Referenced by SubProcess().

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

Definition at line 283 of file SubProcess.h.

Referenced by SubProcess().

bool edm::SubProcess::wantAllEvents_
private

Definition at line 311 of file SubProcess.h.

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