CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CondFormats/L1TObjects/interface/L1TriggerKeyList.h

Go to the documentation of this file.
00001 #ifndef CondFormats_L1TObjects_L1TriggerKeyList_h
00002 #define CondFormats_L1TObjects_L1TriggerKeyList_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     L1TObjects
00006 // Class  :     L1TriggerKeyList
00007 // 
00016 //
00017 // Original Author:  Werner Sun
00018 //         Created:  Fri Feb 29 20:44:53 CET 2008
00019 // $Id: L1TriggerKeyList.h,v 1.4 2009/04/06 01:58:49 wsun Exp $
00020 //
00021 
00022 // system include files
00023 #include <string>
00024 #include <map>
00025 
00026 // user include files
00027 
00028 // forward declarations
00029 
00030 class L1TriggerKeyList
00031 {
00032 
00033    public:
00034       L1TriggerKeyList();
00035       virtual ~L1TriggerKeyList();
00036 
00037       typedef std::map< std::string, std::string > KeyToToken ;
00038       typedef std::map< std::string, KeyToToken > RecordToKeyToToken ;
00039 
00040       // ---------- const member functions ---------------------
00041 
00042       // Get payload token for L1TriggerKey
00043       std::string token( const std::string& tscKey ) const ;
00044 
00045       // Get payload token for configuration data
00046       std::string token( const std::string& recordName,
00047                          const std::string& dataType,
00048                          const std::string& key ) const ;
00049 
00050       // Get payload token for configuration data
00051       std::string token( const std::string& recordType, // "record@type"
00052                          const std::string& key ) const ;
00053 
00054       const KeyToToken& tscKeyToTokenMap() const
00055         { return m_tscKeyToToken ; }
00056 
00057       const RecordToKeyToToken& recordTypeToKeyToTokenMap() const
00058         { return m_recordKeyToken ; }
00059 
00060       // Get object key for a given payload token.  In practice, each
00061       // record in the CondDB has only one object, so there is no need to
00062       // specify the data type.
00063       std::string objectKey( const std::string& recordName,
00064                              const std::string& payloadToken ) const ;
00065 
00066       // Get TSC key for a given L1TriggerKey payload token
00067       std::string tscKey( const std::string& triggerKeyPayloadToken ) const ;
00068 
00069       // ---------- static member functions --------------------
00070 
00071       // ---------- member functions ---------------------------
00072 
00073       // Store payload token for L1TriggerKey, return true if successful
00074       bool addKey( const std::string& tscKey,
00075                    const std::string& payloadToken,
00076                    bool overwriteKey = false ) ;
00077 
00078       // Store payload token for configuration data, return true if successful
00079       bool addKey( const std::string& recordType, // "record@type"
00080                    const std::string& key,
00081                    const std::string& payloadToken,
00082                    bool overwriteKey = false ) ;
00083 
00084    private:
00085       //L1TriggerKeyList(const L1TriggerKeyList&); // stop default
00086 
00087       //const L1TriggerKeyList& operator=(const L1TriggerKeyList&); // stop default
00088 
00089       // ---------- member data --------------------------------
00090 
00091       // map of TSC key (first) to L1TriggerKey payload token (second)
00092       KeyToToken m_tscKeyToToken ;
00093 
00094       // map of subsystem key (second/first) to configuration data payload
00095       // token (second/second), keyed by record@type (first)
00096       RecordToKeyToToken m_recordKeyToken ;
00097 };
00098 
00099 
00100 #endif