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 27 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 31 of file WTAConeJetMaker.h.

31 :
33 m_BlockN(block_n), m_SeedCleaningAlgo(0), m_RollOffBufferSize(rolloff_buffersize)
34 {};
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 40 of file WTAConeJetMaker.h.

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

◆ fTower_to_iTower()

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

Definition at line 61 of file WTAConeJetMaker.h.

61 { // 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 }
const float fl_ETA_MAX
Definition WTASimTypes.h:8
const float fl_PHI_MAX
Definition WTASimTypes.h:9

◆ GetRollOffBufferSize()

int Gep::WTAConeJetMaker::GetRollOffBufferSize ( )
inline

Definition at line 55 of file WTAConeJetMaker.h.

55{return m_RollOffBufferSize;}

◆ iJet_to_fJet()

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

Definition at line 79 of file WTAConeJetMaker.h.

79 { // 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 }
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 9 of file WTAConeJetMaker.cxx.

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

52{m_BlockN = block_n;};

◆ SetRollOffBufferSize()

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

Definition at line 54 of file WTAConeJetMaker.h.

54{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 37 of file WTAConeJetMaker.h.

37{ return "WTAConeJet"; }

Member Data Documentation

◆ m_BlockN

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

Definition at line 127 of file WTAConeJetMaker.h.

127{};

◆ m_GEPWTAParameters

WTAParameters Gep::WTAConeJetMaker::m_GEPWTAParameters

Definition at line 123 of file WTAConeJetMaker.h.

◆ m_RollOffBufferSize

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

Definition at line 129 of file WTAConeJetMaker.h.

129{}; // Only for TwoPass

◆ m_SeedCleaningAlgo

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

Definition at line 128 of file WTAConeJetMaker.h.

128{};

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