CMS 3D CMS Logo

MergeableRunProductProcesses.cc
Go to the documentation of this file.
1 
3 
8 
9 #include "TClass.h"
10 
11 #include <memory>
12 #include <set>
13 
14 namespace edm {
15 
17 
19  TClass* wrapperBaseTClass = TypeWithDict::byName("edm::WrapperBase").getClass();
20  std::set<std::string> processSet;
21  for (auto const& prod : productRegistry.productList()) {
22  BranchDescription const& desc = prod.second;
23  if (desc.branchType() == InRun && !desc.produced() && desc.present()) {
24  TClass* cp = desc.wrappedType().getClass();
25  void* p = cp->New();
26  int offset = cp->GetBaseClassOffset(wrapperBaseTClass);
27  std::unique_ptr<WrapperBase> edp = getAnyPtr<WrapperBase>(p, offset);
28  if (edp->isMergeable()) {
29  processSet.insert(desc.processName());
30  }
31  }
32  }
33  processesWithMergeableRunProducts_.assign(processSet.begin(), processSet.end());
34  }
35 } // namespace edm
void setProcessesWithMergeableRunProducts(ProductRegistry const &productRegistry)
BranchType const & branchType() const
std::string const & processName() const
std::vector< std::string > processesWithMergeableRunProducts_
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
ProductList const & productList() const
TClass * getClass() const
HLT enums.
TypeWithDict const & wrappedType() const