ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1CaloFEX
L1CaloFEXSim
src
eTowerMakerFromSuperCells.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
6
#include "
xAODTrigL1Calo/TriggerTowerContainer.h
"
7
8
#include "
L1CaloFEXSim/eTower.h
"
9
#include "
eTowerBuilder.h
"
10
#include "
L1CaloFEXSim/eTowerContainer.h
"
11
#include "
eTowerMakerFromSuperCells.h
"
12
#include "
eSuperCellTowerMapper.h
"
13
14
#include "
StoreGate/WriteHandle.h
"
15
16
#include <fstream>
17
18
namespace
LVL1
{
19
20
eTowerMakerFromSuperCells::eTowerMakerFromSuperCells
(
const
std::string&
name
, ISvcLocator* pSvcLocator)
21
:
AthReentrantAlgorithm
(
name
, pSvcLocator)
22
{
23
24
}
25
26
27
StatusCode
eTowerMakerFromSuperCells::initialize
()
28
{
29
ATH_CHECK
(
m_eTowerBuilderTool
.retrieve() );
30
31
ATH_CHECK
(
m_eSuperCellTowerMapperTool
.retrieve() );
32
33
ATH_CHECK
(
m_eTowerContainerSGKey
.initialize() );
34
35
return
StatusCode::SUCCESS;
36
}
37
38
39
StatusCode
eTowerMakerFromSuperCells::execute
(
const
EventContext& ctx)
const
40
{
41
// STEP 0 - Make a fresh local eTowerContainer
42
std::unique_ptr<eTowerContainer> local_eTowerContainerRaw = std::make_unique<eTowerContainer>();
43
44
// STEP 1 - Make some eTowers and fill the local container
45
m_eTowerBuilderTool
->init(local_eTowerContainerRaw);
46
local_eTowerContainerRaw->clearContainerMap();
47
local_eTowerContainerRaw->fillContainerMap();
48
49
// STEP 2 - Do the supercell-tower mapping - put this information into the eTowerContainer
50
ATH_CHECK
(
m_eSuperCellTowerMapperTool
->AssignSuperCellsToTowers(local_eTowerContainerRaw));
51
ATH_CHECK
(
m_eSuperCellTowerMapperTool
->AssignTriggerTowerMapper(local_eTowerContainerRaw));
52
53
// STEP 2.5 - Set up a the first CSV file if necessary (should only need to be done if the mapping changes, which should never happen unless major changes to the simulation are required)
54
if
(
false
){
// CSV CODE TO BE RE-INTRODUCED VERY SOON
55
//if (first event){
56
std::ofstream sc_tower_map;
57
sc_tower_map.open(
"./sc_tower_map.csv"
);
58
sc_tower_map <<
"#eTowerID,scID,slot,isSplit"
<<
"\n"
;
59
60
for
(
auto
thistower : *local_eTowerContainerRaw){
61
int
slotcount = 0;
62
for
(
int
layer = 0; layer<=4; layer++){
63
std::vector<Identifier> scIDs = thistower->getLayerSCIDs(layer);
64
std::vector<unsigned int> splits = thistower->getETSplits();
65
for
(
auto
scid : scIDs){
66
sc_tower_map << thistower->id() <<
","
<< scid <<
","
<< slotcount <<
","
<< splits[slotcount] <<
"\n"
;
67
slotcount++;
68
}
69
}
70
}
71
sc_tower_map.close();
72
}
73
74
75
// STEP 3 - Write the completed eTowerContainer into StoreGate (move the local copy in memory)
76
SG::WriteHandle<LVL1::eTowerContainer>
eTowerContainerSG(
m_eTowerContainerSGKey
, ctx);
77
ATH_CHECK
(eTowerContainerSG.
record
(std::move(
/*my_eTowerContainerRaw*/
local_eTowerContainerRaw)));
78
79
return
StatusCode::SUCCESS;
80
}
81
82
83
}
// end of LVL1 namespace
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
WriteHandle.h
Handle class for recording to StoreGate.
TriggerTowerContainer.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
LVL1::eTowerMakerFromSuperCells::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
eTowerMakerFromSuperCells.cxx:39
LVL1::eTowerMakerFromSuperCells::m_eTowerContainerSGKey
SG::WriteHandleKey< LVL1::eTowerContainer > m_eTowerContainerSGKey
Definition
eTowerMakerFromSuperCells.h:33
LVL1::eTowerMakerFromSuperCells::eTowerMakerFromSuperCells
eTowerMakerFromSuperCells(const std::string &name, ISvcLocator *pSvcLocator)
Definition
eTowerMakerFromSuperCells.cxx:20
LVL1::eTowerMakerFromSuperCells::m_eSuperCellTowerMapperTool
ToolHandle< IeSuperCellTowerMapper > m_eSuperCellTowerMapperTool
Definition
eTowerMakerFromSuperCells.h:36
LVL1::eTowerMakerFromSuperCells::m_eTowerBuilderTool
ToolHandle< IeTowerBuilder > m_eTowerBuilderTool
Definition
eTowerMakerFromSuperCells.h:35
LVL1::eTowerMakerFromSuperCells::initialize
virtual StatusCode initialize() override
Definition
eTowerMakerFromSuperCells.cxx:27
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
eSuperCellTowerMapper.h
eTowerBuilder.h
eTowerContainer.h
eTowerMakerFromSuperCells.h
eTower.h
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition
IZdcDataAccess.h:13
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0