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 9 of file HcalTestBeamNumbering.h.

Member Enumeration Documentation

◆ HcalTestBeamDetector

Constructor & Destructor Documentation

◆ HcalTestBeamNumbering()

HcalTestBeamNumbering::HcalTestBeamNumbering ( )
inline

Definition at line 26 of file HcalTestBeamNumbering.h.

26 {}

Member Function Documentation

◆ packIndex()

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, heavyIonCSV_trainingSettings::idx, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), ixx, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy(), iyy, kHcalBeamLayerMask, kHcalBeamLayerOffset, kHcalBeamTypeMask, kHcalBeamTypeOffset, kHcalBeamXSignMask, kHcalBeamXSignOffset, kHcalBeamXValueMask, kHcalBeamXValueOffset, kHcalBeamYSignMask, kHcalBeamYSignOffset, kHcalBeamYValueMask, kHcalBeamYValueOffset, x, and y.

Referenced by HcalTB06BeamSD::setDetUnitId().

6  {
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 }
static const int kHcalBeamYValueOffset
static const int kHcalBeamYSignMask
static const int kHcalBeamLayerMask
static const int kHcalBeamYValueMask
static const int kHcalBeamXSignMask
const int iyy[18][41][3]
const int ixx[18][41][3]
static const int kHcalBeamXValueMask
static const int kHcalBeamLayerOffset
static const int kHcalBeamTypeMask
static const int kHcalBeamYSignOffset
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
static const int kHcalBeamXSignOffset
static const int kHcalBeamXValueOffset
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
static const int kHcalBeamTypeOffset

◆ unpackIndex()

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

Definition at line 31 of file HcalTestBeamNumbering.cc.

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

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

31  {
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 }
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

◆ kHcalBeamLayerMask

const int HcalTestBeamNumbering::kHcalBeamLayerMask = 0x7F
static

Definition at line 20 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

◆ kHcalBeamLayerOffset

const int HcalTestBeamNumbering::kHcalBeamLayerOffset = 21
static

Definition at line 19 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

◆ kHcalBeamTypeMask

const int HcalTestBeamNumbering::kHcalBeamTypeMask = 0xF
static

Definition at line 22 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

◆ kHcalBeamTypeOffset

const int HcalTestBeamNumbering::kHcalBeamTypeOffset = 28
static

Definition at line 21 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

◆ kHcalBeamXSignMask

const int HcalTestBeamNumbering::kHcalBeamXSignMask = 0x1
static

Definition at line 14 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

◆ kHcalBeamXSignOffset

const int HcalTestBeamNumbering::kHcalBeamXSignOffset = 9
static

Definition at line 13 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

◆ kHcalBeamXValueMask

const int HcalTestBeamNumbering::kHcalBeamXValueMask = 0x1FF
static

Definition at line 12 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

◆ kHcalBeamXValueOffset

const int HcalTestBeamNumbering::kHcalBeamXValueOffset = 0
static

Definition at line 11 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

◆ kHcalBeamYSignMask

const int HcalTestBeamNumbering::kHcalBeamYSignMask = 0x1
static

Definition at line 18 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

◆ kHcalBeamYSignOffset

const int HcalTestBeamNumbering::kHcalBeamYSignOffset = 19
static

Definition at line 17 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

◆ kHcalBeamYValueMask

const int HcalTestBeamNumbering::kHcalBeamYValueMask = 0x1FF
static

Definition at line 16 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().

◆ kHcalBeamYValueOffset

const int HcalTestBeamNumbering::kHcalBeamYValueOffset = 10
static

Definition at line 15 of file HcalTestBeamNumbering.h.

Referenced by packIndex(), and unpackIndex().