Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:12

0001 // -*- C++ -*-
0002 //
0003 // Package:    L1TriggerKeyDummyProd
0004 // Class:      L1TriggerKeyDummyProd
0005 //
0006 /**\class L1TriggerKeyDummyProd L1TriggerKeyDummyProd.h CondTools/L1TriggerKeyDummyProd/src/L1TriggerKeyDummyProd.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Werner Man-Li Sun
0015 //         Created:  Sat Mar  1 01:08:46 CET 2008
0016 // $Id: L1TriggerKeyDummyProd.cc,v 1.3 2008/10/13 01:48:38 wsun Exp $
0017 //
0018 //
0019 
0020 // system include files
0021 
0022 // user include files
0023 #include "CondTools/L1Trigger/plugins/L1TriggerKeyDummyProd.h"
0024 
0025 //
0026 // class declaration
0027 //
0028 
0029 //
0030 // constants, enums and typedefs
0031 //
0032 
0033 //
0034 // static data member definitions
0035 //
0036 
0037 //
0038 // constructors and destructor
0039 //
0040 L1TriggerKeyDummyProd::L1TriggerKeyDummyProd(const edm::ParameterSet& iConfig) {
0041   //the following line is needed to tell the framework what
0042   // data is being produced
0043 
0044   // Label should be empty, "SubsystemKeysOnly" or any subsystem label expected
0045   // by L1TriggerKeyOnlineProd.
0046   std::string label = iConfig.getParameter<std::string>("label");
0047   setWhatProduced(this, label);
0048 
0049   //now do what ever other initialization is needed
0050   m_key.setTSCKey(iConfig.getParameter<std::string>("tscKey"));
0051   m_key.setSubsystemKey(L1TriggerKey::kCSCTF, iConfig.getParameter<std::string>("csctfKey"));
0052   m_key.setSubsystemKey(L1TriggerKey::kDTTF, iConfig.getParameter<std::string>("dttfKey"));
0053   m_key.setSubsystemKey(L1TriggerKey::kRPC, iConfig.getParameter<std::string>("rpcKey"));
0054   m_key.setSubsystemKey(L1TriggerKey::kGMT, iConfig.getParameter<std::string>("gmtKey"));
0055   m_key.setSubsystemKey(L1TriggerKey::kRCT, iConfig.getParameter<std::string>("rctKey"));
0056   m_key.setSubsystemKey(L1TriggerKey::kGCT, iConfig.getParameter<std::string>("gctKey"));
0057   m_key.setSubsystemKey(L1TriggerKey::kGT, iConfig.getParameter<std::string>("gtKey"));
0058   m_key.setSubsystemKey(L1TriggerKey::kTSP0, iConfig.getParameter<std::string>("tsp0Key"));
0059 
0060   if (label != "SubsystemKeysOnly") {
0061     typedef std::vector<edm::ParameterSet> ObjectKeys;
0062     ObjectKeys keys = iConfig.getParameter<ObjectKeys>("objectKeys");
0063 
0064     for (ObjectKeys::const_iterator it = keys.begin(); it != keys.end(); ++it) {
0065       // Replace ?s with spaces.
0066       std::string key = it->getParameter<std::string>("key");
0067       replace(key.begin(), key.end(), '?', ' ');
0068 
0069       m_key.add(it->getParameter<std::string>("record"), it->getParameter<std::string>("type"), key);
0070     }
0071   }
0072 }
0073 
0074 L1TriggerKeyDummyProd::~L1TriggerKeyDummyProd() {
0075   // do anything here that needs to be done at desctruction time
0076   // (e.g. close files, deallocate resources etc.)
0077 }
0078 
0079 //
0080 // member functions
0081 //
0082 
0083 // ------------ method called to produce the data  ------------
0084 L1TriggerKeyDummyProd::ReturnType L1TriggerKeyDummyProd::produce(const L1TriggerKeyRcd& iRecord) {
0085   return std::make_unique<L1TriggerKey>(m_key);
0086 }
0087 
0088 //define this as a plug-in
0089 //DEFINE_FWK_EVENTSETUP_MODULE(L1TriggerKeyDummyProd);