CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::ProvenanceAdaptor Class Reference

#include <ProvenanceAdaptor.h>

Public Types

typedef ParameterSetConverter::ParameterSetIdConverter ParameterSetIdConverter
 
typedef std::map< ProcessHistoryID, ProcessHistoryIDProcessHistoryIdConverter
 

Public Member Functions

std::shared_ptr< BranchIDLists const > branchIDLists () const
 
void branchListIndexes (BranchListIndexes &indexes) const
 
ParameterSetID const & convertID (ParameterSetID const &oldID) const
 
ProcessHistoryID const & convertID (ProcessHistoryID const &oldID) const
 
ProvenanceAdaptoroperator= (ProvenanceAdaptor const &)=delete
 
 ProvenanceAdaptor (ProductRegistry &productRegistry, ProcessHistoryMap &pHistMap, ProcessHistoryVector &pHistVector, ProcessConfigurationVector &procConfigVector, ParameterSetIdConverter const &parameterSetIdConverter, bool fullConversion)
 
 ProvenanceAdaptor (ProvenanceAdaptor const &)=delete
 
 ~ProvenanceAdaptor ()
 

Private Member Functions

void fixProcessHistory (ProcessHistoryMap &pHistMap, ProcessHistoryVector &pHistVector)
 

Private Attributes

std::shared_ptr< BranchIDLists const > branchIDLists_
 
std::vector< BranchListIndexbranchListIndexes_
 
ParameterSetIdConverter parameterSetIdConverter_
 
ProcessHistoryIdConverter processHistoryIdConverter_
 

Detailed Description

Definition at line 26 of file ProvenanceAdaptor.h.

Member Typedef Documentation

◆ ParameterSetIdConverter

Definition at line 28 of file ProvenanceAdaptor.h.

◆ ProcessHistoryIdConverter

Definition at line 29 of file ProvenanceAdaptor.h.

Constructor & Destructor Documentation

◆ ProvenanceAdaptor() [1/2]

edm::ProvenanceAdaptor::ProvenanceAdaptor ( ProductRegistry productRegistry,
ProcessHistoryMap pHistMap,
ProcessHistoryVector pHistVector,
ProcessConfigurationVector procConfigVector,
ParameterSetIdConverter const &  parameterSetIdConverter,
bool  fullConversion 
)

Definition at line 150 of file ProvenanceAdaptor.cc.

References branchIDLists_, branchListIndexes_, and fixProcessHistory().

156  : parameterSetIdConverter_(parameterSetIdConverter),
158  branchIDLists_(),
160  fixProcessHistory(pHistMap, pHistVector);
161  fillProcessConfiguration(pHistVector, procConfigVector);
162  if (fullConversion) {
163  fillListsAndIndexes(productRegistry, pHistMap, branchIDLists_, branchListIndexes_);
164  }
165  }
ProcessHistoryIdConverter processHistoryIdConverter_
std::shared_ptr< BranchIDLists const > branchIDLists_
ParameterSetIdConverter parameterSetIdConverter_
std::vector< BranchListIndex > branchListIndexes_
void fixProcessHistory(ProcessHistoryMap &pHistMap, ProcessHistoryVector &pHistVector)

◆ ~ProvenanceAdaptor()

edm::ProvenanceAdaptor::~ProvenanceAdaptor ( )

Definition at line 167 of file ProvenanceAdaptor.cc.

167 {}

◆ ProvenanceAdaptor() [2/2]

edm::ProvenanceAdaptor::ProvenanceAdaptor ( ProvenanceAdaptor const &  )
delete

Member Function Documentation

◆ branchIDLists()

std::shared_ptr< BranchIDLists const > edm::ProvenanceAdaptor::branchIDLists ( ) const

Definition at line 185 of file ProvenanceAdaptor.cc.

References branchIDLists_.

185 { return branchIDLists_; }
std::shared_ptr< BranchIDLists const > branchIDLists_

◆ branchListIndexes()

void edm::ProvenanceAdaptor::branchListIndexes ( BranchListIndexes indexes) const

Definition at line 187 of file ProvenanceAdaptor.cc.

References branchListIndexes_.

187 { indexes = branchListIndexes_; }
std::vector< BranchListIndex > branchListIndexes_

◆ convertID() [1/2]

ParameterSetID const & edm::ProvenanceAdaptor::convertID ( ParameterSetID const &  oldID) const

Definition at line 169 of file ProvenanceAdaptor.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and parameterSetIdConverter_.

Referenced by fixProcessHistory().

169  {
170  ParameterSetIdConverter::const_iterator it = parameterSetIdConverter_.find(oldID);
171  if (it == parameterSetIdConverter_.end()) {
172  return oldID;
173  }
174  return it->second;
175  }
ParameterSetIdConverter parameterSetIdConverter_

◆ convertID() [2/2]

ProcessHistoryID const & edm::ProvenanceAdaptor::convertID ( ProcessHistoryID const &  oldID) const

Definition at line 177 of file ProvenanceAdaptor.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and processHistoryIdConverter_.

177  {
178  ProcessHistoryIdConverter::const_iterator it = processHistoryIdConverter_.find(oldID);
179  if (it == processHistoryIdConverter_.end()) {
180  return oldID;
181  }
182  return it->second;
183  }
ProcessHistoryIdConverter processHistoryIdConverter_

◆ fixProcessHistory()

void edm::ProvenanceAdaptor::fixProcessHistory ( ProcessHistoryMap pHistMap,
ProcessHistoryVector pHistVector 
)
private

Definition at line 25 of file ProvenanceAdaptor.cc.

References cms::cuda::assert(), convertID(), MillePedeFileConverter_cfg::e, edm::ProcessHistory::emplace_back(), EgHLTOffHistBins_cfi::et, mps_fire::i, edm::ProcessHistory::id(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, eostools::move(), processHistoryIdConverter_, and edm::ProcessHistory::size().

Referenced by ProvenanceAdaptor().

25  {
26  assert(pHistMap.empty() != pHistVector.empty());
27  for (ProcessHistoryVector::const_iterator i = pHistVector.begin(), e = pHistVector.end(); i != e; ++i) {
28  pHistMap.insert(std::make_pair(i->id(), *i));
29  }
30  pHistVector.clear();
31  for (ProcessHistoryMap::const_iterator i = pHistMap.begin(), e = pHistMap.end(); i != e; ++i) {
32  ProcessHistory newHist;
33  ProcessHistoryID const& oldphID = i->first;
34  for (ProcessHistory::const_iterator it = i->second.begin(), et = i->second.end(); it != et; ++it) {
35  ParameterSetID const& newPsetID = convertID(it->parameterSetID());
36  newHist.emplace_back(it->processName(), newPsetID, it->releaseVersion(), it->passID());
37  }
38  assert(newHist.size() == i->second.size());
39  ProcessHistoryID newphID = newHist.id();
40  pHistVector.push_back(std::move(newHist));
41  if (newphID != oldphID) {
42  processHistoryIdConverter_.insert(std::make_pair(oldphID, newphID));
43  }
44  }
45  assert(pHistVector.size() == pHistMap.size());
46  }
collection_type::const_iterator const_iterator
ProcessHistoryIdConverter processHistoryIdConverter_
assert(be >=bs)
Hash< ParameterSetType > ParameterSetID
Hash< ProcessHistoryType > ProcessHistoryID
ParameterSetID const & convertID(ParameterSetID const &oldID) const
def move(src, dest)
Definition: eostools.py:511

◆ operator=()

ProvenanceAdaptor& edm::ProvenanceAdaptor::operator= ( ProvenanceAdaptor const &  )
delete

Member Data Documentation

◆ branchIDLists_

std::shared_ptr<BranchIDLists const> edm::ProvenanceAdaptor::branchIDLists_
private

Definition at line 54 of file ProvenanceAdaptor.h.

Referenced by branchIDLists(), and ProvenanceAdaptor().

◆ branchListIndexes_

std::vector<BranchListIndex> edm::ProvenanceAdaptor::branchListIndexes_
private

Definition at line 55 of file ProvenanceAdaptor.h.

Referenced by branchListIndexes(), and ProvenanceAdaptor().

◆ parameterSetIdConverter_

ParameterSetIdConverter edm::ProvenanceAdaptor::parameterSetIdConverter_
private

Definition at line 52 of file ProvenanceAdaptor.h.

Referenced by convertID().

◆ processHistoryIdConverter_

ProcessHistoryIdConverter edm::ProvenanceAdaptor::processHistoryIdConverter_
private

Definition at line 53 of file ProvenanceAdaptor.h.

Referenced by convertID(), and fixProcessHistory().