ATLAS Offline Software
Loading...
Searching...
No Matches
WTAConeJetMaker.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGGEPPERF_WTACONEJETMAKER_H
6#define TRIGGEPPERF_WTACONEJETMAKER_H
7
8#include "IJetMaker.h"
9#include "Jet.h"
10#include "Cluster.h"
11
12#include "TrigGepPerf/WTAConeMaker.h" // WTAConeMaker is the core header
13#include "TrigGepPerf/WTACone2PassMaker.h" // WTACone2PassMaker is the 2-Pass header
15
16#include <string>
17#include <vector>
18#include <memory>
19
20 enum WTAConeMakerEnum{ // use WTAConeMakerEnum for algorithm variants
23};
24
25
26 namespace Gep
27 {
29 {
30 public:
31
32 WTAConeJetMaker(unsigned int block_n = 4, unsigned int rolloff_buffersize = 155) :
34 m_BlockN(block_n), m_SeedCleaningAlgo(0), m_RollOffBufferSize(rolloff_buffersize)
35 {};
36
37
38 virtual std::string toString() const override{ return "WTAConeJet"; }
39 virtual std::vector<Gep::Jet> makeJets(const std::vector<Gep::Cluster>& TopoTowers) const override; // To makeJet, m_seeds and m_consts must not be empty vectors
40
41 std::unique_ptr<WTAConeMaker> CreateWTAConeMaker(enum WTAConeMakerEnum seed_cleaning_algo) const
42 { // Allow user to choose the seed cleaning algorithm
43 switch(seed_cleaning_algo)
44 {
45 case Baseline:
46 return std::make_unique<WTAConeMaker>();
47 case TwoPass:
48 return std::make_unique<WTACone2PassMaker>();
49 }
50 return nullptr;
51 }
52
53 void SetBlockN(unsigned int block_n){m_BlockN = block_n;};
54 void SetSeedCleaningAlgo(unsigned int algo){m_SeedCleaningAlgo = algo;};
55 void SetRollOffBufferSize(int rolloff_buffersize){m_RollOffBufferSize = rolloff_buffersize;}
57
58 #ifdef FLOATING_POINT_SIMULATION
59 // Left empty on purpose
60 #else
61 // Convertors between the floating point and integer
62 WTATrigObj fTower_to_iTower(const Gep::Cluster& topotower, int idx = -99) const { // Need to convert to iTower
63 // Convert floating-point physical values to fixed-point integers
64
65 // Step 1: Scale float values to integers
66 const double pt_scaled = topotower.vec.Pt() / LSB;
67 const double m_scaled = topotower.vec.M() / LSB;
68 const double eta_scaled = (topotower.vec.Eta() + fl_ETA_MAX) / ETA_WIDTH;
69 const double phi_scaled = (topotower.vec.Phi() + fl_PHI_MAX) / PHI_WIDTH;
70
71 // Step 2: Explicitly cast to int, then construct FixedInt types
72 pt_t i_pt (static_cast<int>(pt_scaled));
73 m_t i_m (static_cast<int>(m_scaled));
74 eta_t i_eta(static_cast<int>(eta_scaled));
75 phi_t i_phi(static_cast<int>(phi_scaled));
76
77 // Step 3: Return constructed WTATrigObj
78 return WTATrigObj(i_pt, i_eta, i_phi, i_m, idx);
79 }
80 Gep::Jet iJet_to_fJet(const WTAJet &iJet) const { // Need to convert to fJet
81
82 // Step 1: Extract raw integer values from FixedInt
83 #ifdef BITWISE_SIMULATION
84 const double f_pt = static_cast<double>(iJet.pt().raw()) * LSB;
85 const double f_m = static_cast<double>(iJet.m().raw()) * LSB;
86 const double f_eta = static_cast<double>(iJet.eta().raw()) * ETA_WIDTH - fl_ETA_MAX;
87 const double f_phi = static_cast<double>(iJet.phi().raw()) * PHI_WIDTH - fl_PHI_MAX;
88 #elif defined(INTEGER_SIMULATION)
89 const double f_pt = static_cast<double>(iJet.pt()) * LSB;
90 const double f_m = static_cast<double>(iJet.m()) * LSB;
91 const double f_eta = static_cast<double>(iJet.eta()) * ETA_WIDTH - fl_ETA_MAX;
92 const double f_phi = static_cast<double>(iJet.phi()) * PHI_WIDTH - fl_PHI_MAX;
93 #endif
94
95 // Step 2: Construct and return floating-point Gep::Jet
96 Gep::Jet fJet;
97 fJet.vec.SetPtEtaPhiM(f_pt, f_eta, f_phi, f_m);
98
99 // Step 3: Include the ERing information and return floating-point Gep::Jet
100 WTA4JetERingInfo ering_info = iJet.GetERingInfo();
101 #ifdef BITWISE_SIMULATION
102 fJet.ring0_Et = static_cast<double>(ering_info.ring0_Et.raw()) * LSB;
103 fJet.ring1_Et = static_cast<double>(ering_info.ring1_Et.raw()) * LSB;
104 fJet.ring2_Et = static_cast<double>(ering_info.ring2_Et.raw()) * LSB;
105 fJet.ring3_Et = static_cast<double>(ering_info.ring3_Et.raw()) * LSB;
106 fJet.ring4_Et = static_cast<double>(ering_info.ring4_Et.raw()) * LSB;
107 #elif defined(INTEGER_SIMULATION)
108 fJet.ring0_Et = static_cast<double>(ering_info.ring0_Et) * LSB;
109 fJet.ring1_Et = static_cast<double>(ering_info.ring1_Et) * LSB;
110 fJet.ring2_Et = static_cast<double>(ering_info.ring2_Et) * LSB;
111 fJet.ring3_Et = static_cast<double>(ering_info.ring3_Et) * LSB;
112 fJet.ring4_Et = static_cast<double>(ering_info.ring4_Et) * LSB;
113 #endif
114 fJet.total_TobN = ering_info.total_TobN;
115 fJet.ring0_TobN = ering_info.ring0_TobN;
116 fJet.ring1_TobN = ering_info.ring1_TobN;
117 fJet.ring2_TobN = ering_info.ring2_TobN;
118 fJet.ring3_TobN = ering_info.ring3_TobN;
119 fJet.ring4_TobN = ering_info.ring4_TobN;
120 return fJet;
121 }
122 #endif
123
125
126 private:
127 // WTAConeParallelHelper m_WTAParallelHelper;
128 unsigned int m_BlockN{};
129 unsigned int m_SeedCleaningAlgo{};
130 unsigned int m_RollOffBufferSize{}; // Only for TwoPass
131
132 };
133
134 }
135
136 #endif //TRIGL0GEPPERF_EXCONEJETMAKER_H
137
WTAConeMakerEnum
@ TwoPass
@ Baseline
const float fl_ETA_MAX
Definition WTASimTypes.h:10
const float fl_PHI_MAX
Definition WTASimTypes.h:11
virtual std::string toString() const override
virtual std::vector< Gep::Jet > makeJets(const std::vector< Gep::Cluster > &TopoTowers) const override
unsigned int m_SeedCleaningAlgo
WTAParameters m_GEPWTAParameters
WTATrigObj fTower_to_iTower(const Gep::Cluster &topotower, int idx=-99) const
Gep::Jet iJet_to_fJet(const WTAJet &iJet) const
unsigned int m_RollOffBufferSize
void SetRollOffBufferSize(int rolloff_buffersize)
void SetBlockN(unsigned int block_n)
void SetSeedCleaningAlgo(unsigned int algo)
WTAConeJetMaker(unsigned int block_n=4, unsigned int rolloff_buffersize=155)
std::unique_ptr< WTAConeMaker > CreateWTAConeMaker(enum WTAConeMakerEnum seed_cleaning_algo) const
const WTA4JetERingInfo & GetERingInfo() const
Definition WTAObject.h:176
eta_t eta() const
Definition WTAObject.h:33
phi_t phi() const
Definition WTAObject.h:35
pt_t pt() const
Definition WTAObject.h:31
m_t m() const
Definition WTAObject.h:37
ring4_tobn_t ring4_TobN
Definition WTAObject.h:147
ring1_tobn_t ring1_TobN
Definition WTAObject.h:144
ring2_tobn_t ring2_TobN
Definition WTAObject.h:145
ring0_tobn_t ring0_TobN
Definition WTAObject.h:143
ring3_tobn_t ring3_TobN
Definition WTAObject.h:146