CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::SubProcess Class Reference

#include <SubProcess.h>

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 doEvent (EventPrincipal const &principal)
 
void doStreamBeginLuminosityBlock (unsigned int iID, LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts)
 
void doStreamBeginRun (unsigned int iID, RunPrincipal const &principal, IOVSyncValue const &ts)
 
void doStreamEndLuminosityBlock (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 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
 
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)
 
bool shouldWeCloseOutput () const
 
 SubProcess (ParameterSet &parameterSet, ParameterSet const &topLevelParameterSet, boost::shared_ptr< ProductRegistry const > parentProductRegistry, boost::shared_ptr< BranchIDListHelper const > parentBranchIDListHelper, eventsetup::EventSetupsController &esController, ActivityRegistry &parentActReg, ServiceToken const &token, serviceregistry::ServiceLegacy iLegacy, PreallocationConfiguration const &preallocConfig, ProcessContext const *parentProcessContext)
 
 SubProcess (SubProcess const &)=delete
 
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 ()
 

Private Member Functions

void beginJob ()
 
void beginLuminosityBlock (LuminosityBlockPrincipal const &lb, IOVSyncValue const &ts)
 
void beginRun (RunPrincipal const &r, IOVSyncValue const &ts)
 
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 process (EventPrincipal const &e)
 
void propagateProducts (BranchType type, Principal const &parentPrincipal, Principal &principal) const
 

Private Attributes

std::unique_ptr
< ExceptionToActionTable const > 
act_table_
 
boost::shared_ptr
< BranchIDListHelper
branchIDListHelper_
 
std::map< BranchID::value_type,
BranchID::value_type
droppedBranchIDToKeptBranchID_
 
boost::shared_ptr
< eventsetup::EventSetupProvider
esp_
 
std::vector< HistoryAppenderhistoryAppenders_
 
unsigned int historyLumiOffset_
 
unsigned int historyRunOffset_
 
SelectedProductsForBranchType keptProducts_
 
boost::shared_ptr
< ProductRegistry const > 
parentPreg_
 
std::map< ProcessHistoryID,
ProcessHistoryID
parentToChildPhID_
 
boost::shared_ptr
< ProductRegistry const > 
preg_
 
PrincipalCache principalCache_
 
boost::shared_ptr
< ProcessConfiguration const > 
processConfiguration_
 
ProcessContext processContext_
 
std::vector
< ProcessHistoryRegistry
processHistoryRegistries_
 
std::unique_ptr< ParameterSetprocessParameterSet_
 
ProductSelector productSelector_
 
ProductSelectorRules productSelectorRules_
 
std::auto_ptr< Scheduleschedule_
 
ParameterSetID selector_config_id_
 
detail::TriggerResultsBasedEventSelector selectors_
 
ServiceToken serviceToken_
 
std::auto_ptr< SubProcesssubProcess_
 
bool wantAllEvents_
 

Detailed Description

Definition at line 35 of file SubProcess.h.

Constructor & Destructor Documentation

edm::SubProcess::SubProcess ( ParameterSet parameterSet,
ParameterSet const &  topLevelParameterSet,
boost::shared_ptr< ProductRegistry const >  parentProductRegistry,
boost::shared_ptr< BranchIDListHelper const >  parentBranchIDListHelper,
eventsetup::EventSetupsController esController,
ActivityRegistry parentActReg,
ServiceToken const &  token,
serviceregistry::ServiceLegacy  iLegacy,
PreallocationConfiguration const &  preallocConfig,
ProcessContext const *  parentProcessContext 
)

Definition at line 35 of file SubProcess.cc.

References act_table_, branchIDListHelper_, edm::detail::configureEventSelector(), edm::ActivityRegistry::connectToSubProcess(), esp_, edm::ParameterSet::exists(), edm::getAllTriggerNames(), edm::ParameterSet::getUntrackedParameterSet(), historyAppenders_, historyRunOffset_, cmsHarvester::index, edm::PrincipalCache::insert(), edm::eventsetup::EventSetupsController::makeProvider(), LaserTracksInput_cfi::maxEvents, edm::PreallocationConfiguration::numberOfStreams(), cmsPerfStripChart::operate(), edm::ParameterSet::popParameterSet(), edm::popSubProcessParameterSet(), 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(), edm::IllegalParameters::setThrowAnException(), AlCaHLTBitMon_QueryRunRegistry::string, subProcess_, updateBranchIDListHelper(), and wantAllEvents_.

44  :
45  serviceToken_(),
46  parentPreg_(parentProductRegistry),
47  preg_(),
49  act_table_(),
51  historyLumiOffset_(preallocConfig.numberOfStreams()),
52  historyRunOffset_(historyLumiOffset_+preallocConfig.numberOfLuminosityBlocks()),
53  processHistoryRegistries_(historyRunOffset_+ preallocConfig.numberOfRuns()),
54  historyAppenders_(historyRunOffset_+preallocConfig.numberOfRuns()),
56  esp_(),
57  schedule_(),
59  subProcess_(),
61  productSelectorRules_(parameterSet, "outputCommands", "OutputModule"),
63  wantAllEvents_(true) {
64 
65  //Setup the event selection
67 
68  ParameterSet selectevents =
69  parameterSet.getUntrackedParameterSet("SelectEvents", ParameterSet());
70 
71  selectevents.registerIt(); // Just in case this PSet is not registered
73  tns->getProcessName(),
75  selectors_);
76  std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
78  "",
79  outputModulePathPositions,
80  parentProductRegistry->anyProductProduced());
81  selectProducts(*parentProductRegistry);
82 
83  std::string const maxEvents("maxEvents");
84  std::string const maxLumis("maxLuminosityBlocks");
85 
86  processParameterSet_.reset(parameterSet.popParameterSet(std::string("process")).release());
87 
88  // if this process has a maxEvents or maxLuminosityBlocks parameter set, remove them.
89  if(processParameterSet_->exists(maxEvents)) {
90  processParameterSet_->popParameterSet(maxEvents);
91  }
92  if(processParameterSet_->exists(maxLumis)) {
93  processParameterSet_->popParameterSet(maxLumis);
94  }
95 
96  // if the top level process has a maxEvents or maxLuminosityBlocks parameter set, add them to this process.
97  if(topLevelParameterSet.exists(maxEvents)) {
98  processParameterSet_->addUntrackedParameter<ParameterSet>(maxEvents, topLevelParameterSet.getUntrackedParameterSet(maxEvents));
99  }
100  if(topLevelParameterSet.exists(maxLumis)) {
101  processParameterSet_->addUntrackedParameter<ParameterSet>(maxLumis, topLevelParameterSet.getUntrackedParameterSet(maxLumis));
102  }
103 
104  // If this process has a subprocess, pop the subprocess parameter set out of the process parameter set
105 
106  boost::shared_ptr<ParameterSet> subProcessParameterSet(popSubProcessParameterSet(*processParameterSet_).release());
107 
108  ScheduleItems items(*parentProductRegistry, *this);
109 
110  ParameterSet const& optionsPset(processParameterSet_->getUntrackedParameterSet("options", ParameterSet()));
111  IllegalParameters::setThrowAnException(optionsPset.getUntrackedParameter<bool>("throwIfIllegalParameter", true));
112 
113  //initialize the services
114  ServiceToken iToken;
115 
116  // get any configured services.
117  std::auto_ptr<std::vector<ParameterSet> > serviceSets = processParameterSet_->popVParameterSet(std::string("services"));
118 
119  ServiceToken newToken = items.initServices(*serviceSets, *processParameterSet_, token, iLegacy, false);
120  parentActReg.connectToSubProcess(*items.actReg_);
121  serviceToken_ = items.addCPRandTNS(*processParameterSet_, newToken);
122 
123 
124  //make the services available
126 
127  // intialize miscellaneous items
128  items.initMisc(*processParameterSet_);
129 
130  // intialize the event setup provider
131  esp_ = esController.makeProvider(*processParameterSet_);
132 
133  branchIDListHelper_ = items.branchIDListHelper_;
134  updateBranchIDListHelper(parentBranchIDListHelper->branchIDLists());
135 
136  // intialize the Schedule
137  schedule_ = items.initSchedule(*processParameterSet_,subProcessParameterSet.get(),preallocConfig,&processContext_);
138 
139  // set the items
140  act_table_ = std::move(items.act_table_);
141  preg_.reset(items.preg_.release());
142  //CMS-THREADING this only works since Run/Lumis are synchronous so when principalCache asks for
143  // the reducedProcessHistoryID from a full ProcessHistoryID that registry will not be in use by
144  // another thread. We really need to change how this is done in the PrincipalCache.
146 
147 
148  processConfiguration_ = items.processConfiguration_;
150  processContext_.setParentProcessContext(parentProcessContext);
151 
153  for(unsigned int index = 0; index < preallocConfig.numberOfStreams(); ++index) {
154  boost::shared_ptr<EventPrincipal> ep(new EventPrincipal(preg_,
158  index));
159  ep->preModuleDelayedGetSignal_.connect(std::cref(items.actReg_->preModuleEventDelayedGetSignal_));
160  ep->postModuleDelayedGetSignal_.connect(std::cref(items.actReg_->postModuleEventDelayedGetSignal_));
162  }
163  if(subProcessParameterSet) {
164  subProcess_.reset(new SubProcess(*subProcessParameterSet,
165  topLevelParameterSet,
166  preg_,
168  esController,
169  *items.actReg_,
170  newToken,
171  iLegacy,
172  preallocConfig,
173  &processContext_));
174  }
175  }
unsigned int historyRunOffset_
Definition: SubProcess.h:232
unsigned int historyLumiOffset_
Definition: SubProcess.h:231
ParameterSetID selector_config_id_
Definition: SubProcess.h:253
boost::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:223
void setNumberOfConcurrentPrincipals(PreallocationConfiguration const &)
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:233
std::auto_ptr< ParameterSet > popSubProcessParameterSet(ParameterSet &parameterSet)
Definition: SubProcess.cc:550
boost::shared_ptr< eventsetup::EventSetupProvider > esp_
Definition: SubProcess.h:236
void updateBranchIDListHelper(BranchIDLists const &)
Definition: SubProcess.cc:533
void insert(boost::shared_ptr< RunPrincipal > rp)
void setParentProcessContext(ProcessContext const *parentProcessContext)
void selectProducts(ProductRegistry const &preg)
Definition: SubProcess.cc:212
ServiceToken serviceToken_
Definition: SubProcess.h:222
static void setThrowAnException(bool v)
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:247
SubProcess(ParameterSet &parameterSet, ParameterSet const &topLevelParameterSet, boost::shared_ptr< ProductRegistry const > parentProductRegistry, boost::shared_ptr< BranchIDListHelper const > parentBranchIDListHelper, eventsetup::EventSetupsController &esController, ActivityRegistry &parentActReg, ServiceToken const &token, serviceregistry::ServiceLegacy iLegacy, PreallocationConfiguration const &preallocConfig, ProcessContext const *parentProcessContext)
Definition: SubProcess.cc:35
void setProcessConfiguration(ProcessConfiguration const *processConfiguration)
std::unique_ptr< ExceptionToActionTable const > act_table_
Definition: SubProcess.h:226
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
ProductSelector productSelector_
Definition: SubProcess.h:248
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:254
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:238
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: SubProcess.h:225
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:234
std::unique_ptr< ParameterSet > processParameterSet_
Definition: SubProcess.h:240
std::vector< std::string > const & getAllTriggerNames()
ProcessContext processContext_
Definition: SubProcess.h:228
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::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
boost::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:227
boost::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:224
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector)
PrincipalCache principalCache_
Definition: SubProcess.h:235
edm::SubProcess::~SubProcess ( )
virtual

Definition at line 177 of file SubProcess.cc.

177 {}
edm::SubProcess::SubProcess ( SubProcess const &  )
delete

Member Function Documentation

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

Definition at line 191 of file SubProcess.cc.

References droppedBranchIDToKeptBranchID(), relativeConstraints::empty, fixBranchIDListsForEDAliases(), cmsPerfStripChart::operate(), preg_, schedule_, serviceToken_, and subProcess_.

Referenced by doBeginJob().

191  {
194  }
196  schedule_->beginJob(*preg_);
197  if(subProcess_.get()) subProcess_->doBeginJob();
198  }
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:217
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
void fixBranchIDListsForEDAliases(std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: SubProcess.cc:267
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
boost::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:224
void edm::SubProcess::beginLuminosityBlock ( LuminosityBlockPrincipal const &  lb,
IOVSyncValue const &  ts 
)
private

Definition at line 395 of file SubProcess.cc.

References printConversionInfo::aux, edm::LuminosityBlockPrincipal::aux(), edm::LuminosityBlockPrincipal::index(), edm::InLumi, edm::Principal::processHistory(), edm::Principal::processHistoryID(), and edm::Principal::reader().

395  {
396  boost::shared_ptr<LuminosityBlockAuxiliary> aux(new LuminosityBlockAuxiliary(principal.aux()));
397  aux->setProcessHistoryID(principal.processHistoryID());
398  boost::shared_ptr<LuminosityBlockPrincipal> lbpp(new LuminosityBlockPrincipal(aux, preg_, *processConfiguration_, &(historyAppenders_[historyLumiOffset_+principal.index()]),principal.index()));
399  auto & processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_+principal.index()];
400  processHistoryRegistry.registerProcessHistory(principal.processHistory());
401  lbpp->fillLuminosityBlockPrincipal(processHistoryRegistry, principal.reader());
402  lbpp->setRunPrincipal(principalCache_.runPrincipalPtr());
403  principalCache_.insert(lbpp);
404  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
406  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalBegin> Traits;
407  schedule_->processOneGlobal<Traits>(lbp, esp_->eventSetupForInstance(ts));
408  if(subProcess_.get()) subProcess_->doBeginLuminosityBlock(lbp, ts);
409  }
unsigned int historyLumiOffset_
Definition: SubProcess.h:231
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:233
boost::shared_ptr< eventsetup::EventSetupProvider > esp_
Definition: SubProcess.h:236
void insert(boost::shared_ptr< RunPrincipal > rp)
boost::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
boost::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:234
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:503
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
boost::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:227
boost::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:224
PrincipalCache principalCache_
Definition: SubProcess.h:235
void edm::SubProcess::beginRun ( RunPrincipal const &  r,
IOVSyncValue const &  ts 
)
private

Definition at line 335 of file SubProcess.cc.

References printConversionInfo::aux, edm::RunPrincipal::aux(), edm::RunPrincipal::index(), edm::InRun, edm::Principal::processHistory(), edm::Principal::processHistoryID(), edm::Principal::reader(), and edm::RunPrincipal::reducedProcessHistoryID().

335  {
336  boost::shared_ptr<RunAuxiliary> aux(new RunAuxiliary(principal.aux()));
337  aux->setProcessHistoryID(principal.processHistoryID());
338  boost::shared_ptr<RunPrincipal> rpp(new RunPrincipal(aux, preg_, *processConfiguration_, &(historyAppenders_[historyRunOffset_+principal.index()]),principal.index()));
339  auto & processHistoryRegistry = processHistoryRegistries_[historyRunOffset_+principal.index()];
340  processHistoryRegistry.registerProcessHistory(principal.processHistory());
341  rpp->fillRunPrincipal(processHistoryRegistry, principal.reader());
342  principalCache_.insert(rpp);
343 
344  ProcessHistoryID const& parentInputReducedPHID = principal.reducedProcessHistoryID();
345  ProcessHistoryID const& inputReducedPHID = rpp->reducedProcessHistoryID();
346 
347  parentToChildPhID_.insert(std::make_pair(parentInputReducedPHID,inputReducedPHID));
348 
349  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
351  typedef OccurrenceTraits<RunPrincipal, BranchActionGlobalBegin> Traits;
352  schedule_->processOneGlobal<Traits>(rp, esp_->eventSetupForInstance(ts));
353  if(subProcess_.get()) subProcess_->doBeginRun(rp, ts);
354  }
unsigned int historyRunOffset_
Definition: SubProcess.h:232
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:233
boost::shared_ptr< eventsetup::EventSetupProvider > esp_
Definition: SubProcess.h:236
void insert(boost::shared_ptr< RunPrincipal > rp)
boost::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
Hash< ProcessHistoryType > ProcessHistoryID
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:238
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:234
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:503
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
boost::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:227
boost::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:224
PrincipalCache principalCache_
Definition: SubProcess.h:235
void edm::SubProcess::clearCounters ( )
inline

Clear all the counters in the trigger report.

Definition at line 199 of file SubProcess.h.

References cmsPerfStripChart::operate(), schedule_, serviceToken_, and subProcess_.

199  {
201  schedule_->clearCounters();
202  if(subProcess_.get()) subProcess_->clearCounters();
203  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::closeOutputFiles ( )
inline

Definition at line 93 of file SubProcess.h.

References cmsPerfStripChart::operate(), schedule_, serviceToken_, and subProcess_.

93  {
95  schedule_->closeOutputFiles();
96  if(subProcess_.get()) subProcess_->closeOutputFiles();
97  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::deleteLumiFromCache ( ProcessHistoryID const &  parentPhID,
int  runNumber,
int  lumiNumber 
)

Definition at line 436 of file SubProcess.cc.

436  {
437  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
438  assert(it != parentToChildPhID_.end());
439  principalCache_.deleteLumi(it->second, runNumber, lumiNumber);
440  if(subProcess_.get()) subProcess_->deleteLumiFromCache(it->second, runNumber, lumiNumber);
441  }
void deleteLumi(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi)
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:238
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
PrincipalCache principalCache_
Definition: SubProcess.h:235
void edm::SubProcess::deleteRunFromCache ( ProcessHistoryID const &  parentPhID,
int  runNumber 
)

Definition at line 381 of file SubProcess.cc.

381  {
382  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
383  assert(it != parentToChildPhID_.end());
384  principalCache_.deleteRun(it->second, runNumber);
385  if(subProcess_.get()) subProcess_->deleteRunFromCache(it->second, runNumber);
386  }
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:238
void deleteRun(ProcessHistoryID const &phid, RunNumber_t run)
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
PrincipalCache principalCache_
Definition: SubProcess.h:235
void edm::SubProcess::doBeginJob ( )

Definition at line 180 of file SubProcess.cc.

References beginJob().

180  {
181  this->beginJob();
182  }
void edm::SubProcess::doBeginLuminosityBlock ( LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 389 of file SubProcess.cc.

References cmsPerfStripChart::operate().

389  {
392  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
void beginLuminosityBlock(LuminosityBlockPrincipal const &lb, IOVSyncValue const &ts)
Definition: SubProcess.cc:395
void edm::SubProcess::doBeginRun ( RunPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 329 of file SubProcess.cc.

References cmsPerfStripChart::operate().

329  {
331  beginRun(principal,ts);
332  }
void beginRun(RunPrincipal const &r, IOVSyncValue const &ts)
Definition: SubProcess.cc:335
ServiceToken serviceToken_
Definition: SubProcess.h:222
void edm::SubProcess::doBeginStream ( unsigned int  iID)

Definition at line 444 of file SubProcess.cc.

References cmsPerfStripChart::operate().

444  {
446  schedule_->beginStream(iID);
447  if(subProcess_.get()) subProcess_->doBeginStream(iID);
448  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::doEndJob ( )

Definition at line 185 of file SubProcess.cc.

References endJob().

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

185  {
186  endJob();
187  }
void edm::SubProcess::doEndLuminosityBlock ( LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 412 of file SubProcess.cc.

References cmsPerfStripChart::operate().

412  {
414  endLuminosityBlock(principal,ts,cleaningUpAfterException);
415  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
void endLuminosityBlock(LuminosityBlockPrincipal const &lb, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:418
void edm::SubProcess::doEndRun ( RunPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 357 of file SubProcess.cc.

References cmsPerfStripChart::operate().

357  {
359  endRun(principal,ts,cleaningUpAfterException);
360  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
void endRun(RunPrincipal const &r, IOVSyncValue const &ts, bool cleaningUpAfterException)
Definition: SubProcess.cc:363
void edm::SubProcess::doEndStream ( unsigned int  iID)

Definition at line 451 of file SubProcess.cc.

References cmsPerfStripChart::operate().

451  {
453  schedule_->endStream(iID);
454  if(subProcess_.get()) subProcess_->doEndStream(iID);
455  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::doEvent ( EventPrincipal const &  principal)

Definition at line 282 of file SubProcess.cc.

References cmsPerfStripChart::operate(), and LaserDQM_cfg::process.

282  {
284  /* BEGIN relevant bits from OutputModule::doEvent */
285  detail::TRBESSentry products_sentry(selectors_);
286 
287 
288  if(!wantAllEvents_) {
289  // use module description and const_cast unless interface to
290  // event is changed to just take a const EventPrincipal
291  if(!selectors_.wantEvent(ep, nullptr)) {
292  return;
293  }
294  }
295  process(ep);
296  /* END relevant bits from OutputModule::doEvent */
297  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
void process(EventPrincipal const &e)
Definition: SubProcess.cc:300
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:254
bool wantEvent(EventPrincipal const &e, ModuleCallingContext const *)
void edm::SubProcess::doStreamBeginLuminosityBlock ( unsigned int  iID,
LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 480 of file SubProcess.cc.

References cmsPerfStripChart::operate().

480  {
482  {
483  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
484  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamBegin> Traits;
485  schedule_->processOneStream<Traits>(id,lbp, esp_->eventSetupForInstance(ts));
486  if(subProcess_.get()) subProcess_->doStreamBeginLuminosityBlock(id,lbp, ts);
487  }
488  }
boost::shared_ptr< eventsetup::EventSetupProvider > esp_
Definition: SubProcess.h:236
ServiceToken serviceToken_
Definition: SubProcess.h:222
boost::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
PrincipalCache principalCache_
Definition: SubProcess.h:235
void edm::SubProcess::doStreamBeginRun ( unsigned int  iID,
RunPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 458 of file SubProcess.cc.

References cmsPerfStripChart::operate().

458  {
460  {
461  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
462  typedef OccurrenceTraits<RunPrincipal, BranchActionStreamBegin> Traits;
463  schedule_->processOneStream<Traits>(id,rp, esp_->eventSetupForInstance(ts));
464  if(subProcess_.get()) subProcess_->doStreamBeginRun(id,rp, ts);
465  }
466  }
boost::shared_ptr< eventsetup::EventSetupProvider > esp_
Definition: SubProcess.h:236
boost::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
PrincipalCache principalCache_
Definition: SubProcess.h:235
void edm::SubProcess::doStreamEndLuminosityBlock ( unsigned int  iID,
LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 491 of file SubProcess.cc.

References cmsPerfStripChart::operate().

491  {
493  {
494  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
495  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionStreamEnd> Traits;
496  schedule_->processOneStream<Traits>(id,lbp, esp_->eventSetupForInstance(ts),cleaningUpAfterException);
497  if(subProcess_.get()) subProcess_->doStreamEndLuminosityBlock(id,lbp, ts,cleaningUpAfterException);
498  }
499  }
boost::shared_ptr< eventsetup::EventSetupProvider > esp_
Definition: SubProcess.h:236
ServiceToken serviceToken_
Definition: SubProcess.h:222
boost::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
PrincipalCache principalCache_
Definition: SubProcess.h:235
void edm::SubProcess::doStreamEndRun ( unsigned int  iID,
RunPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 469 of file SubProcess.cc.

References cmsPerfStripChart::operate().

469  {
471  {
472  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
473  typedef OccurrenceTraits<RunPrincipal, BranchActionStreamEnd> Traits;
474  schedule_->processOneStream<Traits>(id,rp, esp_->eventSetupForInstance(ts),cleaningUpAfterException);
475  if(subProcess_.get()) subProcess_->doStreamEndRun(id,rp, ts,cleaningUpAfterException);
476  }
477  }
boost::shared_ptr< eventsetup::EventSetupProvider > esp_
Definition: SubProcess.h:236
boost::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
PrincipalCache principalCache_
Definition: SubProcess.h:235
std::map<BranchID::value_type, BranchID::value_type> const& edm::SubProcess::droppedBranchIDToKeptBranchID ( )
inlineprivate

Definition at line 217 of file SubProcess.h.

References droppedBranchIDToKeptBranchID_.

Referenced by beginJob().

217  {
219  }
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:258
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 172 of file SubProcess.h.

References cmsPerfStripChart::operate(), schedule_, serviceToken_, and subProcess_.

172  {
174  schedule_->enableEndPaths(active);
175  if(subProcess_.get()) subProcess_->enableEndPaths(active);
176  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::endJob ( void  )
private

Definition at line 201 of file SubProcess.cc.

References trackerHits::c, edm::ExceptionCollector::call(), cmsPerfStripChart::operate(), schedule_, serviceToken_, and subProcess_.

Referenced by doEndJob().

201  {
203  ExceptionCollector c("Multiple exceptions were thrown while executing endJob. An exception message follows for each.");
204  schedule_->endJob(c);
205  if(subProcess_.get()) c.call([this](){ this->subProcess_->doEndJob();});
206  if(c.hasThrown()) {
207  c.rethrow();
208  }
209  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::endLuminosityBlock ( LuminosityBlockPrincipal const &  lb,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)
private

Definition at line 418 of file SubProcess.cc.

References edm::InLumi.

418  {
419  LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
421  typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionGlobalEnd> Traits;
422  schedule_->processOneGlobal<Traits>(lbp, esp_->eventSetupForInstance(ts), cleaningUpAfterException);
423  if(subProcess_.get()) subProcess_->doEndLuminosityBlock(lbp, ts, cleaningUpAfterException);
424  }
boost::shared_ptr< eventsetup::EventSetupProvider > esp_
Definition: SubProcess.h:236
boost::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:503
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
PrincipalCache principalCache_
Definition: SubProcess.h:235
bool edm::SubProcess::endPathsEnabled ( ) const
inline

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

Definition at line 179 of file SubProcess.h.

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

179  {
181  return schedule_->endPathsEnabled();
182  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
void edm::SubProcess::endRun ( RunPrincipal const &  r,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)
private

Definition at line 363 of file SubProcess.cc.

References edm::InRun.

363  {
364  RunPrincipal& rp = *principalCache_.runPrincipalPtr();
366  typedef OccurrenceTraits<RunPrincipal, BranchActionGlobalEnd> Traits;
367  schedule_->processOneGlobal<Traits>(rp, esp_->eventSetupForInstance(ts), cleaningUpAfterException);
368  if(subProcess_.get()) subProcess_->doEndRun(rp, ts, cleaningUpAfterException);
369  }
boost::shared_ptr< eventsetup::EventSetupProvider > esp_
Definition: SubProcess.h:236
boost::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:503
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
PrincipalCache principalCache_
Definition: SubProcess.h:235
void edm::SubProcess::fixBranchIDListsForEDAliases ( std::map< BranchID::value_type, BranchID::value_type > const &  droppedBranchIDToKeptBranchID)
private

Definition at line 267 of file SubProcess.cc.

References getDQMSummary::iter.

Referenced by beginJob().

267  {
268  // Check for branches dropped while an EDAlias was kept.
269  // Replace BranchID of each dropped branch with that of the kept alias.
270  for(BranchIDList& branchIDList : branchIDListHelper_->mutableBranchIDLists()) {
271  for(BranchID::value_type& branchID : branchIDList) {
272  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter = droppedBranchIDToKeptBranchID.find(branchID);
273  if(iter != droppedBranchIDToKeptBranchID.end()) {
274  branchID = iter->second;
275  }
276  }
277  }
278  if(subProcess_.get()) subProcess_->fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID);
279  }
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:217
unsigned int value_type
Definition: BranchID.h:16
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: SubProcess.h:225
std::vector< BranchID::value_type > BranchIDList
Definition: BranchIDList.h:18
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
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 186 of file SubProcess.h.

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

186  {
188  schedule_->getTriggerReport(rep);
189  }
string rep
Definition: cuy.py:1188
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
SelectedProductsForBranchType const& edm::SubProcess::keptProducts ( ) const
inline

Definition at line 55 of file SubProcess.h.

References keptProducts_.

Referenced by edm::ScheduleItems::ScheduleItems().

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

Definition at line 100 of file SubProcess.h.

References cmsPerfStripChart::operate(), schedule_, serviceToken_, and subProcess_.

100  {
102  schedule_->openNewOutputFilesIfNeeded();
103  if(subProcess_.get()) subProcess_->openNewOutputFilesIfNeeded();
104  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::openOutputFiles ( FileBlock fb)
inline

Definition at line 107 of file SubProcess.h.

References cmsPerfStripChart::operate(), schedule_, serviceToken_, and subProcess_.

107  {
109  schedule_->openOutputFiles(fb);
110  if(subProcess_.get()) subProcess_->openOutputFiles(fb);
111  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
SubProcess& edm::SubProcess::operator= ( SubProcess const &  )
delete
void edm::SubProcess::postForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
)
inline

Definition at line 137 of file SubProcess.h.

References cmsPerfStripChart::operate(), schedule_, serviceToken_, and subProcess_.

137  {
139  schedule_->postForkReacquireResources(iChildIndex, iNumberOfChildren);
140  if(subProcess_.get()) subProcess_->postForkReacquireResources(iChildIndex, iNumberOfChildren);
141  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::preForkReleaseResources ( )
inline

Definition at line 131 of file SubProcess.h.

References cmsPerfStripChart::operate(), schedule_, serviceToken_, and subProcess_.

131  {
133  schedule_->preForkReleaseResources();
134  if(subProcess_.get()) subProcess_->preForkReleaseResources();
135  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::process ( EventPrincipal const &  e)
private

Definition at line 300 of file SubProcess.cc.

References edm::ProductRegistry::anyProductProduced(), printConversionInfo::aux, edm::EventPrincipal::aux(), edm::EventPrincipal::branchListIndexes(), edm::EventPrincipal::clearEventPrincipal(), edm::EventPrincipal::eventSelectionIDs(), edm::EventPrincipal::fillEventPrincipal(), edm::InEvent, edm::Principal::processHistory(), edm::Principal::processHistoryID(), edm::EventPrincipal::productProvenanceRetrieverPtr(), edm::Principal::productRegistry(), edm::Principal::reader(), edm::EventPrincipal::setLuminosityBlockPrincipal(), edm::EventPrincipal::streamID(), and edm::StreamID::value().

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::dumpPython(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::outputEventContent(), ConfigBuilder.ConfigBuilder::prepare_FASTSIM(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), ConfigBuilder.ConfigBuilder::scheduleSequence(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProperty().

300  {
301  EventAuxiliary aux(principal.aux());
302  aux.setProcessHistoryID(principal.processHistoryID());
303 
304  EventSelectionIDVector esids{principal.eventSelectionIDs()};
305  if (principal.productRegistry().anyProductProduced() || !wantAllEvents_) {
306  esids.push_back(selector_config_id_);
307  }
308 
309  EventPrincipal& ep = principalCache_.eventPrincipal(principal.streamID().value());
310  auto & processHistoryRegistry = processHistoryRegistries_[principal.streamID().value()];
311  processHistoryRegistry.registerProcessHistory(principal.processHistory());
312  BranchListIndexes bli(principal.branchListIndexes());
313  branchIDListHelper_->fixBranchListIndexes(bli);
314  ep.fillEventPrincipal(aux,
315  processHistoryRegistry,
316  std::move(esids),
317  std::move(bli),
318  *(principal.productProvenanceRetrieverPtr()),//NOTE: this transfers the per product provenance
319  principal.reader());
320  ep.setLuminosityBlockPrincipal(principalCache_.lumiPrincipalPtr());
322  typedef OccurrenceTraits<EventPrincipal, BranchActionStreamBegin> Traits;
323  schedule_->processOneEvent<Traits>(ep.streamID().value(),ep, esp_->eventSetup());
324  if(subProcess_.get()) subProcess_->doEvent(ep);
325  ep.clearEventPrincipal();
326  }
ParameterSetID selector_config_id_
Definition: SubProcess.h:253
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:233
boost::shared_ptr< eventsetup::EventSetupProvider > esp_
Definition: SubProcess.h:236
std::vector< EventSelectionID > EventSelectionIDVector
std::vector< BranchListIndex > BranchListIndexes
boost::shared_ptr< LuminosityBlockPrincipal > const & lumiPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: SubProcess.h:225
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:503
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
PrincipalCache principalCache_
Definition: SubProcess.h:235
void edm::SubProcess::propagateProducts ( BranchType  type,
Principal const &  parentPrincipal,
Principal principal 
) const
private

Definition at line 503 of file SubProcess.cc.

References edm::Principal::getProductHolder(), edm::Provenance::processHistory(), edm::ProductHolderBase::productData(), edm::Provenance::productID(), edm::Provenance::productProvenance(), edm::Provenance::productProvenanceValid(), edm::ProductHolderBase::productUnavailable(), edm::ProductData::prov_, edm::Provenance::resetProductProvenance(), edm::Provenance::setProcessHistory(), edm::Provenance::setProductID(), edm::Provenance::setProductProvenance(), edm::Provenance::setStore(), edm::Provenance::store(), and edm::ProductData::wrapper_.

503  {
504  SelectedProducts const& keptVector = keptProducts()[type];
505  for(auto const& item : keptVector) {
506  ProductHolderBase const* parentProductHolder = parentPrincipal.getProductHolder(item->branchID());
507  if(parentProductHolder != nullptr) {
508  ProductData const& parentData = parentProductHolder->productData();
509  ProductHolderBase const* productHolder = principal.getProductHolder(item->branchID());
510  if(productHolder != nullptr) {
511  ProductData& thisData = const_cast<ProductData&>(productHolder->productData());
512  //Propagate the per event(run)(lumi) data for this product to the subprocess.
513  //First, the product itself.
514  thisData.wrapper_ = parentData.wrapper_;
515  // Then the product ID and the ProcessHistory
516  thisData.prov_.setProductID(parentData.prov_.productID());
517  thisData.prov_.setProcessHistory(parentData.prov_.processHistory());
518  // Then the store, in case the product needs reading in a subprocess.
519  thisData.prov_.setStore(parentData.prov_.store());
520  // And last, the other per event provenance.
521  if(parentData.prov_.productProvenanceValid()) {
522  thisData.prov_.setProductProvenance(*parentData.prov_.productProvenance());
523  } else {
524  thisData.prov_.resetProductProvenance();
525  }
526  // Sets unavailable flag, if known that product is not available
527  (void)productHolder->productUnavailable();
528  }
529  }
530  }
531  }
type
Definition: HCALResponse.h:21
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:55
std::vector< BranchDescription const * > SelectedProducts
void edm::SubProcess::respondToCloseInputFile ( FileBlock const &  fb)
inline

Definition at line 119 of file SubProcess.h.

References cmsPerfStripChart::operate(), schedule_, serviceToken_, and subProcess_.

119  {
121  schedule_->respondToCloseInputFile(fb);
122  if(subProcess_.get()) subProcess_->respondToCloseInputFile(fb);
123  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::respondToOpenInputFile ( FileBlock const &  fb)

Definition at line 542 of file SubProcess.cc.

References cmsPerfStripChart::operate().

542  {
544  schedule_->respondToOpenInputFile(fb);
545  if(subProcess_.get()) subProcess_->respondToOpenInputFile(fb);
546  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::selectProducts ( ProductRegistry const &  preg)

Definition at line 212 of file SubProcess.cc.

References edm::ProductRegistry::allBranchDescriptions(), edm::BranchDescription::branchID(), edm::BranchDescription::branchType(), edm::errors::Configuration, edm::hlt::Exception, edm::BranchID::id(), edm::BranchDescription::isAlias(), getDQMSummary::iter, edm::BranchDescription::originalBranchID(), edm::BranchDescription::present(), edm::BranchDescription::produced(), edm::ProductRegistry::productList(), and edm::BranchDescription::transient().

Referenced by SubProcess().

212  {
213  if(productSelector_.initialized()) return;
214  productSelector_.initialize(productSelectorRules_, preg.allBranchDescriptions());
215 
216  // TODO: See if we can collapse keptProducts_ and productSelector_ into a
217  // single object. See the notes in the header for ProductSelector
218  // for more information.
219 
220  std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
221 
222  for(auto const& it : preg.productList()) {
223  BranchDescription const& desc = it.second;
224  if(desc.transient()) {
225  // if the class of the branch is marked transient, output nothing
226  } else if(!desc.present() && !desc.produced()) {
227  // else if the branch containing the product has been previously dropped,
228  // output nothing
229  } else if(productSelector_.selected(desc)) {
230  // else if the branch has been selected, put it in the list of selected branches.
231  if(desc.produced()) {
232  // First we check if an equivalent branch has already been selected due to an EDAlias.
233  // We only need the check for products produced in this process.
234  BranchID const& trueBranchID = desc.originalBranchID();
235  std::map<BranchID, BranchDescription const*>::const_iterator iter = trueBranchIDToKeptBranchDesc.find(trueBranchID);
236  if(iter != trueBranchIDToKeptBranchDesc.end()) {
237  throw edm::Exception(errors::Configuration, "Duplicate Output Selection")
238  << "Two (or more) equivalent branches have been selected for output.\n"
239  << "#1: " << BranchKey(desc) << "\n"
240  << "#2: " << BranchKey(*iter->second) << "\n"
241  << "Please drop at least one of them.\n";
242  }
243  trueBranchIDToKeptBranchDesc.insert(std::make_pair(trueBranchID, &desc));
244  }
245  // Now put it in the list of selected branches.
246  keptProducts_[desc.branchType()].push_back(&desc);
247  }
248  }
249  // Now fill in a mapping needed in the case that a branch was dropped while its EDAlias was kept.
250  for(auto const& it : preg.productList()) {
251  BranchDescription const& desc = it.second;
252  if(!desc.produced() || desc.isAlias()) continue;
253  BranchID const& branchID = desc.branchID();
254  std::map<BranchID, BranchDescription const*>::const_iterator iter = trueBranchIDToKeptBranchDesc.find(branchID);
255  if(iter != trueBranchIDToKeptBranchDesc.end()) {
256  // This branch, produced in this process, or an alias of it, was persisted.
257  BranchID const& keptBranchID = iter->second->branchID();
258  if(keptBranchID != branchID) {
259  // An EDAlias branch was persisted.
260  droppedBranchIDToKeptBranchID_.insert(std::make_pair(branchID.id(), keptBranchID.id()));
261  }
262  }
263  }
264  }
bool selected(BranchDescription const &desc) const
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:246
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:247
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:258
ProductSelector productSelector_
Definition: SubProcess.h:248
bool initialized() const
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
preg
Definition: Schedule.cc:369
bool edm::SubProcess::shouldWeCloseOutput ( ) const
inline

Definition at line 126 of file SubProcess.h.

References cmsPerfStripChart::operate(), schedule_, serviceToken_, and subProcess_.

126  {
128  return schedule_->shouldWeCloseOutput() || (subProcess_.get() ? subProcess_->shouldWeCloseOutput() : false);
129  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
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 193 of file SubProcess.h.

References cmsPerfStripChart::operate(), schedule_, serviceToken_, and subProcess_.

193  {
195  return subProcess_.get() ? subProcess_->terminate() : schedule_->terminate();
196  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
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 153 of file SubProcess.h.

References schedule_.

153  {
154  return schedule_->totalEvents();
155  }
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
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 165 of file SubProcess.h.

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

165  {
167  return schedule_->totalEventsFailed();
168  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
int edm::SubProcess::totalEventsPassed ( ) const
inline

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

Definition at line 158 of file SubProcess.h.

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

158  {
160  return schedule_->totalEventsPassed();
161  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
void edm::SubProcess::updateBranchIDListHelper ( BranchIDLists const &  branchIDLists)

Definition at line 533 of file SubProcess.cc.

Referenced by SubProcess().

533  {
534  branchIDListHelper_->updateFromParent(branchIDLists);
535  if(subProcess_.get()) {
536  subProcess_->updateBranchIDListHelper(branchIDListHelper_->branchIDLists());
537  }
538  }
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: SubProcess.h:225
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
void edm::SubProcess::writeLumi ( ProcessHistoryID const &  parentPhID,
int  runNumber,
int  lumiNumber 
)

Definition at line 427 of file SubProcess.cc.

References cmsPerfStripChart::operate().

427  {
429  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
430  assert(it != parentToChildPhID_.end());
431  schedule_->writeLumi(principalCache_.lumiPrincipal(it->second, runNumber, lumiNumber), &processContext_);
432  if(subProcess_.get()) subProcess_->writeLumi(it->second, runNumber, lumiNumber);
433  }
LuminosityBlockPrincipal & lumiPrincipal(ProcessHistoryID const &phid, RunNumber_t run, LuminosityBlockNumber_t lumi) const
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:238
ProcessContext processContext_
Definition: SubProcess.h:228
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
PrincipalCache principalCache_
Definition: SubProcess.h:235
void edm::SubProcess::writeRun ( ProcessHistoryID const &  parentPhID,
int  runNumber 
)

Definition at line 372 of file SubProcess.cc.

References cmsPerfStripChart::operate().

372  {
374  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
375  assert(it != parentToChildPhID_.end());
377  if(subProcess_.get()) subProcess_->writeRun(it->second, runNumber);
378  }
ServiceToken serviceToken_
Definition: SubProcess.h:222
std::auto_ptr< Schedule > schedule_
Definition: SubProcess.h:237
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:238
ProcessContext processContext_
Definition: SubProcess.h:228
std::auto_ptr< SubProcess > subProcess_
Definition: SubProcess.h:239
PrincipalCache principalCache_
Definition: SubProcess.h:235
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 226 of file SubProcess.h.

Referenced by SubProcess().

boost::shared_ptr<BranchIDListHelper> edm::SubProcess::branchIDListHelper_
private

Definition at line 225 of file SubProcess.h.

Referenced by SubProcess().

std::map<BranchID::value_type, BranchID::value_type> edm::SubProcess::droppedBranchIDToKeptBranchID_
private

Definition at line 258 of file SubProcess.h.

Referenced by droppedBranchIDToKeptBranchID().

boost::shared_ptr<eventsetup::EventSetupProvider> edm::SubProcess::esp_
private

Definition at line 236 of file SubProcess.h.

Referenced by SubProcess().

std::vector<HistoryAppender> edm::SubProcess::historyAppenders_
private

Definition at line 234 of file SubProcess.h.

Referenced by SubProcess().

unsigned int edm::SubProcess::historyLumiOffset_
private

Definition at line 231 of file SubProcess.h.

unsigned int edm::SubProcess::historyRunOffset_
private

Definition at line 232 of file SubProcess.h.

Referenced by SubProcess().

SelectedProductsForBranchType edm::SubProcess::keptProducts_
private

Definition at line 246 of file SubProcess.h.

Referenced by keptProducts().

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

Definition at line 223 of file SubProcess.h.

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

Definition at line 238 of file SubProcess.h.

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

Definition at line 224 of file SubProcess.h.

Referenced by beginJob(), and SubProcess().

PrincipalCache edm::SubProcess::principalCache_
private

Definition at line 235 of file SubProcess.h.

Referenced by SubProcess().

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

Definition at line 227 of file SubProcess.h.

Referenced by SubProcess().

ProcessContext edm::SubProcess::processContext_
private

Definition at line 228 of file SubProcess.h.

Referenced by SubProcess().

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

Definition at line 233 of file SubProcess.h.

Referenced by SubProcess().

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

Definition at line 240 of file SubProcess.h.

Referenced by SubProcess().

ProductSelector edm::SubProcess::productSelector_
private

Definition at line 248 of file SubProcess.h.

ProductSelectorRules edm::SubProcess::productSelectorRules_
private

Definition at line 247 of file SubProcess.h.

std::auto_ptr<Schedule> edm::SubProcess::schedule_
private
ParameterSetID edm::SubProcess::selector_config_id_
private

Definition at line 253 of file SubProcess.h.

Referenced by SubProcess().

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

Definition at line 254 of file SubProcess.h.

Referenced by SubProcess().

ServiceToken edm::SubProcess::serviceToken_
private
std::auto_ptr<SubProcess> edm::SubProcess::subProcess_
private
bool edm::SubProcess::wantAllEvents_
private

Definition at line 252 of file SubProcess.h.

Referenced by SubProcess().