CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 26 of file HcalTBNumberingScheme.h.

Constructor & Destructor Documentation

HcalTBNumberingScheme::HcalTBNumberingScheme ( )
inline

Definition at line 29 of file HcalTBNumberingScheme.h.

29 {}
virtual HcalTBNumberingScheme::~HcalTBNumberingScheme ( )
inlinevirtual

Definition at line 30 of file HcalTBNumberingScheme.h.

30 {}

Member Function Documentation

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

Definition at line 27 of file HcalTBNumberingScheme.cc.

References HcalBarrel, LogDebug, HcalTestNumbering::packHcalIndex(), and HcalTestNumbering::unpackHcalIndex().

Referenced by HcalTB04Analysis::fillBuffer().

28  {
29 
30  int subdet, zside, group, ieta, iphi, lay;
31  HcalTestNumbering::unpackHcalIndex(idHit, subdet, zside, group,
32  ieta, iphi, lay);
33  LogDebug("HcalTBSim") << "HcalTBNumberingScheme: i/p ID 0x" << std::hex
34  << idHit << std::dec << " det " << zside << " group "
35  << group << " layer " << lay << " eta " << ieta
36  << " phi " << iphi;
37 
38  uint32_t idunit;
39  if (subdet == static_cast<int>(HcalBarrel)) {
40  if (lay <= 17) group = 1;
41  else group = 2;
42  }
43  if (mode > 0) {
44  if (subdet == static_cast<int>(HcalBarrel) && iphi > 4) {
45  if (lay <= 17) {
46  // HB2 (unmasked and masked)
47  if (ieta > 4 && ieta < 10) {
48  idunit = HcalTestNumbering::packHcalIndex(0,0,1,0,iphi,lay);
49  } else {
50  idunit = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,group);
51  }
52  } else {
53  // HO behind HB2
54  idunit = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,18);
55  }
56  } else {
57  // HB1, HE, HO behind HB1
58  idunit = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,group);
59  }
60  } else {
61  idunit = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,group);
62  }
63 
64  HcalTestNumbering::unpackHcalIndex(idunit, subdet, zside, group,
65  ieta, iphi, lay);
66  LogDebug("HcalTBSim") << "HcalTBNumberingScheme: idHit 0x" << std::hex
67  << idHit << " idunit 0x" << idunit << std::dec << "\n"
68  << "HcalTBNumberingScheme: o/p ID 0x" << std::hex
69  << idunit << std::dec << " det " << zside << " group "
70  << group << " layer " << lay << " eta " << ieta
71  << " phi " << iphi;
72 
73  return idunit;
74 }
#define LogDebug(id)
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)
std::vector< uint32_t > HcalTBNumberingScheme::getUnitIDs ( const int  type,
const int  mode 
)
static

Definition at line 76 of file HcalTBNumberingScheme.cc.

References errorMatrix2Lands_multiChannel::id, HcalTestNumbering::packHcalIndex(), and tmp.

Referenced by HcalTB04Analysis::init().

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