Skip to content

Commit abe43ae

Browse files
committed
Fix GCT EM cluster deserialization
code format Fix TkEm WP and GCT energy
1 parent 44947db commit abe43ae

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@
5454
#include "DataFormats/L1TCalorimeterPhase2/interface/DigitizedClusterCorrelator.h"
5555
#include "DataFormats/L1THGCal/interface/HGCalMulticluster.h"
5656

57-
// constexpr unsigned int calomapping[] = {3, 0, 9, 6, 4, 1, 10, 7, 5, 2, 11, 8};
58-
constexpr unsigned int calomapping[] = {9, 6, 3, 0, 10, 7, 4, 1, 11, 8, 5, 2};
57+
constexpr unsigned int calomapping[] = {3, 0, 9, 6, 4, 1, 10, 7, 5, 2, 11, 8};
58+
// regions order: GCT1 SLR1, GCT1 SLR3, GCT2 SLR1, GCT2 SLR3, GCT3 SLR1, GCT3SLR3
59+
// phi center: 10 70 130 -170 -110 -50
60+
// eta: + -
5961

6062
//--------------------------------------------------------------------------------------------------
6163
class L1TCorrelatorLayer1Producer : public edm::stream::EDProducer<> {
@@ -1001,15 +1003,6 @@ void L1TCorrelatorLayer1Producer::addHGCalHadCalo(const l1t::HGCalMulticluster &
10011003
}
10021004
}
10031005

1004-
// regions order: GCT1 SLR1, GCT1 SLR3, GCT2 SLR1, GCT2 SLR3, GCT3 SLR1, GCT3SLR3
1005-
// always + then - eta for each region
1006-
1007-
// I don't think above is right. I think this is the mapping
1008-
// from reg. ord: GCT1 SLR1+, GCT1 SLR1-, GCT1 SLR3+, GCT1 SLR3-, GCT2 SLR1+, GCT2 SLR1-,
1009-
// GCT2 SLR3+, GCT2 SLR3-, GCT3 SLR1+, GCT3 SLR1-, GCT3 SLR3+, GCT3 SLR3-
1010-
// to reg. order: GCT1 SLR3-, GCT2 SLR3-, GCT3 SLR3-, GCT1 SLR3+, GCT2 SLR3+, GCT3 SLR3+,
1011-
// GCT1 SLR1-, GCT2 SLR1-, GCT3 SLR1-, GCT1 SLR1+, GCT2 SLR1+, GCT3 SLR1+
1012-
10131006
void L1TCorrelatorLayer1Producer::addGCTEmCaloRaw(const l1tp2::GCTEmDigiClusterLink &link,
10141007
unsigned int linkidx,
10151008
unsigned int entidx) {

L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
muonInputConversionAlgo = cms.string("Emulator"),
4242
gctEmInputConversionAlgo = cms.string("Emulator"),
4343
gctEmInputConversionParameters = cms.PSet(
44-
gctEmCorrector = cms.string("L1Trigger/Phase2L1ParticleFlow/data/emcorr_barrel.root"),
44+
# gctEmCorrector = cms.string("L1Trigger/Phase2L1ParticleFlow/data/emcorr_barrel.root"),
45+
gctEmCorrector = cms.string(""),
4546
gctEmResol = cms.PSet(
4647
etaBins = cms.vdouble( 0.700, 1.200, 1.600),
4748
offset = cms.vdouble( 0.873, 1.081, 1.563),

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,33 @@ l1ct::GctEmClusterDecoderEmulator::~GctEmClusterDecoderEmulator() {}
2626

2727
l1ct::EmCaloObjEmu l1ct::GctEmClusterDecoderEmulator::decode(const l1ct::PFRegionEmu &sector,
2828
const ap_uint<64> &in) const {
29+
constexpr float ETA_RANGE_ONE_SIDE = 1.4841; // barrel goes from (-1.4841, +1.4841)
30+
constexpr float ETA_LSB = 2 * ETA_RANGE_ONE_SIDE / 170.;
31+
constexpr float PHI_LSB = 2 * M_PI / 360.;
32+
2933
// need to add emid
3034
l1ct::EmCaloObjEmu calo;
3135
calo.clear();
3236
calo.hwPt = pt(in) * l1ct::pt_t(0.5); // the LSB for GCT objects
33-
calo.hwEta = eta(in) * 4; // at this point eta is abs(globalEta)
34-
calo.hwPhi = phi(in) * 4;
37+
// We add half a crystal both in eta and phi to avoid a bias
38+
calo.hwEta = l1ct::Scales::makeGlbEta(eta(in) * ETA_LSB + ETA_LSB / 2.); // at this point eta is abs(globalEta)
39+
calo.hwPhi = l1ct::Scales::makePhi(phi(in) * PHI_LSB + (PHI_LSB / 2)); // This is already in the local frame
3540

3641
if (corrector_.valid()) {
37-
float newpt = corrector_.correctedPt(calo.floatPt(), calo.floatPt(), calo.floatEta());
42+
float newpt =
43+
corrector_.correctedPt(calo.floatPt(), calo.floatPt(), calo.floatEta()); // NOTE: this is still abs(globalEta)
3844
calo.hwPt = l1ct::Scales::makePtFromFloat(newpt);
3945
}
4046

4147
// Note: at this point still
42-
calo.hwPtErr = l1ct::Scales::makePtFromFloat(resol_(calo.floatPt(), calo.floatEta()));
48+
calo.hwPtErr =
49+
l1ct::Scales::makePtFromFloat(resol_(calo.floatPt(), calo.floatEta())); // NOTE: this is still abs(globalEta)
4350

4451
// hwQual definition:
4552
// bit 0: standaloneWP: is_iso && is_ss
4653
// bit 1: looseL1TkMatchWP: is_looseTkiso && is_looseTkss
4754
// bit 2: photonWP:
48-
calo.hwEmID = (passes_iso(in) & passes_ss(in)) | ((passes_looseTkiso(in) & passes_looseTkss(in)) << 1) | (false << 2);
55+
calo.hwEmID = (passes_iso(in) & passes_ss(in)) | ((passes_looseTkiso(in) & passes_looseTkss(in)) << 1) | ((passes_looseTkiso(in) & passes_looseTkss(in)) << 2);
4956

5057
// convert eta to local
5158
if (sector.hwEtaCenter < 0) {

0 commit comments

Comments
 (0)