CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

edm::ProvenanceAdaptor Class Reference

#include <ProvenanceAdaptor.h>

List of all members.

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
ProcessHistoryID const & convertID (ProcessHistoryID const &oldID) const
ParameterSetID const & convertID (ParameterSetID const &oldID) const
ProvenanceAdaptoroperator= (ProvenanceAdaptor const &)
 ProvenanceAdaptor (ProductRegistry &productRegistry, ProcessHistoryMap &pHistMap, ProcessHistoryVector &pHistVector, ProcessConfigurationVector &procConfigVector, ParameterSetIdConverter const &parameterSetIdConverter, bool fullConversion)
 ProvenanceAdaptor (ProvenanceAdaptor const &)
 ~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().

                                  :
                parameterSetIdConverter_(parameterSetIdConverter),
                processHistoryIdConverter_(),
                branchIDLists_(),
                branchListIndexes_() {
    fixProcessHistory(pHistMap, pHistVector);
    fillProcessConfiguration(pHistVector, procConfigVector);
    if (fullConversion) {
      fillListsAndIndexes(productRegistry, pHistMap, branchIDLists_, branchListIndexes_);
    }
  }
edm::ProvenanceAdaptor::~ProvenanceAdaptor ( )

Definition at line 168 of file ProvenanceAdaptor.cc.

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

Member Function Documentation

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

Definition at line 189 of file ProvenanceAdaptor.cc.

References branchIDLists_.

                                         {
    return branchIDLists_;
  }
void edm::ProvenanceAdaptor::branchListIndexes ( BranchListIndexes indexes) const

Definition at line 194 of file ProvenanceAdaptor.cc.

References branchListIndexes_.

                                                                         {
    indexes = branchListIndexes_;
  }
ProcessHistoryID const & edm::ProvenanceAdaptor::convertID ( ProcessHistoryID const &  oldID) const

Definition at line 180 of file ProvenanceAdaptor.cc.

References processHistoryIdConverter_.

                                                                  {
    ProcessHistoryIdConverter::const_iterator it = processHistoryIdConverter_.find(oldID);
    if (it == processHistoryIdConverter_.end()) {
      return oldID;
    }
    return it->second; 
  }
ParameterSetID const & edm::ProvenanceAdaptor::convertID ( ParameterSetID const &  oldID) const

Definition at line 171 of file ProvenanceAdaptor.cc.

References parameterSetIdConverter_.

Referenced by fixProcessHistory().

                                                                {
    ParameterSetIdConverter::const_iterator it = parameterSetIdConverter_.find(oldID);
    if (it == parameterSetIdConverter_.end()) {
      return oldID;
    }
    return it->second; 
  }
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().

                                                                          {
    assert (pHistMap.empty() != pHistVector.empty());
    for (ProcessHistoryVector::const_iterator i = pHistVector.begin(), e = pHistVector.end(); i != e; ++i) {
      pHistMap.insert(std::make_pair(i->id(), *i));
    }
    pHistVector.clear();
    for (ProcessHistoryMap::const_iterator i = pHistMap.begin(), e = pHistMap.end(); i != e; ++i) {
      ProcessHistory newHist;
      ProcessHistoryID const& oldphID = i->first;
      for (ProcessHistory::const_iterator it = i->second.begin(), et = i->second.end(); it != et; ++it) {
        ParameterSetID const& newPsetID = convertID(it->parameterSetID());
        newHist.emplace_back(it->processName(), newPsetID, it->releaseVersion(), it->passID());
      }
      assert(newHist.size() == i->second.size());
      ProcessHistoryID newphID = newHist.id();
      pHistVector.push_back(std::move(newHist));
      if (newphID != oldphID) {
        processHistoryIdConverter_.insert(std::make_pair(oldphID, newphID));
      }
    }
    assert(pHistVector.size() == pHistMap.size());
  }
ProvenanceAdaptor& edm::ProvenanceAdaptor::operator= ( ProvenanceAdaptor const &  )

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

Definition at line 59 of file ProvenanceAdaptor.h.

Referenced by branchListIndexes(), and ProvenanceAdaptor().

Definition at line 56 of file ProvenanceAdaptor.h.

Referenced by convertID().

Definition at line 57 of file ProvenanceAdaptor.h.

Referenced by convertID(), and fixProcessHistory().