CMS 3D CMS Logo

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

◆ ~ProcessBlockHelperBase()

edm::ProcessBlockHelperBase::~ProcessBlockHelperBase ( )
virtualdefault

Member Function Documentation

◆ addedProcesses()

std::vector<std::string> const& edm::ProcessBlockHelperBase::addedProcesses ( ) const
inline

◆ cacheEntriesPerFile()

virtual std::vector<unsigned int> const& edm::ProcessBlockHelperBase::cacheEntriesPerFile ( ) const
pure virtual

◆ cacheIndexVectorsPerFile()

virtual std::vector<unsigned int> const& edm::ProcessBlockHelperBase::cacheIndexVectorsPerFile ( ) const
pure virtual

◆ emplaceBackAddedProcessName()

void edm::ProcessBlockHelperBase::emplaceBackAddedProcessName ( std::string const &  processName)
inline

◆ emplaceBackProcessName()

void edm::ProcessBlockHelperBase::emplaceBackProcessName ( std::string const &  processName)
inline

◆ invalidCacheIndex()

static constexpr unsigned int edm::ProcessBlockHelperBase::invalidCacheIndex ( )
inlinestaticconstexpr

◆ invalidProcessIndex()

static constexpr unsigned int edm::ProcessBlockHelperBase::invalidProcessIndex ( )
inlinestaticconstexpr

Definition at line 54 of file ProcessBlockHelperBase.h.

54 { return 0xffffffff; }

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

◆ nEntries()

virtual std::vector<std::vector<unsigned int> > const& edm::ProcessBlockHelperBase::nEntries ( ) const
pure virtual

◆ nProcessesInFirstFile()

virtual unsigned int edm::ProcessBlockHelperBase::nProcessesInFirstFile ( ) const
pure virtual

◆ outerOffset()

virtual unsigned int edm::ProcessBlockHelperBase::outerOffset ( ) const
pure virtual

◆ processBlockCacheIndices()

virtual std::vector<std::vector<unsigned int> > const& edm::ProcessBlockHelperBase::processBlockCacheIndices ( ) const
pure virtual

◆ processBlockIndex()

virtual unsigned int edm::ProcessBlockHelperBase::processBlockIndex ( std::string const &  processName,
EventToProcessBlockIndexes const &   
) const
pure virtual

◆ processesWithProcessBlockProducts()

std::vector<std::string> const& edm::ProcessBlockHelperBase::processesWithProcessBlockProducts ( ) const
inline

◆ selectProcess()

std::string edm::ProcessBlockHelperBase::selectProcess ( ProductRegistry const &  productRegistry,
ProductLabels const &  productLabels,
TypeID const &  typeID 
) const

Definition at line 30 of file ProcessBlockHelperBase.cc.

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  }

References submitPVResolutionJobs::desc, HLT_FULL_cff::distance, newFWLiteAna::found, edm::InProcess, position, processesWithProcessBlockProducts_, SimL1EmulatorRepack_CalouGT_cff::processName, dumpMFGeometry_cfg::prod, HLT_FULL_cff::productLabels, edm::ProductRegistry::productList(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ setAddedProcesses()

void edm::ProcessBlockHelperBase::setAddedProcesses ( std::vector< std::string > const &  val)
inline

Definition at line 33 of file ProcessBlockHelperBase.h.

33 { addedProcesses_ = val; }

References addedProcesses_, and heppy_batch::val.

◆ setProcessesWithProcessBlockProducts()

void edm::ProcessBlockHelperBase::setProcessesWithProcessBlockProducts ( std::vector< std::string > const &  val)
inline

◆ topProcessBlockHelper()

virtual ProcessBlockHelperBase const* edm::ProcessBlockHelperBase::topProcessBlockHelper ( ) const
pure virtual

◆ topProcessesWithProcessBlockProducts()

virtual std::vector<std::string> const& edm::ProcessBlockHelperBase::topProcessesWithProcessBlockProducts ( ) const
pure virtual

◆ updateForNewProcess()

void edm::ProcessBlockHelperBase::updateForNewProcess ( ProductRegistry const &  productRegistry,
std::string const &  processName 
)

Definition at line 16 of file ProcessBlockHelperBase.cc.

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  }

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

Member Data Documentation

◆ addedProcesses_

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

◆ processesWithProcessBlockProducts_

std::vector<std::string> edm::ProcessBlockHelperBase::processesWithProcessBlockProducts_
private
edm::ProcessBlockHelperBase::addedProcesses_
std::vector< std::string > addedProcesses_
Definition: ProcessBlockHelperBase.h:70
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::InProcess
Definition: BranchType.h:11
HLT_FULL_cff.productLabels
productLabels
Definition: HLT_FULL_cff.py:14609
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
edm::ProcessBlockHelperBase::processesWithProcessBlockProducts_
std::vector< std::string > processesWithProcessBlockProducts_
Definition: ProcessBlockHelperBase.h:64
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
heppy_batch.val
val
Definition: heppy_batch.py:351
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7746