Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
fredevb committed Jun 20, 2024
1 parent 22b32f9 commit 8fe820f
Show file tree
Hide file tree
Showing 20 changed files with 631 additions and 556 deletions.
5 changes: 3 additions & 2 deletions Core/include/Acts/Geometry/GeometryHierarchyMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ class GeometryHierarchyMap {
/// Return the number of stored elements.
Size size() const { return m_values.size(); }

// Return the geometry identifier - value pairs (i.e., it reconstructs the input).
// Return the geometry identifier - value pairs (i.e., it reconstructs the
// input).
const std::vector<InputElement> getElements() const {
std::vector<InputElement> res;
for (std::size_t i = 0; i < size(); i++){
for (std::size_t i = 0; i < size(); i++) {
res.push_back({m_ids[i], m_values[i]});
}
return res;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class DigitizationAlgorithm final : public IAlgorithm {
/// Geometric digtizer
ActsFatras::Channelizer m_channelizer;

using CellsMap = std::map<Acts::GeometryIdentifier, std::vector<Cluster::Cell>>;
using CellsMap =
std::map<Acts::GeometryIdentifier, std::vector<Cluster::Cell>>;

ReadDataHandle<SimHitContainer> m_simContainerReadHandle{this,
"SimHitContainer"};
Expand Down
11 changes: 5 additions & 6 deletions Examples/Algorithms/Digitization/src/DigitizationAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <array>
#include <cmath>
#include <cstdint>
#include <limits>
#include <ostream>
#include <set>
#include <stdexcept>
Expand Down Expand Up @@ -153,7 +154,7 @@ ActsExamples::ProcessCode ActsExamples::DigitizationAlgorithm::execute(

// Some statistics
std::size_t skippedHits = 0;

// Some algorithms do the clusterization themselves such as the traccc chain.
// Thus we need to store the cell data from the simulation.
CellsMap cellsMap;
Expand Down Expand Up @@ -217,8 +218,6 @@ ActsExamples::ProcessCode ActsExamples::DigitizationAlgorithm::execute(
simHit, *surfacePtr, ctx.geoContext, driftDir,
cfg.segmentation, cfg.thickness);



if (!channelsRes.ok() || channelsRes->empty()) {
ACTS_DEBUG(
"Geometric channelization did not work, skipping this hit.")
Expand Down Expand Up @@ -266,7 +265,7 @@ ActsExamples::ProcessCode ActsExamples::DigitizationAlgorithm::execute(
// Store the data of the cells from the simulation.
std::vector<Cluster::Cell> cells;
for (auto& [dParameters, simhits] : digitizeParametersResult) {
for (auto cell : dParameters.cluster.channels){
for (auto cell : dParameters.cluster.channels) {
cells.push_back(std::move(cell));
}
}
Expand Down Expand Up @@ -327,9 +326,9 @@ ActsExamples::DigitizationAlgorithm::localParameters(

Acts::ActsScalar totalWeight = 0.;
Acts::Vector2 m(0., 0.);
std::size_t b0min = SIZE_MAX;
std::size_t b0min = std::numeric_limits<std::size_t>::max();
std::size_t b0max = 0;
std::size_t b1min = SIZE_MAX;
std::size_t b1min = std::numeric_limits<std::size_t>::max();
std::size_t b1max = 0;
// Combine the channels
for (const auto& ch : channels) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
// System include(s).
#include <cstdint>
#include <cstdlib>
#include <vector>
#include <map>
#include <vector>

namespace ActsExamples::Traccc::Common::Conversion {

Expand All @@ -31,4 +31,4 @@ namespace ActsExamples::Traccc::Common::Conversion {
std::map<std::uint64_t, std::vector<traccc::cell>> tracccCellsMap(
const std::map<Acts::GeometryIdentifier, std::vector<Cluster::Cell>>& map);

}
} // namespace ActsExamples::Traccc::Common::Conversion
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ namespace ActsExamples::Traccc::Common::Conversion {
traccc::digitization_config tracccConfig(
const Acts::GeometryHierarchyMap<DigiComponentsConfig>& config);

}
} // namespace ActsExamples::Traccc::Common::Conversion
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,18 @@
#include "traccc/edm/track_state.hpp"

// System include(s)
#include <memory>
#include <variant>
#include <cstdint>
#include <cstdlib>
#include <memory>
#include <variant>
#include <vector>

namespace ActsExamples::Traccc::Common::Conversion {

/// @brief Converts a traccc bound index to an Acts bound index.
/// @param tracccBoundIndex the traccc bound index.
/// @returns an Acts bound index.
Acts::BoundIndices boundIndex(
const traccc::bound_indices tracccBoundIndex);
Acts::BoundIndices boundIndex(const traccc::bound_indices tracccBoundIndex);

/// @brief Creates an Acts measurement from a traccc measurement.
/// @tparam the dimension of the Acts measurement (subspace size).
Expand Down Expand Up @@ -158,16 +157,19 @@ inline Acts::ActsVector<2> getVariance(
/// @return A vector of Acts bound variant measurements.
/// @note The type IndexSourceLink is used for the measurements' source links.
template <typename detector_t, typename allocator_t>
inline auto createActsMeasurements(const detector_t& detector, const std::vector<traccc::measurement, allocator_t>& measurements){
std::vector<Acts::BoundVariantMeasurement> measurementContainer;
for (const traccc::measurement& m : measurements)
{
Acts::GeometryIdentifier moduleGeoId(detector.surface(m.surface_link).source);
Index measurementIdx = measurementContainer.size();
IndexSourceLink idxSourceLink{moduleGeoId, measurementIdx};
measurementContainer.push_back(boundVariantMeasurement(m, Acts::SourceLink{idxSourceLink}));
}
return measurementContainer;
inline auto createActsMeasurements(
const detector_t& detector,
const std::vector<traccc::measurement, allocator_t>& measurements) {
std::vector<Acts::BoundVariantMeasurement> measurementContainer;
for (const traccc::measurement& m : measurements) {
Acts::GeometryIdentifier moduleGeoId(
detector.surface(m.surface_link).source);
Index measurementIdx = measurementContainer.size();
IndexSourceLink idxSourceLink{moduleGeoId, measurementIdx};
measurementContainer.push_back(
boundVariantMeasurement(m, Acts::SourceLink{idxSourceLink}));
}
return measurementContainer;
}

}
} // namespace ActsExamples::Traccc::Common::Conversion
Loading

0 comments on commit 8fe820f

Please sign in to comment.