ATLAS Offline Software
Loading...
Searching...
No Matches
WTAConeJetMaker.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3 */
4#include "./WTAConeJetMaker.h"
5#include <iostream>
6
7
8 std::vector<Gep::Jet> Gep::WTAConeJetMaker::makeJets(const std::vector<Gep::Cluster>& inTopoTowers) const
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
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
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 }
85
WTAConeMakerEnum
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
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)
tobn_t GetConstituentCount() const
Definition WTAObject.h:171
const std::vector< WTATrigObj > & GetConstituentList() const
Definition WTAObject.h:170
const WTATrigObj & GetSeed() const
Definition WTAObject.h:165
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
std::vector< int > constituentsIndices
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