Skip to content

Commit 6b68f26

Browse files
committed
Address review comments
1 parent c7ab55d commit 6b68f26

File tree

9 files changed

+14
-192
lines changed

9 files changed

+14
-192
lines changed

DataFormats/L1TParticleFlow/interface/PFCluster.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ namespace l1t {
4040
setPdgId(isEM ? 22 : 130); // photon : non-photon(K0)
4141
}
4242

43-
enum class HWEncoding { None = 0, Had = 1, Em = 2, Gct = 3 };
43+
enum class HWEncoding { None = 0, Had = 1, Em = 2 };
4444

4545
float hOverE() const { return hOverE_; }
4646
void setHOverE(float hOverE) { hOverE_ = hOverE; }
4747

48-
// FIXME: this might nor be consistent with the value stored in the HW digi
48+
// NOTE: this might not be consistent with the value stored in the HW digi
4949
float emEt() const {
5050
if (hOverE_ == -1)
5151
return 0;

DataFormats/L1TParticleFlow/interface/datatypes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ namespace l1ct {
157157
constexpr float SRRTOT_LSB = 0.0019531250; // pow(2, -9)
158158
constexpr unsigned int SRRTOT_SCALE = 64; // pow(2, 6)
159159
constexpr float HOE_LSB = 0.031250000; // pow(2, -5)
160+
// empirical choice: we saturate to 16 while waiting for updates to the GCT-CTL1 interface document
160161
constexpr unsigned int RELISO_SCALE = 16;
161162

162163
inline float floatPt(pt_t pt) { return pt.to_float(); }

L1Trigger/Phase2L1ParticleFlow/interface/conifer.h

Lines changed: 0 additions & 174 deletions
This file was deleted.

L1Trigger/Phase2L1ParticleFlow/interface/egamma/pftkegalgo_ref.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
#include "DataFormats/L1TParticleFlow/interface/pf.h"
77
#include "L1Trigger/Phase2L1ParticleFlow/interface/common/inversion.h"
88

9-
// FIXME: back to the old way of including conifer.h
10-
#include "L1Trigger/Phase2L1ParticleFlow/interface/conifer.h"
11-
// #include "conifer.h"
9+
#include "conifer.h"
1210

1311
namespace edm {
1412
class ParameterSet;

L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/gcthadinput_ref.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace l1ct {
3333
ap_int<7> phi(const ap_uint<64> &in) const { return (ap_int<7>)in.range(25, 19); }
3434

3535
// HoE value
36-
ap_uint<4> hoe(const ap_uint<64> &in) const { return in.range(30, 26); }
36+
ap_uint<4> hoe(const ap_uint<64> &in) const { return in.range(29, 26); }
3737
};
3838
} // namespace l1ct
3939

L1Trigger/Phase2L1ParticleFlow/interface/l1-converters/hgcalinput_ref.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
#include "DataFormats/L1TParticleFlow/interface/layer1_emulator.h"
55
#include "L1Trigger/Phase2L1ParticleFlow/interface/corrector.h"
6-
// FIXME: move to the include from external package
7-
#include "L1Trigger/Phase2L1ParticleFlow/interface/conifer.h"
8-
// #include "conifer.h"
6+
#include "conifer.h"
97

108
namespace edm {
119
class ParameterSet;
@@ -67,7 +65,7 @@ namespace l1ct {
6765
typedef activation_inv_table_t inv_table_t;
6866
};
6967

70-
conifer::BDT<bdt_feature_t, bdt_score_t, false> *multiclass_bdt_;
68+
std::unique_ptr<conifer::BDT<bdt_feature_t, bdt_score_t, false>> multiclass_bdt_;
7169
};
7270

7371
enum class UseEmInterp { No, EmOnly, AllKeepHad, AllKeepTot };

L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -746,10 +746,10 @@ void L1TCorrelatorLayer1Producer::rawHgcalClusterEncode(ap_uint<256> &cwrd,
746746
// FIXME: we keep subtracting an arbitrary number different from the HLGCal FW one
747747
ap_ufixed<12, 11, AP_RND_CONV, AP_SAT> w_meanz = fabs(c.zBarycenter()) - 320; // LSB = 0.5cm
748748

749-
ap_uint<6> w_showerlenght = c.showerLength();
749+
ap_uint<6> w_showerlength = c.showerLength();
750750
ap_uint<7> w_sigmazz = round(c.sigmaZZ() / SIGMAZZ_LSB);
751751
ap_uint<7> w_sigmaphiphi = round(c.sigmaPhiPhiTot() / SIGMAPHIPHI_LSB);
752-
ap_uint<6> w_coreshowerlenght = c.coreShowerLength();
752+
ap_uint<6> w_coreshowerlength = c.coreShowerLength();
753753
ap_uint<5> w_sigmaetaeta = round(c.sigmaEtaEtaTot() / SIGMAETAETA_LSB);
754754
// NOTE: this is an arbitrary choice to keep the rounding consistent with the "addDecodedHadCalo" one
755755
// FIXME: the scaling here is added to the encoded word...
@@ -766,10 +766,10 @@ void L1TCorrelatorLayer1Producer::rawHgcalClusterEncode(ap_uint<256> &cwrd,
766766
cwrd(64 + 18, 64 + 10) = w_phi; // 9 bits: 18-10
767767
cwrd(64 + 30, 64 + 19) = w_meanz.range(); // 12 bits: 30-19
768768
// Word 2
769-
cwrd(128 + 18, 128 + 13) = w_showerlenght; // 6 bits: 18-13
769+
cwrd(128 + 18, 128 + 13) = w_showerlength; // 6 bits: 18-13
770770
cwrd(128 + 38, 128 + 32) = w_sigmazz; // 7 bits: 38-32
771771
cwrd(128 + 45, 128 + 39) = w_sigmaphiphi; // 7 bits: 45-39
772-
cwrd(128 + 51, 128 + 46) = w_coreshowerlenght; // 6 bits: 51-46
772+
cwrd(128 + 51, 128 + 46) = w_coreshowerlength; // 6 bits: 51-46
773773
cwrd(128 + 56, 128 + 52) = w_sigmaetaeta; // 5 bits: 56-52
774774

775775
// cwrd(128+63, 128+57) = w_sigmarrtot; // 7 bits: 63-57 // FIXME: use word3 spare bits

L1Trigger/Phase2L1ParticleFlow/src/corrector.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,9 @@ float l1tpf::corrector::correctedPt(float pt, float emPt, float eta) const {
271271
return total; // no correction
272272
ieta = std::min(std::max<unsigned>(1, index_->GetXaxis()->FindBin(abseta)), neta_) - 1;
273273
// FIXME: why eta 3.1 is hardcoded here?
274+
static const float maxeta = 3.1;
274275
unsigned int iemf =
275-
is2d_ && abseta < 3.1 ? std::min(std::max<unsigned>(1, index_->GetYaxis()->FindBin(emf)), nemf_) - 1 : 0;
276+
is2d_ && abseta < maxeta ? std::min(std::max<unsigned>(1, index_->GetYaxis()->FindBin(emf)), nemf_) - 1 : 0;
276277
float ptcorr = 0;
277278
if (!emulate_) { // not emulation - read from the TGraph as normal
278279
TGraph *graph = corrections_[ieta * nemf_ + iemf];

L1Trigger/Phase2L1ParticleFlow/src/l1-converters/hgcalinputt_ref.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ l1ct::HadCaloObjEmu l1ct::HgcalClusterDecoderEmulator::decode(const l1ct::PFRegi
109109

110110
// Conversion to local (input sector) coordinates
111111
ap_int<9> w_eta = l1ct::glbeta_t(w_abseta.to_int() * (sector.floatEtaCenter() > 0 ? +1 : -1)) - sector.hwEtaCenter;
112-
// if (sector.floatEtaCenter() > 0)
113-
// w_phi = -w_phi;
114112

115113
l1ct::HadCaloObjEmu out;
116114
out.clear();
@@ -202,7 +200,7 @@ l1ct::HgcalClusterDecoderEmulator::MultiClassID::MultiClassID(const std::string
202200
#else
203201
auto resolvedFileName = model;
204202
#endif
205-
multiclass_bdt_ = new conifer::BDT<bdt_feature_t, bdt_score_t, false>(resolvedFileName);
203+
multiclass_bdt_ = std::make_unique<conifer::BDT<bdt_feature_t, bdt_score_t, false>>(resolvedFileName);
206204
}
207205

208206
bool l1ct::HgcalClusterDecoderEmulator::MultiClassID::evaluate(l1ct::HadCaloObjEmu &cl,

0 commit comments

Comments
 (0)