Skip to content

Commit

Permalink
Merge branch 'main' into mockup-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
noemina authored Apr 12, 2023
2 parents d1275d6 + fcdc820 commit ec0ef9b
Show file tree
Hide file tree
Showing 72 changed files with 2,553 additions and 361 deletions.
Binary file modified CI/physmon/reference/performance_ambi_orthogonal.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ambi_seeded.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_orthogonal.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_seeded.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_truth_estimated.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_ckf_truth_smeared.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_gsf.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_seeding_orthogonal.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_seeding_seeded.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_seeding_truth_estimated.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_truth_tracking.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_vertexing_orthogonal_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_vertexing_seeded_hist.root
Binary file not shown.
Binary file not shown.
Binary file modified CI/physmon/reference/performance_vertexing_truth_smeared_hist.root
Binary file not shown.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ option(ACTS_BUILD_PLUGIN_JSON "Build json plugin" OFF)
option(ACTS_USE_SYSTEM_NLOHMANN_JSON "Use nlohmann::json provided by the system instead of the bundled version" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_BUILD_PLUGIN_LEGACY "Build legacy plugin" OFF)
option(ACTS_BUILD_PLUGIN_ONNX "Build ONNX plugin" OFF)
option(ACTS_BUILD_PLUGIN_MLPACK "Build MLpack plugin" OFF)
option(ACTS_SETUP_VECMEM "Explicitly set up vecmem for the project" OFF)
option(ACTS_USE_SYSTEM_VECMEM "Use a system-provided vecmem installation" ${ACTS_USE_SYSTEM_LIBS})
option(ACTS_BUILD_PLUGIN_SYCL "Build SYCL plugin" OFF)
Expand Down Expand Up @@ -181,6 +182,7 @@ set(_acts_eigen3_version 3.3.7)
set(_acts_hepmc3_version 3.2.1)
set(_acts_nlohmanjson_version 3.2.0)
set(_acts_onnxruntime_version 1.12.0)
set(_acts_mlpack_version 3.1.1)
set(_acts_root_version 6.20)
set(_acts_tbb_version 2020.1)

Expand Down Expand Up @@ -292,6 +294,10 @@ endif()
if(ACTS_BUILD_PLUGIN_ONNX)
find_package(OnnxRuntime ${_acts_onnxruntime_version} REQUIRED)
endif()
if(ACTS_BUILD_PLUGIN_MLPACK)
find_package(mlpack ${_acts_mlpack_version} REQUIRED)
include_directories(SYSTEM ${mlpack_INCLUDE_DIR})
endif()
if(ACTS_BUILD_PLUGIN_SYCL)
find_package(SYCL REQUIRED)
endif()
Expand Down
291 changes: 291 additions & 0 deletions Core/include/Acts/Detector/GridAxisGenerators.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
// This file is part of the Acts project.
//
// Copyright (C) 2023 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#pragma once

#include "Acts/Utilities/detail/Axis.hpp"
#include "Acts/Utilities/detail/Grid.hpp"

#include <array>
#include <tuple>
#include <vector>

namespace Acts {
namespace Experimental {

/// Axis generators are used to allow defining different grid types
/// for indexed geometry objects.
namespace GridAxisGenerators {

/// @brief Templated base generator for equidistant axis as a tuple - 1D
///
/// @tparam aType the type of the axis (Bound, Closed, Open)
template <detail::AxisBoundaryType aType>
struct Eq {
/// Broadcast the return_type
using return_type =
std::tuple<detail::Axis<detail::AxisType::Equidistant, aType>>;

/// Broadcast the grid type
template <typename T>
using grid_type =
detail::Grid<T, detail::Axis<detail::AxisType::Equidistant, aType>>;

std::array<ActsScalar, 2u> range = {};
std::size_t nBins = 0u;

/// Call operator that generates the Axis
return_type operator()() const {
detail::Axis<detail::AxisType::Equidistant, aType> eAxis(range[0u],
range[1u], nBins);
return {eAxis};
}
};

// All 1D equidistant options
using EqBound = Eq<detail::AxisBoundaryType::Bound>;
using EqOpen = Eq<detail::AxisBoundaryType::Open>;
using EqClosed = Eq<detail::AxisBoundaryType::Closed>;

/// @brief Templated base generator for vairable axis as a tuple - 1D
///
/// @tparam aType the type of the axis (Bound, Closed, Open)
template <detail::AxisBoundaryType aType>
struct Var {
/// Broadcast the return_type
using return_type =
std::tuple<detail::Axis<detail::AxisType::Variable, aType>>;

/// Broadcast the grid type
template <typename T>
using grid_type =
detail::Grid<T, detail::Axis<detail::AxisType::Variable, aType>>;

std::vector<ActsScalar> edges = {};

/// Call operator that generates the Axis
return_type operator()() const {
detail::Axis<detail::AxisType::Variable, aType> vAxis(edges);
return {vAxis};
}
};

// All 1D variable options
using VarBound = Var<detail::AxisBoundaryType::Bound>;
using VarOpen = Var<detail::AxisBoundaryType::Open>;
using VarClosed = Var<detail::AxisBoundaryType::Closed>;

/// @brief Templated base generator for two equidistant axes as a tuple - 2D
///
/// @tparam aType the type of the first axis (Bound, Closed, Open)
/// @tparam bType the type of the second axis (Bound, Closed, Open)
///
template <detail::AxisBoundaryType aType, detail::AxisBoundaryType bType>
struct EqEq {
/// Broadcast the return_type
using return_type =
std::tuple<detail::Axis<detail::AxisType::Equidistant, aType>,
detail::Axis<detail::AxisType::Equidistant, bType>>;

/// Broadcast the grid type
template <typename T>
using grid_type =
detail::Grid<T, detail::Axis<detail::AxisType::Equidistant, aType>,
detail::Axis<detail::AxisType::Equidistant, bType>>;

std::array<ActsScalar, 2u> range0 = {};
std::size_t nBins0 = 0u;
std::array<ActsScalar, 2u> range1 = {};
std::size_t nBins1 = 1u;

/// Call operator that generates the Axis
return_type operator()() const {
// Create the two axis
detail::Axis<detail::AxisType::Equidistant, aType> aEq(range0[0u],
range0[1u], nBins0);
detail::Axis<detail::AxisType::Equidistant, bType> bEq(range1[0u],
range1[1u], nBins1);
return std::tie(aEq, bEq);
}
};

// All 2D EqEq options
using EqBoundEqBound =
EqEq<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Bound>;
using EqBoundEqOpen =
EqEq<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Open>;
using EqBoundEqClosed =
EqEq<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Closed>;
using EqOpenEqBound =
EqEq<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Bound>;
using EqOpenEqOpen =
EqEq<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Open>;
using EqOpenEqClosed =
EqEq<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Closed>;
using EqClosedEqBound =
EqEq<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Bound>;
using EqClosedEqOpen =
EqEq<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Open>;
using EqClosedEqClosed =
EqEq<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Closed>;

/// @brief Templated base generator for equidistant / variable axes as a tuple - 2D
///
/// @tparam aType the type of the first axis (Bound, Closed, Open)
/// @tparam bType the type of the second axis (Bound, Closed, Open)
///
template <detail::AxisBoundaryType aType, detail::AxisBoundaryType bType>
struct EqVar {
/// Broadcast the return_type
using return_type =
std::tuple<detail::Axis<detail::AxisType::Equidistant, aType>,
detail::Axis<detail::AxisType::Variable, bType>>;

/// Broadcast the grid type
template <typename T>
using grid_type =
detail::Grid<T, detail::Axis<detail::AxisType::Equidistant, aType>,
detail::Axis<detail::AxisType::Variable, bType>>;

std::array<ActsScalar, 2u> range = {};
std::size_t nBins = 0u;
std::vector<ActsScalar> edges = {};

/// Call operator that generates the Axis
return_type operator()() const {
detail::Axis<detail::AxisType::Equidistant, aType> eqA(range[0u], range[1u],
nBins);
detail::Axis<detail::AxisType::Variable, bType> varB(edges);
return std::tie(eqA, varB);
}
};

// All 2D EqVar options
using EqBoundVarBound =
EqVar<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Bound>;
using EqBoundVarOpen =
EqVar<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Open>;
using EqBoundVarClosed =
EqVar<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Closed>;
using EqOpenVarBound =
EqVar<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Bound>;
using EqOpenVarOpen =
EqVar<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Open>;
using EqOpenVarClosed =
EqVar<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Closed>;
using EqClosedVarBound =
EqVar<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Bound>;
using EqClosedVarOpen =
EqVar<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Open>;
using EqClosedVarClosed =
EqVar<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Closed>;

/// @brief Templated base generator for a variable, equidistant axes tuple - 2D
///
/// @tparam aType the type of the first axis (Bound, Closed, Open)
/// @tparam bType the type of the second axis (Bound, Closed, Open)
///
template <detail::AxisBoundaryType aType, detail::AxisBoundaryType bType>
struct VarEq {
/// Broadcast the return_type
using return_type =
std::tuple<detail::Axis<detail::AxisType::Variable, aType>,
detail::Axis<detail::AxisType::Equidistant, bType>>;

/// Broadcast the grid type
template <typename T>
using grid_type =
detail::Grid<T, detail::Axis<detail::AxisType::Variable, aType>,
detail::Axis<detail::AxisType::Equidistant, bType>>;

std::vector<ActsScalar> edges = {};
std::array<ActsScalar, 2u> range = {};
std::size_t nBins = 0u;

/// Call operator that generates the Axis
return_type operator()() const {
detail::Axis<detail::AxisType::Variable, aType> varA(edges);
detail::Axis<detail::AxisType::Equidistant, bType> eqB(range[0u], range[1u],
nBins);
return std::tie(varA, eqB);
}
};

// All 2D VarEq options
using VarBoundEqBound =
VarEq<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Bound>;
using VarBoundEqOpen =
VarEq<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Open>;
using VarBoundEqClosed =
VarEq<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Closed>;
using VarOpenEqBound =
VarEq<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Bound>;
using VarOpenEqOpen =
VarEq<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Open>;
using VarOpenEqClosed =
VarEq<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Closed>;
using VarClosedEqBound =
VarEq<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Bound>;
using VarClosedEqOpen =
VarEq<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Open>;
using VarClosedEqClosed =
VarEq<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Closed>;

/// @brief Templated base generator for a two variable axes tuple - 2D
///
/// @tparam aType the type of the first axis (Bound, Closed, Open)
/// @tparam bType the type of the second axis (Bound, Closed, Open)
///
template <detail::AxisBoundaryType aType, detail::AxisBoundaryType bType>
struct VarVar {
/// Broadcast the return_type
using return_type =
std::tuple<detail::Axis<detail::AxisType::Variable, aType>,
detail::Axis<detail::AxisType::Variable, bType>>;

/// Broadcast the grid type
template <typename T>
using grid_type =
detail::Grid<T, detail::Axis<detail::AxisType::Variable, aType>,
detail::Axis<detail::AxisType::Variable, bType>>;

std::vector<ActsScalar> edges0 = {};
std::vector<ActsScalar> edges1 = {};

/// Call operator that generates the Axis
return_type operator()() const {
detail::Axis<detail::AxisType::Variable, aType> varA(edges0);
detail::Axis<detail::AxisType::Variable, bType> varB(edges1);
return std::tie(varA, varB);
}
};

// All 2D VarVar options
using VarBoundVarBound =
VarVar<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Bound>;
using VarBoundVarOpen =
VarVar<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Open>;
using VarBoundVarClosed =
VarVar<detail::AxisBoundaryType::Bound, detail::AxisBoundaryType::Closed>;
using VarOpenVarBound =
VarVar<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Bound>;
using VarOpenVarOpen =
VarVar<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Open>;
using VarOpenVarClosed =
VarVar<detail::AxisBoundaryType::Open, detail::AxisBoundaryType::Closed>;
using VarClosedVarBound =
VarVar<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Bound>;
using VarClosedVarOpen =
VarVar<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Open>;
using VarClosedVarClosed =
VarVar<detail::AxisBoundaryType::Closed, detail::AxisBoundaryType::Closed>;

} // namespace GridAxisGenerators

} // namespace Experimental
} // namespace Acts
Loading

0 comments on commit ec0ef9b

Please sign in to comment.