test
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<EMTFDaqOutCollection>();
48  prod.produces<EMTFHitCollection>();
49  prod.produces<EMTFTrackCollection>();
50  prod.produces<CSCCorrelatedLCTDigiCollection>();
51  };
52 
53  // Not sure what this function does - AWB 27.01.16
54  virtual std::unique_ptr<UnpackerCollections> getCollections(edm::Event& e) override {
55  return std::unique_ptr<UnpackerCollections>(new EMTFCollections(e));
56  };
57 
58  virtual UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override {
59  // std::cout << "Inside EMTFSetup.cc: getUnpackers" << std::endl;
60 
61  // Presumably need some logic based on fed, amc, etc (c.f. CaloSetup.cc) - AWB 11.01.16
62  UnpackerMap res;
63 
64  // "RegionalMuonEMTFPacker" should be defined in RegionalMuonEMTFPacker.cc - AWB 11.01.15
65 
66  auto emtf_headers_unp = UnpackerFactory::get()->make("stage2::emtf::HeadersBlockUnpacker"); // Unpack "AMC data header" and "Event Record Header"
67  auto emtf_counters_unp = UnpackerFactory::get()->make("stage2::emtf::CountersBlockUnpacker"); // Unpack "Block of Counters"
68  auto emtf_me_unp = UnpackerFactory::get()->make("stage2::emtf::MEBlockUnpacker"); // Unpack "ME Data Record"
69  auto emtf_rpc_unp = UnpackerFactory::get()->make("stage2::emtf::RPCBlockUnpacker"); // // Unpack "RPC Data Record"
70  auto emtf_sp_unp = UnpackerFactory::get()->make("stage2::emtf::SPBlockUnpacker"); // Unpack "SP Output Data Record"
71  auto emtf_trailers_unp = UnpackerFactory::get()->make("stage2::emtf::TrailersBlockUnpacker"); // Unpack "Event Record Trailer"
72 
73  // Index of res is block->header().getID(), matching block_patterns_ in src/Block.cc
74  res[511] = emtf_headers_unp;
75  res[2] = emtf_counters_unp;
76  res[3] = emtf_me_unp;
77  res[4] = emtf_rpc_unp;
78  res[101] = emtf_sp_unp;
79  res[255] = emtf_trailers_unp;
80 
81  return res;
82  }; // End virtual UnpackerMap getUnpackers
83  }; // End class EMTFSetup : public PackingSetup
84  } // End namespace stage2
85 } // End namespace l1t
86 
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:58
static const PackerFactory * get()
Definition: Packer.h:28
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:27
double amc
Definition: hdecay.h:20
virtual std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: EMTFSetup.cc:54
virtual std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: EMTFSetup.cc:18
std::vector< EMTFHit > EMTFHitCollection
Definition: EMTFHit.h:130
std::vector< EMTFDaqOut > EMTFDaqOutCollection
Definition: EMTFDaqOut.h:130
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
std::vector< EMTFTrack > EMTFTrackCollection
Definition: EMTFTrack.h:201
#define DEFINE_L1T_PACKING_SETUP(type)
Definition: PackingSetup.h:61