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
12
if
(transformCode >=
N_TRANSFORMS
)
13
throw
cms::Exception
(
"In HcalDetIdTransform::transform:"
14
" invalid transform code"
);
15
unsigned
t
= 0;
16
switch
(transformCode)
17
{
18
case
RAWID
:
19
t =
id
.rawId();
20
break
;
21
22
case
IETA
:
23
t =
id
.ieta() + ietaShift;
24
break
;
25
26
case
IETAABS
:
27
t =
id
.ietaAbs();
28
break
;
29
30
case
SUBDET
:
31
t =
id
.subdetId();
32
break
;
33
34
default
:
35
throw
cms::Exception
(
"In HcalDetIdTransform::transform:"
36
" unhandled switch clause. This is a bug."
37
" Please report."
);
38
}
39
return
t
;
40
}
41
42
void
validateCode
(
const
unsigned
transformCode)
43
{
44
if
(transformCode >=
N_TRANSFORMS
)
45
throw
cms::Exception
(
"In HcalDetIdTransform::validateCode:"
46
" invalid transform code"
);
47
}
48
}
Exception
Definition:
hltDiff.cc:292
HcalDetIdTransform
Definition:
HcalDetIdTransform.h:6
HcalDetIdTransform::validateCode
void validateCode(unsigned transformCode)
Definition:
HcalDetIdTransform.cc:42
HcalDetId
Definition:
HcalDetId.h:12
HcalDetId.h
HcalDetIdTransform::N_TRANSFORMS
Definition:
HcalDetIdTransform.h:16
HcalDetIdTransform.h
HcalDetIdTransform::RAWID
Definition:
HcalDetIdTransform.h:12
Exception.h
lumiQTWidget.t
t
Definition:
lumiQTWidget.py:50
HcalDetIdTransform::IETA
Definition:
HcalDetIdTransform.h:13
HcalDetIdTransform::IETAABS
Definition:
HcalDetIdTransform.h:14
HcalDetIdTransform::SUBDET
Definition:
HcalDetIdTransform.h:15
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition:
HcalDetIdTransform.cc:8
Generated for CMSSW Reference Manual by
1.8.11