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

Definition at line 28 of file ProvenanceAdaptor.h.

Definition at line 29 of file ProvenanceAdaptor.h.

Constructor & Destructor Documentation

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

Definition at line 148 of file ProvenanceAdaptor.cc.

References branchIDLists_, branchListIndexes_, and fixProcessHistory().

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

Definition at line 165 of file ProvenanceAdaptor.cc.

165 {}
edm::ProvenanceAdaptor::ProvenanceAdaptor ( ProvenanceAdaptor const &  )
delete

Member Function Documentation

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

Definition at line 183 of file ProvenanceAdaptor.cc.

References branchIDLists_.

Referenced by fixProcessHistory().

183 { return branchIDLists_; }
std::shared_ptr< BranchIDLists const > branchIDLists_
void edm::ProvenanceAdaptor::branchListIndexes ( BranchListIndexes indexes) const

Definition at line 185 of file ProvenanceAdaptor.cc.

References branchListIndexes_.

Referenced by fixProcessHistory().

185 { indexes = branchListIndexes_; }
std::vector< BranchListIndex > branchListIndexes_
ParameterSetID const & edm::ProvenanceAdaptor::convertID ( ParameterSetID const &  oldID) const

Definition at line 167 of file ProvenanceAdaptor.cc.

References parameterSetIdConverter_.

Referenced by fixProcessHistory().

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

Definition at line 175 of file ProvenanceAdaptor.cc.

References processHistoryIdConverter_.

175  {
176  ProcessHistoryIdConverter::const_iterator it = processHistoryIdConverter_.find(oldID);
177  if (it == processHistoryIdConverter_.end()) {
178  return oldID;
179  }
180  return it->second;
181  }
ProcessHistoryIdConverter processHistoryIdConverter_
void edm::ProvenanceAdaptor::fixProcessHistory ( ProcessHistoryMap pHistMap,
ProcessHistoryVector pHistVector 
)
private

Definition at line 23 of file ProvenanceAdaptor.cc.

References a, b, edm::ProcessHistory::begin(), edm::BranchDescription::branchID(), branchIDLists(), branchListIndexes(), edm::BranchDescription::branchType(), convertID(), MillePedeFileConverter_cfg::e, edm::ProcessHistory::emplace_back(), edm::ProcessHistory::end(), stringResolutionProvider_cfi::et, edm::find_in_all(), mps_fire::i, edm::ProcessHistory::id(), edm::InEvent, edm::BranchDescription::init(), edm::max(), eostools::move(), AlCaHLTBitMon_ParallelJobs::p, LaserDQM_cfg::process, processHistoryIdConverter_, modifiedElectrons_cfi::processName, edm::BranchDescription::processName(), parseEventContent::prod, edm::ProductRegistry::productListUpdator(), edm::ProcessHistory::push_back(), MetAnalyzer::pv(), edm::ProcessHistory::size(), edm::stable_sort_all(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ProvenanceAdaptor().

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  }
collection_type::const_iterator const_iterator
ProcessHistoryIdConverter processHistoryIdConverter_
Hash< ParameterSetType > ParameterSetID
Hash< ProcessHistoryType > ProcessHistoryID
et
define resolution functions of each parameter
ParameterSetID const & convertID(ParameterSetID const &oldID) const
def move(src, dest)
Definition: eostools.py:511
ProvenanceAdaptor& edm::ProvenanceAdaptor::operator= ( ProvenanceAdaptor const &  )
delete

Member Data Documentation

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

Definition at line 54 of file ProvenanceAdaptor.h.

Referenced by branchIDLists(), and ProvenanceAdaptor().

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

Definition at line 55 of file ProvenanceAdaptor.h.

Referenced by branchListIndexes(), and ProvenanceAdaptor().

ParameterSetIdConverter edm::ProvenanceAdaptor::parameterSetIdConverter_
private

Definition at line 52 of file ProvenanceAdaptor.h.

Referenced by convertID().

ProcessHistoryIdConverter edm::ProvenanceAdaptor::processHistoryIdConverter_
private

Definition at line 53 of file ProvenanceAdaptor.h.

Referenced by convertID(), and fixProcessHistory().