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"
6#include <iostream>
7
8
9 std::vector<Gep::Jet> Gep::WTAConeJetMaker::makeJets(const std::vector<Gep::Cluster>& inTopoTowers) const
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
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
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 }
86
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