ATLAS Offline Software
Loading...
Searching...
No Matches
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
29#include "TileEvent/TileL2.h"
31
32// Athena includes
35
36
37#include <memory>
38
39TileRawChannelToL2::TileRawChannelToL2(const std::string& name, ISvcLocator* pSvcLocator)
40 : AthReentrantAlgorithm(name, pSvcLocator)
41{
42}
43
46
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
58StatusCode TileRawChannelToL2::execute(const EventContext& ctx) const {
59
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}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Handle class for recording to StoreGate.
bool msgLvl(const MSG::Level lvl) const
An algorithm that can be simultaneously executed in multiple threads.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
Class to store TileMuId and Et quantities computed at the TileCal ROD DSPs.
Definition TileL2.h:33
TileRawChannelToL2(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
virtual StatusCode execute(const EventContext &ctx) const override
virtual StatusCode initialize() override
SG::WriteHandleKey< TileL2Container > m_l2ContainerKey
TileL2Container in detector store.
ToolHandle< TileL2Builder > m_tileL2Builder
Pointer to TileL2Builder.
virtual ~TileRawChannelToL2()
Destructor.