CMS 3D CMS Logo

BMTFPackerOutput.cc
Go to the documentation of this file.
1 #include "BMTFPackerOutput.h"
2 #include <vector>
3 
4 // Implementation
5 namespace l1t {
6  namespace stage2 {
8  int board_id = (int)board();
9 
10  auto muonToken = static_cast<const BMTFTokens*>(toks)->getOutputMuonToken();
11 
12  Blocks blocks;
13  const int bmtfBlockID = 123;
14  edm::LogInfo("L1T-BMTFPackerOutput") << "Will use setup:"
15  << " isKalman->" << isKalman_;
16 
18  event.getByToken(muonToken, muons);
19 
20  for (auto imu = muons->begin(); imu != muons->end(); imu++) {
21  if (imu->processor() + 1 == board_id) {
22  uint32_t firstWord(0), lastWord(0);
24  payloadMap_[bmtfBlockID].push_back(firstWord); //imu->link()*2+1
25  payloadMap_[bmtfBlockID].push_back(lastWord); //imu->link()*2+1
26  }
27  } //imu
28 
29  //in case less than 3 muons have been found by the processor
30  if (payloadMap_[bmtfBlockID].size() < 6) {
31  unsigned int initialSize = payloadMap_[bmtfBlockID].size();
32 
33  for (unsigned int j = 0; j < 3 - initialSize / 2; j++) {
34  payloadMap_[bmtfBlockID].push_back(0);
35  uint32_t nullMuon_word2 = 0 | ((65532 & 0xFFFF) << 3) | ((2 & 0x3) << 0);
36  payloadMap_[bmtfBlockID].push_back(nullMuon_word2);
37  }
38  } else if (payloadMap_[bmtfBlockID].size() < 30 && payloadMap_[bmtfBlockID].size() > 6) {
39  unsigned int initialSize = payloadMap_[bmtfBlockID].size();
40 
41  for (unsigned int j = 0; j < 15 - initialSize / 2; j++) {
42  payloadMap_[bmtfBlockID].push_back(0);
43  uint32_t nullMuon_word2 = 0 | ((65532 & 0xFFFF) << 3) | ((2 & 0x3) << 0);
44  payloadMap_[bmtfBlockID].push_back(nullMuon_word2);
45  }
46  }
47 
48  Block block(bmtfBlockID, payloadMap_[bmtfBlockID]);
49 
50  blocks.push_back(block);
51 
52  return blocks;
53  }
54 
55  } // namespace stage2
56 } // namespace l1t
l1t::Blocks
std::vector< Block > Blocks
Definition: Block.h:99
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
l1t::stage2::BMTFPackerOutput::payloadMap_
std::map< unsigned int, std::vector< uint32_t > > payloadMap_
Definition: BMTFPackerOutput.h:15
l1t::stage2::BMTFPackerOutput::pack
Blocks pack(const edm::Event &, const PackerTokens *) override
Definition: BMTFPackerOutput.cc:7
BMTFPackerOutput.h
l1t::stage2::BMTFPackerOutput
Definition: BMTFPackerOutput.h:12
l1tSummaryGtStage2Digis_cfi.muonToken
muonToken
Definition: l1tSummaryGtStage2Digis_cfi.py:16
DEFINE_L1T_PACKER
#define DEFINE_L1T_PACKER(type)
Definition: PackerFactory.h:23
l1t
delete x;
Definition: CaloConfig.h:22
createfilelist.int
int
Definition: createfilelist.py:10
l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords
static void generatePackedDataWords(const RegionalMuonCand &mu, uint32_t &raw_data_00_31, uint32_t &raw_data_32_63, bool isRun3)
Definition: RegionalMuonRawDigiTranslator.cc:107
groupFilesInBlocks.block
block
Definition: groupFilesInBlocks.py:150
l1t::PackerTokens
Definition: PackerTokens.h:10
SiStripSourceConfigTier0_cff.stage2
stage2
Definition: SiStripSourceConfigTier0_cff.py:71
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
l1t::Block
Definition: Block.h:70
gather_cfg.blocks
blocks
Definition: gather_cfg.py:90
l1t::Packer::board
unsigned board()
Definition: Packer.h:18
l1t::stage2::BMTFPackerOutput::isKalman_
bool isKalman_
Definition: BMTFPackerOutput.h:20
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443