forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into kalman-refactor
- Loading branch information
Showing
166 changed files
with
8,894 additions
and
701 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
Binary file not shown.
Binary file modified
BIN
+409 Bytes
(100%)
CI/physmon/reference/performance_amvf_gridseeder_ttbar_hist.root
Binary file not shown.
Binary file modified
BIN
-840 Bytes
(98%)
CI/physmon/reference/performance_amvf_truth_estimated_hist.root
Binary file not shown.
Binary file modified
BIN
-1.05 KB
(97%)
CI/physmon/reference/performance_amvf_truth_smeared_hist.root
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-312 Bytes
(99%)
CI/physmon/reference/performance_ivf_truth_estimated_hist.root
Binary file not shown.
Binary file modified
BIN
-515 Bytes
(99%)
CI/physmon/reference/performance_ivf_truth_smeared_hist.root
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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,155 @@ | ||
// 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/Definitions/Algebra.hpp" | ||
#include "Acts/Definitions/Common.hpp" | ||
#include "Acts/Geometry/VolumeBounds.hpp" | ||
#include "Acts/Utilities/BinningData.hpp" | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace Acts { | ||
namespace Experimental { | ||
|
||
class IInternalStructureBuilder; | ||
|
||
/// A Blueprint is an instruction tree that allows you to defina a tree sequence | ||
/// of volume building using the provided tools. | ||
/// | ||
/// It follows tree nomenclature and can define: | ||
/// | ||
/// - a root node (the top of the tree) | ||
/// - a branch node (also called inner node) | ||
/// - leaf node (also called terminal node) | ||
/// | ||
/// Leaf nodes can have internal builders attached, while all the external | ||
/// builders will be created when the blueprint is interpreted. | ||
namespace Blueprint { | ||
|
||
struct Node final { | ||
/// Branch constructor | ||
/// | ||
/// @param n name of the node | ||
/// @param t the transform | ||
/// @param bt the boundary type | ||
/// @param bv the boundary values | ||
/// @param bss the binning values | ||
/// @param cs the children of the node | ||
Node(const std::string& n, const Transform3& t, VolumeBounds::BoundsType bt, | ||
const std::vector<ActsScalar>& bv, const std::vector<BinningValue>& bss, | ||
std::vector<std::unique_ptr<Node>> cs = {}) | ||
: name(n), | ||
transform(t), | ||
boundsType(bt), | ||
boundaryValues(bv), | ||
children(std::move(cs)), | ||
binning(bss) { | ||
for_each(children.begin(), children.end(), | ||
[this](std::unique_ptr<Node>& c) { c->parent = this; }); | ||
} | ||
|
||
/// Leaf constructor | ||
/// | ||
/// @param n name of the node | ||
/// @param t the transform | ||
/// @param bt the boundary type | ||
/// @param bv the boundary values | ||
/// @param isb the internal structure builder (optional) | ||
Node(const std::string& n, const Transform3& t, VolumeBounds::BoundsType bt, | ||
const std::vector<ActsScalar>& bv, | ||
std::shared_ptr<const IInternalStructureBuilder> isb = nullptr) | ||
: name(n), | ||
transform(t), | ||
boundsType(bt), | ||
boundaryValues(bv), | ||
internalsBuilder(std::move(isb)) {} | ||
|
||
/// Name identification of this node | ||
std::string name = ""; | ||
/// Transform definition of this node | ||
Transform3 transform = Transform3::Identity(); | ||
/// Boundary definition of this node | ||
VolumeBounds::BoundsType boundsType = VolumeBounds::eOther; | ||
/// The boundary type | ||
std::vector<ActsScalar> boundaryValues = {}; | ||
/// Parent node - nullptr for root only | ||
const Node* parent = nullptr; | ||
/// Branch definitions: children | ||
std::vector<std::unique_ptr<Node>> children = {}; | ||
/// Branch definition binning | ||
std::vector<BinningValue> binning = {}; | ||
/// Internal structure builder - for leaf nodes | ||
std::shared_ptr<const IInternalStructureBuilder> internalsBuilder = nullptr; | ||
|
||
/// @brief Check if it is a leaf node | ||
bool isLeaf() const { return children.empty(); } | ||
|
||
/// @brief Check is it is a root | ||
bool isRoot() const { return parent == nullptr; } | ||
|
||
/// @brief Method to add a child to this branch | ||
/// @param c the child to be added | ||
void add(std::unique_ptr<Node> c) { | ||
c->parent = this; | ||
children.push_back(std::move(c)); | ||
} | ||
|
||
/// @brief Turn into a dot output | ||
template <typename stream_type> | ||
void dotStream(stream_type& ss, | ||
const std::string& graphName = "blueprint") const { | ||
if (isRoot()) { | ||
ss << "digraph " << graphName << " {" << '\n'; | ||
ss << name | ||
<< " [shape=\"circle\";style=\"filled\";fillcolor=\"darkorange\"];" | ||
<< '\n'; | ||
|
||
} else if (isLeaf()) { | ||
std::string color = | ||
(internalsBuilder != nullptr) ? "darkolivegreen1" : "darkolivegreen3"; | ||
|
||
ss << name << " [shape=\"box\";style=\"filled\";fillcolor=\""; | ||
ss << color << "\"];" << '\n'; | ||
} else { | ||
ss << name << " [shape=\"diamond\"];" << '\n'; | ||
} | ||
|
||
ss << name << " [label=\"" << name << "\"];" << '\n'; | ||
for (const auto& c : children) { | ||
ss << name << " -> " << c->name << ";" << '\n'; | ||
c->dotStream(ss); | ||
} | ||
if (children.empty()) { | ||
ss << name + "_shape" | ||
<< " [shape=\"cylinder\";style=\"filled\";fillcolor=\"lightgrey\"];" | ||
<< '\n'; | ||
ss << name << " -> " << name + "_shape" | ||
<< ";" << '\n'; | ||
} | ||
|
||
if (internalsBuilder != nullptr) { | ||
ss << name + "_int" | ||
<< " [shape=\"doubleoctagon\";style=\"filled\";fillcolor=" | ||
"\"cadetblue1\"];" | ||
<< '\n'; | ||
ss << name << " -> " << name + "_int" | ||
<< ";" << '\n'; | ||
} | ||
if (isRoot()) { | ||
ss << "}" << '\n'; | ||
} | ||
} | ||
}; | ||
|
||
} // namespace Blueprint | ||
} // namespace Experimental | ||
} // namespace Acts |
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,38 @@ | ||
// 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/Detector/Blueprint.hpp" | ||
#include "Acts/Utilities/BinningData.hpp" | ||
|
||
namespace Acts { | ||
|
||
namespace Experimental { | ||
|
||
namespace detail { | ||
namespace BlueprintHelper { | ||
|
||
/// @brief Sort the nodes in the blueprint container node | ||
/// | ||
/// @param node the node for which the children should be sorted | ||
/// @param recursive if the sorting should be done recursively to children | ||
void sort(Blueprint::Node& node, bool recursive = true); | ||
|
||
/// @brief Fill the gaps in the blueprint container node | ||
/// | ||
/// @param node the node for with the gaps should be filled | ||
/// @param adjustToParent nodes, if nodes should be adjusted to parent | ||
/// | ||
/// @note currently only cylindrical volumes are supported | ||
void fillGaps(Blueprint::Node& node, bool adjustToParent = true); | ||
|
||
} // namespace BlueprintHelper | ||
} // namespace detail | ||
} // namespace Experimental | ||
} // namespace Acts |
Oops, something went wrong.