CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/CondTools/L1Trigger/plugins/L1TriggerKeyDummyProd.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    L1TriggerKeyDummyProd
00004 // Class:      L1TriggerKeyDummyProd
00005 // 
00013 //
00014 // Original Author:  Werner Man-Li Sun
00015 //         Created:  Sat Mar  1 01:08:46 CET 2008
00016 // $Id: L1TriggerKeyDummyProd.cc,v 1.4 2009/05/06 02:02:13 wsun Exp $
00017 //
00018 //
00019 
00020 
00021 // system include files
00022 
00023 // user include files
00024 #include "CondTools/L1Trigger/plugins/L1TriggerKeyDummyProd.h"
00025 
00026 //
00027 // class declaration
00028 //
00029 
00030 //
00031 // constants, enums and typedefs
00032 //
00033 
00034 //
00035 // static data member definitions
00036 //
00037 
00038 //
00039 // constructors and destructor
00040 //
00041 L1TriggerKeyDummyProd::L1TriggerKeyDummyProd(const edm::ParameterSet& iConfig)
00042 {
00043    //the following line is needed to tell the framework what
00044    // data is being produced
00045 
00046   // Label should be empty, "SubsystemKeysOnly" or any subsystem label expected
00047   // by L1TriggerKeyOnlineProd.
00048   std::string label = iConfig.getParameter< std::string >( "label" ) ;
00049   setWhatProduced(this, label);
00050 
00051    //now do what ever other initialization is needed
00052    m_key.setTSCKey( iConfig.getParameter< std::string >( "tscKey" ) ) ;
00053    m_key.setSubsystemKey( L1TriggerKey::kCSCTF,
00054                           iConfig.getParameter< std::string >( "csctfKey" ) ) ;
00055    m_key.setSubsystemKey( L1TriggerKey::kDTTF,
00056                           iConfig.getParameter< std::string >( "dttfKey" ) ) ;
00057    m_key.setSubsystemKey( L1TriggerKey::kRPC,
00058                           iConfig.getParameter< std::string >( "rpcKey" ) ) ;
00059    m_key.setSubsystemKey( L1TriggerKey::kGMT,
00060                           iConfig.getParameter< std::string >( "gmtKey" ) ) ;
00061    m_key.setSubsystemKey( L1TriggerKey::kRCT,
00062                           iConfig.getParameter< std::string >( "rctKey" ) ) ;
00063    m_key.setSubsystemKey( L1TriggerKey::kGCT,
00064                           iConfig.getParameter< std::string >( "gctKey" ) ) ;
00065    m_key.setSubsystemKey( L1TriggerKey::kGT,
00066                           iConfig.getParameter< std::string >( "gtKey" ) ) ;
00067    m_key.setSubsystemKey( L1TriggerKey::kTSP0,
00068                           iConfig.getParameter< std::string >( "tsp0Key" ) ) ;
00069 
00070    if( label != "SubsystemKeysOnly" )
00071      {
00072        typedef std::vector< edm::ParameterSet > ObjectKeys;
00073        ObjectKeys keys = iConfig.getParameter< ObjectKeys >( "objectKeys" ) ;
00074 
00075        for( ObjectKeys::const_iterator it = keys.begin ();
00076             it != keys.end() ;
00077             ++it )
00078          {
00079            // Replace ?s with spaces.
00080            std::string key = it->getParameter< std::string >( "key" ) ;
00081            replace( key.begin(), key.end(), '?', ' ' ) ;
00082 
00083            m_key.add( it->getParameter< std::string >( "record" ),
00084                       it->getParameter< std::string >( "type" ),
00085                       key ) ;
00086          }
00087      }
00088 }
00089 
00090 
00091 L1TriggerKeyDummyProd::~L1TriggerKeyDummyProd()
00092 {
00093  
00094    // do anything here that needs to be done at desctruction time
00095    // (e.g. close files, deallocate resources etc.)
00096 
00097 }
00098 
00099 
00100 //
00101 // member functions
00102 //
00103 
00104 // ------------ method called to produce the data  ------------
00105 L1TriggerKeyDummyProd::ReturnType
00106 L1TriggerKeyDummyProd::produce(const L1TriggerKeyRcd& iRecord)
00107 {
00108    using namespace edm::es;
00109    boost::shared_ptr<L1TriggerKey> pL1TriggerKey ;
00110 
00111    pL1TriggerKey = boost::shared_ptr< L1TriggerKey >(
00112       new L1TriggerKey( m_key ) ) ;
00113 
00114    return pL1TriggerKey ;
00115 }
00116 
00117 //define this as a plug-in
00118 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyDummyProd);