Back to home page

EIC code displayed by LXR

 
 

    


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

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/Definitions/Algebra.hpp"
0012 #include "ActsFatras/Digitization/Segmentizer.hpp"
0013 
0014 #include <numeric>
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   Acts::Vector3 localDirection = Acts::Vector3::Zero();
0029   Acts::Vector3 lengthDirection = Acts::Vector3::Zero();
0030   float localEta = 0.f;
0031   float localPhi = 0.f;
0032   float globalEta = 0.f;
0033   float globalPhi = 0.f;
0034   float etaAngle = 0.f;
0035   float phiAngle = 0.f;
0036 
0037   double sumActivations() const {
0038     return std::accumulate(
0039         channels.begin(), channels.end(), 0.0,
0040         [](double s, const Cluster::Cell& c) { return s + c.activation; });
0041   }
0042 };
0043 
0044 /// Clusters have a one-to-one relation with measurements
0045 using ClusterContainer = std::vector<Cluster>;
0046 
0047 }  // namespace ActsExamples