test
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 
7 
10 
13 
14 namespace edm {
15  class ConsumesCollector;
16  class Event;
17  class ParameterSet;
18  namespace stream {
19  class EDProducerBase;
20  }
21 }
22 
23 namespace l1t {
24  // Mapping of board id to list of unpackers. Different for each set of (FED, Firmware) ids.
25  typedef std::map<std::pair<int, int>, Packers> PackerMap;
26  // Mapping of block id to unpacker. Different for each set of (FED, Board, AMC, Firmware) ids.
27  typedef std::map<int, std::shared_ptr<Unpacker>> UnpackerMap;
28 
29  class PackingSetup {
30  public:
32  virtual std::unique_ptr<PackerTokens> registerConsumes(const edm::ParameterSet&, edm::ConsumesCollector&) = 0;
34 
35  // Get a map of (amc #, board id) ↔ list of packing functions for a specific FED, FW combination
36  virtual PackerMap getPackers(int fed, unsigned int fw) = 0;
37 
38  // Get a map of Block IDs ↔ unpacker for a specific FED, board, AMC, FW combination
39  virtual UnpackerMap getUnpackers(int fed, int board , int amc, unsigned int fw) = 0;
40  virtual std::unique_ptr<UnpackerCollections> getCollections(edm::Event&) = 0;
41 
42  // Fill description with needed parameters for the setup, i.e.,
43  // special input tags
45  };
46 
47  typedef PackingSetup*(prov_fct)();
49 
51  public:
52  static const PackingSetupFactory* get() { return &instance_; };
53  std::auto_ptr<PackingSetup> make(const std::string&) const;
55  private:
57  static const PackingSetupFactory instance_;
58  };
59 }
60 
61 #define DEFINE_L1T_PACKING_SETUP(type) \
62  DEFINE_EDM_PLUGIN(l1t::PackingSetupFactoryT,type,#type)
63 
64 #endif
static const PackingSetupFactory instance_
Definition: PackingSetup.h:56
std::auto_ptr< PackingSetup > make(const std::string &) const
Definition: PackingSetup.cc:12
std::vector< std::shared_ptr< Packer > > Packers
Definition: Packer.h:21
virtual std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &, edm::ConsumesCollector &)=0
Definition: Event.h:16
edmplugin::PluginFactory< prov_fct > PackingSetupFactoryT
Definition: PackingSetup.h:48
void fillDescription(edm::ParameterSetDescription &) const
Definition: PackingSetup.cc:23
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:27
double amc
Definition: hdecay.h:20
virtual void fillDescription(edm::ParameterSetDescription &)=0
virtual std::unique_ptr< UnpackerCollections > getCollections(edm::Event &)=0
virtual PackerMap getPackers(int fed, unsigned int fw)=0
virtual void registerProducts(edm::stream::EDProducerBase &)=0
PackingSetup *( prov_fct)()
Definition: PackingSetup.h:47
virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw)=0
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:25