Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:58

0001 #include "FWCore/Framework/interface/OccurrenceForOutput.h"
0002 
0003 #include "DataFormats/Common/interface/TriggerResults.h"
0004 #include "DataFormats/Provenance/interface/Provenance.h"
0005 #include "DataFormats/Provenance/interface/StableProvenance.h"
0006 #include "FWCore/Common/interface/TriggerResultsByName.h"
0007 #include "FWCore/Framework/interface/Principal.h"
0008 #include "FWCore/ParameterSet/interface/Registry.h"
0009 #include "FWCore/Utilities/interface/Algorithms.h"
0010 #include "FWCore/Utilities/interface/InputTag.h"
0011 
0012 namespace edm {
0013 
0014   OccurrenceForOutput::OccurrenceForOutput(Principal const& p,
0015                                            ModuleDescription const& md,
0016                                            ModuleCallingContext const* moduleCallingContext,
0017                                            bool isAtEnd)
0018       : provRecorder_(p, md, isAtEnd), moduleCallingContext_(moduleCallingContext) {}
0019 
0020   OccurrenceForOutput::~OccurrenceForOutput() {}
0021 
0022   void OccurrenceForOutput::setConsumer(EDConsumerBase const* iConsumer) { provRecorder_.setConsumer(iConsumer); }
0023 
0024   Principal const& OccurrenceForOutput::principal() const { return provRecorder_.principal(); }
0025 
0026   ProcessHistoryID const& OccurrenceForOutput::processHistoryID() const { return principal().processHistoryID(); }
0027 
0028   Provenance OccurrenceForOutput::getProvenance(BranchID const& bid) const {
0029     return provRecorder_.principal().getProvenance(bid);
0030   }
0031 
0032   void OccurrenceForOutput::getAllProvenance(std::vector<Provenance const*>& provenances) const {
0033     provRecorder_.principal().getAllProvenance(provenances);
0034   }
0035 
0036   void OccurrenceForOutput::getAllStableProvenance(std::vector<StableProvenance const*>& provenances) const {
0037     provRecorder_.principal().getAllStableProvenance(provenances);
0038   }
0039 
0040   ProcessHistory const& OccurrenceForOutput::processHistory() const { return provRecorder_.processHistory(); }
0041 
0042   size_t OccurrenceForOutput::size() const { return provRecorder_.principal().size(); }
0043 
0044   BasicHandle OccurrenceForOutput::getByToken(EDGetToken token, TypeID const& typeID) const {
0045     auto result = provRecorder_.getByToken_(typeID, PRODUCT_TYPE, token, moduleCallingContext_);
0046     if (result.failedToGet()) {
0047       return result;
0048     }
0049     if (!provRecorder_.isComplete() && result.wrapper()->isMergeable()) {
0050       principal_get_adapter_detail::throwOnPrematureRead("RunOrLumi", typeID, token);
0051     }
0052     return result;
0053   }
0054 }  // namespace edm