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
7#include "Jet.h"
8#include "Cluster.h"
9
10
11 std::vector<Gep::Jet> Gep::WTAConeJetMaker::makeJets(const std::vector<Gep::Cluster>& inTopoTowers) const
12 { // Makesure the WTA parameters are set before calling makeJets()
13
14 std::vector<WTATrigObj> input_towers;
15 const unsigned int inTopoTowersN = inTopoTowers.size();
16 // for(const auto &TopoTower: inTopoTowers)
17 for(unsigned int i = 0; i < inTopoTowersN; i++)
18 {
19 const auto & TopoTower = inTopoTowers[i];
20 WTATrigObj this_tower(TopoTower.vec.Pt(), TopoTower.vec.Eta(), TopoTower.vec.Phi(), TopoTower.vec.M(), i);
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 WTAJetList = MyWTAConeMaker->GetSeedList();
43 }
44
45 std::vector<Gep::Jet> GepJetList;
46 for(const auto& WTAJet: WTAJetList)
47 {
48 Gep::Jet thisjet;
49 thisjet.vec.SetPtEtaPhiM(WTAJet.pt(), WTAJet.eta(), WTAJet.phi(), WTAJet.m());
51 thisjet.seedEt = WTAJet.GetSeed().pt();
52 thisjet.seedEta = WTAJet.GetSeed().eta();
53 thisjet.seedPhi = WTAJet.GetSeed().phi();
54 const std::vector<WTATrigObj> ConstituentList = WTAJet.GetConstituentList();
55 thisjet.constituentsIndices.clear();
56 for(const auto& constituent: ConstituentList)
57 {
58 thisjet.constituentsIndices.push_back(constituent.idx());
59 }
60 GepJetList.push_back(std::move(thisjet));
61 }
62
63 return GepJetList;
64 }
65
WTAConeMakerEnum
virtual std::vector< Gep::Jet > makeJets(const std::vector< Gep::Cluster > &TopoTowers) const override
unsigned int m_SeedCleaningAlgo
WTAParameters m_GEPWTAParameters
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)
const std::vector< WTATrigObj > & GetConstituentList() const
Definition WTAObject.h:122
const WTATrigObj & GetSeed() const
Definition WTAObject.h:117
unsigned int GetConstituentCount() const
Definition WTAObject.h:123
IntOrFloat m() const
Definition WTAObject.h:44
IntOrFloat pt() const
Definition WTAObject.h:38
IntOrFloat eta() const
Definition WTAObject.h:40
IntOrFloat phi() const
Definition WTAObject.h:42
std::vector< int > constituentsIndices