diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonStandalone.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonStandalone.py index d6b35a152cd9e248042f457678be0133438eb472..4973cdd69fd064b5da8f423e16b011acc7d27f97 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonStandalone.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonStandalone.py @@ -172,6 +172,7 @@ class MuonStandalone(ConfiguredMuonRec): Cleaner.Fitter = getPublicTool("MCTBSLFitterMaterialFromTrack") Cleaner.PullCut = 3 Cleaner.PullCutPhi = 3 + Cleaner.UseSLFit = True SegmentFinder.TrackCleaner = Cleaner # for test purposes allow parallel running of truth segment finding and new segment finder MuonSegmentFinderAlg = CfgMgr.MuonSegmentFinderAlg( "MuonSegmentMaker",SegmentCollectionName=SegmentLocation, diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackCleaner.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackCleaner.cxx index 76adc4d7dc62f35b7e4153b71c0a7dc8f8c3cb06..6d28a71a675570ec11144928866bcdd3fbdb7571 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackCleaner.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackCleaner.cxx @@ -52,6 +52,7 @@ namespace Muon { ATH_CHECK( m_edmHelperSvc.retrieve() ); ATH_CHECK( m_printer.retrieve() ); ATH_CHECK( m_extrapolator.retrieve() ); + ATH_CHECK( m_slextrapolator.retrieve() ); ATH_CHECK( m_pullCalculator.retrieve() ); ATH_CHECK( m_mdtRotCreator.retrieve() ); ATH_CHECK( m_compRotCreator.retrieve() ); @@ -897,6 +898,7 @@ namespace Muon { fieldCondObj->getInitializedCache (fieldCache); state.slFit = !fieldCache.toroidOn() || m_edmHelperSvc->isSLTrack( track ); + if(m_use_slFit) state.slFit = true; // loop over track and calculate residuals const DataVector<const Trk::TrackStateOnSurface>* states = track.trackStateOnSurfaces(); @@ -1194,7 +1196,8 @@ namespace Muon { ATH_MSG_DEBUG("updated competing ROT"); info.cleanedCompROT = std::move(updatedCompRot); if( info.cleanedCompROT->associatedSurface() != meas->associatedSurface() ){ - const Trk::TrackParameters* exPars=m_extrapolator->extrapolate(*pars,info.cleanedCompROT->associatedSurface(),Trk::anyDirection,false,Trk::muon); + const Trk::TrackParameters* exPars= state.slFit ? m_slextrapolator->extrapolate(*pars,info.cleanedCompROT->associatedSurface(),Trk::anyDirection,false,Trk::muon) : + m_extrapolator->extrapolate(*pars,info.cleanedCompROT->associatedSurface(),Trk::anyDirection,false,Trk::muon); if( !exPars ){ ATH_MSG_WARNING("Update of comp rot parameters failed, keeping old ones" ); info.cleanedCompROT.reset(); @@ -1332,7 +1335,7 @@ namespace Muon { } // update sl fit configuration if track has ID hits or vertex constraint - if( state.slFit && (state.hasVertexConstraint || state.nIdHits > 0 ) && fieldCache.solenoidOn() ) { + if( !m_use_slFit && state.slFit && (state.hasVertexConstraint || state.nIdHits > 0 ) && fieldCache.solenoidOn() ) { state.slFit = false; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackCleaner.h b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackCleaner.h index f06d4927d2c7cdbcd4410c722a54f493a1d795e1..2c9ca258f273e3f80e4f9272b1ff4b3eb8cabdb7 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackCleaner.h +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackCleaner.h @@ -291,6 +291,7 @@ namespace Muon { ToolHandle<Muon::MuonEDMPrinterTool> m_printer {this, "Printer", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; ToolHandle<Trk::IExtrapolator> m_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}; + ToolHandle<Trk::IExtrapolator> m_slextrapolator {this, "SlExtrapolator", "Trk::Extrapolator/MuonStraightLineExtrapolator"}; // Read handle for conditions object to get the field cache SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}; @@ -309,6 +310,8 @@ namespace Muon { Gaudi::Property<bool> m_onlyUseHitErrorInRecovery {this, "OnlyUseHitErrorInRecovery", true}; Gaudi::Property<double> m_adcCut {this, "AdcCut", 50.}; Gaudi::Property<bool> m_iterate {this, "Iterate", 0.7}; + Gaudi::Property<bool> m_use_slFit {this, "UseSLFit", false}; + /** helper function to extract chambers that are to be removed */ bool extractChambersToBeRemoved( CleaningState& state, std::set<Identifier>& chambersToBeRemovedSet, bool usePhi=false ) const;