ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileRecAlgs
src
TileBeamElemToCell.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
// Filename : TileBeamElemToCell.cxx
7
// Author : Anna Lupi
8
// Created : July 2004
9
//
10
// DESCRIPTION:
11
// Implementation comments only. Class level comments go in .h file.
12
//
13
// HISTORY:
14
//
15
// BUGS:
16
//
17
//*****************************************************************************
18
19
20
// Tile includes
21
#include "
TileBeamElemToCell.h
"
22
#include "
TileIdentifier/TileHWID.h
"
23
#include "
TileDetDescr/TileDetDescrManager.h
"
24
#include "
TileConditions/TileInfo.h
"
25
#include "
TileEvent/TileCell.h
"
26
27
// Calo includes
28
#include "
CaloIdentifier/TileTBID.h
"
29
#include "CaloDetDescr/CaloDetDescrElement.h"
30
31
// Atlas include
32
#include "
StoreGate/ReadHandle.h
"
33
#include "
StoreGate/WriteHandle.h
"
34
#include "
AthenaKernel/errorcheck.h
"
35
#include "
Identifier/IdentifierHash.h
"
36
// access all RawChannels inside container
37
#include "
EventContainers/SelectAllObject.h
"
38
39
40
// C++ STL includes
41
#include <map>
42
43
//
44
// Constructor
45
//
46
TileBeamElemToCell::TileBeamElemToCell
(
const
std::string& name, ISvcLocator* pSvcLocator)
47
:
AthAlgorithm
(name, pSvcLocator)
48
{
49
}
50
51
TileBeamElemToCell::~TileBeamElemToCell
()
52
{}
53
54
//****************************************************************************
55
//* Initialization
56
//****************************************************************************
57
58
StatusCode
TileBeamElemToCell::initialize
()
59
{
60
61
// retrieve Tile detector manager, TileID helper and TileIfno from det store
62
CHECK
(
detStore
()->retrieve(
m_tileMgr
) );
63
CHECK
(
detStore
()->retrieve(
m_tileTBID
) );
64
CHECK
(
detStore
()->retrieve(
m_tileHWID
) );
65
CHECK
(
detStore
()->retrieve(
m_tileInfo
,
m_infoName
.value()) );
66
67
ATH_CHECK
(
m_beamElemContainerKey
.initialize() );
68
ATH_CHECK
(
m_cellContainerKey
.initialize() );
69
70
ATH_MSG_INFO
(
"initialization completed"
);
71
72
return
StatusCode::SUCCESS;
73
}
74
75
76
//****************************************************************************
77
//* Execution
78
//****************************************************************************
79
80
StatusCode
TileBeamElemToCell::execute
(
const
EventContext& ctx)
81
{
82
83
// create new container
84
SG::WriteHandle<CaloCellContainer>
cellContainer(
m_cellContainerKey
, ctx);
85
86
/* Register the set of TileCells to the event store. */
87
ATH_CHECK
( cellContainer.
record
(std::make_unique<CaloCellContainer>()) );
88
89
//**
90
//* Get TileBeamElems
91
//**
92
SG::ReadHandle<TileBeamElemContainer>
beamElemContainer(
m_beamElemContainerKey
, ctx);
93
94
if
(!beamElemContainer.
isValid
()) {
95
ATH_MSG_WARNING
(
"No signal from beam elements; container '"
96
<<
m_beamElemContainerKey
.key() <<
"' doesn't exist in StoreGate"
);
97
98
}
else
{
99
100
//* Iterate over BeamElem, creating new TileCells (or incrementing
101
//* existing ones). Add each new TileCell to the CaloCellContainer.
102
103
SelectAllObject<TileBeamElemContainer>
beamElems(beamElemContainer.
cptr
());
104
105
for
(
const
TileBeamElem
* beamElem : beamElems) {
106
107
HWIdentifier
adc_id = beamElem->adc_HWID();
108
std::vector<unsigned int> amp = beamElem->get_digits();
109
float
ener = amp[0] *
m_tileInfo
->BeamElemChannelCalib(adc_id);
110
111
Identifier
cell_ID = beamElem->pmt_ID();
112
113
// CaloDDE is NULL pointer here
114
// store cell in container
115
std::unique_ptr<TileCell> cell = std::make_unique<TileCell>(
nullptr
, cell_ID, ener);
116
cellContainer->push_back(cell.release());
117
}
118
}
119
120
121
// Execution completed.
122
123
ATH_MSG_VERBOSE
(
"TileCell container registered to the TES with name"
124
<<
m_cellContainerKey
.key());
125
126
127
return
StatusCode::SUCCESS;
128
129
}
130
131
132
//****************************************************************************
133
//* Finalize
134
//****************************************************************************
135
136
StatusCode
TileBeamElemToCell::finalize
()
137
{
138
139
ATH_MSG_INFO
(
"finalize() end"
);
140
141
return
StatusCode::SUCCESS;
142
}
143
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x,...)
Definition
AthMsgStreamMacros.h:46
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x,...)
Definition
AthMsgStreamMacros.h:42
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
TileTBID.h
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
IdentifierHash.h
SelectAllObject.h
SelectAllObject
SelectAllObjectMT< DCC, OBJECT > SelectAllObject
Definition
SelectAllObject.h:11
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
TileBeamElemToCell.h
TileCell.h
TileDetDescrManager.h
TileHWID.h
TileInfo.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
HWIdentifier
Definition
HWIdentifier.h:13
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:66
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:71
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
TileBeamElemToCell::m_tileHWID
const TileHWID * m_tileHWID
Definition
TileBeamElemToCell.h:95
TileBeamElemToCell::m_tileTBID
const TileTBID * m_tileTBID
Definition
TileBeamElemToCell.h:94
TileBeamElemToCell::m_tileMgr
const TileDetDescrManager * m_tileMgr
Definition
TileBeamElemToCell.h:97
TileBeamElemToCell::m_cellContainerKey
SG::WriteHandleKey< CaloCellContainer > m_cellContainerKey
Definition
TileBeamElemToCell.h:88
TileBeamElemToCell::execute
StatusCode execute(const EventContext &ctx)
Execute method.
Definition
TileBeamElemToCell.cxx:80
TileBeamElemToCell::m_tileInfo
const TileInfo * m_tileInfo
Definition
TileBeamElemToCell.h:96
TileBeamElemToCell::m_beamElemContainerKey
SG::ReadHandleKey< TileBeamElemContainer > m_beamElemContainerKey
Definition
TileBeamElemToCell.h:84
TileBeamElemToCell::~TileBeamElemToCell
virtual ~TileBeamElemToCell()
Definition
TileBeamElemToCell.cxx:51
TileBeamElemToCell::initialize
StatusCode initialize()
Definition
TileBeamElemToCell.cxx:58
TileBeamElemToCell::m_infoName
Gaudi::Property< std::string > m_infoName
Definition
TileBeamElemToCell.h:92
TileBeamElemToCell::finalize
StatusCode finalize()
Definition
TileBeamElemToCell.cxx:136
TileBeamElemToCell::TileBeamElemToCell
TileBeamElemToCell(const std::string &name, ISvcLocator *pSvcLocator)
Definition
TileBeamElemToCell.cxx:46
TileBeamElem
Definition
TileBeamElem.h:27
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0