/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DataFormats/Provenance/src/Provenance.cc
58 строк
2 KB
Christopher Jones
Renamed BranchDescription to ProductDescription
25 янв 2025, 01:05
25 янв 2025, 01:05
73afa2d
Код
Авторство
О чём код?
#include "DataFormats/Provenance/interface/Provenance.h" #include "DataFormats/Provenance/interface/MergeableRunProductMetadataBase.h" #include "DataFormats/Provenance/interface/ProductProvenanceLookup.h" #include "DataFormats/Provenance/interface/ProcessConfiguration.h" #include <algorithm> #include <cassert> /*---------------------------------------------------------------------- ----------------------------------------------------------------------*/ namespace edm { Provenance::Provenance() : Provenance{StableProvenance()} {} Provenance::Provenance(std::shared_ptr<ProductDescription const> const& p, ProductID const& pid) : stableProvenance_(p, pid), store_(), mergeableRunProductMetadata_() {} Provenance::Provenance(StableProvenance const& stable) : stableProvenance_(stable), store_(), mergeableRunProductMetadata_() {} ProductProvenance const* Provenance::productProvenance() const { if (!store_) { return nullptr; } return store_->branchIDToProvenance(originalBranchID()); } bool Provenance::knownImproperlyMerged() const { if (mergeableRunProductMetadata_ && productDescription().isMergeable()) { // This part handles the cases where the product is // a mergeable run product from the input. return mergeableRunProductMetadata_->knownImproperlyMerged(processName()); } // All other cases return false; } void Provenance::write(std::ostream& os) const { // This is grossly inadequate, but it is not critical for the // first pass. stable().write(os); auto pp = productProvenance(); if (pp != nullptr) { pp->write(os); } } bool operator==(Provenance const& a, Provenance const& b) { return a.stable() == b.stable(); } void Provenance::swap(Provenance& iOther) { stableProvenance_.swap(iOther.stableProvenance_); std::swap(store_, iOther.store_); std::swap(mergeableRunProductMetadata_, iOther.mergeableRunProductMetadata_); } } // namespace edm