CMS 3D CMS Logo

Classes | Public Member Functions | Private Member Functions | Private Attributes

edm::SubProcess Class Reference

#include <SubProcess.h>

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

List of all members.

Classes

struct  ESInfo

Public Member Functions

void clearCounters ()
 Clear all the counters in the trigger report.
void closeOutputFiles ()
void deleteLumiFromCache (ProcessHistoryID const &parentPhID, int runNumber, int lumiNumber)
void deleteRunFromCache (ProcessHistoryID const &parentPhID, int runNumber)
void doBeginLuminosityBlock (LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts)
void doBeginRun (RunPrincipal const &principal, IOVSyncValue const &ts)
void doEndLuminosityBlock (LuminosityBlockPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
void doEndRun (RunPrincipal const &principal, IOVSyncValue const &ts, bool cleaningUpAfterException)
void doEvent (EventPrincipal const &principal, IOVSyncValue const &ts)
void enableEndPaths (bool active)
bool endPathsEnabled () const
 Return true if end_paths are active, and false if they are inactive.
std::vector< ModuleDescription
const * > 
getAllModuleDescriptions () const
 Return a vector allowing const access to all the ModuleDescriptions for this SubProcess.
void getTriggerReport (TriggerReport &rep) const
void openNewOutputFilesIfNeeded ()
void openOutputFiles (FileBlock &fb)
void postForkReacquireResources (unsigned int iChildIndex, unsigned int iNumberOfChildren)
void preForkReleaseResources ()
void respondToCloseInputFile (FileBlock const &fb)
void respondToCloseOutputFiles (FileBlock const &fb)
void respondToOpenInputFile (FileBlock const &fb)
void respondToOpenOutputFiles (FileBlock const &fb)
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)
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.
void writeLumi (ProcessHistoryID const &parentPhID, int runNumber, int lumiNumber)
void writeRun (ProcessHistoryID const &parentPhID, int runNumber)
virtual ~SubProcess ()

Private Member Functions

virtual void beginJob ()
virtual void beginLuminosityBlock (LuminosityBlockPrincipal const &lb)
virtual void beginRun (RunPrincipal const &r)
virtual void endJob ()
virtual void endLuminosityBlock (LuminosityBlockPrincipal const &lb)
virtual void endRun (RunPrincipal const &r)
void fixBranchIDListsForEDAliases (std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
void propagateProducts (BranchType type, Principal const &parentPrincipal, Principal &principal) const
virtual void write (EventPrincipal const &e)
virtual void writeLuminosityBlock (LuminosityBlockPrincipal const &)
virtual void writeRun (RunPrincipal const &)

Private Attributes

std::unique_ptr< ActionTable
const > 
act_table_
boost::shared_ptr
< BranchIDListHelper
branchIDListHelper_
bool cleaningUpAfterException_
std::auto_ptr< ESInfoesInfo_
boost::shared_ptr
< eventsetup::EventSetupProvider
esp_
std::unique_ptr< HistoryAppenderhistoryAppender_
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_
std::unique_ptr< ParameterSetprocessParameterSet_
std::auto_ptr< Scheduleschedule_
ServiceToken serviceToken_
std::auto_ptr< SubProcesssubProcess_

Detailed Description

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

Definition at line 33 of file SubProcess.cc.

References act_table_, branchIDListHelper_, edm::OutputModule::configure(), edm::ActivityRegistry::connectToSubProcess(), esp_, edm::ParameterSet::exists(), edm::ParameterSet::getUntrackedParameterSet(), historyAppender_, edm::PrincipalCache::insert(), edm::eventsetup::EventSetupsController::makeProvider(), edm::OutputModule::maxEvents(), edm::ParameterSet::popParameterSet(), edm::popSubProcessParameterSet(), preg_, principalCache_, processConfiguration_, processParameterSet_, schedule_, edm::OutputModule::selectProducts(), serviceToken_, edm::OutputModule::setEventSelectionInfo(), edm::IllegalParameters::setThrowAnException(), AlCaHLTBitMon_QueryRunRegistry::string, and subProcess_.

                                                               :
      OutputModule(parameterSet),
      serviceToken_(),
      parentPreg_(parentProductRegistry),
      preg_(),
      branchIDListHelper_(),
      act_table_(),
      processConfiguration_(),
      principalCache_(),
      esp_(),
      schedule_(),
      parentToChildPhID_(),
      historyAppender_(new HistoryAppender),
      esInfo_(nullptr),
      subProcess_(),
      cleaningUpAfterException_(false),
      processParameterSet_() {

    selectProducts(*parentProductRegistry);

    std::string const maxEvents("maxEvents");
    std::string const maxLumis("maxLuminosityBlocks");

    processParameterSet_.reset(parameterSet.popParameterSet(std::string("process")).release()); 

    // if this process has a maxEvents or maxLuminosityBlocks parameter set, remove them.
    if(processParameterSet_->exists(maxEvents)) {
      processParameterSet_->popParameterSet(maxEvents);
    }
    if(processParameterSet_->exists(maxLumis)) {
      processParameterSet_->popParameterSet(maxLumis);
    }

    // if the top level process has a maxEvents or maxLuminosityBlocks parameter set, add them to this process.
    if(topLevelParameterSet.exists(maxEvents)) {
      processParameterSet_->addUntrackedParameter<ParameterSet>(maxEvents, topLevelParameterSet.getUntrackedParameterSet(maxEvents));
    }
    if(topLevelParameterSet.exists(maxLumis)) {
      processParameterSet_->addUntrackedParameter<ParameterSet>(maxLumis, topLevelParameterSet.getUntrackedParameterSet(maxLumis));
    }

    // If this process has a subprocess, pop the subprocess parameter set out of the process parameter set

    boost::shared_ptr<ParameterSet> subProcessParameterSet(popSubProcessParameterSet(*processParameterSet_).release());
  
    ScheduleItems items(*parentProductRegistry, *parentBranchIDListHelper, *this);

    ParameterSet const& optionsPset(processParameterSet_->getUntrackedParameterSet("options", ParameterSet()));
    IllegalParameters::setThrowAnException(optionsPset.getUntrackedParameter<bool>("throwIfIllegalParameter", true));

    //initialize the services
    ServiceToken iToken;

    // get any configured services.
    std::auto_ptr<std::vector<ParameterSet> > serviceSets = processParameterSet_->popVParameterSet(std::string("services")); 

    ServiceToken newToken = items.initServices(*serviceSets, *processParameterSet_, token, iLegacy, false);
    parentActReg.connectToSubProcess(*items.actReg_);
    serviceToken_ = items.addCPRandTNS(*processParameterSet_, newToken);


    //make the services available
    ServiceRegistry::Operate operate(serviceToken_);

    // intialize miscellaneous items
    items.initMisc(*processParameterSet_);

    // intialize the event setup provider
    esp_ = esController.makeProvider(*processParameterSet_);

    // intialize the Schedule
    schedule_ = items.initSchedule(*processParameterSet_,subProcessParameterSet.get());

    // set the items
    act_table_ = std::move(items.act_table_);
    preg_.reset(items.preg_.release());
    branchIDListHelper_ = items.branchIDListHelper_;
    processConfiguration_ = items.processConfiguration_;

    OutputModuleDescription desc(branchIDListHelper_->branchIDLists());
    configure(desc);

    std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
    setEventSelectionInfo(outputModulePathPositions, parentProductRegistry->anyProductProduced());

    boost::shared_ptr<EventPrincipal> ep(new EventPrincipal(preg_, branchIDListHelper_, *processConfiguration_, historyAppender_.get()));
    principalCache_.insert(ep);

    if(subProcessParameterSet) {
      subProcess_.reset(new SubProcess(*subProcessParameterSet, topLevelParameterSet, preg_, branchIDListHelper_, esController, *items.actReg_, newToken, iLegacy));
    }
  }
edm::SubProcess::~SubProcess ( ) [virtual]

Definition at line 133 of file SubProcess.cc.

{}

Member Function Documentation

void edm::SubProcess::beginJob ( void  ) [private, virtual]
void edm::SubProcess::beginLuminosityBlock ( LuminosityBlockPrincipal const &  lb) [private, virtual]

Reimplemented from edm::OutputModule.

Definition at line 286 of file SubProcess.cc.

References printConversionInfo::aux, edm::LuminosityBlockPrincipal::aux(), esInfo_, historyAppender_, edm::InLumi, edm::PrincipalCache::insert(), edm::PrincipalCache::lumiPrincipalPtr(), preg_, principalCache_, processConfiguration_, edm::Principal::processHistoryID(), propagateProducts(), edm::Principal::reader(), edm::PrincipalCache::runPrincipalPtr(), schedule_, and subProcess_.

                                                                            {
    boost::shared_ptr<LuminosityBlockAuxiliary> aux(new LuminosityBlockAuxiliary(principal.aux()));
    aux->setProcessHistoryID(principal.processHistoryID());
    boost::shared_ptr<LuminosityBlockPrincipal> lbpp(new LuminosityBlockPrincipal(aux, preg_, *processConfiguration_, historyAppender_.get()));
    lbpp->fillLuminosityBlockPrincipal(principal.reader());
    lbpp->setRunPrincipal(principalCache_.runPrincipalPtr());
    principalCache_.insert(lbpp);
    LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
    propagateProducts(InLumi, principal, lbp);
    typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionBegin> Traits;
    schedule_->processOneOccurrence<Traits>(lbp, esInfo_->es_);
    if(subProcess_.get()) subProcess_->doBeginLuminosityBlock(lbp, esInfo_->ts_);
  }
void edm::SubProcess::beginRun ( RunPrincipal const &  r) [private, virtual]

Reimplemented from edm::OutputModule.

Definition at line 220 of file SubProcess.cc.

References edm::RunPrincipal::aux(), printConversionInfo::aux, esInfo_, historyAppender_, edm::InRun, edm::PrincipalCache::insert(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), parentToChildPhID_, preg_, principalCache_, processConfiguration_, edm::RunAuxiliary::processHistoryID(), edm::Principal::processHistoryID(), propagateProducts(), edm::Principal::reader(), edm::FullHistoryToReducedHistoryMap::reduceProcessHistoryID(), edm::PrincipalCache::runPrincipalPtr(), schedule_, and subProcess_.

                                                    {
    boost::shared_ptr<RunAuxiliary> aux(new RunAuxiliary(principal.aux()));
    aux->setProcessHistoryID(principal.processHistoryID());
    boost::shared_ptr<RunPrincipal> rpp(new RunPrincipal(aux, preg_, *processConfiguration_, historyAppender_.get()));
    rpp->fillRunPrincipal(principal.reader());
    principalCache_.insert(rpp);

    FullHistoryToReducedHistoryMap & phidConverter(ProcessHistoryRegistry::instance()->extra());
    ProcessHistoryID const& parentInputReducedPHID = phidConverter.reduceProcessHistoryID(principal.aux().processHistoryID());
    ProcessHistoryID const& inputReducedPHID       = phidConverter.reduceProcessHistoryID(principal.processHistoryID());

    parentToChildPhID_.insert(std::make_pair(parentInputReducedPHID,inputReducedPHID));

    RunPrincipal& rp = *principalCache_.runPrincipalPtr();
    propagateProducts(InRun, principal, rp);
    typedef OccurrenceTraits<RunPrincipal, BranchActionBegin> Traits;
    schedule_->processOneOccurrence<Traits>(rp, esInfo_->es_);
    if(subProcess_.get()) subProcess_->doBeginRun(rp, esInfo_->ts_);
  }
void edm::SubProcess::clearCounters ( ) [inline]

Clear all the counters in the trigger report.

Definition at line 188 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                         {
      ServiceRegistry::Operate operate(serviceToken_);
      schedule_->clearCounters();
      if(subProcess_.get()) subProcess_->clearCounters();
    }
void edm::SubProcess::closeOutputFiles ( ) [inline]

Definition at line 70 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                            {
      ServiceRegistry::Operate operate(serviceToken_);
      schedule_->closeOutputFiles();
      if(subProcess_.get()) subProcess_->closeOutputFiles();
    }
void edm::SubProcess::deleteLumiFromCache ( ProcessHistoryID const &  parentPhID,
int  runNumber,
int  lumiNumber 
)

Definition at line 329 of file SubProcess.cc.

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

                                                                                                   {
    std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
    assert(it != parentToChildPhID_.end());
    principalCache_.deleteLumi(it->second, runNumber, lumiNumber);
      if(subProcess_.get()) subProcess_->deleteLumiFromCache(it->second, runNumber, lumiNumber);
  }
void edm::SubProcess::deleteRunFromCache ( ProcessHistoryID const &  parentPhID,
int  runNumber 
)

Definition at line 269 of file SubProcess.cc.

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

                                                                                  {
    std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
    assert(it != parentToChildPhID_.end());
    principalCache_.deleteRun(it->second, runNumber);
    if(subProcess_.get()) subProcess_->deleteRunFromCache(it->second, runNumber);
  }
void edm::SubProcess::doBeginLuminosityBlock ( LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 277 of file SubProcess.cc.

References esInfo_, esp_, and serviceToken_.

                                                                                                      {
    ServiceRegistry::Operate operate(serviceToken_);
    esInfo_.reset(new ESInfo(ts, *esp_));
    CurrentProcessingContext cpc;
    doBeginLuminosityBlock(principal, esInfo_->es_, &cpc);
    esInfo_.reset();
  }
void edm::SubProcess::doBeginRun ( RunPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 211 of file SubProcess.cc.

References esInfo_, esp_, and serviceToken_.

                                                                              {
    ServiceRegistry::Operate operate(serviceToken_);
    esInfo_.reset(new ESInfo(ts, *esp_));
    CurrentProcessingContext cpc;
    doBeginRun(principal, esInfo_->es_, &cpc);
    esInfo_.reset();
  }
void edm::SubProcess::doEndLuminosityBlock ( LuminosityBlockPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 301 of file SubProcess.cc.

References cleaningUpAfterException_, esInfo_, esp_, and serviceToken_.

                                                                                                                                   {
    cleaningUpAfterException_ = cleaningUpAfterException;
    ServiceRegistry::Operate operate(serviceToken_);
    esInfo_.reset(new ESInfo(ts, *esp_));
    CurrentProcessingContext cpc;
    doEndLuminosityBlock(principal, esInfo_->es_, &cpc);
    esInfo_.reset();
  }
void edm::SubProcess::doEndRun ( RunPrincipal const &  principal,
IOVSyncValue const &  ts,
bool  cleaningUpAfterException 
)

Definition at line 241 of file SubProcess.cc.

References cleaningUpAfterException_, esInfo_, esp_, and serviceToken_.

                                                                                                           {
    cleaningUpAfterException_ = cleaningUpAfterException;
    ServiceRegistry::Operate operate(serviceToken_);
    esInfo_.reset(new ESInfo(ts, *esp_));
    CurrentProcessingContext cpc;
    doEndRun(principal, esInfo_->es_, &cpc);
    esInfo_.reset();
  }
void edm::SubProcess::doEvent ( EventPrincipal const &  principal,
IOVSyncValue const &  ts 
)

Definition at line 177 of file SubProcess.cc.

References esInfo_, esp_, and serviceToken_.

                                                                             {
    ServiceRegistry::Operate operate(serviceToken_);
    esInfo_.reset(new ESInfo(ts, *esp_));
    CurrentProcessingContext cpc;
    doEvent(principal, esInfo_->es_, &cpc);
    esInfo_.reset();
  }
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 161 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                                     {
      ServiceRegistry::Operate operate(serviceToken_);
      schedule_->enableEndPaths(active);
      if(subProcess_.get()) subProcess_->enableEndPaths(active);
    }
void edm::SubProcess::endJob ( void  ) [private, virtual]

Reimplemented from edm::OutputModule.

Definition at line 146 of file SubProcess.cc.

References trackerHits::c, edm::ExceptionCollector::hasThrown(), edm::ExceptionCollector::rethrow(), schedule_, serviceToken_, and subProcess_.

                     {
    ServiceRegistry::Operate operate(serviceToken_);
    ExceptionCollector c("Multiple exceptions were thrown while executing endJob. An exception message follows for each.");
    schedule_->endJob(c);
    if(c.hasThrown()) {
      c.rethrow();
    }
    if(subProcess_.get()) subProcess_->doEndJob();
  }
void edm::SubProcess::endLuminosityBlock ( LuminosityBlockPrincipal const &  lb) [private, virtual]

Reimplemented from edm::OutputModule.

Definition at line 311 of file SubProcess.cc.

References cleaningUpAfterException_, esInfo_, edm::InLumi, edm::PrincipalCache::lumiPrincipalPtr(), principalCache_, propagateProducts(), schedule_, and subProcess_.

                                                                          {
    LuminosityBlockPrincipal& lbp = *principalCache_.lumiPrincipalPtr();
    propagateProducts(InLumi, principal, lbp);
    typedef OccurrenceTraits<LuminosityBlockPrincipal, BranchActionEnd> Traits;
    schedule_->processOneOccurrence<Traits>(lbp, esInfo_->es_, cleaningUpAfterException_);
    if(subProcess_.get()) subProcess_->doEndLuminosityBlock(lbp, esInfo_->ts_, cleaningUpAfterException_);
  }
bool edm::SubProcess::endPathsEnabled ( ) const [inline]

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

Definition at line 168 of file SubProcess.h.

References schedule_, and serviceToken_.

                                 {
      ServiceRegistry::Operate operate(serviceToken_);
      return schedule_->endPathsEnabled();
    }
void edm::SubProcess::endRun ( RunPrincipal const &  r) [private, virtual]

Reimplemented from edm::OutputModule.

Definition at line 251 of file SubProcess.cc.

References cleaningUpAfterException_, esInfo_, edm::InRun, principalCache_, propagateProducts(), edm::PrincipalCache::runPrincipalPtr(), schedule_, and subProcess_.

                                                  {
    RunPrincipal& rp = *principalCache_.runPrincipalPtr();
    propagateProducts(InRun, principal, rp);
    typedef OccurrenceTraits<RunPrincipal, BranchActionEnd> Traits;
    schedule_->processOneOccurrence<Traits>(rp, esInfo_->es_, cleaningUpAfterException_);
    if(subProcess_.get()) subProcess_->doEndRun(rp, esInfo_->ts_, cleaningUpAfterException_);
  }
void edm::SubProcess::fixBranchIDListsForEDAliases ( std::map< BranchID::value_type, BranchID::value_type > const &  droppedBranchIDToKeptBranchID) [private]

Definition at line 157 of file SubProcess.cc.

References branchIDListHelper_, and subProcess_.

Referenced by beginJob().

                                                                                                                              {
    // Check for branches dropped while an EDAlias was kept.
    // Replace BranchID of each dropped branch with that of the kept alias.
    for(BranchIDList& branchIDList : branchIDListHelper_->branchIDLists()) {
      for(BranchID::value_type& branchID : branchIDList) {
        std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter = droppedBranchIDToKeptBranchID.find(branchID);
        if(iter != droppedBranchIDToKeptBranchID.end()) {
          branchID = iter->second;
        }
      }
    }
    if(subProcess_.get()) subProcess_->fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID);
  }
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 175 of file SubProcess.h.

References schedule_, and serviceToken_.

                                                    {
      ServiceRegistry::Operate operate(serviceToken_);
      schedule_->getTriggerReport(rep);
    }
void edm::SubProcess::openNewOutputFilesIfNeeded ( ) [inline]

Definition at line 77 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                                      {
      ServiceRegistry::Operate operate(serviceToken_);
      schedule_->openNewOutputFilesIfNeeded();
      if(subProcess_.get()) subProcess_->openNewOutputFilesIfNeeded();
    }
void edm::SubProcess::openOutputFiles ( FileBlock fb) [inline]

Definition at line 84 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                                        {
      ServiceRegistry::Operate operate(serviceToken_);
      schedule_->openOutputFiles(fb);
      if(subProcess_.get()) subProcess_->openOutputFiles(fb);
    }
void edm::SubProcess::postForkReacquireResources ( unsigned int  iChildIndex,
unsigned int  iNumberOfChildren 
) [inline, virtual]

Reimplemented from edm::OutputModule.

Definition at line 126 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                                                                                              {
      ServiceRegistry::Operate operate(serviceToken_);
      schedule_->postForkReacquireResources(iChildIndex, iNumberOfChildren);
      if(subProcess_.get()) subProcess_->postForkReacquireResources(iChildIndex, iNumberOfChildren);
    }
void edm::SubProcess::preForkReleaseResources ( ) [inline, virtual]

Reimplemented from edm::OutputModule.

Definition at line 120 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                                   {
      ServiceRegistry::Operate operate(serviceToken_);
      schedule_->preForkReleaseResources();
      if(subProcess_.get()) subProcess_->preForkReleaseResources();
    }
void edm::SubProcess::propagateProducts ( BranchType  type,
Principal const &  parentPrincipal,
Principal principal 
) const [private]

Definition at line 337 of file SubProcess.cc.

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

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

                                                                                                             {
    Selections const& keptVector = keptProducts()[type];
    for(Selections::const_iterator it = keptVector.begin(), itEnd = keptVector.end(); it != itEnd; ++it) {
      ProductHolderBase const* parentProductHolder = parentPrincipal.getProductHolder((*it)->branchID(), false, false);
      if(parentProductHolder != 0) {
        ProductData const& parentData = parentProductHolder->productData();
        ProductHolderBase const* productHolder = principal.getProductHolder((*it)->branchID(), false, false);
        if(productHolder != 0) {
          ProductData& thisData = const_cast<ProductData&>(productHolder->productData());
          //Propagate the per event(run)(lumi) data for this product to the subprocess.
          //First, the product itself.
          thisData.wrapper_ = parentData.wrapper_;
          // Then the product ID and the ProcessHistory 
          thisData.prov_.setProductID(parentData.prov_.productID());
          thisData.prov_.setProcessHistoryID(parentData.prov_.processHistoryID());
          // Then the store, in case the product needs reading in a subprocess.
          thisData.prov_.setStore(parentData.prov_.store());
          // And last, the other per event provenance.
          if(parentData.prov_.productProvenanceValid()) {
            thisData.prov_.setProductProvenance(*parentData.prov_.productProvenance());
          } else {
            thisData.prov_.resetProductProvenance();
          }
          // Sets unavailable flag, if known that product is not available
          (void)productHolder->productUnavailable();
        }
      }
    }
  }
void edm::SubProcess::respondToCloseInputFile ( FileBlock const &  fb) [inline, virtual]

Reimplemented from edm::OutputModule.

Definition at line 94 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                                                      {
      ServiceRegistry::Operate operate(serviceToken_);
      schedule_->respondToCloseInputFile(fb);
      if(subProcess_.get()) subProcess_->respondToCloseInputFile(fb);
    }
void edm::SubProcess::respondToCloseOutputFiles ( FileBlock const &  fb) [inline, virtual]

Reimplemented from edm::OutputModule.

Definition at line 108 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                                                        {
      ServiceRegistry::Operate operate(serviceToken_);
      schedule_->respondToCloseOutputFiles(fb);
      if(subProcess_.get()) subProcess_->respondToCloseOutputFiles(fb);
    }
void edm::SubProcess::respondToOpenInputFile ( FileBlock const &  fb) [virtual]

Reimplemented from edm::OutputModule.

Definition at line 369 of file SubProcess.cc.

References branchIDListHelper_, edm::FileBlock::branchIDLists(), schedule_, serviceToken_, and subProcess_.

                                                        {
    ServiceRegistry::Operate operate(serviceToken_);
    branchIDListHelper_->updateFromInput(fb.branchIDLists());
    schedule_->respondToOpenInputFile(fb);
    if(subProcess_.get()) subProcess_->respondToOpenInputFile(fb);
  }
void edm::SubProcess::respondToOpenOutputFiles ( FileBlock const &  fb) [inline, virtual]

Reimplemented from edm::OutputModule.

Definition at line 101 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                                                       {
      ServiceRegistry::Operate operate(serviceToken_);
      schedule_->respondToOpenOutputFiles(fb);
      if(subProcess_.get()) subProcess_->respondToOpenOutputFiles(fb);
    }
bool edm::SubProcess::shouldWeCloseOutput ( ) const [inline]

Definition at line 115 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                                     {
      ServiceRegistry::Operate operate(serviceToken_);
      return schedule_->shouldWeCloseOutput() || (subProcess_.get() ? subProcess_->shouldWeCloseOutput() : false);
    }
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 182 of file SubProcess.h.

References schedule_, serviceToken_, and subProcess_.

                           {
      ServiceRegistry::Operate operate(serviceToken_);
      return subProcess_.get() ? subProcess_->terminate() : schedule_->terminate();
    }
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 142 of file SubProcess.h.

References schedule_.

                            {
      return schedule_->totalEvents();
    }
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 154 of file SubProcess.h.

References schedule_, and serviceToken_.

                                  {
      ServiceRegistry::Operate operate(serviceToken_);
      return schedule_->totalEventsFailed();
    }
int edm::SubProcess::totalEventsPassed ( ) const [inline]

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

Definition at line 147 of file SubProcess.h.

References schedule_, and serviceToken_.

                                  {
      ServiceRegistry::Operate operate(serviceToken_);
      return schedule_->totalEventsPassed();
    }
void edm::SubProcess::write ( EventPrincipal const &  e) [private, virtual]

Implements edm::OutputModule.

Definition at line 186 of file SubProcess.cc.

References edm::ProductRegistry::anyProductProduced(), edm::EventPrincipal::aux(), printConversionInfo::aux, edm::EventPrincipal::branchListIndexes(), edm::EventPrincipal::branchMapperPtr(), esInfo_, edm::PrincipalCache::eventPrincipal(), edm::EventPrincipal::eventSelectionIDs(), edm::EventPrincipal::fillEventPrincipal(), edm::InEvent, edm::PrincipalCache::lumiPrincipalPtr(), principalCache_, edm::Principal::processHistoryID(), edm::Principal::productRegistry(), propagateProducts(), edm::Principal::reader(), schedule_, edm::OutputModule::selectorConfig(), edm::EventPrincipal::setLuminosityBlockPrincipal(), subProcess_, and edm::OutputModule::wantAllEvents().

                                                   {
    EventAuxiliary aux(principal.aux());
    aux.setProcessHistoryID(principal.processHistoryID());

    boost::shared_ptr<EventSelectionIDVector> esids(new EventSelectionIDVector);
    *esids = principal.eventSelectionIDs();
    if (principal.productRegistry().anyProductProduced() || !wantAllEvents()) {
      esids->push_back(selectorConfig());
    }

    EventPrincipal& ep = principalCache_.eventPrincipal();
    ep.fillEventPrincipal(aux,
                          esids,
                          boost::shared_ptr<BranchListIndexes>(new BranchListIndexes(principal.branchListIndexes())),
                          principal.branchMapperPtr(),
                          principal.reader());
    ep.setLuminosityBlockPrincipal(principalCache_.lumiPrincipalPtr());
    propagateProducts(InEvent, principal, ep);
    typedef OccurrenceTraits<EventPrincipal, BranchActionBegin> Traits;
    schedule_->processOneOccurrence<Traits>(ep, esInfo_->es_);
    if(subProcess_.get()) subProcess_->doEvent(ep, esInfo_->ts_);
    ep.clearEventPrincipal();
  }
void edm::SubProcess::writeLumi ( ProcessHistoryID const &  parentPhID,
int  runNumber,
int  lumiNumber 
)

Definition at line 320 of file SubProcess.cc.

References edm::PrincipalCache::lumiPrincipal(), parentToChildPhID_, principalCache_, schedule_, serviceToken_, and subProcess_.

                                                                                         {
    ServiceRegistry::Operate operate(serviceToken_);
    std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
    assert(it != parentToChildPhID_.end());
    schedule_->writeLumi(principalCache_.lumiPrincipal(it->second, runNumber, lumiNumber));
    if(subProcess_.get()) subProcess_->writeLumi(it->second, runNumber, lumiNumber);
  }
virtual void edm::SubProcess::writeLuminosityBlock ( LuminosityBlockPrincipal const &  ) [inline, private, virtual]

Implements edm::OutputModule.

Definition at line 209 of file SubProcess.h.

{ throw 0; }
void edm::SubProcess::writeRun ( ProcessHistoryID const &  parentPhID,
int  runNumber 
)

Definition at line 260 of file SubProcess.cc.

References parentToChildPhID_, principalCache_, edm::PrincipalCache::runPrincipal(), schedule_, serviceToken_, and subProcess_.

                                                                        {
    ServiceRegistry::Operate operate(serviceToken_);
    std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
    assert(it != parentToChildPhID_.end());
    schedule_->writeRun(principalCache_.runPrincipal(it->second, runNumber));
    if(subProcess_.get()) subProcess_->writeRun(it->second, runNumber);
  }
virtual void edm::SubProcess::writeRun ( RunPrincipal const &  ) [inline, private, virtual]

Implements edm::OutputModule.

Definition at line 208 of file SubProcess.h.

{ throw 0; }

Member Data Documentation

std::unique_ptr<ActionTable const> edm::SubProcess::act_table_ [private]

Definition at line 218 of file SubProcess.h.

Referenced by SubProcess().

Definition at line 217 of file SubProcess.h.

Referenced by fixBranchIDListsForEDAliases(), respondToOpenInputFile(), and SubProcess().

Definition at line 227 of file SubProcess.h.

Referenced by doEndLuminosityBlock(), doEndRun(), endLuminosityBlock(), and endRun().

std::auto_ptr<ESInfo> edm::SubProcess::esInfo_ [private]

Definition at line 224 of file SubProcess.h.

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

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

Definition at line 215 of file SubProcess.h.

Definition at line 223 of file SubProcess.h.

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

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

Definition at line 216 of file SubProcess.h.

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

Definition at line 219 of file SubProcess.h.

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

Definition at line 228 of file SubProcess.h.

Referenced by SubProcess().

std::auto_ptr<Schedule> edm::SubProcess::schedule_ [private]
std::auto_ptr<SubProcess> edm::SubProcess::subProcess_ [private]