CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions
HcalTBNumberingScheme Class Reference

#include <SimG4CMS/HcalTestBeam/interface/HcalTBNumberingScheme.h>

Public Member Functions

 HcalTBNumberingScheme ()
 
virtual ~HcalTBNumberingScheme ()
 

Static Public Member Functions

static uint32_t getUnitID (const uint32_t id, const int mode)
 
static std::vector< uint32_t > getUnitIDs (const int type, const int mode)
 

Detailed Description

Description: Numbering scheme for hadron calorimeter in test beam

Usage: Sets up tower ID's of all towers in the 2004 Hcal test beam setup

Definition at line 25 of file HcalTBNumberingScheme.h.

Constructor & Destructor Documentation

◆ HcalTBNumberingScheme()

HcalTBNumberingScheme::HcalTBNumberingScheme ( )
inline

Definition at line 27 of file HcalTBNumberingScheme.h.

27 {}

◆ ~HcalTBNumberingScheme()

virtual HcalTBNumberingScheme::~HcalTBNumberingScheme ( )
inlinevirtual

Definition at line 28 of file HcalTBNumberingScheme.h.

28 {}

Member Function Documentation

◆ getUnitID()

uint32_t HcalTBNumberingScheme::getUnitID ( const uint32_t  id,
const int  mode 
)
static

Definition at line 27 of file HcalTBNumberingScheme.cc.

References TauDecayModes::dec, watchdog::group, HcalBarrel, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, HcalTestNumbering::packHcalIndex(), HcalTestNumbering::unpackHcalIndex(), and ecaldqm::zside().

Referenced by HcalTB04Analysis::fillBuffer().

27  {
28  int subdet, zside, group, ieta, iphi, lay;
29  HcalTestNumbering::unpackHcalIndex(idHit, subdet, zside, group, ieta, iphi, lay);
30 #ifdef EDM_ML_DEBUG
31  edm::LogVerbatim("HcalTBSim") << "HcalTBNumberingScheme: i/p ID 0x" << std::hex << idHit << std::dec << " det "
32  << zside << " group " << group << " layer " << lay << " eta " << ieta << " phi "
33  << iphi;
34 #endif
35  uint32_t idunit;
36  if (subdet == static_cast<int>(HcalBarrel)) {
37  if (lay <= 17)
38  group = 1;
39  else
40  group = 2;
41  }
42  if (mode > 0) {
43  if (subdet == static_cast<int>(HcalBarrel) && iphi > 4) {
44  if (lay <= 17) {
45  // HB2 (unmasked and masked)
46  if (ieta > 4 && ieta < 10) {
47  idunit = HcalTestNumbering::packHcalIndex(0, 0, 1, 0, iphi, lay);
48  } else {
49  idunit = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, group);
50  }
51  } else {
52  // HO behind HB2
53  idunit = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, 18);
54  }
55  } else {
56  // HB1, HE, HO behind HB1
57  idunit = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, group);
58  }
59  } else {
60  idunit = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, group);
61  }
62 
63  HcalTestNumbering::unpackHcalIndex(idunit, subdet, zside, group, ieta, iphi, lay);
64 #ifdef EDM_ML_DEBUG
65  edm::LogVerbatim("HcalTBSim") << "HcalTBNumberingScheme: idHit 0x" << std::hex << idHit << " idunit 0x" << idunit
66  << std::dec << "\n"
67  << "HcalTBNumberingScheme: o/p ID 0x" << std::hex << idunit << std::dec << " det "
68  << zside << " group " << group << " layer " << lay << " eta " << ieta << " phi "
69  << iphi;
70 #endif
71  return idunit;
72 }
Log< level::Info, true > LogVerbatim
int zside(DetId const &)
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)

◆ getUnitIDs()

std::vector< uint32_t > HcalTBNumberingScheme::getUnitIDs ( const int  type,
const int  mode 
)
static

Definition at line 74 of file HcalTBNumberingScheme.cc.

References l1ctLayer2EG_cff::id, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, HcalTestNumbering::packHcalIndex(), and createJobs::tmp.

Referenced by HcalTB04Analysis::init().

74  {
75  std::vector<uint32_t> tmp;
76  int iphi, ieta, lay;
77  uint32_t id;
78 
79  if (type != 1) {
80  // Include HB and HO id's
81  if (mode > 0) {
82  // HB1 and masked part of HB2
83  for (ieta = 1; ieta < 17; ieta++) {
84  for (iphi = 1; iphi < 9; iphi++) {
85  id = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, 1);
86  tmp.push_back(id);
87  }
88  }
89  // HO behind HB1
90  for (ieta = 1; ieta < 16; ieta++) {
91  for (iphi = 2; iphi < 5; iphi++) {
92  id = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, 2);
93  tmp.push_back(id);
94  }
95  }
96  // HB2
97  for (lay = 1; lay < 18; lay++) {
98  for (iphi = 5; iphi < 9; iphi++) {
99  id = HcalTestNumbering::packHcalIndex(0, 0, 1, 0, iphi, lay);
100  tmp.push_back(id);
101  }
102  }
103  // HO behind HB2
104  lay = 18;
105  for (ieta = 1; ieta < 16; ieta++) {
106  for (iphi = 5; iphi < 8; iphi++) {
107  id = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, lay);
108  tmp.push_back(id);
109  }
110  }
111  } else {
112  // HB1 & HB2
113  for (ieta = 1; ieta < 17; ieta++) {
114  for (iphi = 1; iphi < 9; iphi++) {
115  id = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, 1);
116  tmp.push_back(id);
117  }
118  }
119  // HO behind HB
120  for (ieta = 1; ieta < 16; ieta++) {
121  for (iphi = 2; iphi < 8; iphi++) {
122  id = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, 2);
123  tmp.push_back(id);
124  }
125  }
126  }
127  }
128 
129  if (type > 0) {
130  // Include HE id's
131  for (ieta = 15; ieta < 17; ieta++) {
132  for (iphi = 3; iphi < 7; iphi++) {
133  id = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, 3);
134  tmp.push_back(id);
135  }
136  }
137  for (iphi = 3; iphi < 7; iphi++) {
138  id = HcalTestNumbering::packHcalIndex(0, 0, 1, 17, iphi, 1);
139  tmp.push_back(id);
140  }
141  for (ieta = 18; ieta < 21; ieta++) {
142  for (iphi = 3; iphi < 7; iphi++) {
143  for (int idep = 1; idep < 3; idep++) {
144  id = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, idep);
145  tmp.push_back(id);
146  }
147  }
148  }
149  for (ieta = 21; ieta < 26; ieta++) {
150  for (iphi = 2; iphi < 4; iphi++) {
151  for (int idep = 1; idep < 3; idep++) {
152  id = HcalTestNumbering::packHcalIndex(0, 0, 1, ieta, iphi, idep);
153  tmp.push_back(id);
154  }
155  }
156  }
157  }
158 
159  return tmp;
160 }
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
tmp
align.sh
Definition: createJobs.py:716