Skip to content

Commit

Permalink
Merge pull request #32180 from swagata87/dev_11_2_X_nLayerIT
Browse files Browse the repository at this point in the history
Produce nLayerIT variable in EgammaHLTGsfTrackVarProducer
  • Loading branch information
cmsbuild authored Nov 23, 2020
2 parents 66b9db6 + 526910e commit fe5e48d
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class EgammaHLTGsfTrackVarProducer : public edm::global::EDProducer<> {
const edm::EDPutTokenT<reco::RecoEcalCandidateIsolationMap> oneOverESeedMinusOneOverPMapPutToken_;
const edm::EDPutTokenT<reco::RecoEcalCandidateIsolationMap> missingHitsMapPutToken_;
const edm::EDPutTokenT<reco::RecoEcalCandidateIsolationMap> validHitsMapPutToken_;
const edm::EDPutTokenT<reco::RecoEcalCandidateIsolationMap> nLayerITMapPutToken_;
const edm::EDPutTokenT<reco::RecoEcalCandidateIsolationMap> chi2MapPutToken_;
};

Expand All @@ -88,6 +89,7 @@ EgammaHLTGsfTrackVarProducer::EgammaHLTGsfTrackVarProducer(const edm::ParameterS
missingHitsMapPutToken_{
produces<reco::RecoEcalCandidateIsolationMap>("MissingHits").setBranchAlias("missinghits")},
validHitsMapPutToken_{produces<reco::RecoEcalCandidateIsolationMap>("ValidHits").setBranchAlias("validhits")},
nLayerITMapPutToken_{produces<reco::RecoEcalCandidateIsolationMap>("NLayerIT").setBranchAlias("nlayerit")},
chi2MapPutToken_{produces<reco::RecoEcalCandidateIsolationMap>("Chi2").setBranchAlias("chi2")} {}

void EgammaHLTGsfTrackVarProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
Expand Down Expand Up @@ -120,6 +122,7 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co
reco::RecoEcalCandidateIsolationMap oneOverESeedMinusOneOverPMap(recoEcalCandHandle);
reco::RecoEcalCandidateIsolationMap missingHitsMap(recoEcalCandHandle);
reco::RecoEcalCandidateIsolationMap validHitsMap(recoEcalCandHandle);
reco::RecoEcalCandidateIsolationMap nLayerITMap(recoEcalCandHandle);
reco::RecoEcalCandidateIsolationMap chi2Map(recoEcalCandHandle);

for (unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoEcalCandHandle->size(); ++iRecoEcalCand) {
Expand All @@ -144,6 +147,7 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co
}
}

int nLayerITValue = -1;
int validHitsValue = 0;
float chi2Value = 9999999.;
float missingHitsValue = 9999999;
Expand All @@ -161,6 +165,7 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co
: useDefaultValuesForEndcap_ && nrTracks >= 1;

if (rmCutsDueToNrTracks || useDefaultValues) {
nLayerITValue = 100;
dEtaInValue = 0;
dEtaSeedInValue = 0;
dPhiInValue = 0;
Expand Down Expand Up @@ -205,6 +210,10 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co
validHitsValue = gsfTracks[trkNr]->numberOfValidHits();
}

if (gsfTracks[trkNr]->hitPattern().pixelLayersWithMeasurement() > nLayerITValue) {
nLayerITValue = gsfTracks[trkNr]->hitPattern().pixelLayersWithMeasurement();
}

if (gsfTracks[trkNr]->normalizedChi2() < chi2Value) {
chi2Value = gsfTracks[trkNr]->normalizedChi2();
}
Expand Down Expand Up @@ -232,6 +241,7 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co
oneOverESeedMinusOneOverPMap.insert(recoEcalCandRef, oneOverESeedMinusOneOverPValue);
missingHitsMap.insert(recoEcalCandRef, missingHitsValue);
validHitsMap.insert(recoEcalCandRef, validHitsValue);
nLayerITMap.insert(recoEcalCandRef, nLayerITValue);
chi2Map.insert(recoEcalCandRef, chi2Value);
}

Expand All @@ -242,6 +252,7 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co
iEvent.emplace(oneOverESeedMinusOneOverPMapPutToken_, oneOverESeedMinusOneOverPMap);
iEvent.emplace(missingHitsMapPutToken_, missingHitsMap);
iEvent.emplace(validHitsMapPutToken_, validHitsMap);
iEvent.emplace(nLayerITMapPutToken_, nLayerITMap);
iEvent.emplace(chi2MapPutToken_, chi2Map);
}

Expand Down

0 comments on commit fe5e48d

Please sign in to comment.