CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PackingSetup.h
Go to the documentation of this file.
1 #ifndef PackingSetup_h
2 #define PackingSetup_h
3 
4 #include <map>
5 
8 
11 
12 namespace edm {
13  class ConsumesCollector;
14  class Event;
15  class ParameterSet;
16  namespace one {
17  class EDProducerBase;
18  }
19 }
20 
21 namespace l1t {
22  // Mapping of board id to list of unpackers. Different for each set of (FED, Firmware) ids.
23  typedef std::map<std::pair<int, int>, Packers> PackerMap;
24  // Mapping of block id to unpacker. Different for each set of (FED, Board, AMC, Firmware) ids.
25  typedef std::map<int, std::shared_ptr<Unpacker>> UnpackerMap;
26 
27  class PackingSetup {
28  public:
30  virtual std::unique_ptr<PackerTokens> registerConsumes(const edm::ParameterSet&, edm::ConsumesCollector&) = 0;
31  virtual void registerProducts(edm::one::EDProducerBase&) = 0;
32 
33  // Get a map of (amc #, board id) ↔ list of packing functions for a specific FED, FW combination
34  virtual PackerMap getPackers(int fed, int fw) = 0;
35 
36  // Get a map of Block IDs ↔ unpacker for a specific FED, board, AMC, FW combination
37  virtual UnpackerMap getUnpackers(int fed, int board , int amc, int fw) = 0;
38  virtual std::unique_ptr<UnpackerCollections> getCollections(edm::Event&) = 0;
39  };
40 
41  typedef PackingSetup*(prov_fct)();
43 
45  public:
46  static const PackingSetupFactory* get() { return &instance_; };
47  std::auto_ptr<PackingSetup> make(const std::string&) const;
48  private:
50  static const PackingSetupFactory instance_;
51  };
52 }
53 
54 #define DEFINE_L1T_PACKING_SETUP(type) \
55  DEFINE_EDM_PLUGIN(l1t::PackingSetupFactoryT,type,#type)
56 
57 #endif
static const PackingSetupFactory instance_
Definition: PackingSetup.h:49
std::auto_ptr< PackingSetup > make(const std::string &) const
Definition: PackingSetup.cc:12
virtual PackerMap getPackers(int fed, int fw)=0
std::vector< std::shared_ptr< Packer > > Packers
Definition: Packer.h:21
virtual std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &, edm::ConsumesCollector &)=0
edmplugin::PluginFactory< prov_fct > PackingSetupFactoryT
Definition: PackingSetup.h:42
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:25
double amc
Definition: hdecay.h:20
virtual void registerProducts(edm::one::EDProducerBase &)=0
virtual std::unique_ptr< UnpackerCollections > getCollections(edm::Event &)=0
virtual UnpackerMap getUnpackers(int fed, int board, int amc, int fw)=0
PackingSetup *( prov_fct)()
Definition: PackingSetup.h:41
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:23