Main Page
Namespaces
Classes
Package Documentation
CondFormats
HcalObjects
src
HcalDetIdTransform.cc
Go to the documentation of this file.
1
#include "
CondFormats/HcalObjects/interface/HcalDetIdTransform.h
"
2
#include "
DataFormats/HcalDetId/interface/HcalDetId.h
"
3
4
#include "
FWCore/Utilities/interface/Exception.h
"
5
6
namespace
HcalDetIdTransform
7
{
8
unsigned
transform
(
const
HcalDetId
&
id
,
const
unsigned
transformCode)
9
{
10
static
const
int
ietaShift = 1024;
11
static
const
int
maxHcalDepth = 64;
12
13
if
(transformCode >=
N_TRANSFORMS
)
14
throw
cms::Exception
(
"In HcalDetIdTransform::transform:"
15
" invalid transform code"
);
16
unsigned
t
= 0;
17
switch
(transformCode)
18
{
19
case
RAWID
:
20
t =
id
.rawId();
21
break
;
22
23
case
IETA
:
24
t =
id
.ieta() + ietaShift;
25
break
;
26
27
case
IETAABS
:
28
t =
id
.ietaAbs();
29
break
;
30
31
case
SUBDET
:
32
t =
id
.subdetId();
33
break
;
34
35
case
IETADEPTH
:
36
t = (
id
.ieta() + ietaShift)*maxHcalDepth +
id
.
depth
();
37
break
;
38
39
case
IETAABSDEPTH
:
40
t =
id
.ietaAbs()*maxHcalDepth +
id
.depth();
41
break
;
42
43
default
:
44
throw
cms::Exception
(
"In HcalDetIdTransform::transform:"
45
" unhandled switch clause. This is a bug."
46
" Please report."
);
47
}
48
return
t
;
49
}
50
51
void
validateCode
(
const
unsigned
transformCode)
52
{
53
if
(transformCode >=
N_TRANSFORMS
)
54
throw
cms::Exception
(
"In HcalDetIdTransform::validateCode:"
55
" invalid transform code"
);
56
}
57
}
Exception
Definition:
hltDiff.cc:292
HcalDetIdTransform
Definition:
HcalDetIdTransform.h:6
HcalDetIdTransform::IETAABS
Definition:
HcalDetIdTransform.h:14
HcalDetIdTransform::SUBDET
Definition:
HcalDetIdTransform.h:15
HcalDetIdTransform::IETAABSDEPTH
Definition:
HcalDetIdTransform.h:17
HcalDetIdTransform::validateCode
void validateCode(unsigned transformCode)
Definition:
HcalDetIdTransform.cc:51
HcalDetId
Definition:
HcalDetId.h:12
HcalDetId.h
HcalDetIdTransform::N_TRANSFORMS
Definition:
HcalDetIdTransform.h:18
HcalDetIdTransform.h
HcalDetIdTransform::RAWID
Definition:
HcalDetIdTransform.h:12
Exception.h
HcalDetIdTransform::IETA
Definition:
HcalDetIdTransform.h:13
lumiQTWidget.t
t
Definition:
lumiQTWidget.py:50
HcalDetIdTransform::IETADEPTH
Definition:
HcalDetIdTransform.h:16
egammaForCoreTracking_cff.depth
depth
Definition:
egammaForCoreTracking_cff.py:29
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition:
HcalDetIdTransform.cc:8
Generated for CMSSW Reference Manual by
1.8.11