Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
L1Trigger
Phase2L1ParticleFlow
src
utils
DiscretePF2Firmware.h
Go to the documentation of this file.
1
#ifndef L1Trigger_Phase2L1ParticleFlow_DISCRETEPF2FIRMWARE_H
2
#define L1Trigger_Phase2L1ParticleFlow_DISCRETEPF2FIRMWARE_H
3
5
6
#include "../firmware/data.h"
7
#include <vector>
8
9
namespace
dpf2fw {
10
11
// convert inputs from discrete to firmware
12
inline
void
convert
(
const
l1tpf_impl::PropagatedTrack
&
in
,
TkObj
&
out
) {
13
out.
hwPt
= in.
hwPt
;
14
out.
hwPtErr
= in.
hwCaloPtErr
;
15
out.
hwEta
= in.
hwEta
;
// @calo
16
out.
hwPhi
= in.
hwPhi
;
// @calo
17
out.
hwZ0
= in.
hwZ0
;
18
out.
hwTightQuality
= (in.
hwStubs
>= 6 && in.
hwChi2
< 500);
19
}
20
21
inline
TkObj
transformConvert
(
const
l1tpf_impl::PropagatedTrack
&
in
) {
22
TkObj
out
;
23
convert
(in, out);
24
return
out
;
25
}
26
27
inline
void
convert
(
const
l1tpf_impl::CaloCluster
&
in
,
HadCaloObj
&
out
) {
28
out.
hwPt
= in.
hwPt
;
29
out.
hwEmPt
= in.
hwEmPt
;
30
out.
hwEta
= in.
hwEta
;
31
out.
hwPhi
= in.
hwPhi
;
32
out.
hwIsEM
= in.
isEM
;
33
}
34
inline
void
convert
(
const
l1tpf_impl::CaloCluster
&
in
,
EmCaloObj
&
out
) {
35
out.
hwPt
= in.
hwPt
;
36
out.
hwPtErr
= in.
hwPtErr
;
37
out.
hwEta
= in.
hwEta
;
38
out.
hwPhi
= in.
hwPhi
;
39
}
40
inline
void
convert
(
const
l1tpf_impl::Muon
&
in
,
MuObj
&
out
) {
41
out.
hwPt
= in.
hwPt
;
42
out.
hwPtErr
= 0;
// does not exist in input
43
out.
hwEta
= in.
hwEta
;
// @calo
44
out.
hwPhi
= in.
hwPhi
;
// @calo
45
}
46
47
template
<
unsigned
int
NMAX,
typename
In,
typename
Out>
48
void
convert
(
const
std::vector<In> &
in
, Out
out
[NMAX]) {
49
for
(
unsigned
int
i
= 0,
n
= std::min<unsigned int>(NMAX, in.size());
i
<
n
; ++
i
) {
50
convert
(in[
i
],
out
[i]);
51
}
52
for
(
unsigned
int
i
= in.size();
i
< NMAX; ++
i
) {
53
clear
(
out
[
i
]);
54
}
55
}
56
57
template
<
typename
In,
typename
Out>
58
void
convert
(
unsigned
int
NMAX,
const
std::vector<In> &
in
, Out
out
[]) {
59
for
(
unsigned
int
i
= 0,
n
= std::min<unsigned int>(NMAX, in.size());
i
<
n
; ++
i
) {
60
convert
(in[
i
], out[i]);
61
}
62
for
(
unsigned
int
i
= in.size();
i
< NMAX; ++
i
) {
63
clear
(out[
i
]);
64
}
65
}
66
67
}
// namespace dpf2fw
68
69
#endif
MuObj
Definition:
data.h:158
mps_fire.i
i
Definition:
mps_fire.py:428
EmCaloObj::hwPt
pt_t hwPt
Definition:
data.h:133
l1tpf_impl::InputTrack::hwChi2
uint16_t hwChi2
Definition:
DiscretePFInputs.h:88
dpf2fw::convert
void convert(const l1tpf_impl::PropagatedTrack &in, TkObj &out)
Definition:
DiscretePF2Firmware.h:12
l1tpf_impl::CaloCluster::isEM
bool isEM
Definition:
DiscretePFInputs.h:32
clear
activeDets clear()
l1tpf_impl::InputTrack::hwZ0
int16_t hwZ0
Definition:
DiscretePFInputs.h:87
recoMuon::in
Definition:
RecoMuonEnumerators.h:6
HadCaloObj::hwIsEM
bool hwIsEM
Definition:
data.h:122
TkObj::hwPt
pt_t hwPt
Definition:
data.h:144
MuObj::hwEta
etaphi_t hwEta
Definition:
data.h:160
EmCaloObj::hwEta
etaphi_t hwEta
Definition:
data.h:134
l1tpf_impl::PropagatedTrack
Definition:
DiscretePFInputs.h:119
HadCaloObj::hwEmPt
pt_t hwEmPt
Definition:
data.h:121
HadCaloObj
Definition:
data.h:120
EmCaloObj::hwPtErr
pt_t hwPtErr
Definition:
data.h:133
l1tpf_impl::CaloCluster
Definition:
DiscretePFInputs.h:25
MuObj::hwPt
pt_t hwPt
Definition:
data.h:159
l1tpf_impl::CaloCluster::hwEmPt
int16_t hwEmPt
Definition:
DiscretePFInputs.h:27
MuObj::hwPtErr
pt_t hwPtErr
Definition:
data.h:159
TkObj::hwTightQuality
bool hwTightQuality
Definition:
data.h:147
l1tpf_impl::Muon::hwPt
int16_t hwPt
Definition:
DiscretePFInputs.h:157
CaloObj::hwPhi
etaphi_t hwPhi
Definition:
data.h:118
l1tpf_impl::InputTrack::hwStubs
uint16_t hwStubs
Definition:
DiscretePFInputs.h:88
l1tpf_impl::PropagatedTrack::hwPt
int16_t hwPt
Definition:
DiscretePFInputs.h:120
l1tpf_impl::CaloCluster::hwPhi
int16_t hwPhi
Definition:
DiscretePFInputs.h:30
l1tpf_impl::Muon
Definition:
DiscretePFInputs.h:156
CaloObj::hwPt
pt_t hwPt
Definition:
data.h:117
EmCaloObj
Definition:
data.h:132
l1tpf_impl::CaloCluster::hwPtErr
int16_t hwPtErr
Definition:
DiscretePFInputs.h:28
TkObj::hwPtErr
pt_t hwPtErr
Definition:
data.h:144
l1tpf_impl::CaloCluster::hwEta
int16_t hwEta
Definition:
DiscretePFInputs.h:29
l1tpf_impl::PropagatedTrack::hwPhi
int16_t hwPhi
Definition:
DiscretePFInputs.h:124
TkObj::hwZ0
z0_t hwZ0
Definition:
data.h:146
l1tpf_impl::PropagatedTrack::hwCaloPtErr
int16_t hwCaloPtErr
Definition:
DiscretePFInputs.h:122
EmCaloObj::hwPhi
etaphi_t hwPhi
Definition:
data.h:134
l1tpf_impl::Muon::hwPhi
int16_t hwPhi
Definition:
DiscretePFInputs.h:159
CaloObj::hwEta
etaphi_t hwEta
Definition:
data.h:118
dpf2fw::transformConvert
TkObj transformConvert(const l1tpf_impl::PropagatedTrack &in)
Definition:
DiscretePF2Firmware.h:21
TkObj::hwPhi
etaphi_t hwPhi
Definition:
data.h:145
MuObj::hwPhi
etaphi_t hwPhi
Definition:
data.h:160
l1tpf_impl::Muon::hwEta
int16_t hwEta
Definition:
DiscretePFInputs.h:158
TkObj::hwEta
etaphi_t hwEta
Definition:
data.h:145
dqmiodumpmetadata.n
int n
Definition:
dqmiodumpmetadata.py:28
TkObj
Definition:
data.h:143
submitPVResolutionJobs.out
string out
Definition:
submitPVResolutionJobs.py:118
l1tpf_impl::PropagatedTrack::hwEta
int16_t hwEta
Definition:
DiscretePFInputs.h:123
l1tpf_impl::CaloCluster::hwPt
int16_t hwPt
Definition:
DiscretePFInputs.h:26
Generated for CMSSW Reference Manual by
1.8.5