00001 #ifndef IOPool_Input_ProvenanceAdaptor_h 00002 #define IOPool_Input_ProvenanceAdaptor_h 00003 00004 /*---------------------------------------------------------------------- 00005 00006 ProvenanceAdaptor.h 00007 00008 ----------------------------------------------------------------------*/ 00009 #include <map> 00010 #include <vector> 00011 #include "boost/shared_ptr.hpp" 00012 #include "boost/utility.hpp" 00013 #include "DataFormats/Provenance/interface/BranchIDList.h" 00014 #include "DataFormats/Provenance/interface/BranchListIndex.h" 00015 #include "DataFormats/Provenance/interface/ParameterSetID.h" 00016 #include "DataFormats/Provenance/interface/ProcessConfigurationRegistry.h" 00017 #include "DataFormats/Provenance/interface/ProcessHistoryID.h" 00018 #include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h" 00019 #include "DataFormats/Provenance/interface/ProvenanceFwd.h" 00020 #include "FWCore/ParameterSet/interface/ParameterSetConverter.h" 00021 00022 namespace edm { 00023 00024 //------------------------------------------------------------ 00025 // Class ProvenanceAdaptor: 00026 00027 class ProvenanceAdaptor : private boost::noncopyable { 00028 public: 00029 typedef ParameterSetConverter::ParameterSetIdConverter ParameterSetIdConverter; 00030 typedef std::map<ProcessHistoryID, ProcessHistoryID> ProcessHistoryIdConverter; 00031 ProvenanceAdaptor( 00032 ProductRegistry& productRegistry, 00033 ProcessHistoryMap& pHistMap, 00034 ProcessHistoryVector& pHistVector, 00035 ProcessConfigurationVector& procConfigVector, 00036 ParameterSetIdConverter const& parameterSetIdConverter, 00037 bool fullConversion); 00038 ~ProvenanceAdaptor(); 00039 00040 boost::shared_ptr<BranchIDLists const> branchIDLists() const; 00041 00042 void branchListIndexes(BranchListIndexes & indexes) const; 00043 00044 ParameterSetID const& 00045 convertID(ParameterSetID const& oldID) const; 00046 00047 ProcessHistoryID const& 00048 convertID(ProcessHistoryID const& oldID) const; 00049 00050 private: 00051 void fixProcessHistory(ProcessHistoryMap& pHistMap, 00052 ProcessHistoryVector& pHistVector); 00053 00054 ParameterSetIdConverter parameterSetIdConverter_; 00055 ProcessHistoryIdConverter processHistoryIdConverter_; 00056 boost::shared_ptr<BranchIDLists const> branchIDLists_; 00057 std::vector<BranchListIndex> branchListIndexes_; 00058 }; // class ProvenanceAdaptor 00059 } 00060 #endif