Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef FWCore_ParameterSet_ParameterSetConverter_h
0002 #define FWCore_ParameterSet_ParameterSetConverter_h
0003 
0004 #include <map>
0005 #include <list>
0006 #include <set>
0007 #include <string>
0008 #include <utility>
0009 #include <vector>
0010 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0011 #include "DataFormats/Provenance/interface/ParameterSetBlob.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 
0014 namespace edm {
0015 
0016   typedef std::vector<std::string> StringVector;
0017 
0018   struct MainParameterSet {
0019     MainParameterSet(ParameterSetID const& oldID, std::string const& psetString);
0020     ~MainParameterSet();
0021     ParameterSetID oldID_;
0022     ParameterSet parameterSet_;
0023     StringVector paths_;
0024     StringVector endPaths_;
0025     std::set<std::string> triggerPaths_;
0026   };
0027 
0028   struct TriggerPath {
0029     TriggerPath(ParameterSet const& pset);
0030     ~TriggerPath();
0031     ParameterSet parameterSet_;
0032     StringVector tPaths_;
0033     std::set<std::string> triggerPaths_;
0034   };
0035 
0036   //------------------------------------------------------------
0037   // Class ParameterSetConverter
0038 
0039   typedef std::map<ParameterSetID, ParameterSetBlob> ParameterSetMap;
0040   class ParameterSetConverter {
0041   public:
0042     typedef std::list<std::string> StringList;
0043     typedef std::map<std::string, std::string> StringMap;
0044     typedef std::list<std::pair<std::string, ParameterSetID> > StringWithIDList;
0045     typedef std::map<ParameterSetID, ParameterSetID> ParameterSetIdConverter;
0046     ParameterSetConverter(ParameterSetMap const& psetMap,
0047                           ParameterSetIdConverter& idConverter,
0048                           bool alreadyByReference);
0049     ~ParameterSetConverter();
0050     ParameterSetConverter(const ParameterSetConverter&) = delete;
0051     ParameterSetConverter& operator=(const ParameterSetConverter&) = delete;
0052 
0053     ParameterSetIdConverter const& parameterSetIdConverter() const { return parameterSetIdConverter_; }
0054 
0055   private:
0056     void convertParameterSets();
0057     void noConvertParameterSets();
0058     StringWithIDList parameterSets_;
0059     std::vector<MainParameterSet> mainParameterSets_;
0060     std::vector<TriggerPath> triggerPaths_;
0061     StringMap replace_;
0062     ParameterSetIdConverter& parameterSetIdConverter_;
0063   };
0064 }  // namespace edm
0065 #endif