Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 08:22:57

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 "ActsExamples/EventData/Index.hpp"
0012 #include "ActsExamples/EventData/SimHit.hpp"
0013 #include "ActsExamples/EventData/SimParticle.hpp"
0014 #include "ActsExamples/EventData/SimVertex.hpp"
0015 #include "ActsExamples/EventData/Track.hpp"
0016 
0017 #include <cstdint>
0018 #include <map>
0019 #include <optional>
0020 #include <vector>
0021 
0022 namespace ActsExamples {
0023 
0024 using MeasurementSimHitsMap = IndexMultimap<SimHitIndex>;
0025 using MeasurementParticlesMap = IndexMultimap<SimBarcode>;
0026 
0027 using SimHitMeasurementsMap = InverseMultimap<SimHitIndex>;
0028 using ParticleMeasurementsMap = InverseMultimap<SimBarcode>;
0029 
0030 enum class TrackMatchClassification {
0031   Unknown = 0,
0032   /// The track is associated to a truth particle
0033   Matched,
0034   /// The track is associated to a truth particle, but the track is not unique
0035   Duplicate,
0036   /// The track cannot be uniquely associated to a truth particle
0037   Fake,
0038 };
0039 
0040 /// Associate a particle to its hit count within a proto track.
0041 struct ParticleHitCount {
0042   SimBarcode particleId{};
0043   std::size_t hitCount{};
0044 };
0045 
0046 struct TrackMatchEntry {
0047   TrackMatchClassification classification{TrackMatchClassification::Unknown};
0048 
0049   std::optional<SimBarcode> particle;
0050 
0051   /// Number of hits on the track that are associated to a particle
0052   /// Sorted by decreasing number of hits
0053   std::vector<ParticleHitCount> contributingParticles;
0054 };
0055 
0056 struct ParticleMatchEntry {
0057   std::optional<TrackIndexType> track;
0058   std::uint32_t duplicates{};
0059   std::uint32_t fakes{};
0060 };
0061 
0062 using TrackParticleMatching = std::map<TrackIndexType, TrackMatchEntry>;
0063 using ParticleTrackMatching = std::map<SimBarcode, ParticleMatchEntry>;
0064 
0065 enum class RecoVertexClassification {
0066   Unknown = 0,
0067   Clean,
0068   Merged,
0069   Split,
0070 };
0071 
0072 struct VertexToTruthMatching {
0073   std::optional<SimVertexBarcode> vertexId;
0074   double totalTrackWeight{};
0075   double truthMajorityTrackWeights{};
0076   double matchFraction{};
0077 
0078   RecoVertexClassification classification{RecoVertexClassification::Unknown};
0079 };
0080 
0081 struct VertexToRecoMatching {
0082   std::size_t recoIndex{};
0083 
0084   double recoSumPt2{};
0085 };
0086 
0087 using VertexTruthMatching = std::vector<VertexToTruthMatching>;
0088 using TruthVertexMatching = std::map<SimVertexBarcode, VertexToRecoMatching>;
0089 
0090 }  // namespace ActsExamples