ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
Global
GlobalSimulation
src
Jet1
GlobalJet1AlgTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
GlobalJet1AlgTool.h
"
6
7
#include "
../IO/CommonTOB.h
"
8
9
#include <bitset>
10
11
12
namespace
GlobalSim
{
13
14
// Main constructor
15
GlobalJet1AlgTool::GlobalJet1AlgTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent) :
16
base_class(
type
, name, parent) {
17
}
18
19
20
// Initialize function running before first event
21
StatusCode
GlobalJet1AlgTool::initialize
() {
22
23
CHECK
(
m_gblCellTowers
.initialize());
24
CHECK
(
m_gblJet1JetsContainerKey
.initialize());
25
26
return
StatusCode::SUCCESS;
27
}
28
29
30
// Main functional block running for each event
31
StatusCode
GlobalJet1AlgTool::run
(
const
std::unique_ptr<IDataCollector>& dc,
32
const
EventContext& ctx)
const
{
33
34
ATH_MSG_DEBUG
(
"Building WTAConeJets"
);
35
if
(dc){dc->collect(*
this
,
"start"
);}
36
37
38
// Read the GlobalCellTowers
39
auto
h_towerTOBs =
SG::makeHandle
(
m_gblCellTowers
, ctx);
40
CHECK
(h_towerTOBs.isValid());
41
const
auto
& towers = *h_towerTOBs;
42
const
unsigned
int
inTopoTowersN = towers.size();
43
ATH_MSG_DEBUG
(
"Reading "
<< inTopoTowersN <<
" cell towers as GenericTobs"
);
44
45
// Create bitwise towers
46
std::vector<WTATrigObj> input_towers;
47
for
(
unsigned
int
i = 0; i < inTopoTowersN; i++){
48
// Has constituent tracking feature
49
const
IOBitwise::CommonTOB
* tower = towers[i];
50
WTATrigObj
this_tower(tower->
et_bits
().to_ulong(), tower->
eta_bits
().to_ulong(), tower->
phi_bits
().to_ulong(), 0, i);
51
input_towers.push_back(this_tower);
52
}
53
54
// Do the usual
55
std::unique_ptr<WTAConeMaker> MyWTAConeMaker = std::make_unique<WTACone2PassMaker>();
56
WTAParameters
MyWTAParameters =
WTAParameters
(
57
8,
// const_et_cut = 2 GeV
58
20,
// seed_et_cut = 5 GeV
59
4
// jet_dR = 4
60
);
61
MyWTAConeMaker->m_WTAConeMakerParameter = MyWTAParameters;
// Pass the WTAConeParameters
62
WTAConeParallelHelper
wta_parallel_helper;
63
wta_parallel_helper.
SetBlockN
(4);
64
wta_parallel_helper.
CreateBlocks
(input_towers);
65
wta_parallel_helper.
RunParallelWTA
(MyWTAConeMaker);
66
wta_parallel_helper.
CheckJetInCore
();
67
std::vector<WTAJet> WTAJetList = wta_parallel_helper.
GetAllJets
();
// Bitwise Jets
68
69
auto
h_Jet1TOBs =
SG::makeHandle
(
m_gblJet1JetsContainerKey
, ctx);
70
auto
jets = std::make_unique<IOBitwise::CommonTOBContainer>();
71
72
for
(
const
auto
&
WTAJet
: WTAJetList){
73
int
energyBits = std::clamp(
static_cast<
int
>
(
WTAJet
.
pt
()), 0, (1 <<
IOBitwise::CommonTOB::s_et_width
) - 1);
74
int
etaBits = std::clamp(
static_cast<
int
>
(
WTAJet
.
eta
()), 0, (1 <<
IOBitwise::CommonTOB::s_eta_width
) - 1);
75
int
phiBits = std::clamp(
static_cast<
int
>
(
WTAJet
.
phi
()), 0, (1 <<
IOBitwise::CommonTOB::s_phi_width
) - 1);
76
jets->emplace_back(
new
IOBitwise::CommonTOB
(std::bitset<IOBitwise::CommonTOB::s_et_width>(energyBits),
77
std::bitset<IOBitwise::CommonTOB::s_eta_width>(etaBits),
78
std::bitset<IOBitwise::CommonTOB::s_phi_width>(phiBits)));
79
// Print jet TOB
80
ATH_MSG_DEBUG
(
"Returning Jet: "
<< jets->back()->to_string());
81
}
82
83
ATH_MSG_DEBUG
(
"Built "
<< jets->size() <<
" WTAConeJets and stored them as GenericTobs"
);
84
85
CHECK
(h_Jet1TOBs.record(std::move(jets)));
86
87
if
(dc){dc->collect(*
this
,
"end"
);}
88
89
return
StatusCode::SUCCESS;
90
}
91
92
// Overrides toString() function from base class, unused here
93
std::string
GlobalJet1AlgTool::toString
()
const
{
94
return
{};
95
}
96
97
}
//namespace GlobalSim
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
CommonTOB.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
GlobalJet1AlgTool.h
GlobalSim::GlobalJet1AlgTool::m_gblCellTowers
SG::ReadHandleKey< IOBitwise::CommonTOBContainer > m_gblCellTowers
Read key for the output cell towers as a GenericTobContainer.
Definition
GlobalJet1AlgTool.h:57
GlobalSim::GlobalJet1AlgTool::m_gblJet1JetsContainerKey
SG::WriteHandleKey< IOBitwise::CommonTOBContainer > m_gblJet1JetsContainerKey
Write key for the output Jet1Jets as a GenericTobContainer.
Definition
GlobalJet1AlgTool.h:65
GlobalSim::GlobalJet1AlgTool::run
virtual StatusCode run(const std::unique_ptr< IDataCollector > &, const EventContext &ctx) const override
Main functional block running for each event.
Definition
GlobalJet1AlgTool.cxx:31
GlobalSim::GlobalJet1AlgTool::toString
virtual std::string toString() const override
Overriding toString function from base class.
Definition
GlobalJet1AlgTool.cxx:93
GlobalSim::GlobalJet1AlgTool::initialize
virtual StatusCode initialize() override
Initialize function running before first event.
Definition
GlobalJet1AlgTool.cxx:21
GlobalSim::GlobalJet1AlgTool::GlobalJet1AlgTool
GlobalJet1AlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Main constructor.
Definition
GlobalJet1AlgTool.cxx:15
GlobalSim::IOBitwise::CommonTOB
Definition
CommonTOB.h:22
GlobalSim::IOBitwise::CommonTOB::s_eta_width
static constexpr std::size_t s_eta_width
Size of the eta bitset.
Definition
CommonTOB.h:30
GlobalSim::IOBitwise::CommonTOB::et_bits
virtual std::bitset< s_et_width > et_bits() const
Definition
CommonTOB.cxx:27
GlobalSim::IOBitwise::CommonTOB::s_et_width
static constexpr std::size_t s_et_width
Size of the eT bitset.
Definition
CommonTOB.h:28
GlobalSim::IOBitwise::CommonTOB::eta_bits
virtual std::bitset< s_eta_width > eta_bits() const
Definition
CommonTOB.cxx:31
GlobalSim::IOBitwise::CommonTOB::phi_bits
virtual std::bitset< s_phi_width > phi_bits() const
Definition
CommonTOB.cxx:35
GlobalSim::IOBitwise::CommonTOB::s_phi_width
static constexpr std::size_t s_phi_width
Size of the phi bitset.
Definition
CommonTOB.h:32
WTAConeParallelHelper
Definition
WTAConeParallelHelper.h:15
WTAConeParallelHelper::GetAllJets
std::vector< WTAJet > GetAllJets()
Definition
WTAConeParallelHelper.h:221
WTAConeParallelHelper::RunParallelWTA
void RunParallelWTA(std::unique_ptr< WTAClassType > &AnyWTAClass)
Definition
WTAConeParallelHelper.h:175
WTAConeParallelHelper::CreateBlocks
void CreateBlocks(const std::vector< WTATrigObj > &all_towers)
Definition
WTAConeParallelHelper.h:148
WTAConeParallelHelper::CheckJetInCore
void CheckJetInCore()
Definition
WTAConeParallelHelper.h:191
WTAConeParallelHelper::SetBlockN
void SetBlockN(unsigned int block_n)
Definition
WTAConeParallelHelper.h:84
WTAJet
Definition
WTAObject.h:150
WTAParameters
Definition
WTAConeMaker.h:14
WTATrigObj
Definition
WTAObject.h:26
WTATrigObj::eta
eta_t eta() const
Definition
WTAObject.h:33
WTATrigObj::phi
phi_t phi() const
Definition
WTAObject.h:35
WTATrigObj::pt
pt_t pt() const
Definition
WTAObject.h:31
GlobalSim
AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.
Definition
BitSpec.h:23
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:268
type
Generated on
for ATLAS Offline Software by
1.17.0