-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor+fix: use collections and multi-factory in `RichTrack_factory…
…`; fix potential leaks in `TrackPropagation` (#656) ### Briefly, what does this PR introduce? - return `Collection` of `TrackSegments` in `TrackPropagation::propagateToSurfaceList`, rather than a (potentially leaky) new `TrackSegment` pointer - the loop over input trajectories is moved from `RichTrack_factory` to `TrackPropagation::propagateToSurfaceList`, which makes the PR diff appear to be more complex than it actually is - fix additional possible memory leaks by replacing any `return new raw_pointer` calls with `return std::make_unique<...>(...)`, and update any code which depends on this change - improve the configuration with `RichTrackConfig`, which configures the _factory_, not the algorithm, since the factory is used to connect to the `richgeo` service (and not the more general `TrackPropagation` algorithm) ### What kind of change does this PR introduce? - [x] Bug fix (memory leaks) - [x] New feature (issue #__) - [ ] Documentation update - [ ] Other: __ ### Please check if this PR fulfills the following: - [x] Tests for the changes have been added: tested in `irt-algo` branch - [ ] Documentation has been added / updated - [ ] Changes have been communicated to collaborators ### Does this PR introduce breaking changes? What changes might users need to make to their code? no, unless the `TrackPropagation` algorithm is called by anything external of EICrecon ### Does this PR change default behavior? no
- Loading branch information
Showing
8 changed files
with
183 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2023, Christopher Dilks | ||
// Subject to the terms in the LICENSE file found in the top-level directory. | ||
|
||
#pragma once | ||
|
||
#include <spdlog/spdlog.h> | ||
|
||
namespace eicrecon { | ||
|
||
class RichTrackConfig { | ||
public: | ||
|
||
///////////////////////////////////////////////////// | ||
// CONFIGURATION PARAMETERS | ||
// NOTE: some defaults are hard-coded here; override externally | ||
|
||
std::map <std::string,unsigned> numPlanes; // number of xy-planes for track projections (for each radiator) | ||
|
||
// | ||
///////////////////////////////////////////////////// | ||
|
||
|
||
// print all parameters | ||
void Print( | ||
std::shared_ptr<spdlog::logger> m_log, | ||
spdlog::level::level_enum lvl=spdlog::level::debug | ||
) | ||
{ | ||
m_log->log(lvl, "{:=^60}"," RichTrackConfig Settings "); | ||
for(const auto& [rad,val] : numPlanes) | ||
m_log->log(lvl, " {:>20} = {:<}", fmt::format("{} numPlanes", rad), val); | ||
m_log->log(lvl, "{:=^60}",""); | ||
} | ||
|
||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.