Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:47

0001 #ifndef EventFilter_L1TRawToDigi_PackingSetup_h
0002 #define EventFilter_L1TRawToDigi_PackingSetup_h
0003 
0004 #include <map>
0005 
0006 #include "FWCore/Framework/interface/ProducesCollector.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0008 
0009 #include "EventFilter/L1TRawToDigi/interface/Packer.h"
0010 #include "EventFilter/L1TRawToDigi/interface/PackerTokens.h"
0011 
0012 #include "EventFilter/L1TRawToDigi/interface/Unpacker.h"
0013 #include "EventFilter/L1TRawToDigi/interface/UnpackerCollections.h"
0014 
0015 namespace edm {
0016   class ConsumesCollector;
0017   class Event;
0018   class ParameterSet;
0019 }  // namespace edm
0020 
0021 namespace l1t {
0022   // Mapping of board id to list of unpackers.  Different for each set of (FED, Firmware) ids.
0023   typedef std::map<std::pair<int, int>, Packers> PackerMap;
0024   // Mapping of block id to unpacker.  Different for each set of (FED, Board, AMC, Firmware) ids.
0025   typedef std::map<int, std::shared_ptr<Unpacker>> UnpackerMap;
0026 
0027   class PackingSetup {
0028   public:
0029     PackingSetup(){};
0030     virtual ~PackingSetup(){};
0031     virtual std::unique_ptr<PackerTokens> registerConsumes(const edm::ParameterSet&, edm::ConsumesCollector&) = 0;
0032     virtual void registerProducts(edm::ProducesCollector) = 0;
0033 
0034     // Get a map of (amc #, board id) ↔ list of packing functions for a specific FED, FW combination
0035     virtual PackerMap getPackers(int fed, unsigned int fw) = 0;
0036 
0037     // Get a map of Block IDs ↔ unpacker for a specific FED, board, AMC, FW combination
0038     virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) = 0;
0039     virtual std::unique_ptr<UnpackerCollections> getCollections(edm::Event&) = 0;
0040 
0041     // Fill description with needed parameters for the setup, i.e.,
0042     // special input tags
0043     virtual void fillDescription(edm::ParameterSetDescription&) = 0;
0044   };
0045 
0046 }  // namespace l1t
0047 
0048 #endif