DataFormats
HcalDetId
src
HcalGenericDetId.cc
Go to the documentation of this file.
1
6
#include "
DataFormats/HcalDetId/interface/HcalGenericDetId.h
"
7
#include "
DataFormats/HcalDetId/interface/HcalDetId.h
"
8
#include "
DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h
"
9
#include "
DataFormats/HcalDetId/interface/HcalZDCDetId.h
"
10
#include "
DataFormats/HcalDetId/interface/HcalCastorDetId.h
"
11
#include "
DataFormats/HcalDetId/interface/HcalCalibDetId.h
"
12
#include <iostream>
13
#include <cstdlib>
14
15
HcalOtherSubdetector
HcalGenericDetId::otherSubdet
()
const
{
16
if
(
HcalSubdetector
(
subdetId
()) !=
HcalOther
)
17
return
HcalOtherEmpty
;
18
return
HcalOtherSubdetector
((
rawId
() >> 20) & 0x1F);
19
}
20
21
HcalGenericDetId::HcalGenericSubdetector
HcalGenericDetId::genericSubdet
()
const
{
22
if
(
null
())
23
return
HcalGenEmpty
;
24
switch
(
det
()) {
25
case
Calo
:
26
switch
(
subdetId
()) {
27
case
HcalZDCDetId::SubdetectorId
:
28
return
HcalGenZDC
;
29
case
HcalCastorDetId::SubdetectorId
:
30
return
HcalGenCastor
;
31
default
:
32
return
HcalGenUnknown
;
33
}
34
case
Hcal
:
35
switch
(
HcalSubdetector
(
subdetId
())) {
36
case
0:
37
return
HcalGenEmpty
;
38
case
HcalBarrel
:
39
return
HcalGenBarrel
;
40
case
HcalEndcap
:
41
return
HcalGenEndcap
;
42
case
HcalOuter
:
43
return
HcalGenOuter
;
44
case
HcalForward
:
45
return
HcalGenForward
;
46
case
HcalTriggerTower
:
47
return
HcalGenTriggerTower
;
48
case
HcalOther
:
49
switch
(
otherSubdet
()) {
50
case
HcalCalibration
:
51
return
HcalGenCalibration
;
52
default
:
53
return
HcalGenUnknown
;
54
}
55
default
:
56
return
HcalGenUnknown
;
57
}
58
default
:
59
return
HcalGenUnknown
;
60
}
61
return
HcalGenUnknown
;
62
}
63
64
bool
HcalGenericDetId::isHcalDetId
()
const
{
65
HcalGenericSubdetector
subdet =
genericSubdet
();
66
return
subdet ==
HcalGenBarrel
|| subdet ==
HcalGenEndcap
|| subdet ==
HcalGenOuter
|| subdet ==
HcalGenForward
;
67
}
68
69
bool
HcalGenericDetId::isHcalCalibDetId
()
const
{
70
HcalGenericSubdetector
subdet =
genericSubdet
();
71
return
subdet ==
HcalGenCalibration
;
72
}
73
74
bool
HcalGenericDetId::isHcalTrigTowerDetId
()
const
{
75
HcalGenericSubdetector
subdet =
genericSubdet
();
76
return
subdet ==
HcalGenTriggerTower
;
77
}
78
79
bool
HcalGenericDetId::isHcalZDCDetId
()
const
{
80
HcalGenericSubdetector
subdet =
genericSubdet
();
81
return
subdet ==
HcalGenZDC
;
82
}
83
84
bool
HcalGenericDetId::isHcalCastorDetId
()
const
{
85
HcalGenericSubdetector
subdet =
genericSubdet
();
86
return
subdet ==
HcalGenCastor
;
87
}
88
89
std::ostream&
operator<<
(std::ostream&
s
,
const
HcalGenericDetId
&
id
) {
90
if
(
id
.
null
())
91
s
<<
"(Null Id)"
;
92
else
93
switch
(
id
.genericSubdet()) {
94
case
HcalGenericDetId::HcalGenBarrel
:
95
case
HcalGenericDetId::HcalGenEndcap
:
96
case
HcalGenericDetId::HcalGenOuter
:
97
case
HcalGenericDetId::HcalGenForward
:
98
s
<<
HcalDetId
(
id
);
99
break
;
100
case
HcalGenericDetId::HcalGenTriggerTower
:
101
s
<<
HcalTrigTowerDetId
(
id
);
102
break
;
103
case
HcalGenericDetId::HcalGenZDC
:
104
s
<<
HcalZDCDetId
(
id
);
105
break
;
106
case
HcalGenericDetId::HcalGenCastor
:
107
s
<<
HcalCastorDetId
(
id
);
108
break
;
109
case
HcalGenericDetId::HcalGenCalibration
:
110
s
<<
HcalCalibDetId
(
id
);
111
break
;
112
default
:
113
s
<<
"(Hcal Unknown Id: 0x"
<< std::hex <<
id
.rawId() <<
std::dec
<<
')'
;
114
}
115
return
s
;
116
}
HcalOther
Definition:
HcalAssistant.h:38
HcalGenericDetId
Definition:
HcalGenericDetId.h:15
HcalCalibDetId
Definition:
HcalCalibDetId.h:45
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition:
DetId.h:46
HcalGenericDetId::HcalGenEmpty
Definition:
HcalGenericDetId.h:18
DetId::Hcal
Definition:
DetId.h:28
HcalGenericDetId::HcalGenEndcap
Definition:
HcalGenericDetId.h:20
HcalGenericDetId.h
HcalCastorDetId::SubdetectorId
static const int SubdetectorId
Definition:
HcalCastorDetId.h:28
HcalGenericDetId::HcalGenCastor
Definition:
HcalGenericDetId.h:26
HcalBarrel
Definition:
HcalAssistant.h:33
HcalZDCDetId.h
DetId::Calo
Definition:
DetId.h:29
HcalOtherEmpty
Definition:
HcalAssistant.h:40
HcalGenericDetId::isHcalZDCDetId
bool isHcalZDCDetId() const
Definition:
HcalGenericDetId.cc:79
HcalGenericDetId::HcalGenZDC
Definition:
HcalGenericDetId.h:24
HcalZDCDetId
Definition:
HcalZDCDetId.h:16
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
HcalGenericDetId::isHcalCalibDetId
bool isHcalCalibDetId() const
Definition:
HcalGenericDetId.cc:69
HcalGenericDetId::HcalGenUnknown
Definition:
HcalGenericDetId.h:27
HcalOuter
Definition:
HcalAssistant.h:35
HcalCalibDetId.h
HcalCalibration
Definition:
HcalAssistant.h:40
HcalZDCDetId::SubdetectorId
static const int SubdetectorId
Definition:
HcalZDCDetId.h:25
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition:
DetId.h:48
HcalCastorDetId
Definition:
HcalCastorDetId.h:23
HcalTrigTowerDetId.h
HcalGenericDetId::isHcalTrigTowerDetId
bool isHcalTrigTowerDetId() const
Definition:
HcalGenericDetId.cc:74
HcalOtherSubdetector
HcalOtherSubdetector
Definition:
HcalAssistant.h:40
HcalGenericDetId::HcalGenericSubdetector
HcalGenericSubdetector
Definition:
HcalGenericDetId.h:17
HcalDetId.h
HcalGenericDetId::HcalGenTriggerTower
Definition:
HcalGenericDetId.h:23
HcalDetId
Definition:
HcalDetId.h:12
HcalGenericDetId::otherSubdet
HcalOtherSubdetector otherSubdet() const
Definition:
HcalGenericDetId.cc:15
HcalGenericDetId::HcalGenBarrel
Definition:
HcalGenericDetId.h:19
HcalGenericDetId::isHcalCastorDetId
bool isHcalCastorDetId() const
Definition:
HcalGenericDetId.cc:84
HcalSubdetector
HcalSubdetector
Definition:
HcalAssistant.h:31
HcalForward
Definition:
HcalAssistant.h:36
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition:
DetId.h:57
HcalGenericDetId::isHcalDetId
bool isHcalDetId() const
Definition:
HcalGenericDetId.cc:64
HcalEndcap
Definition:
HcalAssistant.h:34
operator<<
std::ostream & operator<<(std::ostream &s, const HcalGenericDetId &id)
Definition:
HcalGenericDetId.cc:89
HcalGenericDetId::genericSubdet
HcalGenericSubdetector genericSubdet() const
Definition:
HcalGenericDetId.cc:21
HcalTriggerTower
Definition:
HcalAssistant.h:37
HcalGenericDetId::HcalGenOuter
Definition:
HcalGenericDetId.h:21
HcalCastorDetId.h
HcalGenericDetId::HcalGenForward
Definition:
HcalGenericDetId.h:22
TauDecayModes.dec
dec
Definition:
TauDecayModes.py:142
HcalGenericDetId::HcalGenCalibration
Definition:
HcalGenericDetId.h:25
HcalTrigTowerDetId
Definition:
HcalTrigTowerDetId.h:14
Generated for CMSSW Reference Manual by
1.8.16