Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:06

0001 #ifndef IOPool_Input_ProvenanceAdaptor_h
0002 #define IOPool_Input_ProvenanceAdaptor_h
0003 
0004 /*----------------------------------------------------------------------
0005 
0006 ProvenanceAdaptor.h 
0007 
0008 ----------------------------------------------------------------------*/
0009 #include <map>
0010 #include <memory>
0011 #include <vector>
0012 
0013 #include "DataFormats/Provenance/interface/BranchIDList.h"
0014 #include "DataFormats/Provenance/interface/BranchListIndex.h"
0015 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0016 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
0017 #include "DataFormats/Provenance/interface/ProcessHistoryRegistry.h"
0018 #include "DataFormats/Provenance/interface/ProvenanceFwd.h"
0019 #include "FWCore/ParameterSet/interface/ParameterSetConverter.h"
0020 
0021 namespace edm {
0022 
0023   //------------------------------------------------------------
0024   // Class ProvenanceAdaptor:
0025 
0026   class ProvenanceAdaptor {
0027   public:
0028     typedef ParameterSetConverter::ParameterSetIdConverter ParameterSetIdConverter;
0029     typedef std::map<ProcessHistoryID, ProcessHistoryID> ProcessHistoryIdConverter;
0030     ProvenanceAdaptor(ProductRegistry& productRegistry,
0031                       ProcessHistoryMap& pHistMap,
0032                       ProcessHistoryVector& pHistVector,
0033                       ProcessConfigurationVector& procConfigVector,
0034                       ParameterSetIdConverter const& parameterSetIdConverter,
0035                       bool fullConversion);
0036     ~ProvenanceAdaptor();
0037 
0038     ProvenanceAdaptor(ProvenanceAdaptor const&) = delete;             // Disallow copying and moving
0039     ProvenanceAdaptor& operator=(ProvenanceAdaptor const&) = delete;  // Disallow copying and moving
0040 
0041     std::shared_ptr<BranchIDLists const> branchIDLists() const;
0042 
0043     void branchListIndexes(BranchListIndexes& indexes) const;
0044 
0045     ParameterSetID const& convertID(ParameterSetID const& oldID) const;
0046 
0047     ProcessHistoryID const& convertID(ProcessHistoryID const& oldID) const;
0048 
0049   private:
0050     void fixProcessHistory(ProcessHistoryMap& pHistMap, ProcessHistoryVector& pHistVector);
0051 
0052     ParameterSetIdConverter parameterSetIdConverter_;
0053     ProcessHistoryIdConverter processHistoryIdConverter_;
0054     std::shared_ptr<BranchIDLists const> branchIDLists_;
0055     std::vector<BranchListIndex> branchListIndexes_;
0056   };  // class ProvenanceAdaptor
0057 }  // namespace edm
0058 #endif