ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigGepPerf
src
TCTowerMaker.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
./TCTowerMaker.h
"
5
std::vector<Gep::Cluster>
6
Gep::TCTowerMaker::makeTowers
(
const
xAOD::CaloClusterContainer
& clusters,
const
CaloCellContainer
& cells)
const
{
7
8
std::vector<Gep::Cluster> customClusters;
9
(void)cells;
// Mark as intentionally unused
10
for
(
const
auto
* iClus : clusters){
11
Gep::Cluster
clus;
12
clus.
vec
.SetPxPyPzE(iClus->p4().Px(), iClus->p4().Py(),
13
iClus->p4().Pz(), iClus->e());
14
customClusters.push_back(std::move(clus));
15
}
16
17
// Define tower array (98 eta bins x 64 phi bins)
18
static
constexpr
int
nEta{98};
19
static
constexpr
int
nPhi{64};
20
//avoid stack use of 605kb
21
auto
tow =
new
Gep::Cluster
[nEta][nPhi]();
22
23
24
// Single loop over clusters to assign them to towers
25
for
(
const
auto
& cluster : customClusters) {
26
// Compute eta and phi indices
27
int
eta_index =
static_cast<
int
>
(std::floor(cluster.vec.Eta() * 10)) + 49;
28
int
phi_index =
static_cast<
int
>
(std::floor(cluster.vec.Phi() * 10)) + 32;
29
30
// Ensure indices are within bounds
31
if
(eta_index < 0 || eta_index >= nEta || phi_index < 0 || phi_index >= nPhi)
continue
;
32
33
// Accumulate cluster data into the corresponding tower
34
tow[eta_index][phi_index].vec += cluster.vec;
35
}
36
37
// Collect non-empty towers into a vector
38
std::vector<Gep::Cluster> customTowers;
39
for
(
int
i = 0; i < nEta; ++i) {
40
for
(
int
j = 0; j < nPhi; ++j) {
41
if
(tow[i][j].
vec
.Et() > 0) {
42
customTowers.push_back(tow[i][j]);
43
}
44
}
45
}
46
delete
[] tow;
47
return
customTowers;
48
}
49
50
std::string
Gep::TCTowerMaker::getName
()
const
{
51
return
"TCTower"
;
52
}
vec
std::vector< size_t > vec
Definition
CombinationsGeneratorTest.cxx:9
TCTowerMaker.h
CaloCellContainer
Container class for CaloCell.
Definition
CaloCellContainer.h:55
Gep::TCTowerMaker::getName
std::string getName() const override
Definition
TCTowerMaker.cxx:50
Gep::TCTowerMaker::makeTowers
std::vector< Gep::Cluster > makeTowers(const xAOD::CaloClusterContainer &clusters, const CaloCellContainer &cells) const override
Definition
TCTowerMaker.cxx:6
xAOD::CaloClusterContainer
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloClusterContainer.h:17
Gep::Cluster
Definition
Trigger/TrigT1/TrigGepPerf/src/Cluster.h:13
Gep::Cluster::vec
TLorentzVector vec
Definition
Trigger/TrigT1/TrigGepPerf/src/Cluster.h:35
Generated on
for ATLAS Offline Software by
1.17.0