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  if (fw == 0x12345678) {
74  res[0] = UnpackerFactory::get()->make("stage2::CaloLayer1Unpacker");
75  }
76  // e.g.
77  // else if (fw == 0xdeadbeef) {
78  // res[0] = UnpackerFactory::get()->make("stage2::CaloLayer1Unpacker_v2");
79  // }
80  else {
81  edm::LogWarning("L1T")
82  << "CaloLayer1Setup: unexpected CTP7 firmware ID, will try unpacking with default unpacker anyway";
83  res[0] = UnpackerFactory::get()->make("stage2::CaloLayer1Unpacker");
84  }
85  }
86  }
87 
88  return res;
89  }
90  } // namespace stage2
91 } // namespace l1t
92 
l1t::stage2::CaloLayer1Setup::registerConsumes
std::unique_ptr< PackerTokens > registerConsumes(const edm::ParameterSet &cfg, edm::ConsumesCollector &cc) override
Definition: CaloLayer1Setup.cc:11
l1t::stage2::CaloLayer1Setup::registerProducts
void registerProducts(edm::ProducesCollector) override
Definition: CaloLayer1Setup.cc:54
mps_fire.i
i
Definition: mps_fire.py:428
PackerFactory.h
MessageLogger.h
l1t::UnpackerMap
std::map< int, std::shared_ptr< Unpacker > > UnpackerMap
Definition: PackingSetup.h:25
l1t::stage2::CaloLayer1Setup::getCollections
std::unique_ptr< UnpackerCollections > getCollections(edm::Event &e) override
Definition: CaloLayer1Setup.cc:63
PackingSetupFactory.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::SortedCollection
Definition: SortedCollection.h:49
l1t::PackerFactory::get
static const PackerFactory * get()
Definition: PackerFactory.h:14
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
l1t::stage2::CaloLayer1Setup::fillDescription
void fillDescription(edm::ParameterSetDescription &desc) override
Definition: CaloLayer1Setup.cc:16
l1t::PackerMap
std::map< std::pair< int, int >, Packers > PackerMap
Definition: PackingSetup.h:23
DEFINE_L1T_PACKING_SETUP
#define DEFINE_L1T_PACKING_SETUP(type)
Definition: PackingSetupFactory.h:24
l1t::stage2::CaloLayer1Setup::getPackers
PackerMap getPackers(int fed, unsigned int fw) override
Definition: CaloLayer1Setup.cc:22
l1t::stage2::CaloLayer1Setup::getUnpackers
UnpackerMap getUnpackers(int fed, int board, int amc, unsigned int fw) override
Definition: CaloLayer1Setup.cc:67
l1t::UnpackerFactory::get
static const UnpackerFactory * get()
Definition: UnpackerFactory.h:14
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
UnpackerFactory.h
CaloLayer1Setup.h
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
l1t
delete x;
Definition: CaloConfig.h:22
fw
Definition: estimate_field.h:12
l1t::stage2::CaloLayer1Setup
Definition: CaloLayer1Setup.h:15
cc
res
Definition: Electron.h:6
SiStripSourceConfigTier0_cff.stage2
stage2
Definition: SiStripSourceConfigTier0_cff.py:71
looper.cfg
cfg
Definition: looper.py:297
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
l1t::UnpackerFactory::make
std::shared_ptr< Unpacker > make(const std::string &) const
Definition: UnpackerFactory.cc:17
edm::ProducesCollector
Definition: ProducesCollector.h:43
L1CaloRegionCollection
std::vector< L1CaloRegion > L1CaloRegionCollection
Definition: L1CaloCollections.h:11
l1t::stage2::CaloLayer1Tokens
Definition: CaloLayer1Tokens.h:12
amc
Definition: AMCSpec.h:8
l1t::PackerFactory::make
std::shared_ptr< Packer > make(const std::string &) const
Definition: PackerFactory.cc:10
l1t::stage2::CaloLayer1Collections
Definition: CaloLayer1Collections.h:12
edm::Event
Definition: Event.h:73
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37