Skip to content

Commit 3a51c5d

Browse files
jmitrevscerminar
authored andcommitted
remove GCT duplicates when using Ideal regionizer (fastmachinelearning#23)
1 parent b5e8c1b commit 3a51c5d

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

L1Trigger/Phase2L1ParticleFlow/plugins/L1TCorrelatorLayer1Producer.cc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,15 +1006,23 @@ void L1TCorrelatorLayer1Producer::addHGCalHadCalo(const l1t::HGCalMulticluster &
10061006
void L1TCorrelatorLayer1Producer::addGCTEmCaloRaw(const l1tp2::GCTEmDigiClusterLink &link,
10071007
unsigned int linkidx,
10081008
unsigned int entidx) {
1009-
event_.raw.gctEm[calomapping[linkidx]].obj.push_back(link[entidx].data());
1010-
addDecodedGCTEmCalo(event_.decoded.emcalo[calomapping[linkidx]], link[entidx]);
1009+
// in the "Ideal" regionizer, ignore the second set that is sent; only use the first
1010+
auto caloIdx = calomapping[linkidx];
1011+
if (caloIdx < event_.raw.gctEm.size()) {
1012+
event_.raw.gctEm[caloIdx].obj.push_back(link[entidx].data());
1013+
addDecodedGCTEmCalo(event_.decoded.emcalo[caloIdx], link[entidx]);
1014+
}
10111015
}
10121016

10131017
void L1TCorrelatorLayer1Producer::addGCTHadCaloRaw(const l1tp2::GCTHadDigiClusterLink &link,
10141018
unsigned int linkidx,
10151019
unsigned int entidx) {
1016-
event_.raw.gctHad[calomapping[linkidx]].obj.push_back(link[entidx].data());
1017-
addDecodedGCTHadCalo(event_.decoded.hadcalo[calomapping[linkidx]], link[entidx]);
1020+
// in the "Ideal" regionizer, ignore the second set that is sent; only use the first
1021+
auto caloIdx = calomapping[linkidx];
1022+
if (caloIdx < event_.raw.gctHad.size()) {
1023+
event_.raw.gctHad[caloIdx].obj.push_back(link[entidx].data());
1024+
addDecodedGCTHadCalo(event_.decoded.hadcalo[caloIdx], link[entidx]);
1025+
}
10181026
}
10191027

10201028
void L1TCorrelatorLayer1Producer::addDecodedTrack(l1ct::DetectorSector<l1ct::TkObjEmu> &sec, const l1t::PFTrack &t) {

L1Trigger/Phase2L1ParticleFlow/python/l1ctLayer1_cff.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,11 @@
111111
tkEgSorterParameters = tkEgSorterParameters.clone(
112112
nObjToSort = 10
113113
),
114-
caloSectors = cms.VPSet(
114+
caloSectors = cms.VPSet( # for Ideal regionizer only--don't include the duplicates
115115
cms.PSet(
116116
etaBoundaries = cms.vdouble(-1.5, 0, 1.5),
117117
phiSlices = cms.uint32(3),
118118
phiZero = cms.double(math.pi/18)
119-
),
120-
cms.PSet(
121-
etaBoundaries = cms.vdouble(-1.5, 0, 1.5),
122-
phiSlices = cms.uint32(3),
123-
phiZero = cms.double(math.pi*7/18)
124119
)
125120
),
126121
regions = cms.VPSet(

L1Trigger/Phase2L1ParticleFlow/test/make_l1ct_binaryFiles_cfg.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,21 @@
112112
process.l1tLayer1BarrelTDR.tkEgAlgoParameters.nTRACK_EGIN = 22
113113
process.l1tLayer1BarrelTDR.tkEgAlgoParameters.nEMCALO_EGIN = 12
114114

115+
process.l1tLayer1BarrelTDR.hadClusters = cms.InputTag('l1tPhase2GCTBarrelToCorrelatorLayer1Emulator', 'GCTHadDigiClusters')
116+
process.l1tLayer1BarrelTDR.gctHadInputConversionAlgo = cms.string("Emulator")
117+
118+
process.l1tLayer1BarrelTDR.caloSectors = cms.VPSet(
119+
cms.PSet(
120+
etaBoundaries = cms.vdouble(-1.5, 0, 1.5),
121+
phiSlices = cms.uint32(3),
122+
phiZero = cms.double(math.pi/18)
123+
),
124+
cms.PSet(
125+
etaBoundaries = cms.vdouble(-1.5, 0, 1.5),
126+
phiSlices = cms.uint32(3),
127+
phiZero = cms.double(math.pi*7/18)
128+
)
129+
)
115130

116131
process.l1tLayer1BarrelSerenity = process.l1tLayer1Barrel.clone()
117132
process.l1tLayer1BarrelSerenity.regionizerAlgo = "MultififoBarrel"

0 commit comments

Comments
 (0)