Go to the documentation of this file.00001 #include "FWCore/Framework/interface/Run.h"
00002 #include "FWCore/Framework/interface/NoDelayedReader.h"
00003 #include "FWCore/Framework/interface/RunPrincipal.h"
00004 #include "FWCore/Utilities/interface/Algorithms.h"
00005
00006 namespace edm {
00007
00008 Run::Run(RunPrincipal& rp, ModuleDescription const& md) :
00009 provRecorder_(rp, md),
00010 aux_(rp.aux()) {
00011 }
00012
00013 Run::~Run() {
00014
00015
00016 for_all(putProducts_, principal_get_adapter_detail::deleter());
00017 }
00018
00019 RunPrincipal&
00020 Run::runPrincipal() {
00021 return dynamic_cast<RunPrincipal&>(provRecorder_.principal());
00022 }
00023
00024 RunPrincipal const&
00025 Run::runPrincipal() const {
00026 return dynamic_cast<RunPrincipal const&>(provRecorder_.principal());
00027 }
00028
00029 Provenance
00030 Run::getProvenance(BranchID const& bid) const {
00031 return runPrincipal().getProvenance(bid);
00032 }
00033
00034 void
00035 Run::getAllProvenance(std::vector<Provenance const*>& provenances) const {
00036 runPrincipal().getAllProvenance(provenances);
00037 }
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 void
00077 Run::commit_() {
00078
00079 RunPrincipal& rp = runPrincipal();
00080 ProductPtrVec::iterator pit(putProducts().begin());
00081 ProductPtrVec::iterator pie(putProducts().end());
00082
00083 while(pit != pie) {
00084
00085 std::auto_ptr<ProductProvenance> runEntryInfoPtr(
00086 new ProductProvenance(pit->second->branchID(),
00087 productstatus::present()));
00088 std::auto_ptr<EDProduct> pr(pit->first);
00089
00090 pit->first = 0;
00091 rp.put(*pit->second, pr, runEntryInfoPtr);
00092 ++pit;
00093 }
00094
00095
00096 putProducts().clear();
00097 }
00098
00099 ProcessHistory const&
00100 Run::processHistory() const {
00101 return provRecorder_.processHistory();
00102 }
00103
00104 void
00105 Run::addToGotBranchIDs(Provenance const& prov) const {
00106 gotBranchIDs_.insert(prov.branchID());
00107 }
00108
00109 BasicHandle
00110 Run::getByLabelImpl(const std::type_info& iWrapperType, const std::type_info& iProductType, const InputTag& iTag) const {
00111 BasicHandle h = provRecorder_.getByLabel_(TypeID(iProductType),iTag);
00112 if (h.isValid()) {
00113 addToGotBranchIDs(*(h.provenance()));
00114 }
00115 return h;
00116 }
00117
00118
00119 }