CMS 3D CMS Logo

insertSelectedProcesses.cc
Go to the documentation of this file.
2 
8 
9 #include "TClass.h"
10 
11 #include <memory>
12 
13 namespace edm {
14 
15  void insertSelectedProcesses(BranchDescription const& desc, std::set<std::string>& processes) {
16  // Select input processes in which mergeable run products were produced
17  if (desc.branchType() == InRun && !desc.produced()) {
18  // Determine if the product is "mergeable"
19  TClass* tClass = desc.wrappedType().getClass();
20  void* p = tClass->New();
21  TClass* wrapperBaseTClass = TypeWithDict::byName("edm::WrapperBase").getClass();
22  int offset = tClass->GetBaseClassOffset(wrapperBaseTClass);
23  std::unique_ptr<WrapperBase> edp = getAnyPtr<WrapperBase>(p, offset);
24  if (edp->isMergeable()) {
25  // record the process names in a set (which is ordered and unique)
26  processes.insert(desc.processName());
27  }
28  }
29  }
30 } // namespace edm
BranchType const & branchType() const
std::string const & processName() const
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
TClass * getClass() const
HLT enums.
void insertSelectedProcesses(BranchDescription const &desc, std::set< std::string > &processes)
TypeWithDict const & wrappedType() const