Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:48

0001 #include <cstdint>
0002 #ifndef SimDataFormats_HGCalTestNumbering_h
0003 #define SimDataFormats_HGCalTestNumbering_h
0004 ///////////////////////////////////////////////////////////////////////////////
0005 // File: HGCalTestNumbering.h
0006 // Description: Numbering scheme for high granularity calorimeter (SIM step)
0007 ///////////////////////////////////////////////////////////////////////////////
0008 
0009 class HGCalTestNumbering {
0010 public:
0011   static const int kHGCalCellSOffset = 0;
0012   static const int kHGCalCellSMask = 0xFFFF;
0013   static const int kHGCalSectorSOffset = 16;
0014   static const int kHGCalSectorSMask = 0x7F;
0015   static const int kHGCalSubSectorSOffset = 23;
0016   static const int kHGCalSubSectorSMask = 0x1;
0017   static const int kHGCalLayerSOffset = 24;
0018   static const int kHGCalLayerSMask = 0x7F;
0019   static const int kHGCalZsideSOffset = 31;
0020   static const int kHGCalZsideSMask = 0x1;
0021 
0022   static const int kHGCalCellHOffset = 0;
0023   static const int kHGCalCellHMask = 0xFF;
0024   static const int kHGCalCellTypHOffset = 8;
0025   static const int kHGCalCellTypHMask = 0x1;
0026   static const int kHGCalWaferHOffset = 9;
0027   static const int kHGCalWaferHMask = 0x3FF;
0028   static const int kHGCalLayerHOffset = 19;
0029   static const int kHGCalLayerHMask = 0x7F;
0030   static const int kHGCalZsideHOffset = 26;
0031   static const int kHGCalZsideHMask = 0x1;
0032   static const int kHGCalSubdetHOffset = 27;
0033   static const int kHGCalSubdetHMask = 0x7;
0034   HGCalTestNumbering() {}
0035   virtual ~HGCalTestNumbering() {}
0036   static uint32_t packSquareIndex(int z, int lay, int sec, int subsec, int cell);
0037   static uint32_t packHexagonIndex(int subdet, int z, int lay, int wafer, int celltyp, int cell);
0038   static void unpackSquareIndex(const uint32_t& idx, int& z, int& lay, int& sec, int& subsec, int& cell);
0039   static void unpackHexagonIndex(
0040       const uint32_t& idx, int& subdet, int& z, int& lay, int& wafer, int& celltyp, int& cell);
0041   static bool isValidSquare(int z, int lay, int sec, int subsec, int cell);
0042   static bool isValidHexagon(int subdet, int z, int lay, int wafer, int celltyp, int cell);
0043 };
0044 
0045 #endif