Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:23

0001 ///
0002 /// \class l1t::Stage1Layer2FirmwareFactory
0003 ///
0004 ///
0005 /// \author: R. Alex Barbieri
0006 ///
0007 
0008 //
0009 // This class implments the firmware factory. Based on the firmware version
0010 // in the configuration, it selects the appropriate concrete implementation.
0011 //
0012 
0013 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0014 
0015 #include "L1Trigger/L1TCalorimeter/interface/Stage1Layer2MainProcessorFirmware.h"
0016 
0017 #include "L1Trigger/L1TCalorimeter/interface/Stage1Layer2FirmwareFactory.h"
0018 #include "L1Trigger/L1TCalorimeter/interface/CaloParamsHelper.h"
0019 
0020 using namespace std;
0021 using namespace edm;
0022 
0023 namespace l1t {
0024 
0025   Stage1Layer2FirmwareFactory::ReturnType Stage1Layer2FirmwareFactory::create(const int m_fwv,
0026                                                                               CaloParamsHelper const* dbPars) {
0027     ReturnType p;
0028     //unsigned fwv = m_fwv.firmwareVersion();
0029     //unsigned fwv = 1;
0030 
0031     // It is up to developers to choose when a new concrete firmware
0032     // implementation is needed. In this example, Imp1 handles FW
0033     // versions 1 and 2, while Imp2 handles FW version 3.
0034 
0035     switch (m_fwv) {
0036       case 1:
0037       case 2:
0038       case 3:
0039         p = ReturnType(new Stage1Layer2MainProcessorFirmwareImp1(m_fwv, dbPars));
0040         break;
0041       default:
0042         // Invalid Firmware, log an error:
0043         LogError("l1t|stage 1 jets") << "Invalid firmware version requested: " << m_fwv << "\n";
0044         break;
0045     }
0046 
0047     return p;
0048   }
0049 
0050 }  // namespace l1t