diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py index ef83516a4e1206bd80bddd944de86639a76a7f54..4d708e98c4e6d6997c4792f0b5334e5e5f5f6f06 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py @@ -1066,7 +1066,7 @@ else: OutputTracksLocation = InDetKeys.UnslimmedTracks(), AssociationTool = getInDetPRDtoTrackMapToolGangedPixels(), AssociationMapName = "PRDtoTrackMap" + InDetKeys.UnslimmedTracks(), - UpdateSharedHitsOnly = False, + UpdateSharedHits = True, UpdateAdditionalInfo = True, SummaryTool = merger_track_summary_tool) topSequence += TrkTrackCollectionMerger @@ -1113,7 +1113,7 @@ else: TracksLocation = DummyCollection, OutputTracksLocation = InDetKeys.DisappearingTracks(), AssociationTool = getInDetPRDtoTrackMapToolGangedPixels(), - UpdateSharedHitsOnly = False, + UpdateSharedHits = True, UpdateAdditionalInfo = True, SummaryTool = merger_track_summary_tool) #TrkTrackCollectionMerger_pix.OutputLevel = VERBOSE diff --git a/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/TrkTrackCollectionMerger/TrackCollectionMerger.h b/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/TrkTrackCollectionMerger/TrackCollectionMerger.h index b4e3b5863c608ced00021e6ec16cf270e658279e..d69e3ad775fbde10ef6abb61f962ac6494eaa546 100644 --- a/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/TrkTrackCollectionMerger/TrackCollectionMerger.h +++ b/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/TrkTrackCollectionMerger/TrackCollectionMerger.h @@ -27,10 +27,6 @@ namespace Trk { /** @brief Class-algorithm for track collection merging and removalof potential duplicate tracks. */ class TrackCollectionMerger : public AthAlgorithm { - - /////////////////////////////////////////////////////////////////// - /** @brief Public methods: */ - /////////////////////////////////////////////////////////////////// public: @@ -44,13 +40,6 @@ namespace Trk { StatusCode execute(); StatusCode finalize(); - /////////////////////////////////////////////////////////////////// - /** @brief Print internal tool parameters and status. */ - /////////////////////////////////////////////////////////////////// - - MsgStream& dump (MsgStream& out) const; - std::ostream& dump (std::ostream& out) const; - protected: /////////////////////////////////////////////////////////////////// @@ -75,20 +64,15 @@ namespace Trk { Trk::PRDtoTrackMap *pPrdToTrackMap, TrackCollection* outputCol); - MsgStream& dumptools(MsgStream& out) const; - MsgStream& dumpevent(MsgStream& out) const; - private: bool m_createViewCollection; //!< option to create a view collection and not deep-copy tracks - bool m_updateSharedHitsOnly; //!< do not create the track summary again, but only update shared hits + bool m_updateSharedHits; //!< do not create the track summary again, but only update shared hits bool m_updateAdditionalInfo; //!< do not create the track summary again, but only update necessary things }; - MsgStream& operator << (MsgStream& ,const TrackCollectionMerger&); - std::ostream& operator << (std::ostream&,const TrackCollectionMerger&); } #endif // TrackCollectionMerger_H diff --git a/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/src/TrackCollectionMerger.cxx b/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/src/TrackCollectionMerger.cxx index 9e01f0dba3ad01d603333f235b20f303cf46cecb..f72e148fad2646b8727f28e61f0ecb38a2d97229 100644 --- a/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/src/TrackCollectionMerger.cxx +++ b/Tracking/TrkAlgorithms/TrkTrackCollectionMerger/src/TrackCollectionMerger.cxx @@ -1,12 +1,11 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// // Implementation file for class Trk::TrackCollectionMerger /////////////////////////////////////////////////////////////////// -// (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////// // Version 1.0 11/26/2007 Thomas Koffas /////////////////////////////////////////////////////////////////// @@ -23,7 +22,7 @@ Trk::TrackCollectionMerger::TrackCollectionMerger (const std::string& name, ISvcLocator* pSvcLocator ) : AthAlgorithm(name, pSvcLocator ), m_createViewCollection(true), - m_updateSharedHitsOnly(true), + m_updateSharedHits(true), m_updateAdditionalInfo(false) { m_outtracklocation = "CombinedInDetTracks" ; @@ -32,7 +31,7 @@ Trk::TrackCollectionMerger::TrackCollectionMerger declareProperty("OutputTracksLocation", m_outtracklocation ); declareProperty("SummaryTool" , m_trkSummaryTool ); declareProperty("CreateViewColllection" , m_createViewCollection ); - declareProperty("UpdateSharedHitsOnly" , m_updateSharedHitsOnly); + declareProperty("UpdateSharedHits" , m_updateSharedHits); declareProperty("UpdateAdditionalInfo" , m_updateAdditionalInfo); } @@ -44,12 +43,6 @@ StatusCode Trk::TrackCollectionMerger::initialize() { ATH_MSG_DEBUG("Initializing TrackCollectionMerger"); - - if( m_updateSharedHitsOnly && m_updateAdditionalInfo){ - msg(MSG::WARNING) << "Both UpdateAdditionalInfo and UpdateSharedHitsOnly set true - UpdateAdditionalInfo includes a shared hits update. " << endmsg; - msg(MSG::WARNING) << "If you *only* want to update shared hits, set UpdateAdditionalInfo=False and UpdateSharedHitsOnly=True" << endmsg; - } - ATH_CHECK( m_tracklocation.initialize() ); ATH_CHECK( m_outtracklocation.initialize() ); if (not m_trkSummaryTool.name().empty()) ATH_CHECK( m_trkSummaryTool.retrieve() ); @@ -93,11 +86,13 @@ Trk::TrackCollectionMerger::execute(){ ATH_MSG_DEBUG("Update summaries"); // now loop over all tracks and update summaries with new shared hit counts // @TODO magic! tracks are now non-const !?? + const bool createTrackSummary = not (m_updateAdditionalInfo or m_updateSharedHits); for (Trk::Track* trk : *outputCol) { - if (m_updateAdditionalInfo) m_trkSummaryTool->updateAdditionalInfo(*trk, pPrdToTrackMap.get()); - else if (m_updateSharedHitsOnly) m_trkSummaryTool->updateSharedHitCount(*trk, pPrdToTrackMap.get()); - else { + if (createTrackSummary){ m_trkSummaryTool->computeAndReplaceTrackSummary(*trk, pPrdToTrackMap.get(), false /* DO NOT suppress hole search*/); + } else { + if (m_updateAdditionalInfo) m_trkSummaryTool->updateAdditionalInfo(*trk); + if (m_updateSharedHits) m_trkSummaryTool->updateSharedHitCount(*trk, pPrdToTrackMap.get()); } } } else { @@ -113,7 +108,6 @@ Trk::TrackCollectionMerger::execute(){ } } //Print common event information - ATH_MSG_DEBUG(*this); ATH_MSG_DEBUG("Done !"); return StatusCode::SUCCESS; } @@ -127,63 +121,6 @@ StatusCode Trk::TrackCollectionMerger::finalize() return StatusCode::SUCCESS; } -/////////////////////////////////////////////////////////////////// -// Dumps relevant information into the MsgStream -/////////////////////////////////////////////////////////////////// - -MsgStream& Trk::TrackCollectionMerger::dump( MsgStream& out ) const -{ - out<<std::endl; - if(msgLvl(MSG::DEBUG)) return dumpevent(out); - return dumptools(out); -} - -/////////////////////////////////////////////////////////////////// -// Dumps conditions information into the MsgStream -/////////////////////////////////////////////////////////////////// - -MsgStream& Trk::TrackCollectionMerger::dumptools( MsgStream& out ) const -{ - return out; -} - -/////////////////////////////////////////////////////////////////// -// Dumps event information into the MsgStream -/////////////////////////////////////////////////////////////////// - -MsgStream& Trk::TrackCollectionMerger::dumpevent( MsgStream& out ) const -{ - return out; -} - -/////////////////////////////////////////////////////////////////// -// Dumps relevant information into the ostream -/////////////////////////////////////////////////////////////////// - -std::ostream& Trk::TrackCollectionMerger::dump( std::ostream& out ) const -{ - return out; -} - -/////////////////////////////////////////////////////////////////// -// Overload of << operator MsgStream -/////////////////////////////////////////////////////////////////// - -MsgStream& Trk::operator << - (MsgStream& sl,const Trk::TrackCollectionMerger& se) -{ - return se.dump(sl); -} - -/////////////////////////////////////////////////////////////////// -// Overload of << operator std::ostream -/////////////////////////////////////////////////////////////////// - -std::ostream& Trk::operator << - (std::ostream& sl,const Trk::TrackCollectionMerger& se) -{ - return se.dump(sl); -} /////////////////////////////////////////////////////////////////// diff --git a/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx b/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx index 7c06c26505ac4b84972b0580fab2b7befeb86666..c46db14d84887bf1c2f68aeb8b7d367667a3a8ee 100644 --- a/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx +++ b/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx @@ -549,7 +549,7 @@ TrackParticleCreatorTool::TrackParticleCreatorTool(const std::string& t, const s summary = updated_summary.get(); } else if (m_computeAdditionalInfo) { updated_summary = std::make_unique<Trk::TrackSummary>(*track.trackSummary()); - m_trackSummaryTool->updateAdditionalInfo(track, prd_to_track_map, *updated_summary); + m_trackSummaryTool->updateAdditionalInfo(track, *updated_summary); summary = updated_summary.get(); } } else { diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h index 8837a91c0bf9404d094bb18ba1be45a95669fc87..7e2510cc2dfb1019e59a8a9de0d2cb979ccf09ef 100644 --- a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h +++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/IExtendedTrackSummaryTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRKIEXTENDEDTRACKSUMMARYTOOL_H @@ -108,12 +108,9 @@ public: * summary is owned by the track. */ virtual void updateAdditionalInfo(const Track& track, - const Trk::PRDtoTrackMap* prd_to_track_map, TrackSummary& summary) const = 0; - virtual void updateAdditionalInfo( - Track& track, - const Trk::PRDtoTrackMap* prd_to_track_map) const = 0; + virtual void updateAdditionalInfo(Track& track) const = 0; }; inline const InterfaceID& diff --git a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h index 7417ae0e0a3e0323a1c837533edba1ec437ca219..102a1f8b1cd7e178a9bc7c392eacfe65443c6345 100755 --- a/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h +++ b/Tracking/TrkTools/TrkToolInterfaces/TrkToolInterfaces/ITrackSummaryTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRKITRACKSUMMARYTOOL_H diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h index 405062de0b3912b34cd1b4476ddf14d710fe2c5a..2c3ca7d0363977c10f1490071dfd1b19456a9c89 100755 --- a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h +++ b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRKTRACKSUMMARYTOOL_H @@ -133,12 +133,6 @@ public: Track& track, const Trk::PRDtoTrackMap* prd_to_track_map) const override; - /** method to update additional information (PID,shared hits, dEdX), this is - * optimised for track collection merging. - */ - virtual void updateAdditionalInfo( - Track& track, - const Trk::PRDtoTrackMap* prd_to_track_map) const override; /** Update the shared hit count of the given track summary. * @param summary the summary to be updated i.e. a copy of the track summary @@ -173,7 +167,6 @@ public: * summary is owned by the track. */ virtual void updateAdditionalInfo(const Track& track, - const Trk::PRDtoTrackMap* prd_to_track_map, TrackSummary& summary) const override; /** method to update additional information (PID,shared hits, dEdX), this is @@ -200,7 +193,6 @@ private: bool suppress_hole_search) const; void updateAdditionalInfo(const Track& track, - const Trk::PRDtoTrackMap* prd_to_track_map, TrackSummary& summary, bool initialise_to_zero) const; diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.icc b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.icc index 2323c82101e68cf6fa0e3a8b3c8f90fbe305e6cb..7b9924eba8867edb1423dea5158f6381768b636e 100644 --- a/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.icc +++ b/Tracking/TrkTools/TrkTrackSummaryTool/TrkTrackSummaryTool/TrackSummaryTool.icc @@ -40,22 +40,6 @@ TrackSummaryTool::updateSharedHitCount( } } -inline void -TrackSummaryTool::updateAdditionalInfo( - Track& track, - const Trk::PRDtoTrackMap* prd_to_track_map) const -{ - if (!track.trackSummary()) { - computeAndReplaceTrackSummary( - track, prd_to_track_map, false /*DO NOT suppress hole search*/); - } else { - updateAdditionalInfo( - track, - prd_to_track_map, - *track.trackSummary(), - true); // @TODO set to false; true for backward compatibility - } -} inline void TrackSummaryTool::updateSharedHitCount(Track& track) const @@ -71,10 +55,9 @@ TrackSummaryTool::updateSharedHitCount(Track& track) const inline void TrackSummaryTool::updateAdditionalInfo( const Track& track, - const Trk::PRDtoTrackMap* prd_to_track_map, TrackSummary& summary) const { - updateAdditionalInfo(track, prd_to_track_map, summary, false); + updateAdditionalInfo(track, summary, false); } inline void @@ -86,7 +69,6 @@ TrackSummaryTool::updateAdditionalInfo(Track& track) const } else { updateAdditionalInfo( track, - nullptr, *track.trackSummary(), true); // @TODO set to false; true for backward compatibility } diff --git a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx index 7b4ae59a39dd9ff7245b252ca1cb3c58f3f6182f..52ccbbc735384acada6d42944c93166f8a4c6a8d 100755 --- a/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx +++ b/Tracking/TrkTools/TrkTrackSummaryTool/src/TrackSummaryTool.cxx @@ -44,9 +44,7 @@ Trk::TrackSummaryTool::~TrackSummaryTool() StatusCode Trk::TrackSummaryTool::initialize() { - // StatusCode sc=StatusCode::SUCCESS; - //StatusCode sc = AlgTool::initialize(); - //if (sc.isFailure()) return sc; + ATH_CHECK( detStore()->retrieve(m_detID, "AtlasID" )); @@ -360,7 +358,7 @@ void Trk::TrackSummaryTool::updateSharedHitCount(const Track& track, const Trk:: m_idTool->updateSharedHitCount(track, prd_to_track_map, summary); } -void Trk::TrackSummaryTool::updateAdditionalInfo(const Track& track, const Trk::PRDtoTrackMap *prd_to_track_map, TrackSummary &summary, bool initialise_to_zero) const +void Trk::TrackSummaryTool::updateAdditionalInfo(const Track& track, TrackSummary &summary, bool initialise_to_zero) const { unsigned int numberOfeProbabilityTypes = Trk::numberOfeProbabilityTypes+1; std::vector<float> eProbability(numberOfeProbabilityTypes,0.5); @@ -397,8 +395,6 @@ void Trk::TrackSummaryTool::updateAdditionalInfo(const Track& track, const Trk:: m_idTool->updateAdditionalInfo(summary, eProbability,dedx, nhitsuseddedx,noverflowhitsdedx); - m_idTool->updateSharedHitCount(track, prd_to_track_map, summary); - m_idTool->updateExpectedHitInfo(track, summary); if (m_addInDetDetailedSummary) m_idTool->addDetailedTrackSummary(track,summary);