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-2020 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
,
m_tileTBID
(0)
49
,
m_tileHWID
(0)
50
,
m_tileInfo
(0)
51
,
m_tileMgr
(0)
52
{
53
declareProperty
(
"TileInfoName"
,
m_infoName
=
"TileInfo"
);
// name of TileInfo store
54
}
55
56
TileBeamElemToCell::~TileBeamElemToCell
()
57
{}
58
59
//****************************************************************************
60
//* Initialization
61
//****************************************************************************
62
63
StatusCode
TileBeamElemToCell::initialize
()
64
{
65
66
// retrieve Tile detector manager, TileID helper and TileIfno from det store
67
CHECK
(
detStore
()->retrieve(
m_tileMgr
) );
68
CHECK
(
detStore
()->retrieve(
m_tileTBID
) );
69
CHECK
(
detStore
()->retrieve(
m_tileHWID
) );
70
CHECK
(
detStore
()->retrieve(
m_tileInfo
,
m_infoName
) );
71
72
ATH_CHECK
(
m_beamElemContainerKey
.initialize() );
73
ATH_CHECK
(
m_cellContainerKey
.initialize() );
74
75
ATH_MSG_INFO
(
"initialization completed"
);
76
77
return
StatusCode::SUCCESS;
78
}
79
80
81
//****************************************************************************
82
//* Execution
83
//****************************************************************************
84
85
StatusCode
TileBeamElemToCell::execute
(
const
EventContext& ctx)
86
{
87
88
// create new container
89
SG::WriteHandle<CaloCellContainer>
cellContainer(
m_cellContainerKey
, ctx);
90
91
/* Register the set of TileCells to the event store. */
92
ATH_CHECK
( cellContainer.
record
(std::make_unique<CaloCellContainer>()) );
93
94
//**
95
//* Get TileBeamElems
96
//**
97
SG::ReadHandle<TileBeamElemContainer>
beamElemContainer(
m_beamElemContainerKey
, ctx);
98
99
if
(!beamElemContainer.
isValid
()) {
100
ATH_MSG_WARNING
(
"No signal from beam elements; container '"
101
<<
m_beamElemContainerKey
.key() <<
"' doesn't exist in StoreGate"
);
102
103
}
else
{
104
105
//* Iterate over BeamElem, creating new TileCells (or incrementing
106
//* existing ones). Add each new TileCell to the CaloCellContainer.
107
108
SelectAllObject<TileBeamElemContainer>
beamElems(beamElemContainer.
cptr
());
109
110
for
(
const
TileBeamElem
* beamElem : beamElems) {
111
112
HWIdentifier
adc_id = beamElem->adc_HWID();
113
std::vector<unsigned int> amp = beamElem->get_digits();
114
float
ener = amp[0] *
m_tileInfo
->BeamElemChannelCalib(adc_id);
115
116
Identifier
cell_ID = beamElem->pmt_ID();
117
118
// CaloDDE is NULL pointer here
119
// store cell in container
120
std::unique_ptr<TileCell> cell = std::make_unique<TileCell>(
nullptr
, cell_ID, ener);
121
cellContainer->push_back(cell.release());
122
}
123
}
124
125
126
// Execution completed.
127
128
ATH_MSG_VERBOSE
(
"TileCell container registered to the TES with name"
129
<<
m_cellContainerKey
.key());
130
131
132
return
StatusCode::SUCCESS;
133
134
}
135
136
137
//****************************************************************************
138
//* Finalize
139
//****************************************************************************
140
141
StatusCode
TileBeamElemToCell::finalize
()
142
{
143
144
ATH_MSG_INFO
(
"finalize() end"
);
145
146
return
StatusCode::SUCCESS;
147
}
148
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
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 >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
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:67
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:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
TileBeamElemToCell::m_infoName
std::string m_infoName
Definition
TileBeamElemToCell.h:92
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:85
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:56
TileBeamElemToCell::initialize
StatusCode initialize()
Definition
TileBeamElemToCell.cxx:63
TileBeamElemToCell::finalize
StatusCode finalize()
Definition
TileBeamElemToCell.cxx:141
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