CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
edm::ProcessBlockHelperBase Class Referenceabstract

#include <ProcessBlockHelperBase.h>

Inheritance diagram for edm::ProcessBlockHelperBase:
edm::ProcessBlockHelper edm::SubProcessBlockHelper

Public Member Functions

std::vector< std::string > const & addedProcesses () const
 
virtual std::vector< unsigned
int > const & 
cacheEntriesPerFile () const =0
 
virtual std::vector< unsigned
int > const & 
cacheIndexVectorsPerFile () const =0
 
void emplaceBackAddedProcessName (std::string const &processName)
 
void emplaceBackProcessName (std::string const &processName)
 
virtual std::vector
< std::vector< unsigned int >
> const & 
nEntries () const =0
 
virtual unsigned int nProcessesInFirstFile () const =0
 
virtual unsigned int outerOffset () const =0
 
virtual std::vector
< std::vector< unsigned int >
> const & 
processBlockCacheIndices () const =0
 
virtual unsigned int processBlockIndex (std::string const &processName, EventToProcessBlockIndexes const &) const =0
 
std::vector< std::string > const & processesWithProcessBlockProducts () const
 
std::string selectProcess (ProductRegistry const &, ProductLabels const &, TypeID const &) const
 
void setAddedProcesses (std::vector< std::string > const &val)
 
void setProcessesWithProcessBlockProducts (std::vector< std::string > const &val)
 
virtual ProcessBlockHelperBase
const * 
topProcessBlockHelper () const =0
 
virtual std::vector
< std::string > const & 
topProcessesWithProcessBlockProducts () const =0
 
void updateForNewProcess (ProductRegistry const &, std::string const &processName)
 
virtual ~ProcessBlockHelperBase ()
 

Static Public Member Functions

static constexpr unsigned int invalidCacheIndex ()
 
static constexpr unsigned int invalidProcessIndex ()
 

Private Attributes

std::vector< std::string > addedProcesses_
 
std::vector< std::string > processesWithProcessBlockProducts_
 

Detailed Description

Author
W. David Dagenhart, created 30 December, 2020

Definition at line 18 of file ProcessBlockHelperBase.h.

Constructor & Destructor Documentation

edm::ProcessBlockHelperBase::~ProcessBlockHelperBase ( )
virtualdefault

Member Function Documentation

std::vector<std::string> const& edm::ProcessBlockHelperBase::addedProcesses ( ) const
inline
virtual std::vector<unsigned int> const& edm::ProcessBlockHelperBase::cacheEntriesPerFile ( ) const
pure virtual
virtual std::vector<unsigned int> const& edm::ProcessBlockHelperBase::cacheIndexVectorsPerFile ( ) const
pure virtual
void edm::ProcessBlockHelperBase::emplaceBackAddedProcessName ( std::string const &  processName)
inline

Definition at line 34 of file ProcessBlockHelperBase.h.

References addedProcesses_.

Referenced by edm::SubProcessBlockHelper::updateFromParentProcess().

34 { addedProcesses_.emplace_back(processName); }
std::vector< std::string > addedProcesses_
void edm::ProcessBlockHelperBase::emplaceBackProcessName ( std::string const &  processName)
inline
static constexpr unsigned int edm::ProcessBlockHelperBase::invalidCacheIndex ( )
inlinestatic
static constexpr unsigned int edm::ProcessBlockHelperBase::invalidProcessIndex ( )
inlinestatic

Definition at line 54 of file ProcessBlockHelperBase.h.

Referenced by edm::ProcessBlockHelper::fillFromPrimaryInputWhenNotEmpty().

54 { return 0xffffffff; }
virtual std::vector<std::vector<unsigned int> > const& edm::ProcessBlockHelperBase::nEntries ( ) const
pure virtual
virtual unsigned int edm::ProcessBlockHelperBase::nProcessesInFirstFile ( ) const
pure virtual
virtual unsigned int edm::ProcessBlockHelperBase::outerOffset ( ) const
pure virtual
virtual std::vector<std::vector<unsigned int> > const& edm::ProcessBlockHelperBase::processBlockCacheIndices ( ) const
pure virtual
virtual unsigned int edm::ProcessBlockHelperBase::processBlockIndex ( std::string const &  processName,
EventToProcessBlockIndexes const &   
) const
pure virtual
std::vector<std::string> const& edm::ProcessBlockHelperBase::processesWithProcessBlockProducts ( ) const
inline
std::string edm::ProcessBlockHelperBase::selectProcess ( ProductRegistry const &  productRegistry,
ProductLabels const &  productLabels,
TypeID const &  typeID 
) const

Definition at line 30 of file ProcessBlockHelperBase.cc.

References edm::BranchDescription::branchType(), submitPVResolutionJobs::desc, HLT_FULL_cff::distance, newFWLiteAna::found, edm::InProcess, edm::ProductLabels::module, edm::BranchDescription::moduleLabel(), position, edm::BranchDescription::present(), edm::ProductLabels::process, processesWithProcessBlockProducts_, edm::BranchDescription::processName(), FSQHLTOfflineSource_cfi::processName, edm::BranchDescription::produced(), edm::ProductLabels::productInstance, edm::BranchDescription::productInstanceName(), edm::ProductRegistry::productList(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::BranchDescription::unwrappedTypeID().

32  {
34  std::string selectedProcess;
35 
36  unsigned int bestPosition = 0;
37  for (auto const& prod : productRegistry.productList()) {
38  BranchDescription const& desc = prod.second;
39  if (desc.branchType() == InProcess && !desc.produced() && desc.present() &&
40  desc.moduleLabel() == productLabels.module && desc.productInstanceName() == productLabels.productInstance &&
41  desc.unwrappedTypeID() == typeID && (processName.empty() || processName == desc.processName())) {
42  // This code is to select the latest matching process
43  auto found =
44  std::find_if(processesWithProcessBlockProducts_.begin(),
46  [&desc](auto const& processFromHelper) { return processFromHelper == desc.processName(); });
48  const unsigned int position = std::distance(processesWithProcessBlockProducts_.begin(), found);
49  if (position >= bestPosition) {
50  bestPosition = position;
51  selectedProcess = desc.processName();
52  }
53  }
54  }
55  }
56  return selectedProcess;
57  }
std::vector< std::string > processesWithProcessBlockProducts_
static int position[264][3]
Definition: ReadPGInfo.cc:289
void edm::ProcessBlockHelperBase::setAddedProcesses ( std::vector< std::string > const &  val)
inline
void edm::ProcessBlockHelperBase::setProcessesWithProcessBlockProducts ( std::vector< std::string > const &  val)
inline
virtual ProcessBlockHelperBase const* edm::ProcessBlockHelperBase::topProcessBlockHelper ( ) const
pure virtual
virtual std::vector<std::string> const& edm::ProcessBlockHelperBase::topProcessesWithProcessBlockProducts ( ) const
pure virtual
void edm::ProcessBlockHelperBase::updateForNewProcess ( ProductRegistry const &  productRegistry,
std::string const &  processName 
)

Definition at line 16 of file ProcessBlockHelperBase.cc.

References addedProcesses_, submitPVResolutionJobs::desc, edm::InProcess, processesWithProcessBlockProducts_, and edm::ProductRegistry::productList().

17  {
18  // Add the current process at the end if there are any
19  // process blocks produced in the current process.
20  for (auto const& product : productRegistry.productList()) {
21  auto const& desc = product.second;
22  if (desc.branchType() == InProcess && desc.produced() && !desc.transient()) {
24  addedProcesses_.emplace_back(processName);
25  return;
26  }
27  }
28  }
std::vector< std::string > addedProcesses_
std::vector< std::string > processesWithProcessBlockProducts_

Member Data Documentation

std::vector<std::string> edm::ProcessBlockHelperBase::addedProcesses_
private
std::vector<std::string> edm::ProcessBlockHelperBase::processesWithProcessBlockProducts_
private