ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1CaloFEX
L1CaloFEXSim
src
eFEXtauAlgoBase.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//***********************************************************************************
6
// eFEXtauAlgoBase.cxx
7
// -------------------
8
// begin : 08 05 2023
9
// email : david.reikher@cern.ch,
10
// nicholas.andrew.luongo@cern.ch
11
// *********************************************************************************/
12
13
#include "
L1CaloFEXSim/eFEXtauAlgoBase.h
"
14
15
LVL1::eFEXtauAlgoBase::eFEXtauAlgoBase
(
const
std::string &
type
,
16
const
std::string &
name
,
17
const
IInterface *parent)
18
:
AthAlgTool
(
type
,
name
, parent) {
19
declareInterface<eFEXtauAlgoBase>(
this
);
20
}
21
22
LVL1::eFEXtauAlgoBase::~eFEXtauAlgoBase
() {}
23
24
StatusCode
LVL1::eFEXtauAlgoBase::safetyTest
(
const
EventContext& ctx) {
25
26
SG::ReadHandle<eTowerContainer>
eTowerContainer
(
m_eTowerContainerKey
, ctx);
27
if
(!
eTowerContainer
.isValid()) {
28
ATH_MSG_FATAL
(
"Could not retrieve eTowerContainer "
29
<<
m_eTowerContainerKey
.key());
30
return
StatusCode::FAILURE;
31
}
32
m_eTowers
=
eTowerContainer
.cptr();
33
return
StatusCode::SUCCESS;
34
}
35
36
// Build arrays holding cell ETs for each layer plus entire tower
37
void
LVL1::eFEXtauAlgoBase::buildLayers
(
int
efex_id,
int
fpga_id,
38
int
central_eta) {
39
40
41
for
(
unsigned
int
ieta = 0; ieta < 3; ieta++) {
42
for
(
unsigned
int
iphi = 0; iphi < 3; iphi++) {
43
if
(((efex_id % 3 == 0) && (fpga_id == 0) && (central_eta == 0) &&
44
(ieta == 0)) ||
45
((efex_id % 3 == 2) && (fpga_id == 3) && (central_eta == 5) &&
46
(ieta == 2))) {
47
m_twrcells
[ieta][iphi] = 0;
48
m_em0cells
[ieta][iphi] = 0;
49
m_em3cells
[ieta][iphi] = 0;
50
m_hadcells
[ieta][iphi] = 0;
51
for
(
unsigned
int
i = 0; i < 4; i++) {
52
m_em1cells
[4 * ieta + i][iphi] = 0;
53
m_em2cells
[4 * ieta + i][iphi] = 0;
54
}
55
}
else
{
56
const
LVL1::eTower
*tmpTower =
57
m_eTowers
->findTower(
m_eFexalgoTowerID
[iphi][ieta]);
58
m_twrcells
[ieta][iphi] = tmpTower->
getTotalET
();
59
m_em0cells
[ieta][iphi] = tmpTower->
getLayerTotalET
(0);
60
m_em3cells
[ieta][iphi] = tmpTower->
getLayerTotalET
(3);
61
m_hadcells
[ieta][iphi] = tmpTower->
getLayerTotalET
(4);
62
for
(
unsigned
int
i = 0; i < 4; i++) {
63
m_em1cells
[4 * ieta + i][iphi] = tmpTower->
getET
(1, i);
64
m_em2cells
[4 * ieta + i][iphi] = tmpTower->
getET
(2, i);
65
}
66
}
67
}
68
}
69
m_cellsSet
=
true
;
70
}
71
72
// Utility function to calculate and return jet discriminant sums for specified
73
// location Intended to allow xAOD TOBs to be decorated with this information
74
void
LVL1::eFEXtauAlgoBase::getSums
(
unsigned
int
/*seed*/
,
bool
/*UnD*/
,
75
std::vector<unsigned int> &RcoreSums,
76
std::vector<unsigned int> &RemSums) {
77
// Set seed parameters to supplied values
78
79
// Now just call the 2 discriminant calculation methods
80
getRCore
(RcoreSums);
81
getRHad
(RemSums);
82
}
83
84
// Calculate the hadronic fraction isolation variable
85
void
LVL1::eFEXtauAlgoBase::getRHad
(std::vector<unsigned int> &rHadVec)
const
{
86
unsigned
int
core =
rHadCore
();
87
unsigned
int
env =
rHadEnv
();
88
89
rHadVec.push_back(core);
90
rHadVec.push_back(env);
91
}
92
93
// Calculate float isolation variable
94
float
LVL1::eFEXtauAlgoBase::getRealRCore
()
const
{
95
unsigned
int
core =
rCoreCore
();
96
unsigned
int
env =
rCoreEnv
();
97
98
unsigned
int
num = core;
99
unsigned
int
denom = core + env;
100
101
float
out = denom ?
static_cast<
float
>
(num) /
static_cast<
float
>
(denom) : 0;
102
103
return
out;
104
}
105
106
float
LVL1::eFEXtauAlgoBase::getRealRHad
()
const
{
107
unsigned
int
core =
rHadCore
();
108
unsigned
int
env =
rHadEnv
();
109
110
unsigned
int
num = core;
111
unsigned
int
denom = core + env;
112
113
float
out = denom ?
static_cast<
float
>
(num) /
static_cast<
float
>
(denom) : 0;
114
115
return
out;
116
}
117
118
void
LVL1::eFEXtauAlgoBase::getRCore
(
119
std::vector<unsigned int> &rCoreVec)
const
{
120
unsigned
int
core =
rCoreCore
();
121
unsigned
int
env =
rCoreEnv
();
122
123
rCoreVec.push_back(core);
124
rCoreVec.push_back(env);
125
}
126
127
// Check if central tower qualifies as a seed tower for the tau algorithm
128
bool
LVL1::eFEXtauAlgoBase::isCentralTowerSeed
()
const
{
129
// Need layer cell ET arrays to be built
130
if
(
m_cellsSet
==
false
) {
131
ATH_MSG_DEBUG
(
132
"Layers not built, cannot accurately determine if a seed tower."
);
133
}
134
135
bool
out =
true
;
136
137
// Get central tower ET
138
unsigned
int
centralET =
m_twrcells
[1][1];
139
140
// Loop over all cells and check that the central tower is a local maximum
141
for
(
unsigned
int
beta = 0; beta < 3; beta++) {
142
for
(
unsigned
int
bphi = 0; bphi < 3; bphi++) {
143
// Don't need to compare central cell with itself
144
if
((beta == 1) && (bphi == 1)) {
145
continue
;
146
}
147
148
// Cells to the up and right must have strictly lesser ET
149
if
(beta == 2 || (beta == 1 && bphi == 2)) {
150
if
(centralET <=
m_twrcells
[beta][bphi]) {
151
out =
false
;
152
}
153
}
154
// Cells down and to the left must have lesser or equal ET. If strictly
155
// lesser would create zero TOB if two adjacent cells had equal energy
156
else
if
(beta == 0 || (beta == 1 && bphi == 0)) {
157
if
(centralET <
m_twrcells
[beta][bphi]) {
158
out =
false
;
159
}
160
}
161
}
162
}
163
164
return
out;
165
}
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
LVL1::eFEXtauAlgoBase::m_eFexalgoTowerID
int m_eFexalgoTowerID[3][3]
Definition
eFEXtauAlgoBase.h:79
LVL1::eFEXtauAlgoBase::rCoreEnv
virtual unsigned int rCoreEnv() const
Definition
eFEXtauAlgoBase.h:52
LVL1::eFEXtauAlgoBase::m_em1cells
unsigned int m_em1cells[12][3]
Definition
eFEXtauAlgoBase.h:91
LVL1::eFEXtauAlgoBase::rHadEnv
virtual unsigned int rHadEnv() const =0
LVL1::eFEXtauAlgoBase::m_eTowers
const LVL1::eTowerContainer * m_eTowers
Definition
eFEXtauAlgoBase.h:75
LVL1::eFEXtauAlgoBase::isCentralTowerSeed
virtual bool isCentralTowerSeed() const
Definition
eFEXtauAlgoBase.cxx:128
LVL1::eFEXtauAlgoBase::m_eTowerContainerKey
SG::ReadHandleKey< LVL1::eTowerContainer > m_eTowerContainerKey
Definition
eFEXtauAlgoBase.h:73
LVL1::eFEXtauAlgoBase::m_cellsSet
bool m_cellsSet
Definition
eFEXtauAlgoBase.h:77
LVL1::eFEXtauAlgoBase::m_twrcells
unsigned int m_twrcells[3][3]
Definition
eFEXtauAlgoBase.h:95
LVL1::eFEXtauAlgoBase::m_hadcells
unsigned int m_hadcells[3][3]
Definition
eFEXtauAlgoBase.h:94
LVL1::eFEXtauAlgoBase::eFEXtauAlgoBase
eFEXtauAlgoBase(const std::string &type, const std::string &name, const IInterface *parent)
Constructors.
Definition
eFEXtauAlgoBase.cxx:15
LVL1::eFEXtauAlgoBase::rHadCore
virtual unsigned int rHadCore() const =0
LVL1::eFEXtauAlgoBase::~eFEXtauAlgoBase
virtual ~eFEXtauAlgoBase()
Destructor.
Definition
eFEXtauAlgoBase.cxx:22
LVL1::eFEXtauAlgoBase::getRHad
virtual void getRHad(std::vector< unsigned int > &rHadVec) const
Definition
eFEXtauAlgoBase.cxx:85
LVL1::eFEXtauAlgoBase::m_em0cells
unsigned int m_em0cells[3][3]
Definition
eFEXtauAlgoBase.h:90
LVL1::eFEXtauAlgoBase::m_em2cells
unsigned int m_em2cells[12][3]
Definition
eFEXtauAlgoBase.h:92
LVL1::eFEXtauAlgoBase::rCoreCore
virtual unsigned int rCoreCore() const
Definition
eFEXtauAlgoBase.h:51
LVL1::eFEXtauAlgoBase::getSums
virtual void getSums(unsigned int seed, bool UnD, std::vector< unsigned int > &RcoreSums, std::vector< unsigned int > &Remums)
Definition
eFEXtauAlgoBase.cxx:74
LVL1::eFEXtauAlgoBase::getRealRCore
virtual float getRealRCore() const
Definition
eFEXtauAlgoBase.cxx:94
LVL1::eFEXtauAlgoBase::getRCore
virtual void getRCore(std::vector< unsigned int > &rCoreVec) const
Definition
eFEXtauAlgoBase.cxx:118
LVL1::eFEXtauAlgoBase::buildLayers
void buildLayers(int efex_id, int fpga_id, int central_eta)
Definition
eFEXtauAlgoBase.cxx:37
LVL1::eFEXtauAlgoBase::safetyTest
virtual StatusCode safetyTest(const EventContext &ctx)
Definition
eFEXtauAlgoBase.cxx:24
LVL1::eFEXtauAlgoBase::getRealRHad
virtual float getRealRHad() const
Definition
eFEXtauAlgoBase.cxx:106
LVL1::eFEXtauAlgoBase::m_em3cells
unsigned int m_em3cells[3][3]
Definition
eFEXtauAlgoBase.h:93
LVL1::eTowerContainer
Definition
eTowerContainer.h:31
LVL1::eTower
The eTower class is an interface object for eFEX trigger algorithms The purposes are twofold:
Definition
eTower.h:38
LVL1::eTower::getLayerTotalET
int getLayerTotalET(unsigned int layer) const
Get total ET sum of all cells in a given layer in MeV.
Definition
eTower.cxx:249
LVL1::eTower::getET
int getET(unsigned int layer, int cell=0) const
Get ET of a specified cell in MeV.
Definition
eTower.cxx:172
LVL1::eTower::getTotalET
int getTotalET() const
Get ET sum of all cells in the eTower in MeV.
Definition
eTower.cxx:194
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
eFEXtauAlgoBase.h
type
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0