File indexing completed on 2024-04-06 12:04:17
0001
0002
0003
0004
0005 #include "DataFormats/HcalDetId/interface/HcalTestNumbering.h"
0006
0007 uint32_t HcalTestNumbering::packHcalIndex(int det, int z, int depth, int eta, int phi, int lay) {
0008 uint32_t idx = (det & 15) << 28;
0009 idx += ((depth - 1) & 3) << 26;
0010 idx += ((lay - 1) & 31) << 21;
0011 idx += (z & 1) << 20;
0012 idx += (eta & 1023) << 10;
0013 idx += (phi & 1023);
0014
0015 return idx;
0016 }
0017
0018 void HcalTestNumbering::unpackHcalIndex(
0019 const uint32_t& idx, int& det, int& z, int& depth, int& eta, int& phi, int& lay) {
0020 det = (idx >> 28) & 15;
0021 depth = (idx >> 26) & 3;
0022 depth += 1;
0023 lay = (idx >> 21) & 31;
0024 lay += 1;
0025 z = (idx >> 20) & 1;
0026 eta = (idx >> 10) & 1023;
0027 phi = (idx & 1023);
0028 }