CMS 3D CMS Logo

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