CMS 3D CMS Logo

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
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 
22  TkObj out;
23  convert(in, out);
24  return out;
25  }
26 
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  }
35  out.hwPt = in.hwPt;
36  out.hwPtErr = in.hwPtErr;
37  out.hwEta = in.hwEta;
38  out.hwPhi = in.hwPhi;
39  }
40  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
dpf2fw
NOTE: this include is not standalone, since the path to DiscretePFInputs is different in CMSSW & Viva...
Definition: DiscretePF2Firmware.h:9
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
l1tpf_impl::PropagatedTrack
Definition: DiscretePFInputs.h:119
EmCaloObj
Definition: data.h:132
l1tpf_impl::Muon
Definition: DiscretePFInputs.h:156
clear
void clear(HadCaloObj &c)
Definition: data.h:124
TkObj
Definition: data.h:143
recoMuon::in
Definition: RecoMuonEnumerators.h:6
MuObj
Definition: data.h:158
dpf2fw::transformConvert
TkObj transformConvert(const l1tpf_impl::PropagatedTrack &in)
Definition: DiscretePF2Firmware.h:21
l1tpf_impl::CaloCluster
Definition: DiscretePFInputs.h:25
dpf2fw::convert
void convert(const l1tpf_impl::PropagatedTrack &in, TkObj &out)
Definition: DiscretePF2Firmware.h:12
HadCaloObj
Definition: data.h:120
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
HcalHPDFilter_cfg.Out
Out
Definition: HcalHPDFilter_cfg.py:16