diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx index 2e36749dbaffe01616fc41241cdab065e703f04a..14f2b0e0d1aace563883dbee8e261f41d5ddacae 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx +++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx @@ -10,6 +10,7 @@ // (c) ATLAS Combined Muon software ////////////////////////////////////////////////////////////////////////////// +#include "TrkTrackSummary/MuonTrackSummary.h" #include "MuonCandidateTool.h" namespace MuonCombined { @@ -40,6 +41,7 @@ namespace MuonCombined { if( !m_trackExtrapolationTool.empty() ) ATH_CHECK(m_trackExtrapolationTool.retrieve()); else m_trackExtrapolationTool.disable(); ATH_CHECK(m_ambiguityProcessor.retrieve()); + ATH_CHECK(m_idHelperSvc.retrieve()); ATH_CHECK(m_beamSpotKey.initialize()); return StatusCode::SUCCESS; } @@ -89,11 +91,25 @@ namespace MuonCombined { else if( !standaloneTrack->perigeeParameters()->covariance() ) ATH_MSG_WARNING(" Track with perigee without covariance " << standaloneTrack); trackLinks[ standaloneTrack ] = std::make_pair(trackLink,standaloneTrack); }else{ - standaloneTrack=new Trk::Track(msTrack); - trackLinks[ standaloneTrack ] = std::make_pair(trackLink,nullptr); - } - extrapTracks->push_back( standaloneTrack ); - tracksToBeDeleted.insert( standaloneTrack ); // insert track for deletion + //We can create tracks from EM segments+TGC hits + //If these are not successfully extrapolated, they are too low quality to be useful + //So only make candidates from un-extrapolated tracks if they are not EM-only + bool skipTrack=true; + for(auto& chs : msTrack.trackSummary()->muonTrackSummary()->chamberHitSummary()){ + if(chs.isMdt() && m_idHelperSvc->stationIndex(chs.chamberId())!=Muon::MuonStationIndex::EM){ + skipTrack=false; + break; + } + } + if(!skipTrack){ + standaloneTrack=new Trk::Track(msTrack); + trackLinks[ standaloneTrack ] = std::make_pair(trackLink,nullptr); + } + } + if(standaloneTrack){ + extrapTracks->push_back( standaloneTrack ); + tracksToBeDeleted.insert( standaloneTrack ); // insert track for deletion + } } ATH_MSG_DEBUG("Finished back-tracking, total number of successfull fits " << ntracks); diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h index 29a84b2b5b4e635908bab2d80982ae9c07e0c1a3..5313474c3a7b405a227db21aee4c6ecc838373e4 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h +++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h @@ -16,6 +16,7 @@ #include "MuidInterfaces/ICombinedMuonTrackBuilder.h" #include "MuonRecHelperTools/MuonEDMPrinterTool.h" #include "MuonRecToolInterfaces/IMuonTrackExtrapolationTool.h" +#include "MuonIdHelpers/IMuonIdHelperSvc.h" namespace MuonCombined { @@ -37,6 +38,7 @@ namespace MuonCombined { ToolHandle<Rec::ICombinedMuonTrackBuilder> m_trackBuilder; ToolHandle<Muon::IMuonTrackExtrapolationTool> m_trackExtrapolationTool; ToolHandle<Trk::ITrackAmbiguityProcessorTool> m_ambiguityProcessor; + ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; unsigned int m_extrapolationStrategy; diff --git a/Tools/PROCTools/data/master_q221_AOD_digest.ref b/Tools/PROCTools/data/master_q221_AOD_digest.ref index 0431193610022860bf2724e98ebf51c0c746c572..4be2ccf40c734f8bf20a03c125c1d702945a66f5 100644 --- a/Tools/PROCTools/data/master_q221_AOD_digest.ref +++ b/Tools/PROCTools/data/master_q221_AOD_digest.ref @@ -9,7 +9,7 @@ 284500 87473063 62 76 5 2 6 2 4 6 4 2 284500 87473068 26 35 1 1 0 0 0 0 0 0 284500 87473075 72 84 6 0 5 0 5 5 4 1 - 284500 87473084 83 85 7 3 14 1 13 10 5 5 + 284500 87473084 83 85 7 2 14 1 13 10 5 5 284500 87473091 43 49 3 0 2 1 1 5 2 3 284500 87473096 72 75 3 2 2 0 2 3 2 1 284500 87473104 61 63 6 0 6 1 5 5 4 1