File indexing completed on 2026-06-22 08:01:21
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 "ActsFatras/EventData/Barcode.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<ActsFatras::Barcode>& 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<ActsFatras::Barcode>& constituents() const {
0109 return m_constituents;
0110 }
0111
0112
0113
0114 void setAssociatedTracks(
0115 const std::vector<Acts::AnyConstTrackProxy>& associatedTracks) {
0116 m_associatedTracks = associatedTracks;
0117 }
0118
0119
0120
0121 const std::vector<Acts::AnyConstTrackProxy>& associatedTracks() const {
0122 return m_associatedTracks;
0123 }
0124
0125 private:
0126
0127 std::vector<ActsFatras::Barcode> m_constituents;
0128
0129 std::vector<int> m_constituentIndices;
0130
0131 std::vector<Acts::AnyConstTrackProxy> m_associatedTracks;
0132 };
0133
0134
0135 class TrackJet : public Jet {
0136 public:
0137
0138
0139
0140 explicit TrackJet(const Acts::Vector4& fourMom, const JetLabel& label)
0141 : Jet(fourMom, label) {}
0142
0143
0144
0145 void setConstituents(
0146 const std::vector<Acts::AnyConstTrackProxy>& constituents) {
0147 m_constituents = constituents;
0148 }
0149
0150
0151
0152 const std::vector<Acts::AnyConstTrackProxy>& constituents() const {
0153 return m_constituents;
0154 }
0155
0156 private:
0157
0158 std::vector<Acts::AnyConstTrackProxy> m_constituents;
0159 };
0160
0161
0162 }