CMS 3D CMS Logo

CICADAUnpacker.cc
Go to the documentation of this file.
3 
4 #include "CICADAUnpacker.h"
5 
6 #include <cmath>
7 
8 using namespace edm;
9 
10 namespace l1t {
11  namespace stage2 {
13  LogDebug("L1T") << "Block Size = " << block.header().getSize();
14  LogDebug("L1T") << "Board ID = " << block.amc().getBoardID();
15 
16  auto res = static_cast<CaloLayer1Collections*>(coll)->getCICADABxCollection();
17  // default BX range to trigger standard -2 to 2
18  // Even though CICADA will never have BX information
19  // And everything gets put in BX 0
20  res->setBXRange(-2, 2);
21 
22  int amc_slot = block.amc().getAMCNumber();
23  if (not(amc_slot == 7)) {
24  throw cms::Exception("CICADAUnpacker")
25  << "Calo Summary (CICADA) unpacker is unpacking an unexpected AMC. Expected AMC number 7, got AMC number "
26  << amc_slot << std::endl;
27  return false;
28  } else {
29  const uint32_t* base = block.payload().data();
30  //First 4 bits of the first 4 words are CICADA bits
31  uint32_t word = (caloCrateCicadaBitsPattern & base[0]) >> 16 | (caloCrateCicadaBitsPattern & base[1]) >> 20 |
32  (caloCrateCicadaBitsPattern & base[2]) >> 24 | (caloCrateCicadaBitsPattern & base[3]) >> 28;
33  float score = static_cast<float>(word) / 256.f;
34  res->push_back(0, score);
35  return true;
36  }
37  }
38 
39  } // namespace stage2
40 } // namespace l1t
41 
base
Main Program
Definition: newFWLiteAna.py:92
delete x;
Definition: CaloConfig.h:22
Definition: Electron.h:6
uint64_t word
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
double f[11][100]
HLT enums.
#define DEFINE_L1T_UNPACKER(type)
#define LogDebug(id)