ATLAS Offline Software
Loading...
Searching...
No Matches
Gep::WTAConeJetMaker Class Reference

#include <WTAConeJetMaker.h>

Inheritance diagram for Gep::WTAConeJetMaker:
Collaboration diagram for Gep::WTAConeJetMaker:

Public Member Functions

 WTAConeJetMaker (unsigned int block_n=4, unsigned int rolloff_buffersize=155)
virtual std::string toString () const override
virtual std::vector< Gep::JetmakeJets (const std::vector< Gep::Cluster > &TopoTowers) const override
std::unique_ptr< WTAConeMakerCreateWTAConeMaker (enum WTAConeMakerEnum seed_cleaning_algo) const
void SetBlockN (unsigned int block_n)
void SetSeedCleaningAlgo (unsigned int algo)
void SetRollOffBufferSize (int rolloff_buffersize)
int GetRollOffBufferSize ()
WTATrigObj fTower_to_iTower (const Gep::Cluster &topotower, int idx=-99) const
Gep::Jet iJet_to_fJet (const WTAJet &iJet) const

Public Attributes

WTAParameters m_GEPWTAParameters

Private Attributes

unsigned int m_BlockN {}
unsigned int m_SeedCleaningAlgo {}
unsigned int m_RollOffBufferSize {}

Detailed Description

Definition at line 28 of file WTAConeJetMaker.h.

Constructor & Destructor Documentation

◆ WTAConeJetMaker()

Gep::WTAConeJetMaker::WTAConeJetMaker ( unsigned int block_n = 4,
unsigned int rolloff_buffersize = 155 )
inline

Definition at line 32 of file WTAConeJetMaker.h.

32 :
34 m_BlockN(block_n), m_SeedCleaningAlgo(0), m_RollOffBufferSize(rolloff_buffersize)
35 {};
unsigned int m_SeedCleaningAlgo
WTAParameters m_GEPWTAParameters
unsigned int m_RollOffBufferSize

Member Function Documentation

◆ CreateWTAConeMaker()

std::unique_ptr< WTAConeMaker > Gep::WTAConeJetMaker::CreateWTAConeMaker ( enum WTAConeMakerEnum seed_cleaning_algo) const
inline

Definition at line 41 of file WTAConeJetMaker.h.

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 }
@ TwoPass
@ Baseline

◆ fTower_to_iTower()

WTATrigObj Gep::WTAConeJetMaker::fTower_to_iTower ( const Gep::Cluster & topotower,
int idx = -99 ) const
inline

Definition at line 62 of file WTAConeJetMaker.h.

62 { // 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 }
const float fl_ETA_MAX
Definition WTASimTypes.h:10
const float fl_PHI_MAX
Definition WTASimTypes.h:11

◆ GetRollOffBufferSize()

int Gep::WTAConeJetMaker::GetRollOffBufferSize ( )
inline

Definition at line 56 of file WTAConeJetMaker.h.

56{return m_RollOffBufferSize;}

◆ iJet_to_fJet()

Gep::Jet Gep::WTAConeJetMaker::iJet_to_fJet ( const WTAJet & iJet) const
inline

Definition at line 80 of file WTAConeJetMaker.h.

80 { // 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 }
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

◆ makeJets()

std::vector< Gep::Jet > Gep::WTAConeJetMaker::makeJets ( const std::vector< Gep::Cluster > & TopoTowers) const
overridevirtual

Implements Gep::IJetMaker.

Definition at line 8 of file WTAConeJetMaker.cxx.

9 { // Makesure the WTA parameters are set before calling makeJets()
10
11 std::vector<WTATrigObj> input_towers;
12 const unsigned int inTopoTowersN = inTopoTowers.size();
13 for(unsigned int i = 0; i < inTopoTowersN; i++)
14 {
15 const auto & TopoTower = inTopoTowers[i];
16 #ifndef FLOATING_POINT_SIMULATION
17 WTATrigObj this_tower = fTower_to_iTower(TopoTower, i);
18 #else
19 WTATrigObj this_tower(TopoTower.vec.Pt(), TopoTower.vec.Eta(), TopoTower.vec.Phi(), TopoTower.vec.M(), i); // Floating can take the raw values
20 #endif
21 input_towers.push_back(this_tower);
22 }
23
24 std::unique_ptr<WTAConeMaker> MyWTAConeMaker = CreateWTAConeMaker(static_cast<WTAConeMakerEnum>(m_SeedCleaningAlgo));
25 if(auto* MyWTACone2PassMaker = dynamic_cast<WTACone2PassMaker*>(MyWTAConeMaker.get()))MyWTACone2PassMaker->SetRollOffBufferSize(m_RollOffBufferSize); // Only for two-pass algorithm
26 std::vector<WTAJet> WTAJetList;
27 MyWTAConeMaker->m_WTAConeMakerParameter = m_GEPWTAParameters; // Pass the WTAConeParameters
28 if(m_BlockN != 1)
29 { // Run parallel WTAConeJets
30 WTAConeParallelHelper wta_parallel_helper;
31 wta_parallel_helper.SetBlockN(m_BlockN);
32 wta_parallel_helper.CreateBlocks(input_towers);
33 wta_parallel_helper.RunParallelWTA(MyWTAConeMaker);
34 wta_parallel_helper.CheckJetInCore();
35 WTAJetList = wta_parallel_helper.GetAllJets();
36 }
37 else
38 { // Run over whole calorimeter
39 MyWTAConeMaker->InitiateInputs(input_towers);
40 MyWTAConeMaker->SeedCleaning();
41 MyWTAConeMaker->MergeConstsToSeeds();
42 MyWTAConeMaker->CreateERingInfo();
43 WTAJetList = MyWTAConeMaker->GetSeedList();
44 }
45
46 std::vector<Gep::Jet> GepJetList;
47 for(const auto& WTAJet: WTAJetList)
48 {
49 Gep::Jet thisjet;
50 #ifndef FLOATING_POINT_SIMULATION
51 thisjet = iJet_to_fJet(WTAJet);
52 #else
53 thisjet.vec.SetPtEtaPhiM(WTAJet.pt(), WTAJet.eta(), WTAJet.phi(), WTAJet.m()); // Floating can take the raw values
54 // Store ERing information
55 WTA4JetERingInfo ering_info = WTAJet.GetERingInfo();
56 thisjet.ring0_Et = ering_info.ring0_Et;
57 thisjet.ring1_Et = ering_info.ring1_Et;
58 thisjet.ring2_Et = ering_info.ring2_Et;
59 thisjet.ring3_Et = ering_info.ring3_Et;
60 thisjet.ring4_Et = ering_info.ring4_Et;
61 thisjet.total_TobN = ering_info.total_TobN;
62 thisjet.ring0_TobN = ering_info.ring0_TobN;
63 thisjet.ring1_TobN = ering_info.ring1_TobN;
64 thisjet.ring2_TobN = ering_info.ring2_TobN;
65 thisjet.ring3_TobN = ering_info.ring3_TobN;
66 thisjet.ring4_TobN = ering_info.ring4_TobN;
67 #endif
68 // WTAJet.PrintERingInfo(); // Debug ERing TobN and Et
69 thisjet.nConstituents = WTAJet.GetConstituentCount();
70 thisjet.seedEt = WTAJet.GetSeed().pt();
71 thisjet.seedEta = WTAJet.GetSeed().eta();
72 thisjet.seedPhi = WTAJet.GetSeed().phi();
73 const std::vector<WTATrigObj> ConstituentList = WTAJet.GetConstituentList();
74 thisjet.constituentsIndices.clear();
75 for(const auto& constituent: ConstituentList)
76 {
77 thisjet.constituentsIndices.push_back(constituent.idx());
78 }
79
80 GepJetList.push_back(std::move(thisjet));
81 }
82
83 return GepJetList;
84 }
WTAConeMakerEnum
WTATrigObj fTower_to_iTower(const Gep::Cluster &topotower, int idx=-99) const
Gep::Jet iJet_to_fJet(const WTAJet &iJet) const
std::unique_ptr< WTAConeMaker > CreateWTAConeMaker(enum WTAConeMakerEnum seed_cleaning_algo) const
std::vector< WTAJet > GetAllJets()
void RunParallelWTA(std::unique_ptr< WTAClassType > &AnyWTAClass)
void CreateBlocks(const std::vector< WTATrigObj > &all_towers)
void SetBlockN(unsigned int block_n)
std::vector< int > constituentsIndices

◆ SetBlockN()

void Gep::WTAConeJetMaker::SetBlockN ( unsigned int block_n)
inline

Definition at line 53 of file WTAConeJetMaker.h.

53{m_BlockN = block_n;};

◆ SetRollOffBufferSize()

void Gep::WTAConeJetMaker::SetRollOffBufferSize ( int rolloff_buffersize)
inline

Definition at line 55 of file WTAConeJetMaker.h.

55{m_RollOffBufferSize = rolloff_buffersize;}

◆ SetSeedCleaningAlgo()

void Gep::WTAConeJetMaker::SetSeedCleaningAlgo ( unsigned int algo)
inline

◆ toString()

virtual std::string Gep::WTAConeJetMaker::toString ( ) const
inlineoverridevirtual

Implements Gep::IJetMaker.

Definition at line 38 of file WTAConeJetMaker.h.

38{ return "WTAConeJet"; }

Member Data Documentation

◆ m_BlockN

unsigned int Gep::WTAConeJetMaker::m_BlockN {}
private

Definition at line 128 of file WTAConeJetMaker.h.

128{};

◆ m_GEPWTAParameters

WTAParameters Gep::WTAConeJetMaker::m_GEPWTAParameters

Definition at line 124 of file WTAConeJetMaker.h.

◆ m_RollOffBufferSize

unsigned int Gep::WTAConeJetMaker::m_RollOffBufferSize {}
private

Definition at line 130 of file WTAConeJetMaker.h.

130{}; // Only for TwoPass

◆ m_SeedCleaningAlgo

unsigned int Gep::WTAConeJetMaker::m_SeedCleaningAlgo {}
private

Definition at line 129 of file WTAConeJetMaker.h.

129{};

The documentation for this class was generated from the following files: