CMS 3D CMS Logo

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