CMS 3D CMS Logo

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