File indexing completed on 2026-03-28 07:45:56
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/EventData/AnyTrackProxy.hpp"
0013 #include "ActsExamples/EventData/SimParticle.hpp"
0014
0015 #include <vector>
0016
0017 namespace ActsExamples {
0018
0019
0020
0021 enum class JetLabel {
0022 Unknown = 0,
0023 BJet = 5,
0024 CJet = 4,
0025 LightJet = 1,
0026 };
0027
0028
0029
0030
0031
0032 inline std::ostream& operator<<(std::ostream& os, const JetLabel& label) {
0033 switch (label) {
0034 case JetLabel::Unknown:
0035 os << "Unknown";
0036 break;
0037 case JetLabel::BJet:
0038 os << "BJet";
0039 break;
0040 case JetLabel::CJet:
0041 os << "CJet";
0042 break;
0043 case JetLabel::LightJet:
0044 os << "LightJet";
0045 break;
0046 default:
0047 os << "InvalidJetLabel";
0048 break;
0049 }
0050 return os;
0051 }
0052
0053
0054 class Jet {
0055 public:
0056
0057
0058
0059 Jet(const Acts::Vector4& fourMom, const JetLabel& label)
0060 : m_fourMomentum{fourMom}, m_jetLabel{label} {}
0061
0062
0063
0064 Acts::Vector4 fourMomentum() const { return m_fourMomentum; }
0065
0066
0067
0068 JetLabel jetLabel() const { return m_jetLabel; }
0069
0070
0071
0072 void setJetLabel(const JetLabel& label) { m_jetLabel = label; }
0073
0074 private:
0075 Acts::Vector4 m_fourMomentum{Acts::Vector4::Zero()};
0076 JetLabel m_jetLabel{JetLabel::Unknown};
0077
0078 friend std::ostream& operator<<(std::ostream& os, const Jet& jet) {
0079 os << "Jet 4-momentum: " << jet.fourMomentum().transpose() << std::endl;
0080 os << "Jet label: " << jet.jetLabel() << std::endl;
0081 return os;
0082 }
0083 };
0084
0085
0086 class TruthJet : public Jet {
0087 public:
0088
0089
0090
0091 TruthJet(const Acts::Vector4& fourMom, const JetLabel& label)
0092 : Jet(fourMom, label) {}
0093
0094
0095
0096 void setConstituents(const std::vector<SimBarcode>& constituents) {
0097 m_constituents = constituents;
0098 }
0099
0100
0101
0102 void setConstituentIndices(const std::vector<int>& indices) {
0103 m_constituentIndices = indices;
0104 }
0105
0106
0107
0108 const std::vector<SimBarcode>& constituents() const { return m_constituents; }
0109
0110
0111
0112 void setAssociatedTracks(
0113 const std::vector<Acts::AnyConstTrackProxy>& associatedTracks) {
0114 m_associatedTracks = associatedTracks;
0115 }
0116
0117
0118
0119 const std::vector<Acts::AnyConstTrackProxy>& associatedTracks() const {
0120 return m_associatedTracks;
0121 }
0122
0123 private:
0124
0125 std::vector<SimBarcode> m_constituents;
0126
0127 std::vector<int> m_constituentIndices;
0128
0129 std::vector<Acts::AnyConstTrackProxy> m_associatedTracks;
0130 };
0131
0132
0133 class TrackJet : public Jet {
0134 public:
0135
0136
0137
0138 explicit TrackJet(const Acts::Vector4& fourMom, const JetLabel& label)
0139 : Jet(fourMom, label) {}
0140
0141
0142
0143 void setConstituents(
0144 const std::vector<Acts::AnyConstTrackProxy>& constituents) {
0145 m_constituents = constituents;
0146 }
0147
0148
0149
0150 const std::vector<Acts::AnyConstTrackProxy>& constituents() const {
0151 return m_constituents;
0152 }
0153
0154 private:
0155
0156 std::vector<Acts::AnyConstTrackProxy> m_constituents;
0157 };
0158
0159
0160 }