Skip to content

Commit

Permalink
Merge branch 'main' into chore-synchronize-system-builtin-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
asalzburger authored Sep 20, 2024
2 parents 2b2d9b7 + 971be3a commit b0d29b4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ScoreBasedAmbiguityResolution::computeInitialState(

for (const auto& ts : track.trackStatesReversed()) {
if (!ts.hasReferenceSurface()) {
ACTS_ERROR("Track state has no reference surface");
ACTS_DEBUG("Track state has no reference surface");
continue;
}
auto iVolume = ts.referenceSurface().geometryId().volume();
Expand Down
9 changes: 9 additions & 0 deletions Core/include/Acts/EventData/MultiTrajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ class TrackStateRange {
}
}

Iterator operator++(int) {
Iterator tmp(*this);
operator++();
return tmp;
}

bool operator==(const Iterator& other) const {
if (!proxy && !other.proxy) {
return true;
Expand All @@ -109,6 +115,9 @@ class TrackStateRange {
Iterator begin() { return m_begin; }
Iterator end() { return Iterator{std::nullopt}; }

Iterator cbegin() const { return m_begin; }
Iterator cend() const { return Iterator{std::nullopt}; }

private:
Iterator m_begin;
};
Expand Down
23 changes: 17 additions & 6 deletions Plugins/Json/src/AmbiguityConfigJsonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,26 @@ void from_json(const nlohmann::json& j, ConfigPair& p) {

detectorConfig.sharedHitsFlag = value["sharedHitsFlag"];

std::vector<double> factorHits = value["factorHits"];
std::vector<double> factorHoles = value["factorHoles"];
const std::vector<double>& goodHits = value["goodHits"];
const std::vector<double>& goodHoles = value["goodHoles"];

for (auto factor : factorHits) {
detectorConfig.factorHits.push_back(factor);
const std::vector<double>& fakeHits = value["fakeHits"];
const std::vector<double>& fakeHoles = value["fakeHoles"];

if (goodHits.size() != fakeHits.size()) {
throw std::invalid_argument("goodHits and FakeHits size mismatch");
}

for (std::size_t i = 0; i < goodHits.size(); i++) {
detectorConfig.factorHits.push_back(goodHits[i] / fakeHits[i]);
}

if (goodHoles.size() != fakeHoles.size()) {
throw std::invalid_argument("goodHoles and FakeHoles size mismatch");
}

for (auto factor : factorHoles) {
detectorConfig.factorHoles.push_back(factor);
for (std::size_t i = 0; i < goodHoles.size(); i++) {
detectorConfig.factorHoles.push_back(goodHoles[i] / fakeHoles[i]);
}

detectorConfigs.push_back(detectorConfig);
Expand Down

0 comments on commit b0d29b4

Please sign in to comment.