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 148 of file ProvenanceAdaptor.cc.

154  : parameterSetIdConverter_(parameterSetIdConverter),
156  branchIDLists_(),
158  fixProcessHistory(pHistMap, pHistVector);
159  fillProcessConfiguration(pHistVector, procConfigVector);
160  if (fullConversion) {
161  fillListsAndIndexes(productRegistry, pHistMap, branchIDLists_, branchListIndexes_);
162  }
163  }

References branchIDLists_, branchListIndexes_, and fixProcessHistory().

◆ ~ProvenanceAdaptor()

edm::ProvenanceAdaptor::~ProvenanceAdaptor ( )

Definition at line 165 of file ProvenanceAdaptor.cc.

165 {}

◆ 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 183 of file ProvenanceAdaptor.cc.

183 { return branchIDLists_; }

References branchIDLists_.

◆ branchListIndexes()

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

Definition at line 185 of file ProvenanceAdaptor.cc.

185 { indexes = branchListIndexes_; }

References branchListIndexes_.

◆ convertID() [1/2]

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

Definition at line 167 of file ProvenanceAdaptor.cc.

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

References parameterSetIdConverter_.

Referenced by fixProcessHistory().

◆ convertID() [2/2]

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

Definition at line 175 of file ProvenanceAdaptor.cc.

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

References processHistoryIdConverter_.

◆ fixProcessHistory()

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

Definition at line 23 of file ProvenanceAdaptor.cc.

23  {
24  assert(pHistMap.empty() != pHistVector.empty());
25  for (ProcessHistoryVector::const_iterator i = pHistVector.begin(), e = pHistVector.end(); i != e; ++i) {
26  pHistMap.insert(std::make_pair(i->id(), *i));
27  }
28  pHistVector.clear();
29  for (ProcessHistoryMap::const_iterator i = pHistMap.begin(), e = pHistMap.end(); i != e; ++i) {
30  ProcessHistory newHist;
31  ProcessHistoryID const& oldphID = i->first;
32  for (ProcessHistory::const_iterator it = i->second.begin(), et = i->second.end(); it != et; ++it) {
33  ParameterSetID const& newPsetID = convertID(it->parameterSetID());
34  newHist.emplace_back(it->processName(), newPsetID, it->releaseVersion(), it->passID());
35  }
36  assert(newHist.size() == i->second.size());
37  ProcessHistoryID newphID = newHist.id();
38  pHistVector.push_back(std::move(newHist));
39  if (newphID != oldphID) {
40  processHistoryIdConverter_.insert(std::make_pair(oldphID, newphID));
41  }
42  }
43  assert(pHistVector.size() == pHistMap.size());
44  }

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

Referenced by ProvenanceAdaptor().

◆ 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().

edm::ParameterSetID
Hash< ParameterSetType > ParameterSetID
Definition: ParameterSetID.h:21
mps_fire.i
i
Definition: mps_fire.py:355
ProducerES_cfi.ProcessHistory
ProcessHistory
Definition: ProducerES_cfi.py:14
cms::cuda::assert
assert(be >=bs)
edm::ProvenanceAdaptor::branchIDLists_
std::shared_ptr< BranchIDLists const > branchIDLists_
Definition: ProvenanceAdaptor.h:54
edm::ProvenanceAdaptor::parameterSetIdConverter_
ParameterSetIdConverter parameterSetIdConverter_
Definition: ProvenanceAdaptor.h:52
edm::ProvenanceAdaptor::convertID
ParameterSetID const & convertID(ParameterSetID const &oldID) const
Definition: ProvenanceAdaptor.cc:167
edm::ProvenanceAdaptor::branchListIndexes_
std::vector< BranchListIndex > branchListIndexes_
Definition: ProvenanceAdaptor.h:55
edm::ProcessHistory::const_iterator
collection_type::const_iterator const_iterator
Definition: ProcessHistory.h:19
edm::ProvenanceAdaptor::fixProcessHistory
void fixProcessHistory(ProcessHistoryMap &pHistMap, ProcessHistoryVector &pHistVector)
Definition: ProvenanceAdaptor.cc:23
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ProcessHistoryID
Hash< ProcessHistoryType > ProcessHistoryID
Definition: ProcessHistoryID.h:8
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::ProvenanceAdaptor::processHistoryIdConverter_
ProcessHistoryIdConverter processHistoryIdConverter_
Definition: ProvenanceAdaptor.h:53