CMS 3D CMS Logo

HcalTestBeamNumbering.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 //#define EDM_ML_DEBUG
5 
6 uint32_t HcalTestBeamNumbering::packIndex(int det, int lay, int x, int y) {
7  int ix(0), ixx(x);
8  if (x < 0) {
9  ix = 1;
10  ixx = -x;
11  }
12  int iy(0), iyy(y);
13  if (y < 0) {
14  iy = 1;
15  iyy = -y;
16  }
17  uint32_t idx = (det & kHcalBeamTypeMask) << kHcalBeamTypeOffset;
23 
24 #ifdef EDM_ML_DEBUG
25  std::cout << "HcalTestBeamNumbering: Detector " << det << " Layer " << lay << " x " << x << " " << ix << " " << ixx
26  << " y " << y << " " << iy << " " << iyy << " ID " << std::hex << idx << std::dec << std::endl;
27 #endif
28  return idx;
29 }
30 
31 void HcalTestBeamNumbering::unpackIndex(const uint32_t& idx, int& det, int& lay, int& x, int& y) {
37  y = -y;
39  x = -x;
40 
41 #ifdef EDM_ML_DEBUG
42  std::cout << "HcalTestBeamNumbering: ID " << std::hex << idx << std::dec << " Detector " << det << " Layer " << lay
43  << " x " << x << " y " << y << std::endl;
44 #endif
45 }
DDAxes::y
HcalTestBeamNumbering::kHcalBeamXValueOffset
static const int kHcalBeamXValueOffset
Definition: HcalTestBeamNumbering.h:11
HcalTestBeamNumbering::packIndex
static uint32_t packIndex(int det, int lay, int x, int y)
Definition: HcalTestBeamNumbering.cc:6
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DDAxes::x
iyy
int iyy[18][41][3]
Definition: EcalDAQHandler.cc:317
training_settings.idx
idx
Definition: training_settings.py:16
HcalTestBeamNumbering::kHcalBeamYValueOffset
static const int kHcalBeamYValueOffset
Definition: HcalTestBeamNumbering.h:15
HcalTestBeamNumbering.h
vertices_cff.x
x
Definition: vertices_cff.py:29
HcalTestBeamNumbering::kHcalBeamXValueMask
static const int kHcalBeamXValueMask
Definition: HcalTestBeamNumbering.h:12
HcalTestBeamNumbering::kHcalBeamTypeMask
static const int kHcalBeamTypeMask
Definition: HcalTestBeamNumbering.h:22
HcalTestBeamNumbering::kHcalBeamTypeOffset
static const int kHcalBeamTypeOffset
Definition: HcalTestBeamNumbering.h:21
HcalTestBeamNumbering::kHcalBeamYValueMask
static const int kHcalBeamYValueMask
Definition: HcalTestBeamNumbering.h:16
HcalTestBeamNumbering::unpackIndex
static void unpackIndex(const uint32_t &idx, int &det, int &lay, int &x, int &y)
Definition: HcalTestBeamNumbering.cc:31
HcalTestBeamNumbering::kHcalBeamLayerOffset
static const int kHcalBeamLayerOffset
Definition: HcalTestBeamNumbering.h:19
HcalTestBeamNumbering::kHcalBeamLayerMask
static const int kHcalBeamLayerMask
Definition: HcalTestBeamNumbering.h:20
HcalTestBeamNumbering::kHcalBeamXSignOffset
static const int kHcalBeamXSignOffset
Definition: HcalTestBeamNumbering.h:13
ixx
int ixx[18][41][3]
Definition: EcalDAQHandler.cc:226
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
HcalTestBeamNumbering::kHcalBeamYSignOffset
static const int kHcalBeamYSignOffset
Definition: HcalTestBeamNumbering.h:17
HcalTestBeamNumbering::kHcalBeamYSignMask
static const int kHcalBeamYSignMask
Definition: HcalTestBeamNumbering.h:18
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
HcalTestBeamNumbering::kHcalBeamXSignMask
static const int kHcalBeamXSignMask
Definition: HcalTestBeamNumbering.h:14