Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:21

0001 #ifndef CondFormats_L1TObjects_L1TriggerKeyList_h
0002 #define CondFormats_L1TObjects_L1TriggerKeyList_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     L1TObjects
0006 // Class  :     L1TriggerKeyList
0007 //
0008 /**\class L1TriggerKeyList L1TriggerKeyList.h CondFormats/L1TObjects/interface/L1TriggerKeyList.h
0009 
0010  Description: <one line class summary>
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Werner Sun
0018 //         Created:  Fri Feb 29 20:44:53 CET 2008
0019 // $Id: L1TriggerKeyList.h,v 1.3 2008/11/06 23:13:00 wsun Exp $
0020 //
0021 
0022 // system include files
0023 #include "CondFormats/Serialization/interface/Serializable.h"
0024 
0025 #include <string>
0026 #include <map>
0027 
0028 // user include files
0029 
0030 // forward declarations
0031 
0032 class L1TriggerKeyList {
0033 public:
0034   L1TriggerKeyList();
0035   virtual ~L1TriggerKeyList();
0036 
0037   typedef std::map<std::string, std::string> KeyToToken;
0038   typedef std::map<std::string, KeyToToken> RecordToKeyToToken;
0039 
0040   // ---------- const member functions ---------------------
0041 
0042   // Get payload token for L1TriggerKey
0043   std::string token(const std::string& tscKey) const;
0044 
0045   // Get payload token for configuration data
0046   std::string token(const std::string& recordName, const std::string& dataType, const std::string& key) const;
0047 
0048   // Get payload token for configuration data
0049   std::string token(const std::string& recordType,  // "record@type"
0050                     const std::string& key) const;
0051 
0052   const KeyToToken& tscKeyToTokenMap() const { return m_tscKeyToToken; }
0053 
0054   const RecordToKeyToToken& recordTypeToKeyToTokenMap() const { return m_recordKeyToken; }
0055 
0056   // Get object key for a given payload token.  In practice, each
0057   // record in the CondDB has only one object, so there is no need to
0058   // specify the data type.
0059   std::string objectKey(const std::string& recordName, const std::string& payloadToken) const;
0060 
0061   // Get TSC key for a given L1TriggerKey payload token
0062   std::string tscKey(const std::string& triggerKeyPayloadToken) const;
0063 
0064   // ---------- static member functions --------------------
0065 
0066   // ---------- member functions ---------------------------
0067 
0068   // Store payload token for L1TriggerKey, return true if successful
0069   bool addKey(const std::string& tscKey, const std::string& payloadToken, bool overwriteKey = false);
0070 
0071   // Store payload token for configuration data, return true if successful
0072   bool addKey(const std::string& recordType,  // "record@type"
0073               const std::string& key,
0074               const std::string& payloadToken,
0075               bool overwriteKey = false);
0076 
0077 private:
0078   //L1TriggerKeyList(const L1TriggerKeyList&); // stop default
0079 
0080   //const L1TriggerKeyList& operator=(const L1TriggerKeyList&); // stop default
0081 
0082   // ---------- member data --------------------------------
0083 
0084   // map of TSC key (first) to L1TriggerKey payload token (second)
0085   KeyToToken m_tscKeyToToken;
0086 
0087   // map of subsystem key (second/first) to configuration data payload
0088   // token (second/second), keyed by record@type (first)
0089   RecordToKeyToToken m_recordKeyToken;
0090 
0091   COND_SERIALIZABLE;
0092 };
0093 
0094 #endif