From ce1567d16861a8325f29b09b2c45fb819e229c9e Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Wed, 21 Oct 2026 17:41:19 -0500 Subject: [PATCH] Add edep filtering --- TrkFilters/src/HelixFilter_module.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/TrkFilters/src/HelixFilter_module.cc b/TrkFilters/src/HelixFilter_module.cc index 4da6f163dd..04552ac2a1 100644 --- a/TrkFilters/src/HelixFilter_module.cc +++ b/TrkFilters/src/HelixFilter_module.cc @@ -58,6 +58,8 @@ namespace mu2e fhicl::OptionalAtom minAbsLambda { Name("minAbsLambda"), Comment("minAbsLambda ") }; fhicl::OptionalAtom maxNLoops { Name("maxNLoops"), Comment("maxNLoops ") }; fhicl::OptionalAtom minNLoops { Name("minNLoops"), Comment("minNLoops ") }; + fhicl::OptionalAtom minEDepAvg { Name("minEDepAvg"), Comment("Minimum mean straw hit energy deposit (MeV)")}; + fhicl::OptionalAtom maxEDepAvg { Name("maxEDepAvg"), Comment("Maximum mean straw hit energy deposit (MeV)")}; fhicl::OptionalAtom slopeSigMin { Name("slopeSigMin"), Comment("Minimum helix seed slope significance selection")}; fhicl::OptionalAtom slopeSigMax { Name("slopeSigMax"), Comment("Maximum helix seed slope significance selection")}; fhicl::Sequence helixFitFlag { Name("helixFitFlag"), Comment("helixFitFlag "), std::vector{"HelixOK"} }; @@ -86,6 +88,8 @@ namespace mu2e config.minAbsLambda(_minlambda); config.maxNLoops(_maxnloops); config.minNLoops(_minnloops); + config.minEDepAvg(_minedep); + config.maxEDepAvg(_maxedep); _useSlopeSigMin = config.slopeSigMin(_slopeSigMin); _useSlopeSigMax = config.slopeSigMax(_slopeSigMax); } @@ -130,12 +134,14 @@ namespace mu2e const float slope = Helix.recoDir().slope(); const float slopeErr = std::fabs(Helix.recoDir().slopeErr()); const float slopeSignedSig = (slopeErr > 0.f) ? slope/slopeErr : 0.f; //signifance from 0 signed by the slope direction + const float edep = Helix.hits().eDepAvg(); // straw hit weighted, as AgnosticHelixFinder maxEDepAvg if(Debug > 2){ std::cout << "[HelixFilter] : status = " << Helix.status() << " nhits = " << nstrawhits << " mom = " << hmom << std::endl << "[HelixFilter] : chi2XY = " << chi2XY << " chi2ZPHI = " << chi2PhiZ << " d0 = " << d0 << " lambda = "<< lambda << " p = " << hmom << " pT = " << hpT - << " nLoops = " << nLoops << " hRatio = "<< hRatio << " slopeSignedSig = " << slopeSignedSig << std::endl; + << " nLoops = " << nLoops << " hRatio = "<< hRatio << " slopeSignedSig = " << slopeSignedSig + << " eDepAvg = " << edep << std::endl; } if( Helix.status().hasAllProperties(_goodh) && (!_hascc || Helix.caloCluster().isNonnull()) && @@ -151,6 +157,8 @@ namespace mu2e nLoops >= _minnloops && hmom >= _minmom && hmom <= _maxmom && + edep >= _minedep && + edep <= _maxedep && (!_useSlopeSigMin || slopeSignedSig > _slopeSigMin) && (!_useSlopeSigMax || slopeSignedSig < _slopeSigMax) && hRatio >= _minHitRatio ) { @@ -185,6 +193,8 @@ namespace mu2e double _minlambda = 0.; // the cut is applied to |lambda| double _maxnloops = std::numeric_limits::max(); double _minnloops = 0.; + double _minedep = std::numeric_limits::lowest(); + double _maxedep = std::numeric_limits::max(); bool _useSlopeSigMin = false; double _slopeSigMin = 0.; bool _useSlopeSigMax = false;