Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:34

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Clusterization/Clusterization.hpp"
0012 #include "Acts/Definitions/Algebra.hpp"
0013 #include "Acts/Definitions/TrackParametrization.hpp"
0014 #include "Acts/Utilities/BinUtility.hpp"
0015 #include "ActsExamples/Digitization/MeasurementCreation.hpp"
0016 #include "ActsExamples/EventData/Cluster.hpp"
0017 #include "ActsExamples/EventData/SimHit.hpp"
0018 
0019 #include <cstddef>
0020 #include <set>
0021 #include <utility>
0022 #include <variant>
0023 #include <vector>
0024 
0025 namespace ActsExamples {
0026 struct DigitizedParameters;
0027 
0028 struct ModuleValue {
0029   std::vector<Acts::BoundIndices> paramIndices = {};
0030   std::vector<double> paramValues = {};
0031   std::vector<double> paramVariances = {};
0032   std::variant<Cluster, Cluster::Cell> value;
0033   std::set<SimHitContainer::size_type> sources = {};
0034   Acts::Ccl::Label label = {Acts::Ccl::NO_LABEL};
0035 };
0036 
0037 class ModuleClusters {
0038  public:
0039   using simhit_t = SimHitContainer::size_type;
0040 
0041   ModuleClusters(Acts::BinUtility segmentation,
0042                  std::vector<Acts::BoundIndices> geoIndices, bool merge,
0043                  double nsigma, bool commonCorner)
0044       : m_segmentation(std::move(segmentation)),
0045         m_geoIndices(std::move(geoIndices)),
0046         m_merge(merge),
0047         m_nsigma(nsigma),
0048         m_commonCorner(commonCorner) {}
0049 
0050   void add(DigitizedParameters params, simhit_t simhit);
0051   std::vector<std::pair<DigitizedParameters, std::set<simhit_t>>>
0052   digitizedParameters();
0053 
0054  private:
0055   Acts::BinUtility m_segmentation;
0056   std::vector<Acts::BoundIndices> m_geoIndices;
0057   std::vector<ModuleValue> m_moduleValues;
0058   bool m_merge;
0059   double m_nsigma;
0060   bool m_commonCorner;
0061 
0062   std::vector<ModuleValue> createCellCollection();
0063   void merge();
0064   ModuleValue squash(std::vector<ModuleValue>& values);
0065   std::vector<std::size_t> nonGeoEntries(
0066       std::vector<Acts::BoundIndices>& indices);
0067   std::vector<std::vector<ModuleValue>> mergeParameters(
0068       std::vector<ModuleValue> values);
0069 };
0070 
0071 }  // namespace ActsExamples