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