Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:18

0001 #ifndef CondFormats_L1TObjects_L1TriggerKeyListExt_h
0002 #define CondFormats_L1TObjects_L1TriggerKeyListExt_h
0003 
0004 // system include files
0005 #include "CondFormats/Serialization/interface/Serializable.h"
0006 
0007 #include <string>
0008 #include <map>
0009 
0010 class L1TriggerKeyListExt {
0011 public:
0012   L1TriggerKeyListExt();
0013   virtual ~L1TriggerKeyListExt();
0014 
0015   typedef std::map<std::string, std::string> KeyToToken;
0016   typedef std::map<std::string, KeyToToken> RecordToKeyToToken;
0017 
0018   // ---------- const member functions ---------------------
0019 
0020   // Get payload token for L1TriggerKeyExt
0021   std::string token(const std::string& tscKey) const;
0022 
0023   // Get payload token for configuration data
0024   std::string token(const std::string& recordName, const std::string& dataType, const std::string& key) const;
0025 
0026   // Get payload token for configuration data
0027   std::string token(const std::string& recordType,  // "record@type"
0028                     const std::string& key) const;
0029 
0030   const KeyToToken& tscKeyToTokenMap() const { return m_tscKeyToToken; }
0031 
0032   const RecordToKeyToToken& recordTypeToKeyToTokenMap() const { return m_recordKeyToken; }
0033 
0034   // Get object key for a given payload token.  In practice, each
0035   // record in the CondDB has only one object, so there is no need to
0036   // specify the data type.
0037   std::string objectKey(const std::string& recordName, const std::string& payloadToken) const;
0038 
0039   // Get TSC key for a given L1TriggerKeyExt payload token
0040   std::string tscKey(const std::string& triggerKeyPayloadToken) const;
0041 
0042   // ---------- static member functions --------------------
0043 
0044   // ---------- member functions ---------------------------
0045 
0046   // Store payload token for L1TriggerKey, return true if successful
0047   bool addKey(const std::string& tscKey, const std::string& payloadToken, bool overwriteKey = false);
0048 
0049   // Store payload token for configuration data, return true if successful
0050   bool addKey(const std::string& recordType,  // "record@type"
0051               const std::string& key,
0052               const std::string& payloadToken,
0053               bool overwriteKey = false);
0054 
0055 private:
0056   //L1TriggerKeyListExt(const L1TriggerKeyListExt&); // stop default
0057 
0058   //const L1TriggerKeyListExt& operator=(const L1TriggerKeyListExt&); // stop default
0059 
0060   // ---------- member data --------------------------------
0061 
0062   // map of TSC key (first) to L1TriggerKeyExt payload token (second)
0063   KeyToToken m_tscKeyToToken;
0064 
0065   // map of subsystem key (second/first) to configuration data payload
0066   // token (second/second), keyed by record@type (first)
0067   RecordToKeyToToken m_recordKeyToken;
0068 
0069   COND_SERIALIZABLE;
0070 };
0071 
0072 #endif