CMS 3D CMS Logo

CaloLayer1Setup.cc
Go to the documentation of this file.
2 
6 
7 #include "CaloLayer1Setup.h"
8 
9 namespace l1t {
10  namespace stage2 {
11  std::unique_ptr<PackerTokens> CaloLayer1Setup::registerConsumes(const edm::ParameterSet& cfg,
13  return std::unique_ptr<PackerTokens>(new CaloLayer1Tokens(cfg, cc));
14  }
15 
17  desc.addOptional<edm::InputTag>("ecalDigis");
18  desc.addOptional<edm::InputTag>("hcalDigis");
19  desc.addOptional<edm::InputTag>("caloRegions");
20  }
21 
22  PackerMap CaloLayer1Setup::getPackers(int fed, unsigned int fw) {
23  PackerMap res;
24 
25  if (fed == 1354) {
26  // AMC #, board #
27  res[{2, 3}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
28  res[{3, 4}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
29  res[{5, 5}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
30  res[{8, 6}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
31  res[{9, 7}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
32  res[{11, 8}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
33  } else if (fed == 1356) {
34  // AMC #, board #
35  res[{2, 15}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
36  res[{3, 16}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
37  res[{5, 17}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
38  res[{8, 0}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
39  res[{9, 1}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
40  res[{11, 2}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
41  } else if (fed == 1358) {
42  // AMC #, board #
43  res[{2, 9}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
44  res[{3, 10}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
45  res[{5, 11}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
46  res[{8, 12}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
47  res[{9, 13}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
48  res[{11, 14}] = {PackerFactory::get()->make("stage2::CaloLayer1Packer")};
49  }
50 
51  return res;
52  }
53 
55  prod.produces<EcalTrigPrimDigiCollection>();
56  prod.produces<HcalTrigPrimDigiCollection>();
57  prod.produces<L1CaloRegionCollection>();
58  for (int i = 0; i < 5; ++i) {
59  prod.produces<EcalTrigPrimDigiCollection>("EcalDigisBx" + std::to_string(i + 1));
60  }
61  }
62 
63  std::unique_ptr<UnpackerCollections> CaloLayer1Setup::getCollections(edm::Event& e) {
64  return std::unique_ptr<UnpackerCollections>(new CaloLayer1Collections(e));
65  }
66 
67  UnpackerMap CaloLayer1Setup::getUnpackers(int fed, int board, int amc, unsigned int fw) {
69  LogDebug("L1T") << "CaloLayer1Setup: about to pick an unpacker for fed " << fed << " board " << board << " amc "
70  << amc << " fw 0x" << std::hex << fw << std::dec;
71  if (fed == 1354 || fed == 1356 || fed == 1358) {
72  if (board < 18) {
73  res[0] = UnpackerFactory::get()->make("stage2::CaloLayer1Unpacker");
74  }
75  }
76 
77  return res;
78  }
79  } // namespace stage2
80 } // namespace l1t
81 
std::shared_ptr< Packer > make(const std::string &) const
void registerProducts(edm::ProducesCollector) override
std::string to_string(const V &value)
Definition: OMSAccess.h:71
delete x;
Definition: CaloConfig.h:22
Definition: Electron.h:6
std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
static const PackerFactory * get()
Definition: PackerFactory.h:14
UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
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
#define DEFINE_L1T_PACKING_SETUP(type)
static const UnpackerFactory * get()
void fillDescription(edm::ParameterSetDescription &desc) override
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:23
std::vector< L1CaloRegion > L1CaloRegionCollection
std::shared_ptr< Unpacker > make(const std::string &) const
Definition: AMCSpec.h:8
PackerMap getPackers(int fed, unsigned int fw) override
#define LogDebug(id)