ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
Global
GlobalSimulation
src
JET1Alg.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JET1Alg.h
"
6
#include "
GlobalSimulation/Tower.h
"
7
#include "
GlobalSimulation/JET1Jet.h
"
8
#include "
xAODCore/AuxContainerBase.h
"
9
10
namespace
GlobalSim
{
11
12
StatusCode
JET1Alg::initialize
() {
13
14
CHECK
(
m_inputTowersKey
.initialize() );
15
CHECK
(
m_outputKey
.initialize() );
16
17
return
StatusCode::SUCCESS;
18
}
19
20
StatusCode
JET1Alg::execute
(
const
EventContext& ctx)
const
{
21
22
ATH_MSG_DEBUG
(
"Building WTAConeJets"
);
23
// Read the GlobalCellTowers
24
auto
towers =
SG::makeHandle
(
m_inputTowersKey
, ctx);
25
CHECK
(towers.isValid());
26
auto
nTowers = towers->size();
27
ATH_MSG_DEBUG
(
"Reading "
<< nTowers <<
" cell towers from xAOD::BaseContainer"
);
28
29
std::vector<WTATrigObj> input_towers;
30
for
(
size_t
i = 0; i < nTowers; i++){
31
Object<Tower>
tower( *towers->at(i) );
32
WTATrigObj
this_tower(tower.ptt.
bits
().to_ulong(), tower.eta.
bits
().to_ulong(), tower.phi.
bits
().to_ulong(), 0, i);
33
input_towers.push_back(this_tower);
34
}
35
36
// Do the usual
37
std::unique_ptr<WTAConeMaker> MyWTAConeMaker = std::make_unique<WTACone2PassMaker>();
38
WTAParameters
MyWTAParameters =
WTAParameters
(
39
8,
// const_et_cut = 2 GeV
40
20,
// seed_et_cut = 5 GeV
41
4
// jet_dR = 4
42
);
43
44
MyWTAConeMaker->m_WTAConeMakerParameter = MyWTAParameters;
// Pass the WTAConeParameters
45
WTAConeParallelHelper
wta_parallel_helper;
46
wta_parallel_helper.
SetBlockN
(4);
47
wta_parallel_helper.
CreateBlocks
(input_towers);
48
wta_parallel_helper.
RunParallelWTA
(MyWTAConeMaker);
49
wta_parallel_helper.
CheckJetInCore
();
50
std::vector<WTAJet> WTAJetList = wta_parallel_helper.
GetAllJets
();
// Bitwise Jets
51
52
//Write out as an xAOD::BaseContainer of SG::AuxElements
53
auto
jets =
SG::makeHandle
(
m_outputKey
, ctx);
54
CHECK
( jets.record( std::make_unique<xAOD::BaseContainer>(), std::make_unique<xAOD::AuxContainerBase>()) );
55
56
for
(
const
auto
&
WTAJet
: WTAJetList){
57
jets->push_back( std::make_unique<SG::AuxElement>() );
58
auto
jet
=
Object<JET1Jet>
( *jets->back());
59
60
// Assigned through the bits overload, not the value one: ptt carries a 0.25 encoder,
61
// so handing it the raw count would store a count where a physical value is expected
62
// and multiply it by four on the way back out. The reference implementation writes
63
// the count straight into the field (GoldenGate: obj.pt() & 0x1FFF).
64
jet
.ptt = std::bitset<
jet
.ptt.width>(
WTAJet
.
pt
());
65
jet
.eta = std::bitset<
jet
.eta.width>(
WTAJet
.
eta
());
66
jet
.phi = std::bitset<
jet
.phi.width>(
WTAJet
.
phi
());
67
WTA4JetERingInfo
ering_info =
WTAJet
.
GetERingInfo
();
68
jet
.ring_zero_ptt = ering_info.
ring0_Et
;
69
jet
.ring_one_ptt = ering_info.
ring1_Et
;
70
jet
.ring_two_ptt = ering_info.
ring2_Et
;
71
jet
.ring_three_ptt = ering_info.
ring3_Et
;
72
jet
.ring_four_ptt = ering_info.
ring4_Et
;
73
jet
.total_tobs = ering_info.
total_TobN
;
74
jet
.ring_one_tobs = ering_info.
ring1_TobN
;
75
jet
.ring_two_tobs = ering_info.
ring2_TobN
;
76
jet
.ring_three_tobs = ering_info.
ring3_TobN
;
77
jet
.ring_four_tobs = ering_info.
ring4_TobN
;
78
// The WTA engine does not provide the flags yet, so they are written as
79
// false. The fields still have to be filled: without them the aux variable
80
// does not exist and packing the word throws. Note et_overflow is genuinely
81
// set in the reference data, so this is a placeholder, not a final value.
82
jet
.flag_et_overflow =
false
;
83
jet
.flag_error =
false
;
84
jet
.flag_next_tob_same_et =
false
;
85
jet
.flag_truncate =
false
;
86
}
87
88
return
StatusCode::SUCCESS;
89
}
90
91
92
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
AuxContainerBase.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
JET1Alg.h
JET1Jet.h
Tower.h
GlobalSim::JET1Alg::m_outputKey
SG::WriteHandleKey< xAOD::BaseContainer > m_outputKey
Key for the output jets.
Definition
JET1Alg.h:38
GlobalSim::JET1Alg::m_inputTowersKey
SG::ReadHandleKey< xAOD::BaseContainer > m_inputTowersKey
Key for the Input cell towers.
Definition
JET1Alg.h:35
GlobalSim::JET1Alg::initialize
virtual StatusCode initialize() override
initialize function running before first event
Definition
JET1Alg.cxx:12
GlobalSim::JET1Alg::execute
virtual StatusCode execute(const EventContext &) const override
execute function running for every event
Definition
JET1Alg.cxx:20
GlobalSim::Object
Definition
Object.h:39
GlobalSim::Object::bits
Spec::bitset_type bits() const
Definition
Object.h:57
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
WTAJet::GetERingInfo
const WTA4JetERingInfo & GetERingInfo() const
Definition
WTAObject.h:176
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:24
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:268
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
WTA4JetERingInfo
Definition
WTAObject.h:136
WTA4JetERingInfo::ring4_TobN
ring4_tobn_t ring4_TobN
Definition
WTAObject.h:147
WTA4JetERingInfo::ring1_TobN
ring1_tobn_t ring1_TobN
Definition
WTAObject.h:144
WTA4JetERingInfo::ring1_Et
pt_t ring1_Et
Definition
WTAObject.h:138
WTA4JetERingInfo::ring2_TobN
ring2_tobn_t ring2_TobN
Definition
WTAObject.h:145
WTA4JetERingInfo::total_TobN
tobn_t total_TobN
Definition
WTAObject.h:142
WTA4JetERingInfo::ring3_Et
pt_t ring3_Et
Definition
WTAObject.h:140
WTA4JetERingInfo::ring4_Et
pt_t ring4_Et
Definition
WTAObject.h:141
WTA4JetERingInfo::ring2_Et
pt_t ring2_Et
Definition
WTAObject.h:139
WTA4JetERingInfo::ring3_TobN
ring3_tobn_t ring3_TobN
Definition
WTAObject.h:146
WTA4JetERingInfo::ring0_Et
pt_t ring0_Et
Definition
WTAObject.h:137
Generated on
for ATLAS Offline Software by
1.17.0