Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:25

0001 // -*- C++ -*-
0002 //
0003 // Package:    L1RPCHsbConfigOnlineProd
0004 // Class:      L1RPCHsbConfigOnlineProd
0005 //
0006 /**\class L1RPCHsbConfigOnlineProd L1RPCHsbConfigOnlineProd.h L1Trigger/RPCConfigProducers/src/RPCHsbConfigOnlineProd.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 
0014 // system include files
0015 
0016 // user include files
0017 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0018 
0019 #include "CondTools/L1Trigger/interface/L1ConfigOnlineProdBase.h"
0020 
0021 #include "CondFormats/L1TObjects/interface/L1RPCHsbConfig.h"
0022 #include "CondFormats/DataRecord/interface/L1RPCHsbConfigRcd.h"
0023 
0024 //
0025 // class declaration
0026 //
0027 
0028 class L1RPCHsbConfigOnlineProd : public L1ConfigOnlineProdBase<L1RPCHsbConfigRcd, L1RPCHsbConfig> {
0029 public:
0030   L1RPCHsbConfigOnlineProd(const edm::ParameterSet&);
0031   ~L1RPCHsbConfigOnlineProd() override;
0032 
0033   std::unique_ptr<L1RPCHsbConfig> newObject(const std::string& objectKey) override;
0034 
0035 private:
0036   // ----------member data ---------------------------
0037 };
0038 
0039 //
0040 // constants, enums and typedefs
0041 //
0042 
0043 //
0044 // static data member definitions
0045 //
0046 
0047 //
0048 // constructors and destructor
0049 //
0050 L1RPCHsbConfigOnlineProd::L1RPCHsbConfigOnlineProd(const edm::ParameterSet& iConfig)
0051     : L1ConfigOnlineProdBase<L1RPCHsbConfigRcd, L1RPCHsbConfig>(iConfig) {
0052   //the following line is needed to tell the framework what
0053   // data is being produced
0054 
0055   //now do what ever other initialization is needed
0056 }
0057 
0058 L1RPCHsbConfigOnlineProd::~L1RPCHsbConfigOnlineProd() {
0059   // do anything here that needs to be done at desctruction time
0060   // (e.g. close files, deallocate resources etc.)
0061 }
0062 
0063 std::unique_ptr<L1RPCHsbConfig> L1RPCHsbConfigOnlineProd::newObject(const std::string& objectKey) {
0064   edm::LogError("L1-O2O") << "L1RPCHsbConfig object with key " << objectKey << " not in ORCON!";
0065   auto pHsbConfig = std::make_unique<L1RPCHsbConfig>();
0066   std::vector<int> hsbconf;
0067   int mask = 3;
0068   // XX was: i<9, corrected
0069   hsbconf.reserve(8);
0070   for (int i = 0; i < 8; i++)
0071     hsbconf.push_back(mask);
0072   pHsbConfig->setHsbMask(0, hsbconf);
0073   pHsbConfig->setHsbMask(1, hsbconf);
0074   return pHsbConfig;
0075 }
0076 
0077 //
0078 // member functions
0079 //
0080 
0081 // ------------ method called to produce the data  ------------
0082 
0083 //define this as a plug-in
0084 DEFINE_FWK_EVENTSETUP_MODULE(L1RPCHsbConfigOnlineProd);