Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-11 08:04:29

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2021 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "ActsFatras/Digitization/Segmentizer.hpp"
0012 
0013 #include <numeric>
0014 #include <optional>
0015 #include <vector>
0016 
0017 namespace ActsExamples {
0018 
0019 /// Simple struct holding cluster information.
0020 struct Cluster {
0021   using Cell = ActsFatras::Segmentizer::ChannelSegment;
0022   std::size_t sizeLoc0 = 0;
0023   std::size_t sizeLoc1 = 0;
0024   std::vector<Cell> channels;
0025 
0026   // TODO make this be provided by Fatras?
0027   Acts::Vector3 globalPosition = Acts::Vector3::Zero();
0028 
0029   double sumActivations() const {
0030     return std::accumulate(
0031         channels.begin(), channels.end(), 0.0,
0032         [](double s, const Cluster::Cell& c) { return s + c.activation; });
0033   }
0034 };
0035 
0036 /// Clusters have a one-to-one relation with measurements
0037 using ClusterContainer = std::vector<Cluster>;
0038 
0039 }  // namespace ActsExamples