CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
HcalTestBeamNumbering Class Reference

#include <HcalTestBeamNumbering.h>

Public Types

enum  HcalTestBeamDetector { HcalTBEmpty =0, HcalTBScintillator =1, HcalTBWireChamber =2 }
 

Public Member Functions

 HcalTestBeamNumbering ()
 

Static Public Member Functions

static uint32_t packIndex (int det, int lay, int x, int y)
 
static void unpackIndex (const uint32_t &idx, int &det, int &lay, int &x, int &y)
 

Static Public Attributes

static const int kHcalBeamLayerMask = 0x7F
 
static const int kHcalBeamLayerOffset = 21
 
static const int kHcalBeamTypeMask = 0xF
 
static const int kHcalBeamTypeOffset = 28
 
static const int kHcalBeamXSignMask = 0x1
 
static const int kHcalBeamXSignOffset = 9
 
static const int kHcalBeamXValueMask = 0x1FF
 
static const int kHcalBeamXValueOffset = 0
 
static const int kHcalBeamYSignMask = 0x1
 
static const int kHcalBeamYSignOffset = 19
 
static const int kHcalBeamYValueMask = 0x1FF
 
static const int kHcalBeamYValueOffset = 10
 

Detailed Description

Definition at line 10 of file HcalTestBeamNumbering.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

HcalTestBeamNumbering::HcalTestBeamNumbering ( )
inline

Definition at line 28 of file HcalTestBeamNumbering.h.

References training_settings::idx, packIndex(), unpackIndex(), x, and y.

28 {}

Member Function Documentation

uint32_t HcalTestBeamNumbering::packIndex ( int  det,
int  lay,
int  x,
int  y 
)
static

Definition at line 6 of file HcalTestBeamNumbering.cc.

References gather_cfg::cout, TauDecayModes::dec, training_settings::idx, ixx, iyy, kHcalBeamLayerMask, kHcalBeamLayerOffset, kHcalBeamTypeMask, kHcalBeamTypeOffset, kHcalBeamXSignMask, kHcalBeamXSignOffset, kHcalBeamXValueMask, kHcalBeamXValueOffset, kHcalBeamYSignMask, kHcalBeamYSignOffset, kHcalBeamYValueMask, kHcalBeamYValueOffset, x, and y.

Referenced by HcalTestBeamNumbering(), and HcalTB06BeamSD::setDetUnitId().

6  {
7 
8  int ix(0), ixx(x);
9  if (x < 0) { ix = 1; ixx =-x;}
10  int iy(0), iyy(y);
11  if (y < 0) { iy = 1; iyy =-y;}
12  uint32_t idx = (det&kHcalBeamTypeMask)<<kHcalBeamTypeOffset;
18 
19 #ifdef EDM_ML_DEBUG
20  std::cout << "HcalTestBeamNumbering: Detector " << det << " Layer " << lay
21  << " x " << x << " " << ix << " " << ixx << " y " << y << " "
22  << iy << " " << iyy << " ID " << std::hex << idx << std::dec
23  << std::endl;
24 #endif
25  return idx;
26 }
static const int kHcalBeamYValueOffset
int iyy[18][41][3]
static const int kHcalBeamYSignMask
static const int kHcalBeamLayerMask
int ixx[18][41][3]
static const int kHcalBeamYValueMask
static const int kHcalBeamXSignMask
static const int kHcalBeamXValueMask
static const int kHcalBeamLayerOffset
static const int kHcalBeamTypeMask
static const int kHcalBeamYSignOffset
static const int kHcalBeamXSignOffset
static const int kHcalBeamXValueOffset
static const int kHcalBeamTypeOffset
void HcalTestBeamNumbering::unpackIndex ( const uint32_t &  idx,
int &  det,
int &  lay,
int &  x,
int &  y 
)
static

Definition at line 28 of file HcalTestBeamNumbering.cc.

References gather_cfg::cout, TauDecayModes::dec, kHcalBeamLayerMask, kHcalBeamLayerOffset, kHcalBeamTypeMask, kHcalBeamTypeOffset, kHcalBeamXSignMask, kHcalBeamXSignOffset, kHcalBeamXValueMask, kHcalBeamXValueOffset, kHcalBeamYSignMask, kHcalBeamYSignOffset, kHcalBeamYValueMask, kHcalBeamYValueOffset, x, and y.

Referenced by HcalTB06Analysis::analyze(), HGCalTBAnalyzer::analyzeSimHits(), and HcalTestBeamNumbering().

29  {
30 
35  if (((idx>>kHcalBeamYSignOffset)&kHcalBeamYSignMask) == 1) y = -y;
36  if (((idx>>kHcalBeamXSignOffset)&kHcalBeamXSignMask) == 1) x = -x;
37 
38 #ifdef EDM_ML_DEBUG
39  std::cout << "HcalTestBeamNumbering: ID " << std::hex << idx << std::dec
40  << " Detector " << det << " Layer " << lay << " x " << x << " y "
41  << y << std::endl;
42 #endif
43 }
static const int kHcalBeamYValueOffset
static const int kHcalBeamYSignMask
static const int kHcalBeamLayerMask
static const int kHcalBeamYValueMask
static const int kHcalBeamXSignMask
static const int kHcalBeamXValueMask
static const int kHcalBeamLayerOffset
static const int kHcalBeamTypeMask
static const int kHcalBeamYSignOffset
static const int kHcalBeamXSignOffset
static const int kHcalBeamXValueOffset
static const int kHcalBeamTypeOffset

Member Data Documentation

const int HcalTestBeamNumbering::kHcalBeamLayerMask = 0x7F
static

Definition at line 22 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

const int HcalTestBeamNumbering::kHcalBeamLayerOffset = 21
static

Definition at line 21 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

const int HcalTestBeamNumbering::kHcalBeamTypeMask = 0xF
static

Definition at line 24 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

const int HcalTestBeamNumbering::kHcalBeamTypeOffset = 28
static

Definition at line 23 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

const int HcalTestBeamNumbering::kHcalBeamXSignMask = 0x1
static

Definition at line 16 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

const int HcalTestBeamNumbering::kHcalBeamXSignOffset = 9
static

Definition at line 15 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

const int HcalTestBeamNumbering::kHcalBeamXValueMask = 0x1FF
static

Definition at line 14 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

const int HcalTestBeamNumbering::kHcalBeamXValueOffset = 0
static

Definition at line 13 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

const int HcalTestBeamNumbering::kHcalBeamYSignMask = 0x1
static

Definition at line 20 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

const int HcalTestBeamNumbering::kHcalBeamYSignOffset = 19
static

Definition at line 19 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

const int HcalTestBeamNumbering::kHcalBeamYValueMask = 0x1FF
static

Definition at line 18 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

const int HcalTestBeamNumbering::kHcalBeamYValueOffset = 10
static

Definition at line 17 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().