CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EMTFSetup.cc
Go to the documentation of this file.
1 
4 
7 
9 
10 #include "EMTFCollections.h"
11 #include "EMTFTokens.h"
12 
13 namespace l1t {
14  namespace stage2 {
15  class EMTFSetup : public PackingSetup {
16  public:
17  // Not sure what this function does - AWB 27.01.16
18  virtual std::unique_ptr<PackerTokens> registerConsumes(const edm::ParameterSet& cfg, edm::ConsumesCollector& cc) override {
19  return std::unique_ptr<PackerTokens>(new EMTFTokens(cfg, cc));
20  };
21 
22  // Not sure what this block does, or if it's necessary - AWB 27.01.16
23  virtual void fillDescription(edm::ParameterSetDescription& desc) override {
24  desc.addOptional<edm::InputTag>("EMTFInputLabelAWB")->setComment("for stage2");
25  };
26 
27  // Ignore Packer functionality for now - AWB 27.01.16
28  virtual PackerMap getPackers(int fed, unsigned int fw) override {
29  PackerMap res;
30 
31  if (fed == 1402) {
32  // Use amc_no and board id 1 for packing
33  res[{1, 1}] = {
34  // "RegionalMuonEMTFPacker" should be defined in RegionalMuonEMTFPacker.cc - AWB 11.01.15
35  PackerFactory::get()->make("stage2::RegionalMuonEMTFPacker"),
36  // Should we even be doing a MuonPacker? = AWB 11.01.15
37  PackerFactory::get()->make("stage2::MuonPacker"),
38  };
39  }
40 
41  return res;
42  }; // End virtual PackerMap getPackers
43 
44  // Not sure what this function does - AWB 27.01.16
46  prod.produces<RegionalMuonCandBxCollection>();
47  prod.produces<EMTFOutputCollection>();
48  };
49 
50  // Not sure what this function does - AWB 27.01.16
51  virtual std::unique_ptr<UnpackerCollections> getCollections(edm::Event& e) override {
52  return std::unique_ptr<UnpackerCollections>(new EMTFCollections(e));
53  };
54 
55  virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override {
56  // Presumably need some logic based on fed, amc, etc (c.f. CaloSetup.cc) - AWB 11.01.16
57  UnpackerMap res;
58 
59  // "RegionalMuonEMTFPacker" should be defined in RegionalMuonEMTFPacker.cc - AWB 11.01.15
60 
61  auto emtf_headers_unp = UnpackerFactory::get()->make("stage2::emtf::HeadersBlockUnpacker"); // Unpack "AMC data header" and "Event Record Header"
62  auto emtf_counters_unp = UnpackerFactory::get()->make("stage2::emtf::CountersBlockUnpacker"); // Unpack "Block of Counters"
63  auto emtf_me_unp = UnpackerFactory::get()->make("stage2::emtf::MEBlockUnpacker"); // Unpack "ME Data Record"
64  auto emtf_rpc_unp = UnpackerFactory::get()->make("stage2::emtf::RPCBlockUnpacker"); // // Unpack "RPC Data Record"
65  auto emtf_sp_unp = UnpackerFactory::get()->make("stage2::emtf::SPBlockUnpacker"); // Unpack "SP Output Data Record"
66  auto emtf_trailers_unp = UnpackerFactory::get()->make("stage2::emtf::TrailersBlockUnpacker"); // Unpack "Event Record Trailer"
67 
68  // Index of res is block->header().getID(), matching block_patterns_ in src/Block.cc
69  res[511] = emtf_headers_unp;
70  res[2] = emtf_counters_unp;
71  res[3] = emtf_me_unp;
72  res[4] = emtf_rpc_unp;
73  res[101] = emtf_sp_unp;
74  res[255] = emtf_trailers_unp;
75 
76  return res;
77  }; // End virtual UnpackerMap getUnpackers
78  }; // End class EMTFSetup : public PackingSetup
79  } // End namespace stage2
80 } // End namespace l1t
81 
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
tuple cfg
Definition: looper.py:293
virtual void registerProducts(edm::stream::EDProducerBase &prod) override
Definition: EMTFSetup.cc:45
virtual void fillDescription(edm::ParameterSetDescription &desc) override
Definition: EMTFSetup.cc:23
std::shared_ptr< Packer > make(const std::string &) const
Definition: Packer.cc:12
virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: EMTFSetup.cc:55
static const PackerFactory * get()
Definition: Packer.h:28
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:27
std::vector< EMTFOutput > EMTFOutputCollection
Definition: EMTFOutput.h:104
double amc
Definition: hdecay.h:20
virtual std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: EMTFSetup.cc:51
virtual std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: EMTFSetup.cc:18
std::shared_ptr< Unpacker > make(const std::string &) const
Definition: Unpacker.cc:21
static const UnpackerFactory * get()
Definition: Unpacker.h:23
virtual PackerMap getPackers(int fed, unsigned int fw) override
Definition: EMTFSetup.cc:28
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:25
#define DEFINE_L1T_PACKING_SETUP(type)
Definition: PackingSetup.h:61