From b4433a0973f97883fec7c9045d51ed038d40e832 Mon Sep 17 00:00:00 2001 From: "A.R.Sahasransu" Date: Wed, 17 Jan 2024 12:24:55 +0100 Subject: [PATCH 1/7] Added signed GSF track variable producers --- .../plugins/EgammaHLTGsfTrackVarProducer.cc | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc index ce66e70a0daab..d02de8e6da15d 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc @@ -60,8 +60,11 @@ class EgammaHLTGsfTrackVarProducer : public edm::global::EDProducer<> { const edm::EDPutTokenT dEtaMapPutToken_; const edm::EDPutTokenT dEtaSeedMapPutToken_; + const edm::EDPutTokenT dEtaSeedSignedMapPutToken_; const edm::EDPutTokenT dPhiMapPutToken_; + const edm::EDPutTokenT dPhiSignedMapPutToken_; const edm::EDPutTokenT oneOverESuperMinusOneOverPMapPutToken_; + const edm::EDPutTokenT oneOverESuperMinusOneOverPSignedMapPutToken_; const edm::EDPutTokenT oneOverESeedMinusOneOverPMapPutToken_; const edm::EDPutTokenT missingHitsMapPutToken_; const edm::EDPutTokenT validHitsMapPutToken_; @@ -83,8 +86,13 @@ EgammaHLTGsfTrackVarProducer::EgammaHLTGsfTrackVarProducer(const edm::ParameterS useDefaultValuesForEndcap_{config.getParameter("useDefaultValuesForEndcap")}, dEtaMapPutToken_{produces("Deta").setBranchAlias("deta")}, dEtaSeedMapPutToken_{produces("DetaSeed").setBranchAlias("detaseed")}, + dEtaSeedSignedMapPutToken_{ + produces("DetaSeedSigned").setBranchAlias("detaseedsigned")}, dPhiMapPutToken_{produces("Dphi").setBranchAlias("dphi")}, + dPhiSignedMapPutToken_{produces("DphiSigned").setBranchAlias("dphisigned")}, oneOverESuperMinusOneOverPMapPutToken_{produces("OneOESuperMinusOneOP")}, + oneOverESuperMinusOneOverPSignedMapPutToken_{ + produces("OneOESuperMinusOneOPSigned")}, oneOverESeedMinusOneOverPMapPutToken_{produces("OneOESeedMinusOneOP")}, missingHitsMapPutToken_{ produces("MissingHits").setBranchAlias("missinghits")}, @@ -117,8 +125,11 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co reco::RecoEcalCandidateIsolationMap dEtaMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap dEtaSeedMap(recoEcalCandHandle); + reco::RecoEcalCandidateIsolationMap dEtaSeedSignedMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap dPhiMap(recoEcalCandHandle); + reco::RecoEcalCandidateIsolationMap dPhiSignedMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap oneOverESuperMinusOneOverPMap(recoEcalCandHandle); + reco::RecoEcalCandidateIsolationMap oneOverESuperMinusOneOverPSignedMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap oneOverESeedMinusOneOverPMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap missingHitsMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap validHitsMap(recoEcalCandHandle); @@ -153,8 +164,11 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co float missingHitsValue = 9999999; float dEtaInValue = 999999; float dEtaSeedInValue = 999999; + float dEtaSeedInSignedValue = 999999; float dPhiInValue = 999999; + float dPhiInSignedValue = 999999; float oneOverESuperMinusOneOverPValue = 999999; + float oneOverESuperMinusOneOverPSignedValue = 999999; float oneOverESeedMinusOneOverPValue = 999999; const int nrTracks = gsfTracks.size(); @@ -168,11 +182,14 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co nLayerITValue = 100; dEtaInValue = 0; dEtaSeedInValue = 0; + dEtaSeedInSignedValue = 0; dPhiInValue = 0; + dPhiInSignedValue = 0; missingHitsValue = 0; validHitsValue = 100; chi2Value = 0; oneOverESuperMinusOneOverPValue = 0; + oneOverESuperMinusOneOverPSignedValue = 0; oneOverESeedMinusOneOverPValue = 0; } else { for (size_t trkNr = 0; trkNr < gsfTracks.size(); trkNr++) { @@ -192,6 +209,7 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co if (scRef->energy() != 0 && trkP != 0) { if (std::abs(1 / scRef->energy() - 1 / trkP) < oneOverESuperMinusOneOverPValue) { oneOverESuperMinusOneOverPValue = std::abs(1 / scRef->energy() - 1 / trkP); + oneOverESuperMinusOneOverPSignedValue = 1 / scRef->energy() - 1 / trkP; } } if (scRef->seed().isNonnull() && scRef->seed()->energy() != 0 && trkP != 0) { @@ -225,19 +243,24 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co if (std::abs(scAtVtx.dEta()) < dEtaSeedInValue) { dEtaSeedInValue = std::abs(scAtVtx.dEta() - scRef->position().eta() + scRef->seed()->position().eta()); + dEtaSeedInSignedValue = scAtVtx.dEta() - scRef->position().eta() + scRef->seed()->position().eta(); } if (std::abs(scAtVtx.dPhi()) < dPhiInValue) { // we are allowing them to come from different tracks dPhiInValue = std::abs(scAtVtx.dPhi()); + dPhiInSignedValue = scAtVtx.dPhi(); } } } dEtaMap.insert(recoEcalCandRef, dEtaInValue); dEtaSeedMap.insert(recoEcalCandRef, dEtaSeedInValue); + dEtaSeedSignedMap.insert(recoEcalCandRef, dEtaSeedInSignedValue); dPhiMap.insert(recoEcalCandRef, dPhiInValue); + dPhiSignedMap.insert(recoEcalCandRef, dPhiInSignedValue); oneOverESuperMinusOneOverPMap.insert(recoEcalCandRef, oneOverESuperMinusOneOverPValue); + oneOverESuperMinusOneOverPSignedMap.insert(recoEcalCandRef, oneOverESuperMinusOneOverPSignedValue); oneOverESeedMinusOneOverPMap.insert(recoEcalCandRef, oneOverESeedMinusOneOverPValue); missingHitsMap.insert(recoEcalCandRef, missingHitsValue); validHitsMap.insert(recoEcalCandRef, validHitsValue); @@ -247,8 +270,11 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co iEvent.emplace(dEtaMapPutToken_, dEtaMap); iEvent.emplace(dEtaSeedMapPutToken_, dEtaSeedMap); + iEvent.emplace(dEtaSeedSignedMapPutToken_, dEtaSeedSignedMap); iEvent.emplace(dPhiMapPutToken_, dPhiMap); + iEvent.emplace(dPhiSignedMapPutToken_, dPhiSignedMap); iEvent.emplace(oneOverESuperMinusOneOverPMapPutToken_, oneOverESuperMinusOneOverPMap); + iEvent.emplace(oneOverESuperMinusOneOverPSignedMapPutToken_, oneOverESuperMinusOneOverPSignedMap); iEvent.emplace(oneOverESeedMinusOneOverPMapPutToken_, oneOverESeedMinusOneOverPMap); iEvent.emplace(missingHitsMapPutToken_, missingHitsMap); iEvent.emplace(validHitsMapPutToken_, validHitsMap); From cf64de5f72f0fc907c42a9e5a780302521f5c825 Mon Sep 17 00:00:00 2001 From: Sam Harper Date: Thu, 18 Jan 2024 14:50:27 +0000 Subject: [PATCH 2/7] adding fbrem to gsftrack var producer --- .../plugins/EgammaHLTGsfTrackVarProducer.cc | 68 ++++++++++++++++--- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc index d02de8e6da15d..fb257ab88c276 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc @@ -39,6 +39,18 @@ #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" class EgammaHLTGsfTrackVarProducer : public edm::global::EDProducer<> { +public: + struct GsfTrackExtrapolations { + GsfTrackExtrapolations(){} + void operator()(const reco::GsfTrack& trk,const reco::SuperCluster& sc,const MultiTrajectoryStateTransform& mtsTransform); + TrajectoryStateOnSurface innTSOS; + TrajectoryStateOnSurface outTSOS; + TrajectoryStateOnSurface sclTSOS; + + // mode + GlobalVector innMom, outMom, sclMom; + GlobalPoint innPos, outPos, sclPos; + }; public: explicit EgammaHLTGsfTrackVarProducer(const edm::ParameterSet&); void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; @@ -70,8 +82,19 @@ class EgammaHLTGsfTrackVarProducer : public edm::global::EDProducer<> { const edm::EDPutTokenT validHitsMapPutToken_; const edm::EDPutTokenT nLayerITMapPutToken_; const edm::EDPutTokenT chi2MapPutToken_; + const edm::EDPutTokenT fbremMapPutToken_; + + }; +namespace{ + + float calRelDelta(float a, float b,float defaultVal=0){ + return b!=0 ? (a-b)/a : defaultVal; + } + +} + EgammaHLTGsfTrackVarProducer::EgammaHLTGsfTrackVarProducer(const edm::ParameterSet& config) : recoEcalCandToken_( consumes(config.getParameter("recoEcalCandidateProducer"))), @@ -98,7 +121,8 @@ EgammaHLTGsfTrackVarProducer::EgammaHLTGsfTrackVarProducer(const edm::ParameterS produces("MissingHits").setBranchAlias("missinghits")}, validHitsMapPutToken_{produces("ValidHits").setBranchAlias("validhits")}, nLayerITMapPutToken_{produces("NLayerIT").setBranchAlias("nlayerit")}, - chi2MapPutToken_{produces("Chi2").setBranchAlias("chi2")} {} + chi2MapPutToken_{produces("Chi2").setBranchAlias("chi2")}, + fbremMapPutToken_{produces("fbrem")}{} void EgammaHLTGsfTrackVarProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; @@ -135,6 +159,7 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co reco::RecoEcalCandidateIsolationMap validHitsMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap nLayerITMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap chi2Map(recoEcalCandHandle); + reco::RecoEcalCandidateIsolationMap fbremMap(recoEcalCandHandle); for (unsigned int iRecoEcalCand = 0; iRecoEcalCand < recoEcalCandHandle->size(); ++iRecoEcalCand) { reco::RecoEcalCandidateRef recoEcalCandRef(recoEcalCandHandle, iRecoEcalCand); @@ -170,6 +195,7 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co float oneOverESuperMinusOneOverPValue = 999999; float oneOverESuperMinusOneOverPSignedValue = 999999; float oneOverESeedMinusOneOverPValue = 999999; + float fbrem = 999999; const int nrTracks = gsfTracks.size(); const bool rmCutsDueToNrTracks = nrTracks <= lowerTrackNrToRemoveCut_ || nrTracks >= upperTrackNrToRemoveCut_; @@ -178,6 +204,10 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co ? useDefaultValuesForBarrel_ && nrTracks >= 1 : useDefaultValuesForEndcap_ && nrTracks >= 1; + + MultiTrajectoryStateTransform mtsTransform(&trackerGeometry, &magneticField); + GsfTrackExtrapolations gsfTrackExtrapolations; + if (rmCutsDueToNrTracks || useDefaultValues) { nLayerITValue = 100; dEtaInValue = 0; @@ -191,20 +221,17 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co oneOverESuperMinusOneOverPValue = 0; oneOverESuperMinusOneOverPSignedValue = 0; oneOverESeedMinusOneOverPValue = 0; + fbrem = 0; } else { for (size_t trkNr = 0; trkNr < gsfTracks.size(); trkNr++) { GlobalPoint scPos(scRef->x(), scRef->y(), scRef->z()); - GlobalPoint trackExtrapToSC; - { - auto innTSOS = - MultiTrajectoryStateTransform::innerStateOnSurface(*gsfTracks[trkNr], trackerGeometry, &magneticField); - auto posTSOS = extrapolator.extrapolate(innTSOS, scPos); - multiTrajectoryStateMode::positionFromModeCartesian(posTSOS, trackExtrapToSC); - } - - EleRelPointPair scAtVtx(scRef->position(), trackExtrapToSC, beamSpotPosition); + gsfTrackExtrapolations(*gsfTracks[trkNr],*scRef,mtsTransform); + + EleRelPointPair scAtVtx(scRef->position(), gsfTrackExtrapolations.sclPos, beamSpotPosition); + fbrem = calRelDelta(gsfTrackExtrapolations.innMom.mag(),gsfTrackExtrapolations.outMom.mag(),fbrem); + float trkP = gsfTracks[trkNr]->p(); if (scRef->energy() != 0 && trkP != 0) { if (std::abs(1 / scRef->energy() - 1 / trkP) < oneOverESuperMinusOneOverPValue) { @@ -266,6 +293,7 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co validHitsMap.insert(recoEcalCandRef, validHitsValue); nLayerITMap.insert(recoEcalCandRef, nLayerITValue); chi2Map.insert(recoEcalCandRef, chi2Value); + fbremMap.insert(recoEcalCandRef, fbrem); } iEvent.emplace(dEtaMapPutToken_, dEtaMap); @@ -280,6 +308,26 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co iEvent.emplace(validHitsMapPutToken_, validHitsMap); iEvent.emplace(nLayerITMapPutToken_, nLayerITMap); iEvent.emplace(chi2MapPutToken_, chi2Map); + iEvent.emplace(fbremMapPutToken_, fbremMap); +} + + +void EgammaHLTGsfTrackVarProducer::GsfTrackExtrapolations::operator()(const reco::GsfTrack& trk,const reco::SuperCluster& sc,const MultiTrajectoryStateTransform& mtsTransform) +{ + innTSOS = mtsTransform.innerStateOnSurface(trk); + outTSOS = mtsTransform.outerStateOnSurface(trk); + sclTSOS = mtsTransform.extrapolatedState( + innTSOS, GlobalPoint(sc.x(), sc.y(), sc.z()) + ); + + multiTrajectoryStateMode::momentumFromModeCartesian(innTSOS, innMom); + multiTrajectoryStateMode::positionFromModeCartesian(innTSOS, innPos); + multiTrajectoryStateMode::momentumFromModeCartesian(sclTSOS, sclMom); + multiTrajectoryStateMode::positionFromModeCartesian(sclTSOS, sclPos); + multiTrajectoryStateMode::momentumFromModeCartesian(outTSOS, outMom); + multiTrajectoryStateMode::positionFromModeCartesian(outTSOS, outPos); + + } #include "FWCore/Framework/interface/MakerMacros.h" From 363a747c0b349a894468848c27591e77b566339a Mon Sep 17 00:00:00 2001 From: Sam Harper Date: Tue, 23 Jan 2024 13:48:19 +0000 Subject: [PATCH 3/7] adding request of only producing signed variable --- .../python/customizeHLTforCMSSW.py | 14 ++- .../HLTEgammaGenericQuadraticEtaFilter.cc | 4 +- .../HLTEgammaGenericQuadraticEtaFilter.h | 1 + .../HLTEgammaGenericQuadraticFilter.cc | 4 +- .../plugins/HLTEgammaGenericQuadraticFilter.h | 1 + HLTrigger/Egamma/plugins/HLTGenericFilter.cc | 9 +- HLTrigger/Egamma/plugins/HLTGenericFilter.h | 1 + .../plugins/EgammaHLTGsfTrackVarProducer.cc | 107 ++++++------------ 8 files changed, 64 insertions(+), 77 deletions(-) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index c792b95f46fe1..c91c2a0e3e382 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -261,6 +261,18 @@ def customizeHLTfor43549(process): return process +def customizeHLTfor43748(process): + filt_types = ["HLTEgammaGenericFilter","HLTEgammaGenericQuadraticEtaFilter","HLTEgammaGenericQuadraticFilter","HLTElectronGenericFilter"] + absAbleVar = ["DEta","deta","DetaSeed","Dphi","OneOESuperMinusOneOP","OneOESeedMinusOneOP"] + for filt_type in filt_types: + for filt in filters_by_type(process, filt_type): + if filt.varTag.productInstanceLabel in absAbleVar: + filt.useAbs = cms.bool(True) + + return process + + + # CMSSW version specific customizations def customizeHLTforCMSSW(process, menuType="GRun"): @@ -271,5 +283,5 @@ def customizeHLTforCMSSW(process, menuType="GRun"): process = customizeHLTfor43025(process) process = customizeHLTfor43549(process) - + process = customizeHLTfor43748(process) return process diff --git a/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticEtaFilter.cc b/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticEtaFilter.cc index 673e91a50bbe5..9ab14ecfff3c8 100644 --- a/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticEtaFilter.cc +++ b/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticEtaFilter.cc @@ -31,6 +31,7 @@ HLTEgammaGenericQuadraticEtaFilter::HLTEgammaGenericQuadraticEtaFilter(const edm energyLowEdges_ = iConfig.getParameter >("energyLowEdges"); lessThan_ = iConfig.getParameter("lessThan"); useEt_ = iConfig.getParameter("useEt"); + useAbs_ = iConfig.getParameter("useAbs"); etaBoundaryEB12_ = iConfig.getParameter("etaBoundaryEB12"); etaBoundaryEE12_ = iConfig.getParameter("etaBoundaryEE12"); @@ -101,6 +102,7 @@ void HLTEgammaGenericQuadraticEtaFilter::fillDescriptions(edm::ConfigurationDesc desc.add >("energyLowEdges", {0.0}); // No energy-dependent cuts by default desc.add("lessThan", true); desc.add("useEt", true); + desc.add("useAbs", false); desc.add("etaBoundaryEB12", 1.0); desc.add("etaBoundaryEE12", 2.0); desc.add >("thrRegularEB1", {4.0}); @@ -175,7 +177,7 @@ bool HLTEgammaGenericQuadraticEtaFilter::hltFilter(edm::Event& iEvent, ref = recoecalcands[i]; reco::RecoEcalCandidateIsolationMap::const_iterator mapi = (*depMap).find(ref); - float vali = mapi->val; + float vali = useAbs_ ? std::abs(mapi->val) : mapi->val; float EtaSC = ref->eta(); // Pick the right EA and do rhoCorr diff --git a/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticEtaFilter.h b/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticEtaFilter.h index d0432ec60c809..764217be0e3de 100644 --- a/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticEtaFilter.h +++ b/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticEtaFilter.h @@ -36,6 +36,7 @@ class HLTEgammaGenericQuadraticEtaFilter : public HLTFilter { edm::EDGetTokenT varToken_; bool lessThan_; // the cut is "<" or ">" ? bool useEt_; // use E or Et in relative isolation cuts + bool useAbs_; // use the standard abs of the variable (before any rho corr) /* Barrel quadratic threshold function: vali (<= or >=) thrRegularEB_ + (E or Et)*thrOverEEB_ + (E or Et)*(E or Et)*thrOverE2EB_ Endcap quadratic threshold function: diff --git a/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticFilter.cc b/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticFilter.cc index baf1b8b588cef..5e75615534123 100644 --- a/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticFilter.cc +++ b/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticFilter.cc @@ -31,6 +31,7 @@ HLTEgammaGenericQuadraticFilter::HLTEgammaGenericQuadraticFilter(const edm::Para energyLowEdges_ = iConfig.getParameter >("energyLowEdges"); lessThan_ = iConfig.getParameter("lessThan"); useEt_ = iConfig.getParameter("useEt"); + useAbs_ = iConfig.getParameter("useAbs"); thrRegularEB_ = iConfig.getParameter >("thrRegularEB"); thrRegularEE_ = iConfig.getParameter >("thrRegularEE"); @@ -89,6 +90,7 @@ void HLTEgammaGenericQuadraticFilter::fillDescriptions(edm::ConfigurationDescrip desc.add >("energyLowEdges", {0.0}); // No energy-dependent cuts by default desc.add("lessThan", true); desc.add("useEt", false); + desc.add("useAbs", false); desc.add >("thrRegularEB", {0.0}); desc.add >("thrRegularEE", {0.0}); desc.add >("thrOverEEB", {-1.0}); @@ -155,7 +157,7 @@ bool HLTEgammaGenericQuadraticFilter::hltFilter(edm::Event& iEvent, ref = recoecalcands[i]; reco::RecoEcalCandidateIsolationMap::const_iterator mapi = (*depMap).find(ref); - float vali = mapi->val; + float vali = useAbs_ ? std::abs(mapi->val) : mapi->val; float EtaSC = ref->eta(); // Pick the right EA and do rhoCorr diff --git a/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticFilter.h b/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticFilter.h index 0cb3e0d652bcd..f410c0fe1cf12 100644 --- a/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticFilter.h +++ b/HLTrigger/Egamma/plugins/HLTEgammaGenericQuadraticFilter.h @@ -37,6 +37,7 @@ class HLTEgammaGenericQuadraticFilter : public HLTFilter { bool lessThan_; // the cut is "<" or ">" ? bool useEt_; // use E or Et in relative isolation cuts + bool useAbs_; // use the standard abs of the variable (before any rho corr) /* Barrel quadratic threshold function: vali (<= or >=) thrRegularEB_ + (E or Et)*thrOverEEB_ + (E or Et)*(E or Et)*thrOverE2EB_ Endcap quadratic threshold function: diff --git a/HLTrigger/Egamma/plugins/HLTGenericFilter.cc b/HLTrigger/Egamma/plugins/HLTGenericFilter.cc index f84cf062d304a..31fba72842f6c 100644 --- a/HLTrigger/Egamma/plugins/HLTGenericFilter.cc +++ b/HLTrigger/Egamma/plugins/HLTGenericFilter.cc @@ -33,6 +33,7 @@ HLTGenericFilter::HLTGenericFilter(const edm::ParameterSet& iConfig) : HLTFi energyLowEdges_ = iConfig.template getParameter>("energyLowEdges"); lessThan_ = iConfig.template getParameter("lessThan"); useEt_ = iConfig.template getParameter("useEt"); + useAbs_ = iConfig.template getParameter("useAbs"); thrRegularEB_ = iConfig.template getParameter>("thrRegularEB"); thrRegularEE_ = iConfig.template getParameter>("thrRegularEE"); thrOverEEB_ = iConfig.template getParameter>("thrOverEEB"); @@ -88,6 +89,7 @@ void HLTGenericFilter::fillDescriptions(edm::ConfigurationDescriptions& desc desc.add>("energyLowEdges", {0.0}); // No energy-dependent cuts by default desc.add("lessThan", true); desc.add("useEt", false); + desc.add("useAbs", false); desc.add>("thrRegularEB", {0.0}); desc.add>("thrRegularEE", {0.0}); desc.add>("thrOverEEB", {-1.0}); @@ -177,7 +179,11 @@ bool HLTGenericFilter::hltFilter(edm::Event& iEvent, T1Ref ref = recoCands[i]; typename T1IsolationMap::const_iterator mapi = (*depMap).find(ref); - float vali = mapi->val; + //should we do the abs before or after the rho corr? + //note: its very unlikely to rho correct a variable that wants to be abs + //decided yes as it seems slightly better this way but can not think of a use case either way + float vali = useAbs_ ? std::abs(mapi->val) : mapi->val; + float EtaSC = ref->eta(); // Pick the right EA and do rhoCorr @@ -191,7 +197,6 @@ bool HLTGenericFilter::hltFilter(edm::Event& iEvent, energy = getEt(ref); else energy = getEnergy(ref); - //if (energy < 0.) energy = 0.; // require energy to be positive (needed?) // Pick the right cut threshold double cutRegularEB_ = 9999., cutRegularEE_ = 9999.; diff --git a/HLTrigger/Egamma/plugins/HLTGenericFilter.h b/HLTrigger/Egamma/plugins/HLTGenericFilter.h index 603162b8498af..d7fd3a948828e 100644 --- a/HLTrigger/Egamma/plugins/HLTGenericFilter.h +++ b/HLTrigger/Egamma/plugins/HLTGenericFilter.h @@ -56,6 +56,7 @@ class HLTGenericFilter : public HLTFilter { std::vector energyLowEdges_; // lower bin edges for energy-dependent cuts bool lessThan_; // the cut is "<" or ">" ? bool useEt_; // use E or Et in relative isolation cuts + bool useAbs_; // use the standard abs of the variable (before any rho corr) std::vector thrRegularEB_; // threshold for regular cut (x < thr) - ECAL barrel std::vector thrRegularEE_; // threshold for regular cut (x < thr) - ECAL endcap std::vector thrOverEEB_; // threshold for x/E < thr cut (isolations) - ECAL barrel diff --git a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc index fb257ab88c276..8e5f73c38de05 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc @@ -40,21 +40,31 @@ class EgammaHLTGsfTrackVarProducer : public edm::global::EDProducer<> { public: - struct GsfTrackExtrapolations { - GsfTrackExtrapolations(){} - void operator()(const reco::GsfTrack& trk,const reco::SuperCluster& sc,const MultiTrajectoryStateTransform& mtsTransform); + struct GsfTrackExtrapolations { + GsfTrackExtrapolations() {} + void operator()(const reco::GsfTrack& trk, + const reco::SuperCluster& sc, + const MultiTrajectoryStateTransform& mtsTransform); TrajectoryStateOnSurface innTSOS; TrajectoryStateOnSurface outTSOS; TrajectoryStateOnSurface sclTSOS; - + // mode GlobalVector innMom, outMom, sclMom; GlobalPoint innPos, outPos, sclPos; }; + public: explicit EgammaHLTGsfTrackVarProducer(const edm::ParameterSet&); void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + float fillAbsAbleVar(float& existVal, const float newVal) const { + if (std::abs(newVal) < existVal) { + return produceAbsValues_ ? std::abs(newVal) : newVal; + } else { + return existVal; + } + } private: const edm::EDGetTokenT recoEcalCandToken_; @@ -69,31 +79,25 @@ class EgammaHLTGsfTrackVarProducer : public edm::global::EDProducer<> { const int lowerTrackNrToRemoveCut_; const bool useDefaultValuesForBarrel_; const bool useDefaultValuesForEndcap_; + const bool produceAbsValues_; const edm::EDPutTokenT dEtaMapPutToken_; const edm::EDPutTokenT dEtaSeedMapPutToken_; - const edm::EDPutTokenT dEtaSeedSignedMapPutToken_; const edm::EDPutTokenT dPhiMapPutToken_; - const edm::EDPutTokenT dPhiSignedMapPutToken_; const edm::EDPutTokenT oneOverESuperMinusOneOverPMapPutToken_; - const edm::EDPutTokenT oneOverESuperMinusOneOverPSignedMapPutToken_; const edm::EDPutTokenT oneOverESeedMinusOneOverPMapPutToken_; const edm::EDPutTokenT missingHitsMapPutToken_; const edm::EDPutTokenT validHitsMapPutToken_; const edm::EDPutTokenT nLayerITMapPutToken_; const edm::EDPutTokenT chi2MapPutToken_; const edm::EDPutTokenT fbremMapPutToken_; - - }; -namespace{ - - float calRelDelta(float a, float b,float defaultVal=0){ - return b!=0 ? (a-b)/a : defaultVal; - } +namespace { -} + float calRelDelta(float a, float b, float defaultVal = 0) { return b != 0 ? (a - b) / a : defaultVal; } + +} // namespace EgammaHLTGsfTrackVarProducer::EgammaHLTGsfTrackVarProducer(const edm::ParameterSet& config) : recoEcalCandToken_( @@ -107,22 +111,18 @@ EgammaHLTGsfTrackVarProducer::EgammaHLTGsfTrackVarProducer(const edm::ParameterS lowerTrackNrToRemoveCut_{config.getParameter("lowerTrackNrToRemoveCut")}, useDefaultValuesForBarrel_{config.getParameter("useDefaultValuesForBarrel")}, useDefaultValuesForEndcap_{config.getParameter("useDefaultValuesForEndcap")}, + produceAbsValues_{config.getParameter("produceAbsValues")}, dEtaMapPutToken_{produces("Deta").setBranchAlias("deta")}, dEtaSeedMapPutToken_{produces("DetaSeed").setBranchAlias("detaseed")}, - dEtaSeedSignedMapPutToken_{ - produces("DetaSeedSigned").setBranchAlias("detaseedsigned")}, dPhiMapPutToken_{produces("Dphi").setBranchAlias("dphi")}, - dPhiSignedMapPutToken_{produces("DphiSigned").setBranchAlias("dphisigned")}, oneOverESuperMinusOneOverPMapPutToken_{produces("OneOESuperMinusOneOP")}, - oneOverESuperMinusOneOverPSignedMapPutToken_{ - produces("OneOESuperMinusOneOPSigned")}, oneOverESeedMinusOneOverPMapPutToken_{produces("OneOESeedMinusOneOP")}, missingHitsMapPutToken_{ produces("MissingHits").setBranchAlias("missinghits")}, validHitsMapPutToken_{produces("ValidHits").setBranchAlias("validhits")}, nLayerITMapPutToken_{produces("NLayerIT").setBranchAlias("nlayerit")}, chi2MapPutToken_{produces("Chi2").setBranchAlias("chi2")}, - fbremMapPutToken_{produces("fbrem")}{} + fbremMapPutToken_{produces("fbrem")} {} void EgammaHLTGsfTrackVarProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; @@ -133,6 +133,7 @@ void EgammaHLTGsfTrackVarProducer::fillDescriptions(edm::ConfigurationDescriptio desc.add(("lowerTrackNrToRemoveCut"), -1); desc.add(("useDefaultValuesForBarrel"), false); desc.add(("useDefaultValuesForEndcap"), false); + desc.add(("produceAbsValues"), false); descriptions.add("hltEgammaHLTGsfTrackVarProducer", desc); } @@ -149,11 +150,8 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co reco::RecoEcalCandidateIsolationMap dEtaMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap dEtaSeedMap(recoEcalCandHandle); - reco::RecoEcalCandidateIsolationMap dEtaSeedSignedMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap dPhiMap(recoEcalCandHandle); - reco::RecoEcalCandidateIsolationMap dPhiSignedMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap oneOverESuperMinusOneOverPMap(recoEcalCandHandle); - reco::RecoEcalCandidateIsolationMap oneOverESuperMinusOneOverPSignedMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap oneOverESeedMinusOneOverPMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap missingHitsMap(recoEcalCandHandle); reco::RecoEcalCandidateIsolationMap validHitsMap(recoEcalCandHandle); @@ -189,11 +187,8 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co float missingHitsValue = 9999999; float dEtaInValue = 999999; float dEtaSeedInValue = 999999; - float dEtaSeedInSignedValue = 999999; float dPhiInValue = 999999; - float dPhiInSignedValue = 999999; float oneOverESuperMinusOneOverPValue = 999999; - float oneOverESuperMinusOneOverPSignedValue = 999999; float oneOverESeedMinusOneOverPValue = 999999; float fbrem = 999999; @@ -204,7 +199,6 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co ? useDefaultValuesForBarrel_ && nrTracks >= 1 : useDefaultValuesForEndcap_ && nrTracks >= 1; - MultiTrajectoryStateTransform mtsTransform(&trackerGeometry, &magneticField); GsfTrackExtrapolations gsfTrackExtrapolations; @@ -212,37 +206,29 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co nLayerITValue = 100; dEtaInValue = 0; dEtaSeedInValue = 0; - dEtaSeedInSignedValue = 0; dPhiInValue = 0; - dPhiInSignedValue = 0; missingHitsValue = 0; validHitsValue = 100; chi2Value = 0; oneOverESuperMinusOneOverPValue = 0; - oneOverESuperMinusOneOverPSignedValue = 0; oneOverESeedMinusOneOverPValue = 0; fbrem = 0; } else { for (size_t trkNr = 0; trkNr < gsfTracks.size(); trkNr++) { GlobalPoint scPos(scRef->x(), scRef->y(), scRef->z()); - gsfTrackExtrapolations(*gsfTracks[trkNr],*scRef,mtsTransform); - + gsfTrackExtrapolations(*gsfTracks[trkNr], *scRef, mtsTransform); + EleRelPointPair scAtVtx(scRef->position(), gsfTrackExtrapolations.sclPos, beamSpotPosition); - fbrem = calRelDelta(gsfTrackExtrapolations.innMom.mag(),gsfTrackExtrapolations.outMom.mag(),fbrem); - + fbrem = calRelDelta(gsfTrackExtrapolations.innMom.mag(), gsfTrackExtrapolations.outMom.mag(), fbrem); + float trkP = gsfTracks[trkNr]->p(); if (scRef->energy() != 0 && trkP != 0) { - if (std::abs(1 / scRef->energy() - 1 / trkP) < oneOverESuperMinusOneOverPValue) { - oneOverESuperMinusOneOverPValue = std::abs(1 / scRef->energy() - 1 / trkP); - oneOverESuperMinusOneOverPSignedValue = 1 / scRef->energy() - 1 / trkP; - } + fillAbsAbleVar(oneOverESuperMinusOneOverPValue, 1 / scRef->energy() - 1 / trkP); } if (scRef->seed().isNonnull() && scRef->seed()->energy() != 0 && trkP != 0) { - if (std::abs(1 / scRef->seed()->energy() - 1 / trkP) < oneOverESeedMinusOneOverPValue) { - oneOverESeedMinusOneOverPValue = std::abs(1 / scRef->seed()->energy() - 1 / trkP); - } + fillAbsAbleVar(oneOverESeedMinusOneOverPValue, 1 / scRef->seed()->energy() - 1 / trkP); } if (gsfTracks[trkNr]->missingInnerHits() < missingHitsValue) { @@ -263,31 +249,16 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co chi2Value = gsfTracks[trkNr]->normalizedChi2(); } - if (std::abs(scAtVtx.dEta()) < dEtaInValue) { - // we are allowing them to come from different tracks - dEtaInValue = std::abs(scAtVtx.dEta()); - } - - if (std::abs(scAtVtx.dEta()) < dEtaSeedInValue) { - dEtaSeedInValue = std::abs(scAtVtx.dEta() - scRef->position().eta() + scRef->seed()->position().eta()); - dEtaSeedInSignedValue = scAtVtx.dEta() - scRef->position().eta() + scRef->seed()->position().eta(); - } - - if (std::abs(scAtVtx.dPhi()) < dPhiInValue) { - // we are allowing them to come from different tracks - dPhiInValue = std::abs(scAtVtx.dPhi()); - dPhiInSignedValue = scAtVtx.dPhi(); - } + fillAbsAbleVar(dEtaInValue, scAtVtx.dEta()); + fillAbsAbleVar(dEtaSeedInValue, scAtVtx.dEta() - scRef->position().eta() + scRef->seed()->position().eta()); + fillAbsAbleVar(dPhiInValue, scAtVtx.dPhi()); } } dEtaMap.insert(recoEcalCandRef, dEtaInValue); dEtaSeedMap.insert(recoEcalCandRef, dEtaSeedInValue); - dEtaSeedSignedMap.insert(recoEcalCandRef, dEtaSeedInSignedValue); dPhiMap.insert(recoEcalCandRef, dPhiInValue); - dPhiSignedMap.insert(recoEcalCandRef, dPhiInSignedValue); oneOverESuperMinusOneOverPMap.insert(recoEcalCandRef, oneOverESuperMinusOneOverPValue); - oneOverESuperMinusOneOverPSignedMap.insert(recoEcalCandRef, oneOverESuperMinusOneOverPSignedValue); oneOverESeedMinusOneOverPMap.insert(recoEcalCandRef, oneOverESeedMinusOneOverPValue); missingHitsMap.insert(recoEcalCandRef, missingHitsValue); validHitsMap.insert(recoEcalCandRef, validHitsValue); @@ -298,11 +269,8 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co iEvent.emplace(dEtaMapPutToken_, dEtaMap); iEvent.emplace(dEtaSeedMapPutToken_, dEtaSeedMap); - iEvent.emplace(dEtaSeedSignedMapPutToken_, dEtaSeedSignedMap); iEvent.emplace(dPhiMapPutToken_, dPhiMap); - iEvent.emplace(dPhiSignedMapPutToken_, dPhiSignedMap); iEvent.emplace(oneOverESuperMinusOneOverPMapPutToken_, oneOverESuperMinusOneOverPMap); - iEvent.emplace(oneOverESuperMinusOneOverPSignedMapPutToken_, oneOverESuperMinusOneOverPSignedMap); iEvent.emplace(oneOverESeedMinusOneOverPMapPutToken_, oneOverESeedMinusOneOverPMap); iEvent.emplace(missingHitsMapPutToken_, missingHitsMap); iEvent.emplace(validHitsMapPutToken_, validHitsMap); @@ -311,23 +279,18 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::StreamID, edm::Event& iEvent, co iEvent.emplace(fbremMapPutToken_, fbremMap); } - -void EgammaHLTGsfTrackVarProducer::GsfTrackExtrapolations::operator()(const reco::GsfTrack& trk,const reco::SuperCluster& sc,const MultiTrajectoryStateTransform& mtsTransform) -{ +void EgammaHLTGsfTrackVarProducer::GsfTrackExtrapolations::operator()( + const reco::GsfTrack& trk, const reco::SuperCluster& sc, const MultiTrajectoryStateTransform& mtsTransform) { innTSOS = mtsTransform.innerStateOnSurface(trk); outTSOS = mtsTransform.outerStateOnSurface(trk); - sclTSOS = mtsTransform.extrapolatedState( - innTSOS, GlobalPoint(sc.x(), sc.y(), sc.z()) - ); - + sclTSOS = mtsTransform.extrapolatedState(innTSOS, GlobalPoint(sc.x(), sc.y(), sc.z())); + multiTrajectoryStateMode::momentumFromModeCartesian(innTSOS, innMom); multiTrajectoryStateMode::positionFromModeCartesian(innTSOS, innPos); multiTrajectoryStateMode::momentumFromModeCartesian(sclTSOS, sclMom); multiTrajectoryStateMode::positionFromModeCartesian(sclTSOS, sclPos); multiTrajectoryStateMode::momentumFromModeCartesian(outTSOS, outMom); multiTrajectoryStateMode::positionFromModeCartesian(outTSOS, outPos); - - } #include "FWCore/Framework/interface/MakerMacros.h" From 360b794de6ee2ee71b551af4a370a568c1b36d10 Mon Sep 17 00:00:00 2001 From: Sam Harper Date: Tue, 23 Jan 2024 16:10:11 +0000 Subject: [PATCH 4/7] fixing bug filling variables --- .../plugins/EgammaHLTGsfTrackVarProducer.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc index 8e5f73c38de05..46a087559d0cc 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc @@ -58,11 +58,9 @@ class EgammaHLTGsfTrackVarProducer : public edm::global::EDProducer<> { explicit EgammaHLTGsfTrackVarProducer(const edm::ParameterSet&); void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - float fillAbsAbleVar(float& existVal, const float newVal) const { + void fillAbsAbleVar(float& existVal, const float newVal) const { if (std::abs(newVal) < existVal) { - return produceAbsValues_ ? std::abs(newVal) : newVal; - } else { - return existVal; + existVal = produceAbsValues_ ? std::abs(newVal) : newVal; } } From c8dfc097ae2508c8b7bdb0a14f3d7bd40faf0652 Mon Sep 17 00:00:00 2001 From: Sam Harper Date: Tue, 23 Jan 2024 16:10:54 +0000 Subject: [PATCH 5/7] adjusting pr number --- HLTrigger/Configuration/python/customizeHLTforCMSSW.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index c91c2a0e3e382..2d457ddb337a0 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -261,7 +261,7 @@ def customizeHLTfor43549(process): return process -def customizeHLTfor43748(process): +def customizeHLTfor43774(process): filt_types = ["HLTEgammaGenericFilter","HLTEgammaGenericQuadraticEtaFilter","HLTEgammaGenericQuadraticFilter","HLTElectronGenericFilter"] absAbleVar = ["DEta","deta","DetaSeed","Dphi","OneOESuperMinusOneOP","OneOESeedMinusOneOP"] for filt_type in filt_types: @@ -283,5 +283,5 @@ def customizeHLTforCMSSW(process, menuType="GRun"): process = customizeHLTfor43025(process) process = customizeHLTfor43549(process) - process = customizeHLTfor43748(process) + process = customizeHLTfor43774(process) return process From f2d6925985a1fadedde5c21ce231b34525a3e1e9 Mon Sep 17 00:00:00 2001 From: Sam Harper Date: Tue, 23 Jan 2024 16:41:50 +0000 Subject: [PATCH 6/7] another bug fix on setting abs vars --- .../EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc index 46a087559d0cc..4abb4587a06c8 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc @@ -59,7 +59,7 @@ class EgammaHLTGsfTrackVarProducer : public edm::global::EDProducer<> { void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); void fillAbsAbleVar(float& existVal, const float newVal) const { - if (std::abs(newVal) < existVal) { + if (std::abs(newVal) < std::abs(existVal)) { existVal = produceAbsValues_ ? std::abs(newVal) : newVal; } } From 676482b3c2ecb0ad2656e7fafb73877c6247c99e Mon Sep 17 00:00:00 2001 From: Sam Harper Date: Wed, 24 Jan 2024 13:21:44 +0000 Subject: [PATCH 7/7] code review comments --- .../plugins/EgammaHLTGsfTrackVarProducer.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc index 4abb4587a06c8..f309f2621b981 100644 --- a/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/plugins/EgammaHLTGsfTrackVarProducer.cc @@ -49,9 +49,8 @@ class EgammaHLTGsfTrackVarProducer : public edm::global::EDProducer<> { TrajectoryStateOnSurface outTSOS; TrajectoryStateOnSurface sclTSOS; - // mode - GlobalVector innMom, outMom, sclMom; - GlobalPoint innPos, outPos, sclPos; + GlobalVector innMom, outMom; + GlobalPoint sclPos; }; public: @@ -93,7 +92,7 @@ class EgammaHLTGsfTrackVarProducer : public edm::global::EDProducer<> { namespace { - float calRelDelta(float a, float b, float defaultVal = 0) { return b != 0 ? (a - b) / a : defaultVal; } + float calRelDelta(float a, float b, float defaultVal = 0.f) { return a != 0.f ? (a - b) / a : defaultVal; } } // namespace @@ -284,11 +283,8 @@ void EgammaHLTGsfTrackVarProducer::GsfTrackExtrapolations::operator()( sclTSOS = mtsTransform.extrapolatedState(innTSOS, GlobalPoint(sc.x(), sc.y(), sc.z())); multiTrajectoryStateMode::momentumFromModeCartesian(innTSOS, innMom); - multiTrajectoryStateMode::positionFromModeCartesian(innTSOS, innPos); - multiTrajectoryStateMode::momentumFromModeCartesian(sclTSOS, sclMom); multiTrajectoryStateMode::positionFromModeCartesian(sclTSOS, sclPos); multiTrajectoryStateMode::momentumFromModeCartesian(outTSOS, outMom); - multiTrajectoryStateMode::positionFromModeCartesian(outTSOS, outPos); } #include "FWCore/Framework/interface/MakerMacros.h"