SimG4CMS
HcalTestBeam
plugins
HcalTBNumberingScheme.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: HcalTestBeam
4
// Class : HcalTBNumberingScheme
5
//
6
// Implementation:
7
// Numbering scheme for test beam hadron calorimeter
8
//
9
// Original Author:
10
// Created: Tue May 16 10:14:34 CEST 2006
11
//
12
13
// system include files
14
#include <iostream>
15
16
// user include files
17
#include "
SimG4CMS/Calo/interface/HcalTestNumberingScheme.h
"
18
#include "
DataFormats/HcalDetId/interface/HcalSubdetector.h
"
19
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
20
#include "
HcalTBNumberingScheme.h
"
21
22
//
23
// member functions
24
//
25
26
uint32_t
HcalTBNumberingScheme::getUnitID
(
const
uint32_t idHit,
const
int
mode
) {
27
int
subdet,
zside
,
group
,
ieta
,
iphi
, lay;
28
HcalTestNumbering::unpackHcalIndex
(idHit, subdet,
zside
,
group
,
ieta
,
iphi
, lay);
29
LogDebug
(
"HcalTBSim"
) <<
"HcalTBNumberingScheme: i/p ID 0x"
<< std::hex << idHit <<
std::dec
<<
" det "
<<
zside
30
<<
" group "
<<
group
<<
" layer "
<< lay <<
" eta "
<<
ieta
<<
" phi "
<<
iphi
;
31
32
uint32_t idunit;
33
if
(subdet == static_cast<int>(
HcalBarrel
)) {
34
if
(lay <= 17)
35
group
= 1;
36
else
37
group
= 2;
38
}
39
if
(
mode
> 0) {
40
if
(subdet == static_cast<int>(
HcalBarrel
) &&
iphi
> 4) {
41
if
(lay <= 17) {
42
// HB2 (unmasked and masked)
43
if
(
ieta
> 4 &&
ieta
< 10) {
44
idunit =
HcalTestNumbering::packHcalIndex
(0, 0, 1, 0,
iphi
, lay);
45
}
else
{
46
idunit =
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
,
group
);
47
}
48
}
else
{
49
// HO behind HB2
50
idunit =
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
, 18);
51
}
52
}
else
{
53
// HB1, HE, HO behind HB1
54
idunit =
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
,
group
);
55
}
56
}
else
{
57
idunit =
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
,
group
);
58
}
59
60
HcalTestNumbering::unpackHcalIndex
(idunit, subdet,
zside
,
group
,
ieta
,
iphi
, lay);
61
LogDebug
(
"HcalTBSim"
) <<
"HcalTBNumberingScheme: idHit 0x"
<< std::hex << idHit <<
" idunit 0x"
<< idunit <<
std::dec
62
<<
"\n"
63
<<
"HcalTBNumberingScheme: o/p ID 0x"
<< std::hex << idunit <<
std::dec
<<
" det "
<<
zside
64
<<
" group "
<<
group
<<
" layer "
<< lay <<
" eta "
<<
ieta
<<
" phi "
<<
iphi
;
65
66
return
idunit;
67
}
68
69
std::vector<uint32_t>
HcalTBNumberingScheme::getUnitIDs
(
const
int
type
,
const
int
mode
) {
70
std::vector<uint32_t>
tmp
;
71
int
iphi
,
ieta
, lay;
72
uint32_t
id
;
73
74
if
(
type
!= 1) {
75
// Include HB and HO id's
76
if
(
mode
> 0) {
77
// HB1 and masked part of HB2
78
for
(
ieta
= 1;
ieta
< 17;
ieta
++) {
79
for
(
iphi
= 1;
iphi
< 9;
iphi
++) {
80
id
=
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
, 1);
81
tmp
.push_back(
id
);
82
}
83
}
84
// HO behind HB1
85
for
(
ieta
= 1;
ieta
< 16;
ieta
++) {
86
for
(
iphi
= 2;
iphi
< 5;
iphi
++) {
87
id
=
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
, 2);
88
tmp
.push_back(
id
);
89
}
90
}
91
// HB2
92
for
(lay = 1; lay < 18; lay++) {
93
for
(
iphi
= 5;
iphi
< 9;
iphi
++) {
94
id
=
HcalTestNumbering::packHcalIndex
(0, 0, 1, 0,
iphi
, lay);
95
tmp
.push_back(
id
);
96
}
97
}
98
// HO behind HB2
99
lay = 18;
100
for
(
ieta
= 1;
ieta
< 16;
ieta
++) {
101
for
(
iphi
= 5;
iphi
< 8;
iphi
++) {
102
id
=
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
, lay);
103
tmp
.push_back(
id
);
104
}
105
}
106
}
else
{
107
// HB1 & HB2
108
for
(
ieta
= 1;
ieta
< 17;
ieta
++) {
109
for
(
iphi
= 1;
iphi
< 9;
iphi
++) {
110
id
=
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
, 1);
111
tmp
.push_back(
id
);
112
}
113
}
114
// HO behind HB
115
for
(
ieta
= 1;
ieta
< 16;
ieta
++) {
116
for
(
iphi
= 2;
iphi
< 8;
iphi
++) {
117
id
=
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
, 2);
118
tmp
.push_back(
id
);
119
}
120
}
121
}
122
}
123
124
if
(
type
> 0) {
125
// Include HE id's
126
for
(
ieta
= 15;
ieta
< 17;
ieta
++) {
127
for
(
iphi
= 3;
iphi
< 7;
iphi
++) {
128
id
=
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
, 3);
129
tmp
.push_back(
id
);
130
}
131
}
132
for
(
iphi
= 3;
iphi
< 7;
iphi
++) {
133
id
=
HcalTestNumbering::packHcalIndex
(0, 0, 1, 17,
iphi
, 1);
134
tmp
.push_back(
id
);
135
}
136
for
(
ieta
= 18;
ieta
< 21;
ieta
++) {
137
for
(
iphi
= 3;
iphi
< 7;
iphi
++) {
138
for
(
int
idep = 1; idep < 3; idep++) {
139
id
=
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
, idep);
140
tmp
.push_back(
id
);
141
}
142
}
143
}
144
for
(
ieta
= 21;
ieta
< 26;
ieta
++) {
145
for
(
iphi
= 2;
iphi
< 4;
iphi
++) {
146
for
(
int
idep = 1; idep < 3; idep++) {
147
id
=
HcalTestNumbering::packHcalIndex
(0, 0, 1,
ieta
,
iphi
, idep);
148
tmp
.push_back(
id
);
149
}
150
}
151
}
152
}
153
154
return
tmp
;
155
}
MessageLogger.h
ecaldqm::zside
int zside(DetId const &)
Definition:
EcalDQMCommonUtils.cc:189
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition:
ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
HcalBarrel
Definition:
HcalAssistant.h:33
createJobs.tmp
tmp
align.sh
Definition:
createJobs.py:716
LEDCalibrationChannels.iphi
iphi
Definition:
LEDCalibrationChannels.py:64
HcalTestNumbering::unpackHcalIndex
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
Definition:
HcalTestNumbering.cc:18
HcalTBNumberingScheme.h
LEDCalibrationChannels.ieta
ieta
Definition:
LEDCalibrationChannels.py:63
LogDebug
#define LogDebug(id)
Definition:
MessageLogger.h:233
HcalTestNumbering::packHcalIndex
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
Definition:
HcalTestNumbering.cc:7
type
type
Definition:
SiPixelVCal_PayloadInspector.cc:39
HcalSubdetector.h
HcalTBNumberingScheme::getUnitIDs
static std::vector< uint32_t > getUnitIDs(const int type, const int mode)
Definition:
HcalTBNumberingScheme.cc:69
triggerObjects_cff.id
id
Definition:
triggerObjects_cff.py:29
HcalTBNumberingScheme::getUnitID
static uint32_t getUnitID(const uint32_t id, const int mode)
Definition:
HcalTBNumberingScheme.cc:26
HcalTestNumberingScheme.h
TauDecayModes.dec
dec
Definition:
TauDecayModes.py:142
watchdog.group
group
Definition:
watchdog.py:82
Generated for CMSSW Reference Manual by
1.8.16