DataFormats
HcalDetId
src
HcalDcsDetId.cc
Go to the documentation of this file.
1
#include "
DataFormats/HcalDetId/interface/HcalDcsDetId.h
"
2
#include "
FWCore/Utilities/interface/Exception.h
"
3
#include <ostream>
4
5
HcalDcsDetId::HcalDcsDetId
() :
HcalOtherDetId
() {}
6
7
HcalDcsDetId::HcalDcsDetId
(uint32_t rawid) :
HcalOtherDetId
(rawid) {}
8
9
HcalDcsDetId::HcalDcsDetId
(
DetId
const
&
id
) :
HcalOtherDetId
(
id
) {
10
if
((
subdet
() !=
HcalDcsBarrel
) || (
subdet
() !=
HcalDcsEndcap
) || (
subdet
() !=
HcalDcsOuter
) ||
11
(
subdet
() !=
HcalDcsForward
)) {
12
throw
cms::Exception
(
"Invalid DetId"
) <<
"Cannot intialize HcalDcsDetId from "
<< std::hex <<
id_
<<
std::dec
;
13
}
14
}
15
16
HcalDcsDetId::HcalDcsDetId
(
17
HcalOtherSubdetector
subd,
int
side_or_ring,
unsigned
int
slc,
DcsType
ty,
unsigned
int
subchan)
18
:
HcalOtherDetId
(subd) {
19
id_
|= ((side_or_ring > 0) ? ((1 <<
kSideOffset
) | (side_or_ring <<
kRingOffset
)) : ((-side_or_ring) <<
kRingOffset
));
20
id_
|= (slc & 0x1F) <<
kSliceOffset
;
21
id_
|= (ty & 0xF) <<
kTypeOffset
;
22
id_
|= (subchan & 0xF) <<
kSubChannelOffset
;
23
}
24
25
HcalDcsDetId::DcsType
HcalDcsDetId::DcsTypeFromString
(
const
std::string
&
str
) {
26
int
ty(
HV
);
27
do
{
28
if
(
typeString
(
HcalDcsDetId::DcsType
(ty)) ==
str
)
29
return
HcalDcsDetId::DcsType
(ty);
30
}
while
(++ty !=
DCS_MAX
);
31
return
DCSUNKNOWN
;
32
}
33
34
std::string
HcalDcsDetId::typeString
(
DcsType
typ) {
35
switch
(typ) {
36
case
HV
:
37
return
"HV"
;
38
case
BV
:
39
return
"BV"
;
40
case
CATH
:
41
return
"CATH"
;
42
case
DYN7
:
43
return
"DYN7"
;
44
case
DYN8
:
45
return
"DYN8"
;
46
case
RM_TEMP
:
47
return
"RM_TEMP"
;
48
case
CCM_TEMP
:
49
return
"CCM_TEMP"
;
50
case
CALIB_TEMP
:
51
return
"CALIB_TEMP"
;
52
case
LVTTM_TEMP
:
53
return
"LVTTM_TEMP"
;
54
case
TEMP
:
55
return
"TEMP"
;
56
case
QPLL_LOCK
:
57
return
"QPLL_LOCK"
;
58
case
STATUS
:
59
return
"STATUS"
;
60
default
:
61
return
"DCSUNKNOWN"
;
62
}
63
return
"Invalid"
;
64
}
65
66
std::ostream&
operator<<
(std::ostream&
s
,
const
HcalDcsDetId
&
id
) {
67
switch
(
id
.subdet()) {
68
case
(
HcalDcsBarrel
):
69
return
s
<<
"(HB"
<<
id
.zside() <<
' '
<<
id
.slice() <<
' '
<<
id
.typeString(
id
.
type
()) <<
id
.subchannel() <<
')'
;
70
case
(
HcalDcsEndcap
):
71
return
s
<<
"(HE"
<<
id
.zside() <<
' '
<<
id
.slice() <<
' '
<<
id
.typeString(
id
.
type
()) <<
id
.subchannel() <<
')'
;
72
case
(
HcalDcsOuter
):
73
return
s
<<
"(HO"
<<
id
.ring() <<
" "
<<
id
.slice() <<
' '
<<
id
.typeString(
id
.
type
()) <<
id
.subchannel() <<
')'
;
74
case
(
HcalDcsForward
):
75
return
s
<<
"(HF"
<<
id
.zside() <<
' '
<< ((
id
.type() <=
HcalDcsDetId::DYN8
) ?
"Q"
:
""
) <<
id
.slice() <<
' '
76
<<
id
.typeString(
id
.
type
()) <<
id
.subchannel() <<
')'
;
77
default
:
78
return
s
<<
id
.rawId();
79
}
80
}
HcalDcsDetId::DCSUNKNOWN
Definition:
HcalDcsDetId.h:42
HcalDcsDetId::CCM_TEMP
Definition:
HcalDcsDetId.h:36
HcalDcsDetId::RM_TEMP
Definition:
HcalDcsDetId.h:35
HcalDcsDetId::CATH
Definition:
HcalDcsDetId.h:32
HcalDcsDetId
Definition:
HcalDcsDetId.h:27
HcalDcsEndcap
Definition:
HcalSubdetector.h:18
HcalDcsDetId::kSubChannelOffset
static unsigned const int kSubChannelOffset
Definition:
HcalDcsDetId.h:67
operator<<
std::ostream & operator<<(std::ostream &s, const HcalDcsDetId &id)
Definition:
HcalDcsDetId.cc:66
HcalDcsDetId::TEMP
Definition:
HcalDcsDetId.h:39
HcalDcsDetId::typeString
static std::string typeString(DcsType typ)
Definition:
HcalDcsDetId.cc:34
HcalDcsDetId::DYN8
Definition:
HcalDcsDetId.h:34
HcalDcsDetId::kSliceOffset
static unsigned const int kSliceOffset
Definition:
HcalDcsDetId.h:65
HcalDcsDetId::DcsType
DcsType
Definition:
HcalDcsDetId.h:29
DetId
Definition:
DetId.h:17
HcalDcsDetId::QPLL_LOCK
Definition:
HcalDcsDetId.h:40
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
HcalDcsDetId.h
HcalDcsDetId::DcsTypeFromString
static DcsType DcsTypeFromString(const std::string &str)
Definition:
HcalDcsDetId.cc:25
HcalDcsDetId::kSideOffset
static unsigned const int kSideOffset
Definition:
HcalDcsDetId.h:63
str
#define str(s)
Definition:
TestProcessor.cc:53
HcalDcsDetId::HV
Definition:
HcalDcsDetId.h:30
HcalDcsOuter
Definition:
HcalSubdetector.h:19
HcalOtherSubdetector
HcalOtherSubdetector
Definition:
HcalAssistant.h:40
DetId::id_
uint32_t id_
Definition:
DetId.h:69
HcalDcsDetId::HcalDcsDetId
HcalDcsDetId()
Definition:
HcalDcsDetId.cc:5
HcalDcsDetId::kRingOffset
static unsigned const int kRingOffset
Definition:
HcalDcsDetId.h:64
HcalDcsDetId::DYN7
Definition:
HcalDcsDetId.h:33
gainCalibHelper::gainCalibPI::type
type
Definition:
SiPixelGainCalibHelper.h:40
HcalDcsDetId::LVTTM_TEMP
Definition:
HcalDcsDetId.h:38
HcalDcsDetId::kTypeOffset
static unsigned const int kTypeOffset
Definition:
HcalDcsDetId.h:66
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
HcalDcsDetId::BV
Definition:
HcalDcsDetId.h:31
HcalDcsDetId::DCS_MAX
Definition:
HcalDcsDetId.h:43
HcalDcsBarrel
Definition:
HcalSubdetector.h:17
triggerObjects_cff.id
id
Definition:
triggerObjects_cff.py:29
Exception
Definition:
hltDiff.cc:245
HcalDcsDetId::STATUS
Definition:
HcalDcsDetId.h:41
HcalOtherDetId
Definition:
HcalOtherDetId.h:22
Exception.h
HcalOtherDetId::subdet
HcalOtherSubdetector subdet() const
get the category
Definition:
HcalOtherDetId.h:30
HcalDcsForward
Definition:
HcalSubdetector.h:20
HcalDcsDetId::CALIB_TEMP
Definition:
HcalDcsDetId.h:37
TauDecayModes.dec
dec
Definition:
TauDecayModes.py:142
Generated for CMSSW Reference Manual by
1.8.16