File indexing completed on 2025-12-16 09:23:27
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Clusterization/Clusterization.hpp"
0012 #include "Acts/Definitions/TrackParametrization.hpp"
0013 #include "Acts/Utilities/BinUtility.hpp"
0014 #include "ActsExamples/Digitization/MeasurementCreation.hpp"
0015 #include "ActsExamples/EventData/Cluster.hpp"
0016 #include "ActsExamples/EventData/SimHit.hpp"
0017
0018 #include <cstddef>
0019 #include <set>
0020 #include <utility>
0021 #include <variant>
0022 #include <vector>
0023
0024 namespace ActsExamples {
0025 struct DigitizedParameters;
0026
0027 struct ModuleValue {
0028 std::vector<Acts::BoundIndices> paramIndices = {};
0029 std::vector<double> paramValues = {};
0030 std::vector<double> paramVariances = {};
0031 std::variant<Cluster, Cluster::Cell> value;
0032 std::set<SimHitContainer::size_type> sources = {};
0033 Acts::Ccl::Label label = {Acts::Ccl::NO_LABEL};
0034 };
0035
0036 class ModuleClusters {
0037 public:
0038 using simhit_t = SimHitContainer::size_type;
0039
0040 ModuleClusters(Acts::BinUtility segmentation,
0041 std::vector<Acts::BoundIndices> geoIndices, bool merge,
0042 double nsigma, bool commonCorner)
0043 : m_segmentation(std::move(segmentation)),
0044 m_geoIndices(std::move(geoIndices)),
0045 m_merge(merge),
0046 m_nsigma(nsigma),
0047 m_commonCorner(commonCorner) {}
0048
0049 void add(DigitizedParameters params, simhit_t simhit);
0050 std::vector<std::pair<DigitizedParameters, std::set<simhit_t>>>
0051 digitizedParameters();
0052
0053 private:
0054 Acts::BinUtility m_segmentation;
0055 std::vector<Acts::BoundIndices> m_geoIndices;
0056 std::vector<ModuleValue> m_moduleValues;
0057 bool m_merge;
0058 double m_nsigma;
0059 bool m_commonCorner;
0060
0061 std::vector<ModuleValue> createCellCollection();
0062 void merge();
0063 ModuleValue squash(std::vector<ModuleValue>& values);
0064 std::vector<std::size_t> nonGeoEntries(
0065 std::vector<Acts::BoundIndices>& indices);
0066 std::vector<std::vector<ModuleValue>> mergeParameters(
0067 std::vector<ModuleValue> values);
0068 };
0069
0070 }