CMS 3D CMS Logo

MissEtUnpacker.cc
Go to the documentation of this file.
3 
4 #include "CaloCollections.h"
5 #include "MissEtUnpacker.h"
6 
7 namespace l1t {
8  namespace stage1 {
10  LogDebug("L1T") << "Block ID = " << block.header().getID() << " size = " << block.header().getSize();
11 
12  int nBX, firstBX, lastBX;
13  nBX = int(ceil(block.header().getSize() / 2.));
14  getBXRange(nBX, firstBX, lastBX);
15 
16  auto res_ = static_cast<CaloCollections*>(coll)->getEtSums();
17  res_->setBXRange(firstBX, lastBX);
18 
19  LogDebug("L1T") << "nBX = " << nBX << " first BX = " << firstBX << " lastBX = " << lastBX;
20 
21  // Initialise index
22  int unsigned i = 0;
23 
24  // Loop over multiple BX and then number of jets filling jet collection
25  for (int bx = firstBX; bx <= lastBX; bx++) {
26  res_->resize(bx, 4);
27 
28  uint32_t raw_data0 = block.payload()[i++];
29  uint32_t raw_data1 = block.payload()[i++];
30 
31  /* if (raw_data0 == 0 || raw_data1==0) continue; */
32 
33  uint16_t candbit[2];
34  candbit[0] = raw_data0 & 0xFFFF;
35  candbit[1] = raw_data1 & 0xFFFF;
36 
37  int etmiss = candbit[0] & 0xFFF;
38  int overflowetmiss = (candbit[0] >> 12) & 0x1;
39  int etmissphi = candbit[1] & 0x7F;
40 
42  met.setHwPt(etmiss);
43  met.setHwPhi(etmissphi);
44  met.setType(l1t::EtSum::kMissingEt);
45  int flagetmiss = met.hwQual();
46  flagetmiss |= overflowetmiss;
47  met.setHwQual(flagetmiss);
48  LogDebug("L1T") << "MET: pT " << met.hwPt() << "is overflow " << overflowetmiss << std::endl;
49  res_->set(bx, 0, met);
50  }
51 
52  return true;
53  }
54  } // namespace stage1
55 } // namespace l1t
56 
mps_fire.i
i
Definition: mps_fire.py:428
l1t::stage1::MissEtUnpacker::unpack
bool unpack(const Block &block, UnpackerCollections *coll) override
Definition: MissEtUnpacker.cc:9
MissEtUnpacker.h
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
RPCBxOrConfig_cff.firstBX
firstBX
Definition: RPCBxOrConfig_cff.py:5
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
MakerMacros.h
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
reco::ceil
constexpr int32_t ceil(float num)
Definition: constexpr_cmath.h:7
l1t::EtSum::kMissingEt
Definition: EtSum.h:25
UnpackerFactory.h
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
l1t
delete x;
Definition: CaloConfig.h:22
l1t::EtSum
Definition: EtSum.h:20
createfilelist.int
int
Definition: createfilelist.py:10
groupFilesInBlocks.block
block
Definition: groupFilesInBlocks.py:150
l1t::stage1::MissEtUnpacker
Definition: MissEtUnpacker.h:8
l1t::UnpackerCollections
Definition: UnpackerCollections.h:9
RPCBxOrConfig_cff.lastBX
lastBX
Definition: RPCBxOrConfig_cff.py:4
DEFINE_L1T_UNPACKER
#define DEFINE_L1T_UNPACKER(type)
Definition: UnpackerFactory.h:23
l1t::getBXRange
void getBXRange(int nbx, int &first, int &last)
Definition: UnpackerFactory.cc:12
CaloCollections.h
l1t::Block
Definition: Block.h:70