Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:38:06

0001 #ifndef HcalSimAlgos_HcalFinegrainBit_h
0002 #define HcalSimAlgos_HcalFinegrainBit_h
0003 
0004 #include <array>
0005 #include <bitset>
0006 #include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h"
0007 
0008 class HcalFinegrainBit {
0009 public:
0010   // see the const definitions below for the meaning of the bit towers.
0011   // Each bit is replicated for each depth level
0012   typedef std::array<std::bitset<6>, 2> Tower;
0013   // Each pair contains uHTR group 0 LUT bits 12-15, TDC, and ADC of the cell in that depth of the trigger tower
0014   typedef std::array<std::pair<std::pair<int, bool>, std::pair<int, int>>, 7> TowerTDC;
0015 
0016   HcalFinegrainBit(int version) : version_(version) {}
0017 
0018   std::bitset<2> compute(const Tower&) const;
0019   std::bitset<6> compute(const TowerTDC&, const HcalTrigTowerDetId&) const;
0020 
0021 private:
0022   // define the two bits in the tower
0023   const int is_mip = 0;
0024   const int is_above_mip = 1;
0025 
0026   int version_;
0027 
0028   // define prompt-delayed TDC range. Note this is offset from depth and ieta by 1
0029   const int tdc_boundary[29][7] = {
0030       {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0},
0031       {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0},
0032       {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0},
0033       {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0}, {12, 12, 12, 12, 0, 0, 0},
0034       {0, 12, 10, 0, 0, 0, 0},   {0, 9, 10, 9, 10, 0, 0},   {16, 9, 9, 9, 11, 10, 0},  {17, 8, 9, 8, 9, 10, 0},
0035       {9, 7, 7, 7, 9, 6, 0},     {8, 7, 7, 6, 6, 6, 0},     {8, 6, 6, 6, 7, 7, 0},     {7, 6, 6, 6, 7, 6, 0},
0036       {7, 6, 6, 6, 6, 6, 0},     {6, 6, 6, 6, 6, 6, 0},     {6, 5, 6, 6, 6, 7, 10},    {9, 9, 9, 5, 5, 6, 6},
0037       {0, 0, 0, 0, 0, 0, 0}};
0038 };
0039 
0040 #endif