CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

L1SubsystemKeysOnlineProd Class Reference

#include <CondTools/L1Trigger/interface/L1SubsystemKeysOnlineProd.h>

Inheritance diagram for L1SubsystemKeysOnlineProd:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Types

typedef boost::shared_ptr
< L1TriggerKey
ReturnType

Public Member Functions

 L1SubsystemKeysOnlineProd (const edm::ParameterSet &)
ReturnType produce (const L1TriggerKeyRcd &)
 ~L1SubsystemKeysOnlineProd ()

Private Attributes

bool m_forceGeneration
l1t::OMDSReader m_omdsReader
std::string m_tscKey

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 38 of file L1SubsystemKeysOnlineProd.h.


Member Typedef Documentation

Definition at line 43 of file L1SubsystemKeysOnlineProd.h.


Constructor & Destructor Documentation

L1SubsystemKeysOnlineProd::L1SubsystemKeysOnlineProd ( const edm::ParameterSet iConfig)

Definition at line 51 of file L1SubsystemKeysOnlineProd.cc.

References edm::ESProducer::setWhatProduced().

   : m_tscKey( iConfig.getParameter< std::string >( "tscKey" ) ),
     m_omdsReader(
        iConfig.getParameter< std::string >( "onlineDB" ),
        iConfig.getParameter< std::string >( "onlineAuthentication" ) ),
     m_forceGeneration( iConfig.getParameter< bool >( "forceGeneration" ) )
{
   //the following line is needed to tell the framework what
   // data is being produced
  setWhatProduced(this, "SubsystemKeysOnly");

   //now do what ever other initialization is needed
}
L1SubsystemKeysOnlineProd::~L1SubsystemKeysOnlineProd ( )

Definition at line 66 of file L1SubsystemKeysOnlineProd.cc.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

L1SubsystemKeysOnlineProd::ReturnType L1SubsystemKeysOnlineProd::produce ( const L1TriggerKeyRcd iRecord)

Definition at line 81 of file L1SubsystemKeysOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), l1t::OMDSReader::QueryResults::fillVariable(), L1TriggerKey::kCSCTF, L1TriggerKey::kDTTF, L1TriggerKey::kGCT, L1TriggerKey::kGMT, L1TriggerKey::kGT, L1TriggerKey::kRCT, L1TriggerKey::kRPC, L1TriggerKey::kTSP0, m_forceGeneration, m_omdsReader, m_tscKey, l1t::OMDSReader::QueryResults::numberRows(), l1t::OMDSReader::QueryResults::queryFailed(), and l1t::OMDSReader::singleAttribute().

{
   using namespace edm::es;
   boost::shared_ptr<L1TriggerKey> pL1TriggerKey ;

   // Get L1TriggerKeyList
   L1TriggerKeyList keyList ;
   l1t::DataWriter dataWriter ;
   if( !dataWriter.fillLastTriggerKeyList( keyList ) )
     {
       edm::LogError( "L1-O2O" )
         << "Problem getting last L1TriggerKeyList" ;
     }

   // If L1TriggerKeyList does not contain TSC key, token is empty
   if( keyList.token( m_tscKey ) == std::string() ||
       m_forceGeneration )
     {
       // Instantiate new L1TriggerKey
       pL1TriggerKey = boost::shared_ptr< L1TriggerKey >(
         new L1TriggerKey() ) ;
       pL1TriggerKey->setTSCKey( m_tscKey ) ;

       edm::LogVerbatim( "L1-O2O" ) << "TSC KEY " << m_tscKey ;

       // Get subsystem keys from OMDS

       // SELECT CSCTF_KEY, DTTF_KEY, RPC_KEY, GMT_KEY, RCT_KEY, GCT_KEY, GT_KEY FROM TRIGGERSUP_CONF WHERE TRIGGERSUP_CONF.TS_KEY = m_tscKey
       std::vector< std::string > queryStrings ;
       queryStrings.push_back( "CSCTF_KEY" ) ;
       queryStrings.push_back( "DTTF_KEY" ) ;
       queryStrings.push_back( "RPC_KEY" ) ;
       queryStrings.push_back( "GMT_KEY" ) ;
       queryStrings.push_back( "RCT_KEY" ) ;
       queryStrings.push_back( "GCT_KEY" ) ;
       queryStrings.push_back( "GT_KEY" ) ;
       //         queryStrings.push_back( "TSP0_KEY" ) ;

       l1t::OMDSReader::QueryResults subkeyResults =
         m_omdsReader.basicQuery( queryStrings,
                                  "CMS_TRG_L1_CONF",
                                  "TRIGGERSUP_CONF",
                                  "TRIGGERSUP_CONF.TS_KEY",
                                  m_omdsReader.singleAttribute( m_tscKey ) ) ;

       if( subkeyResults.queryFailed() ||
           subkeyResults.numberRows() != 1 ) // check query successful
         {
           edm::LogError( "L1-O2O" ) << "Problem with subsystem keys." ;
           return pL1TriggerKey ;
         }

       std::string csctfKey, dttfKey, rpcKey, gmtKey, rctKey, gctKey, gtKey ;

       subkeyResults.fillVariable( "CSCTF_KEY", csctfKey ) ;
       pL1TriggerKey->setSubsystemKey( L1TriggerKey::kCSCTF, csctfKey ) ;
       edm::LogVerbatim( "L1-O2O" ) << "CSCTF_KEY " << csctfKey ;

       subkeyResults.fillVariable( "DTTF_KEY", dttfKey ) ;
       pL1TriggerKey->setSubsystemKey( L1TriggerKey::kDTTF, dttfKey ) ;
       edm::LogVerbatim( "L1-O2O" ) << "DTTF_KEY " << dttfKey ;

       subkeyResults.fillVariable( "RPC_KEY", rpcKey ) ;
       pL1TriggerKey->setSubsystemKey( L1TriggerKey::kRPC, rpcKey ) ;
       edm::LogVerbatim( "L1-O2O" ) << "RPC_KEY " << rpcKey ;

       subkeyResults.fillVariable( "GMT_KEY", gmtKey ) ;
       pL1TriggerKey->setSubsystemKey( L1TriggerKey::kGMT, gmtKey ) ;
       edm::LogVerbatim( "L1-O2O" ) << "GMT_KEY " << gmtKey ;

       subkeyResults.fillVariable( "RCT_KEY", rctKey ) ;
       pL1TriggerKey->setSubsystemKey( L1TriggerKey::kRCT, rctKey ) ;
       edm::LogVerbatim( "L1-O2O" ) << "RCT_KEY " << rctKey ;

       subkeyResults.fillVariable( "GCT_KEY", gctKey ) ;
       pL1TriggerKey->setSubsystemKey( L1TriggerKey::kGCT, gctKey ) ;
       edm::LogVerbatim( "L1-O2O" ) << "GCT_KEY " << gctKey ;

       subkeyResults.fillVariable( "GT_KEY", gtKey ) ;
       pL1TriggerKey->setSubsystemKey( L1TriggerKey::kGT, gtKey ) ;
       edm::LogVerbatim( "L1-O2O" ) << "GT_KEY " << gtKey ;

       //       std::string tsp0Key = row[ "TSP0_KEY" ].data< std::string >() ;
       std::string tsp0Key ;
       pL1TriggerKey->setSubsystemKey( L1TriggerKey::kTSP0, tsp0Key ) ;
       edm::LogVerbatim( "L1-O2O" ) << "TSP0_KEY " << tsp0Key ;
   }
   else
   {
     throw l1t::DataAlreadyPresentException(
        "L1TriggerKey for TSC key " + m_tscKey + " already in CondDB." ) ;
   }

   return pL1TriggerKey ;
}

Member Data Documentation

Definition at line 50 of file L1SubsystemKeysOnlineProd.h.

Referenced by produce().

Definition at line 49 of file L1SubsystemKeysOnlineProd.h.

Referenced by produce().

std::string L1SubsystemKeysOnlineProd::m_tscKey [private]

Definition at line 48 of file L1SubsystemKeysOnlineProd.h.

Referenced by produce().