L1Trigger
L1TMuonOverlap
src
OmtfName.cc
Go to the documentation of this file.
1
#include "
L1Trigger/L1TMuonOverlap/interface/OmtfName.h
"
2
3
namespace
{
4
template
<
typename
T>
5
int
sgn
(
T
val
) {
6
return
(
T
(0) <
val
) - (
val
<
T
(0));
7
}
8
}
// namespace
9
10
OmtfName::OmtfName
(
unsigned
int
iProcesor,
int
endcap
) {
11
int
iproc = (iProcesor <= 5) ? static_cast<int>(iProcesor) : -1;
12
int
position
= (
abs
(
endcap
) == 1) ?
endcap
: 0;
13
theBoard
=
static_cast<
Board
>
(
sgn
(
position
) * (iproc + 1));
14
}
15
16
OmtfName::OmtfName
(
unsigned
int
iProcesor,
l1t::tftype
endcap
) {
17
int
iproc = (iProcesor <= 5) ? static_cast<int>(iProcesor) : -1;
18
int
position
= (
endcap
==
l1t::omtf_pos
) ? 1 : ((
endcap
==
l1t::omtf_neg
) ? -1 : 0);
19
theBoard
=
static_cast<
Board
>
(
sgn
(
position
) * (iproc + 1));
20
}
21
22
OmtfName::OmtfName
(
const
std::string
& board) {
23
if
(board ==
"OMTFn1"
)
24
theBoard
=
OMTFn1
;
25
else
if
(board ==
"OMTFn2"
)
26
theBoard
=
OMTFn2
;
27
else
if
(board ==
"OMTFn3"
)
28
theBoard
=
OMTFn3
;
29
else
if
(board ==
"OMTFn4"
)
30
theBoard
=
OMTFn4
;
31
else
if
(board ==
"OMTFn5"
)
32
theBoard
=
OMTFn5
;
33
else
if
(board ==
"OMTFn6"
)
34
theBoard
=
OMTFn6
;
35
else
if
(board ==
"OMTFp1"
)
36
theBoard
=
OMTFp1
;
37
else
if
(board ==
"OMTFp2"
)
38
theBoard
=
OMTFp2
;
39
else
if
(board ==
"OMTFp3"
)
40
theBoard
=
OMTFp3
;
41
else
if
(board ==
"OMTFp4"
)
42
theBoard
=
OMTFp4
;
43
else
if
(board ==
"OMTFp5"
)
44
theBoard
=
OMTFp5
;
45
else
if
(board ==
"OMTFp6"
)
46
theBoard
=
OMTFp6
;
47
else
48
theBoard
=
OMTFp6
;
49
}
50
51
std::string
OmtfName::name
()
const
{
52
switch
(
theBoard
) {
53
case
(
OMTFn1
):
54
return
"OMTFn1"
;
55
case
(
OMTFn2
):
56
return
"OMTFn2"
;
57
case
(
OMTFn3
):
58
return
"OMTFn3"
;
59
case
(
OMTFn4
):
60
return
"OMTFn4"
;
61
case
(
OMTFn5
):
62
return
"OMTFn5"
;
63
case
(
OMTFn6
):
64
return
"OMTFn6"
;
65
case
(
OMTFp1
):
66
return
"OMTFp1"
;
67
case
(
OMTFp2
):
68
return
"OMTFp2"
;
69
case
(
OMTFp3
):
70
return
"OMTFp3"
;
71
case
(
OMTFp4
):
72
return
"OMTFp4"
;
73
case
(
OMTFp5
):
74
return
"OMTFp5"
;
75
case
(
OMTFp6
):
76
return
"OMTFp6"
;
77
default
:
78
return
"UNKNOWN"
;
79
}
80
}
81
82
int
OmtfName::position
()
const
{
return
sgn
(
theBoard
); }
83
84
unsigned
int
OmtfName::processor
()
const
{
return
abs
(
theBoard
) - 1; }
85
86
l1t::tftype
OmtfName::tftype
()
const
{
return
sgn
(
theBoard
) > 0 ?
l1t::omtf_pos
:
l1t::omtf_neg
; }
OmtfName::Board
Board
Definition:
OmtfName.h:11
OmtfName::theBoard
Board theBoard
Definition:
OmtfName.h:49
FWPFMaths::sgn
float sgn(float val)
Definition:
FWPFMaths.cc:9
OmtfName.h
OmtfName::OMTFn4
Definition:
OmtfName.h:15
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
OmtfName::OMTFp2
Definition:
OmtfName.h:19
OmtfName::OMTFn3
Definition:
OmtfName.h:14
l1t::tftype
tftype
Definition:
RegionalMuonCandFwd.h:8
OmtfName::OMTFn6
Definition:
OmtfName.h:17
l1t::omtf_neg
Definition:
RegionalMuonCandFwd.h:8
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
OmtfName::OMTFp5
Definition:
OmtfName.h:22
OmtfName::tftype
l1t::tftype tftype() const
Definition:
OmtfName.cc:86
OmtfName::OmtfName
OmtfName(Board board=UNKNOWN)
Definition:
OmtfName.h:28
l1t::omtf_pos
Definition:
RegionalMuonCandFwd.h:8
OmtfName::position
int position() const
Definition:
OmtfName.cc:82
makeMuonMisalignmentScenario.endcap
endcap
Definition:
makeMuonMisalignmentScenario.py:320
OmtfName::name
std::string name() const
Definition:
OmtfName.cc:51
OmtfName::OMTFn5
Definition:
OmtfName.h:16
OmtfName::OMTFn1
Definition:
OmtfName.h:12
OmtfName::OMTFp3
Definition:
OmtfName.h:20
OmtfName::OMTFp4
Definition:
OmtfName.h:21
OmtfName::processor
unsigned int processor() const
Definition:
OmtfName.cc:84
OmtfName::OMTFp1
Definition:
OmtfName.h:18
OmtfName::OMTFp6
Definition:
OmtfName.h:23
T
long double T
Definition:
Basic3DVectorLD.h:48
heppy_batch.val
val
Definition:
heppy_batch.py:351
OmtfName::OMTFn2
Definition:
OmtfName.h:13
Generated for CMSSW Reference Manual by
1.8.14