Skip to content

Commit 8110319

Browse files
authored
Merge pull request #49218 from stahlleiton/DeDxMiniAOD_CMSSW_16_0_X
Reduce size of dEdx estimators in PbPb MiniAOD
2 parents a7e8f69 + bb215fe commit 8110319

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

PhysicsTools/PatAlgos/plugins/DeDxEstimatorRekeyer.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "DataFormats/TrackReco/interface/DeDxHitInfo.h"
66
#include "DataFormats/TrackReco/interface/TrackFwd.h"
77
#include "DataFormats/PatCandidates/interface/PackedCandidate.h"
8+
#include "DataFormats/Math/interface/libminifloat.h"
89

910
//
1011
// class declaration
@@ -101,8 +102,13 @@ void DeDxEstimatorRekeyer::produce(edm::StreamID, edm::Event& iEvent, const edm:
101102
// Loop over packed candidates
102103
for (const auto& h : pcTrkMap) {
103104
std::vector<reco::DeDxData> dedxEstimate(h.first->size());
104-
for (const auto& p : h.second)
105-
dedxEstimate[p.first.key()] = dedxEstimators[p.second];
105+
for (const auto& p : h.second) {
106+
const auto& dedx = dedxEstimators[p.second];
107+
const auto val = MiniFloatConverter::reduceMantissaToNbitsRounding<12>(dedx.dEdx());
108+
const auto err = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(dedx.dEdxError());
109+
dedxEstimate[p.first.key()] =
110+
reco::DeDxData(val, err, dedx.numberOfSaturatedMeasurements(), dedx.numberOfMeasurements());
111+
}
106112
filler.insert(h.first, dedxEstimate.begin(), dedxEstimate.end());
107113
}
108114
// Fill the value map and put it into the event

PhysicsTools/PatAlgos/python/slimming/MicroEventContent_cff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
from Configuration.Eras.Modifier_run3_upc_cff import run3_upc
174174
run3_upc.toModify(MicroEventContent, outputCommands = MicroEventContent.outputCommands + _upc_extraCommands)
175175

176-
_dedx_extraCommands = ["keep recoDeDxDataedmValueMap_dedxEstimator_*_*"]
176+
_dedx_extraCommands = ["keep recoDeDxDataedmValueMap_dedxEstimator_dedxAllLikelihood_*"]
177177
from Configuration.Eras.Modifier_dedx_lfit_cff import dedx_lfit
178178
dedx_lfit.toModify(MicroEventContent, outputCommands = MicroEventContent.outputCommands + _dedx_extraCommands)
179179

0 commit comments

Comments
 (0)