CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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,
ProcessHistoryID
ProcessHistoryIdConverter
 

Public Member Functions

boost::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

boost::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 150 of file ProvenanceAdaptor.cc.

References branchIDLists_, branchListIndexes_, and fixProcessHistory().

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

Definition at line 168 of file ProvenanceAdaptor.cc.

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

Member Function Documentation

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

Definition at line 189 of file ProvenanceAdaptor.cc.

References branchIDLists_.

189  {
190  return branchIDLists_;
191  }
boost::shared_ptr< BranchIDLists const > branchIDLists_
void edm::ProvenanceAdaptor::branchListIndexes ( BranchListIndexes indexes) const

Definition at line 194 of file ProvenanceAdaptor.cc.

References branchListIndexes_.

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

Definition at line 171 of file ProvenanceAdaptor.cc.

References parameterSetIdConverter_.

Referenced by fixProcessHistory().

171  {
172  ParameterSetIdConverter::const_iterator it = parameterSetIdConverter_.find(oldID);
173  if (it == parameterSetIdConverter_.end()) {
174  return oldID;
175  }
176  return it->second;
177  }
ParameterSetIdConverter parameterSetIdConverter_
ProcessHistoryID const & edm::ProvenanceAdaptor::convertID ( ProcessHistoryID const &  oldID) const

Definition at line 180 of file ProvenanceAdaptor.cc.

References processHistoryIdConverter_.

180  {
181  ProcessHistoryIdConverter::const_iterator it = processHistoryIdConverter_.find(oldID);
182  if (it == processHistoryIdConverter_.end()) {
183  return oldID;
184  }
185  return it->second;
186  }
ProcessHistoryIdConverter processHistoryIdConverter_
void edm::ProvenanceAdaptor::fixProcessHistory ( ProcessHistoryMap pHistMap,
ProcessHistoryVector pHistVector 
)
private

Definition at line 24 of file ProvenanceAdaptor.cc.

References convertID(), alignCSCRings::e, edm::ProcessHistory::emplace_back(), i, edm::ProcessHistory::id(), 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
int i
Definition: DBlmapReader.cc:9
ProcessHistoryIdConverter processHistoryIdConverter_
Hash< ParameterSetType > ParameterSetID
Hash< ProcessHistoryType > ProcessHistoryID
ParameterSetID const & convertID(ParameterSetID const &oldID) const
ProvenanceAdaptor& edm::ProvenanceAdaptor::operator= ( ProvenanceAdaptor const &  )
delete

Member Data Documentation

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

Definition at line 58 of file ProvenanceAdaptor.h.

Referenced by branchIDLists(), and ProvenanceAdaptor().

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

Definition at line 59 of file ProvenanceAdaptor.h.

Referenced by branchListIndexes(), and ProvenanceAdaptor().

ParameterSetIdConverter edm::ProvenanceAdaptor::parameterSetIdConverter_
private

Definition at line 56 of file ProvenanceAdaptor.h.

Referenced by convertID().

ProcessHistoryIdConverter edm::ProvenanceAdaptor::processHistoryIdConverter_
private

Definition at line 57 of file ProvenanceAdaptor.h.

Referenced by convertID(), and fixProcessHistory().