Skip to content

Commit

Permalink
Renamed BranchDescription to ProductDescription
Browse files Browse the repository at this point in the history
Also renamed branchDescription to productDescription
  • Loading branch information
Dr15Jones committed Jan 24, 2025
1 parent 0e3e123 commit 73afa2d
Show file tree
Hide file tree
Showing 234 changed files with 881 additions and 881 deletions.
4 changes: 2 additions & 2 deletions CalibTracker/SiStripCommon/plugins/ShallowTree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ShallowTree::ShallowTree(const edm::ParameterSet& iConfig) {

std::set<std::string> branchnames;
callWhenNewProductsRegistered(
[productSelectorRules, branchnames, leafmap, this](edm::BranchDescription const& selection) mutable {
[productSelectorRules, branchnames, leafmap, this](edm::ProductDescription const& selection) mutable {
if (productSelectorRules.select(selection)) {
//Check for duplicate branch names
if (branchnames.find(selection.productInstanceName()) != branchnames.end()) {
Expand Down Expand Up @@ -183,7 +183,7 @@ void ShallowTree::TypedBranchConnector<T>::connect(const edm::Event& iEvent) {
}

template <class T>
ShallowTree::TypedBranchConnector<T>::TypedBranchConnector(edm::BranchDescription const* desc,
ShallowTree::TypedBranchConnector<T>::TypedBranchConnector(edm::ProductDescription const* desc,
std::string t,
TTree* tree)
: ml_(desc->moduleLabel()), pin_(desc->productInstanceName()) {
Expand Down
4 changes: 2 additions & 2 deletions CalibTracker/SiStripCommon/plugins/ShallowTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ShallowTree : public edm::one::EDAnalyzer<edm::one::SharedResources> {
void analyze(const edm::Event&, const edm::EventSetup&) override;

template <class T>
void eat(edm::BranchDescription const& desc) {
void eat(edm::ProductDescription const& desc) {
consumes<T>(edm::InputTag(desc.moduleLabel(), desc.productInstanceName()));
}

Expand All @@ -55,7 +55,7 @@ class ShallowTree : public edm::one::EDAnalyzer<edm::one::SharedResources> {
T* object_ptr_;

public:
TypedBranchConnector(edm::BranchDescription const*, std::string, TTree*);
TypedBranchConnector(edm::ProductDescription const*, std::string, TTree*);
void connect(const edm::Event&) override;
};

Expand Down
2 changes: 1 addition & 1 deletion DQMServices/Components/plugins/DQMFileSaver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ DQMFileSaver::DQMFileSaver(const edm::ParameterSet &ps)
// Abuse ProcessMatch as a "match all".
jobmegetter_(edm::GetterOfProducts<DQMToken>(edm::ProcessMatch("*"), this, edm::InProcess)),
runmegetter_(edm::GetterOfProducts<DQMToken>(edm::ProcessMatch("*"), this, edm::InRun)) {
callWhenNewProductsRegistered([this](edm::BranchDescription const &bd) {
callWhenNewProductsRegistered([this](edm::ProductDescription const &bd) {
this->jobmegetter_(bd);
this->runmegetter_(bd);
});
Expand Down
2 changes: 1 addition & 1 deletion DQMServices/Components/plugins/MEtoEDMConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ MEtoEDMConverter::MEtoEDMConverter(const edm::ParameterSet& iPSet) : fName(""),

lumigetter_ = edm::GetterOfProducts<DQMToken>(edm::ProcessMatch("*"), this, edm::InLumi);
rungetter_ = edm::GetterOfProducts<DQMToken>(edm::ProcessMatch("*"), this, edm::InRun);
callWhenNewProductsRegistered([this](edm::BranchDescription const& bd) {
callWhenNewProductsRegistered([this](edm::ProductDescription const& bd) {
this->lumigetter_(bd);
this->rungetter_(bd);
});
Expand Down
6 changes: 3 additions & 3 deletions DQMServices/Core/interface/DQMEDHarvester.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ namespace edm {
}
}

bool operator()(edm::BranchDescription const &branchDescription) {
bool operator()(edm::ProductDescription const &productDescription) {
for (auto &m : matchers_) {
if (m(branchDescription)) {
if (m(productDescription)) {
return true;
}
}
Expand Down Expand Up @@ -88,7 +88,7 @@ class DQMEDHarvester
jobmegetter_ = edm::GetterOfProducts<DQMToken>(edm::VInputTagMatch(inputtags), this, edm::InProcess);
runmegetter_ = edm::GetterOfProducts<DQMToken>(edm::VInputTagMatch(inputtags), this, edm::InRun);
lumimegetter_ = edm::GetterOfProducts<DQMToken>(edm::VInputTagMatch(inputtags), this, edm::InLumi);
callWhenNewProductsRegistered([this](edm::BranchDescription const &bd) {
callWhenNewProductsRegistered([this](edm::ProductDescription const &bd) {
jobmegetter_(bd);
runmegetter_(bd);
lumimegetter_(bd);
Expand Down
2 changes: 1 addition & 1 deletion DQMServices/FileIO/plugins/DQMFileSaverBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ DQMFileSaverBase::DQMFileSaverBase(const edm::ParameterSet &ps) {
// This makes sure a file saver runs in a very end
lumigetter_ = edm::GetterOfProducts<DQMToken>(edm::ProcessMatch("*"), this, edm::InLumi);
rungetter_ = edm::GetterOfProducts<DQMToken>(edm::ProcessMatch("*"), this, edm::InRun);
callWhenNewProductsRegistered([this](edm::BranchDescription const &bd) {
callWhenNewProductsRegistered([this](edm::ProductDescription const &bd) {
this->lumigetter_(bd);
this->rungetter_(bd);
});
Expand Down
2 changes: 1 addition & 1 deletion DQMServices/FwkIO/plugins/DQMRootOutputModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ DQMRootOutputModule::DQMRootOutputModule(edm::ParameterSet const& pset)
// DQM module labels.
// This is needed to support unscheduled DQM modules now that
// non-consumed EDProducers are deleted from the job at beginJob.
callWhenNewProductsRegistered([this](edm::BranchDescription const& bd) {
callWhenNewProductsRegistered([this](edm::ProductDescription const& bd) {
m_getterOfProductsLumi(bd);
m_getterOfProductsRun(bd);
});
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/Common/doc/Common_edm.doc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Commonly used EDM classes.

\subsection interface Public interface
- edm::BranchDescription:
- edm::ProductDescription:
- edm::BranchEntryDescription
- edm::BranchKey:
- edm::ConditionsID:
Expand Down
10 changes: 5 additions & 5 deletions DataFormats/Common/interface/ProductData.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ is the storage unit of such information.
#include <memory>

namespace edm {
class BranchDescription;
class ProductDescription;
class MergeableRunProductMetadataBase;
class WrapperBase;

class ProductData {
public:
ProductData();

explicit ProductData(std::shared_ptr<BranchDescription const> bd);
explicit ProductData(std::shared_ptr<ProductDescription const> bd);

// For use by FWLite
ProductData(WrapperBase* product, Provenance const& prov);

std::shared_ptr<BranchDescription const> const& branchDescription() const {
return prov_.constBranchDescriptionPtr();
std::shared_ptr<ProductDescription const> const& productDescription() const {
return prov_.constProductDescriptionPtr();
}

Provenance const& provenance() const { return prov_; }
Expand All @@ -47,7 +47,7 @@ namespace edm {
void unsafe_setWrapper(std::unique_ptr<WrapperBase> iValue) const;
void unsafe_setWrapper(std::shared_ptr<WrapperBase const> iValue) const; // for SwitchProducer

void resetBranchDescription(std::shared_ptr<BranchDescription const> bd);
void resetProductDescription(std::shared_ptr<ProductDescription const> bd);

void resetProductData() { wrapper_.reset(); }

Expand Down
14 changes: 7 additions & 7 deletions DataFormats/Common/interface/setIsMergeable.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
// Class : setIsMergeable
//
/*
Description: Should be called only after the BranchDescription::init
Description: Should be called only after the ProductDescription::init
function has been called either directly or through
the BranchDescription constructor.
the ProductDescription constructor.
Helper function used to set the isMergeable data member
in BranchDescription. It would be much more convenient
to have been able to put this inside the BranchDescription
in ProductDescription. It would be much more convenient
to have been able to put this inside the ProductDescription
class itself in the init function, but the WrapperBase
class in package DataFormats/Common is needed to implement
this and that cannot be used in package DataFormats/Provenance
because it would create a circular dependency.
Anything creating a BranchDescription or reading one from
Anything creating a ProductDescription or reading one from
a ROOT file will need to call this directly if they need
the isMergeable data member to be set properly. Note that
the isMergeable data member will default to false so if
Expand All @@ -32,9 +32,9 @@

namespace edm {

class BranchDescription;
class ProductDescription;

void setIsMergeable(BranchDescription&);
void setIsMergeable(ProductDescription&);
} // namespace edm

#endif
6 changes: 3 additions & 3 deletions DataFormats/Common/src/ProductData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
namespace edm {
ProductData::ProductData() : wrapper_(), prov_() {}

ProductData::ProductData(std::shared_ptr<BranchDescription const> bd) : wrapper_(), prov_(bd, ProductID()) {}
ProductData::ProductData(std::shared_ptr<ProductDescription const> bd) : wrapper_(), prov_(bd, ProductID()) {}

// For use by FWLite
ProductData::ProductData(WrapperBase* product, Provenance const& prov)
: wrapper_(product, do_nothing_deleter()), prov_(prov) {}

void ProductData::resetBranchDescription(std::shared_ptr<BranchDescription const> bd) {
prov_.setBranchDescription(bd);
void ProductData::resetProductDescription(std::shared_ptr<ProductDescription const> bd) {
prov_.setProductDescription(bd);
}

void ProductData::setWrapper(std::unique_ptr<WrapperBase> iValue) { wrapper_ = std::move(iValue); }
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/Common/src/setIsMergeable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "DataFormats/Common/interface/setIsMergeable.h"

#include "DataFormats/Common/interface/WrapperBase.h"
#include "DataFormats/Provenance/interface/BranchDescription.h"
#include "DataFormats/Provenance/interface/ProductDescription.h"
#include "FWCore/Utilities/interface/BranchType.h"
#include "FWCore/Utilities/interface/getAnyPtr.h"

Expand All @@ -12,7 +12,7 @@

namespace edm {

void setIsMergeable(BranchDescription& desc) {
void setIsMergeable(ProductDescription& desc) {
// Save some time here with the knowledge that the isMergeable
// data member can only be true for run or lumi products.
// It defaults to false. Also if it is true that means it
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/FWLite/interface/ChainEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace edm {
class WrapperBase;
class ProductRegistry;
class ProcessHistory;
class BranchDescription;
class ProductDescription;
class EDProductGetter;
class EventAux;
class TriggerResults;
Expand Down Expand Up @@ -82,7 +82,7 @@ namespace fwlite {

edm::EventAuxiliary const& eventAuxiliary() const override;

std::vector<edm::BranchDescription> const& getBranchDescriptions() const;
std::vector<edm::ProductDescription> const& getProductDescriptions() const;
std::vector<std::string> const& getProcessHistory() const;
edm::ProcessHistory const& processHistory() const override;
TFile* getTFile() const { return event_->getTFile(); }
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/FWLite/interface/DataGetterHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class TTreeCache;
class TTree;

namespace edm {
class BranchDescription;
class ProductDescription;
class BranchID;
class ObjectWithDict;
class ProductID;
Expand Down Expand Up @@ -99,7 +99,7 @@ namespace fwlite {

internal::Data& getBranchDataFor(std::type_info const&, char const*, char const*, char const*) const;
void getBranchData(edm::EDProductGetter const*, Long64_t, internal::Data&) const;
bool getByBranchDescription(edm::BranchDescription const&, Long_t eventEntry, KeyToDataMap::iterator&) const;
bool getByProductDescription(edm::ProductDescription const&, Long_t eventEntry, KeyToDataMap::iterator&) const;
edm::WrapperBase const* wrapperBasePtr(edm::ObjectWithDict const&) const;
edm::ThinnedAssociation const* getThinnedAssociation(edm::BranchID const& branchID, Long_t eventEntry) const;

Expand Down
6 changes: 3 additions & 3 deletions DataFormats/FWLite/interface/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
namespace edm {
class WrapperBase;
class ProductRegistry;
class BranchDescription;
class ProductDescription;
class EDProductGetter;
class EventAux;
class Timestamp;
Expand Down Expand Up @@ -173,8 +173,8 @@ namespace fwlite {

edm::EventAuxiliary const& eventAuxiliary() const override;

std::vector<edm::BranchDescription> const& getBranchDescriptions() const {
return branchMap_.getBranchDescriptions();
std::vector<edm::ProductDescription> const& getProductDescriptions() const {
return branchMap_.getProductDescriptions();
}
std::vector<std::string> const& getProcessHistory() const;
TFile* getTFile() const { return branchMap_.getFile(); }
Expand Down
6 changes: 3 additions & 3 deletions DataFormats/FWLite/interface/LuminosityBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
namespace edm {
class WrapperBase;
class ProductRegistry;
class BranchDescription;
class ProductDescription;
class EDProductGetter;
class LuminosityBlockAux;
class Timestamp;
Expand Down Expand Up @@ -89,8 +89,8 @@ namespace fwlite {

edm::LuminosityBlockAuxiliary const& luminosityBlockAuxiliary() const override;

std::vector<edm::BranchDescription> const& getBranchDescriptions() const {
return branchMap_->getBranchDescriptions();
std::vector<edm::ProductDescription> const& getProductDescriptions() const {
return branchMap_->getProductDescriptions();
}

// void setGetter(//Copy from Event if needed
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/FWLite/interface/MultiChainEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace edm {
class WrapperBase;
class ProductRegistry;
class ProcessHistory;
class BranchDescription;
class ProductDescription;
class EDProductGetter;
class EventAux;
class TriggerResults;
Expand Down Expand Up @@ -97,7 +97,7 @@ namespace fwlite {

edm::EventAuxiliary const& eventAuxiliary() const override;

std::vector<edm::BranchDescription> const& getBranchDescriptions() const;
std::vector<edm::ProductDescription> const& getProductDescriptions() const;
std::vector<std::string> const& getProcessHistory() const;
edm::ProcessHistory const& processHistory() const override;
TFile* getTFile() const { return event1_->getTFile(); }
Expand Down
6 changes: 3 additions & 3 deletions DataFormats/FWLite/interface/Run.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
namespace edm {
class WrapperBase;
class ProductRegistry;
class BranchDescription;
class ProductDescription;
class EDProductGetter;
class RunAux;
class Timestamp;
Expand Down Expand Up @@ -86,8 +86,8 @@ namespace fwlite {

edm::RunAuxiliary const& runAuxiliary() const override;

std::vector<edm::BranchDescription> const& getBranchDescriptions() const {
return branchMap_->getBranchDescriptions();
std::vector<edm::ProductDescription> const& getProductDescriptions() const {
return branchMap_->getProductDescriptions();
}

// void setGetter(//Copy from Event if needed
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/FWLite/src/ChainEvent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ namespace fwlite {
return event_->getBranchNameFor(iType, iModule, iInstance, iProcess);
}

std::vector<edm::BranchDescription> const& ChainEvent::getBranchDescriptions() const {
return event_->getBranchDescriptions();
std::vector<edm::ProductDescription> const& ChainEvent::getProductDescriptions() const {
return event_->getProductDescriptions();
}

std::vector<std::string> const& ChainEvent::getProcessHistory() const { return event_->getProcessHistory(); }
Expand Down
12 changes: 6 additions & 6 deletions DataFormats/FWLite/src/DataGetterHelper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ namespace fwlite {
char const* iModuleLabel,
char const* iProductInstanceLabel,
char const* iProcessLabel) -> std::optional<edm::BranchID> {
for (auto const& bd : branchMap_->getBranchDescriptions()) {
for (auto const& bd : branchMap_->getProductDescriptions()) {
if (bd.unwrappedTypeID() == iInfo and bd.moduleLabel() == iModuleLabel and
bd.productInstanceName() == iProductInstanceLabel and bd.processName() == iProcessLabel) {
return bd.branchID();
Expand Down Expand Up @@ -337,7 +337,7 @@ namespace fwlite {
return true;
}

bool DataGetterHelper::getByBranchDescription(edm::BranchDescription const& bDesc,
bool DataGetterHelper::getByProductDescription(edm::ProductDescription const& bDesc,
Long_t eventEntry,
KeyToDataMap::iterator& itData) const {
if (!bDesc.branchID().isValid()) {
Expand Down Expand Up @@ -378,10 +378,10 @@ namespace fwlite {
std::map<IDPair, std::shared_ptr<internal::Data>>::const_iterator itFound = idToData_.find(theID);

if (itFound == idToData_.end()) {
edm::BranchDescription const& bDesc = branchMap_->productToBranch(iID);
edm::ProductDescription const& bDesc = branchMap_->productToBranch(iID);
KeyToDataMap::iterator itData;

if (!getByBranchDescription(bDesc, eventEntry, itData)) {
if (!getByProductDescription(bDesc, eventEntry, itData)) {
return nullptr;
}
itFound = idToData_.insert(std::make_pair(theID, itData->second)).first;
Expand All @@ -403,10 +403,10 @@ namespace fwlite {
auto itFound = bidToData_.find(bid);

if (itFound == bidToData_.end()) {
edm::BranchDescription const& bDesc = branchMap_->branchIDToBranch(bid);
edm::ProductDescription const& bDesc = branchMap_->branchIDToBranch(bid);
KeyToDataMap::iterator itData;

if (!getByBranchDescription(bDesc, eventEntry, itData)) {
if (!getByProductDescription(bDesc, eventEntry, itData)) {
return nullptr;
}
itFound = bidToData_.insert(std::make_pair(bid, itData->second)).first;
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/FWLite/src/EventBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include "FWCore/Utilities/interface/TypeID.h"

static const edm::ProductID s_id;
static edm::BranchDescription const s_branch = edm::BranchDescription(edm::BranchDescription());
static const edm::Provenance s_prov(std::shared_ptr<edm::BranchDescription const>(&s_branch, edm::do_nothing_deleter()),
static edm::ProductDescription const s_branch = edm::ProductDescription(edm::ProductDescription());
static const edm::Provenance s_prov(std::shared_ptr<edm::ProductDescription const>(&s_branch, edm::do_nothing_deleter()),
s_id);

namespace fwlite {
Expand Down
Loading

0 comments on commit 73afa2d

Please sign in to comment.