ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileL2Algs
src
TileRawChannelToL2.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
// Filename : TileRawChannelToL2.cxx
7
// Author : Aranzazu Ruiz
8
// Created : February, 2007
9
//
10
// DESCRIPTION:
11
// Created to emulate the algorithms processed at the TileCal ROD DSP level
12
// to contribute to the LVL2 trigger: a low Pt muon tagging algorithm based
13
// on the typical muon energy deposition in each cell of TileCal following
14
// projective patterns and the Et calculation per superdrawer.
15
// It takes as input the TileRawChannelContainer. The resulting TileL2 objects
16
// store the information about the number of muons tagged, their coordinates
17
// eta and phi, the energy deposited in Tile, a quality factor and the Et
18
// per superdrawer. There is a TileL2 object per superdrawer, stored in a
19
// TileL2Container in StoreGate.
20
//
21
// HISTORY:
22
//
23
// BUGS:
24
//
25
//*****************************************************************************
26
27
// Tile includes
28
#include "
TileL2Algs/TileRawChannelToL2.h
"
29
#include "
TileEvent/TileL2.h
"
30
#include "
TileL2Algs/TileL2Builder.h
"
31
32
// Athena includes
33
#include "
AthenaKernel/errorcheck.h
"
34
#include "
StoreGate/WriteHandle.h
"
35
36
37
#include <memory>
38
39
TileRawChannelToL2::TileRawChannelToL2
(
const
std::string& name, ISvcLocator* pSvcLocator)
40
:
AthReentrantAlgorithm
(name, pSvcLocator)
41
{
42
}
43
44
TileRawChannelToL2::~TileRawChannelToL2
() {
45
}
46
47
StatusCode
TileRawChannelToL2::initialize
() {
48
49
CHECK
(
m_tileL2Builder
.retrieve() );
50
51
ATH_CHECK
(
m_l2ContainerKey
.initialize() );
52
53
ATH_MSG_DEBUG
(
"TileRawChannelToL2 initialization completed"
);
54
55
return
StatusCode::SUCCESS;
56
}
57
58
StatusCode
TileRawChannelToL2::execute
(
const
EventContext& ctx)
const
{
59
60
SG::WriteHandle<TileL2Container>
l2Container(
m_l2ContainerKey
, ctx);
61
ATH_CHECK
( l2Container.
record
(std::make_unique<TileL2Container>()) );
62
63
ATH_MSG_VERBOSE
(
"TileL2 container registered to the TES with name "
<<
m_l2ContainerKey
.key() );
64
65
l2Container->reserve(256);
66
for
(
int
i = 0; i < 256; i++) {
67
int
collId =
m_tileL2Builder
->indexToId(i);
68
std::unique_ptr<TileL2> l2 = std::make_unique<TileL2>(collId);
69
l2Container->push_back(l2.release());
70
}
71
72
// TileL2Builder is called
73
ATH_CHECK
(
m_tileL2Builder
->process(0, 0xFFFF, l2Container.
ptr
(), ctx) );
74
75
// Debug
76
if
(
msgLvl
(MSG::VERBOSE)) {
77
78
for
(
const
TileL2
* l2 : *l2Container) {
79
80
msg
(MSG::VERBOSE) <<
"frag ID = 0x"
<< MSG::hex << l2->identify() << MSG::dec
81
<<
" phi = "
<< l2->phi(0)
82
<<
" Et = "
<< l2->Et() <<
endmsg
;
83
84
for
(
unsigned
int
i = 0; i < l2->NMuons(); ++i) {
85
msg
(MSG::VERBOSE) <<
"Muon found:"
86
<<
" frag ID = 0x"
<< MSG::hex << l2->identify()
87
<<
" word1 = 0x"
<< l2->val(2 * i)
88
<<
" word2 = 0x"
<< l2->val(2 * i + 1) << MSG::dec
89
<<
" eta = "
<< l2->eta(i)
90
<<
" phi = "
<< l2->phi(i) <<
endmsg
;
91
92
msg
(MSG::VERBOSE) <<
"Muon found:"
93
<<
" E[0] = "
<< l2->enemu0(i) <<
" MeV"
94
<<
" E[1] = "
<< l2->enemu1(i) <<
" MeV"
95
<<
" E[2] = "
<< l2->enemu2(i) <<
" MeV"
96
<<
" QF = "
<< l2->qual(i) <<
endmsg
;
97
98
}
99
}
100
}
101
102
103
104
// Execution completed
105
ATH_MSG_DEBUG
(
"TileRawChannelToL2 execution completed"
);
106
107
return
StatusCode::SUCCESS;
108
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
WriteHandle.h
Handle class for recording to StoreGate.
TileL2Builder.h
TileL2.h
TileRawChannelToL2.h
AthCommonAlgorithm< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition
AthCommonMsg.h:30
AthCommonAlgorithm< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
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.
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
TileL2
Class to store TileMuId and Et quantities computed at the TileCal ROD DSPs.
Definition
TileL2.h:33
TileRawChannelToL2::TileRawChannelToL2
TileRawChannelToL2(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
TileRawChannelToL2.cxx:39
TileRawChannelToL2::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
TileRawChannelToL2.cxx:58
TileRawChannelToL2::initialize
virtual StatusCode initialize() override
Definition
TileRawChannelToL2.cxx:47
TileRawChannelToL2::m_l2ContainerKey
SG::WriteHandleKey< TileL2Container > m_l2ContainerKey
TileL2Container in detector store.
Definition
TileRawChannelToL2.h:69
TileRawChannelToL2::m_tileL2Builder
ToolHandle< TileL2Builder > m_tileL2Builder
Pointer to TileL2Builder.
Definition
TileRawChannelToL2.h:66
TileRawChannelToL2::~TileRawChannelToL2
virtual ~TileRawChannelToL2()
Destructor.
Definition
TileRawChannelToL2.cxx:44
Generated on
for ATLAS Offline Software by
1.17.0