ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TestBeam
TBRec
src
TBCellContainerFillerTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TBCellContainerFillerTool.h
"
6
7
#include "
CaloEvent/CaloCellContainer.h
"
8
#include "
CaloIdentifier/CaloCell_ID.h
"
9
#include "
CaloDetDescr/CaloDetDescrManager.h
"
10
#include "
LArIdentifier/LArOnlineID.h
"
11
12
13
TBCellContainerFillerTool::TBCellContainerFillerTool
(
14
const
std::string&
type
,
15
const
std::string& name,
16
const
IInterface* parent)
17
:base_class (
type
, name, parent)
18
{
19
}
20
21
22
23
24
StatusCode
TBCellContainerFillerTool::initialize
()
25
{
26
ATH_CHECK
(
m_caloMgrKey
.initialize());
27
// Cache pointers:
28
ATH_CHECK
(detStore()->retrieve(
m_theCaloCCIDM
,
"CaloCell_ID"
));
29
30
m_hashMax
=
m_theCaloCCIDM
->calo_cell_hash_max();
31
32
ATH_CHECK
( detStore()->retrieve(
m_onlineHelper
,
"LArOnlineID"
) );
33
34
return
StatusCode::SUCCESS;
35
}
36
37
StatusCode
38
TBCellContainerFillerTool::process
(
CaloCellContainer
* theCont,
39
const
EventContext& ctx)
const
40
{
41
SG::ReadCondHandle<CaloDetDescrManager>
caloMgrHandle{
m_caloMgrKey
,ctx};
42
ATH_CHECK
(caloMgrHandle.
isValid
());
43
const
CaloDetDescrManager
* caloMgr = *caloMgrHandle;
44
45
StatusCode returnSc = StatusCode::SUCCESS ;
46
47
unsigned
int
index
= 0;
48
CaloCellContainer::const_iterator
itrCell;
49
if
(msgLvl(MSG::VERBOSE)) {
50
for
(itrCell=theCont->
begin
();itrCell!=theCont->
end
();++itrCell){
51
const
CaloDetDescrElement
* theDDE=(*itrCell)->caloDDE();
52
ATH_MSG_VERBOSE
(
index
<<
" "
<< (*itrCell)
53
<<
" hash id "
<< theDDE->
calo_hash
()
54
<<
" eta "
<< theDDE->
eta
()
55
<<
" phi "
<< theDDE->
phi
()
56
<<
"e "
<< (*itrCell)->e() );
57
++
index
;
58
}
59
}
60
61
62
// fill holes with 0 energy cells
63
64
ATH_MSG_DEBUG
(
" Now check all cells give meaningfull answer "
);
65
ATH_MSG_DEBUG
(
" Size of original container: "
<<theCont->
size
() );
66
for
(
unsigned
int
theHash=0;theHash<
m_hashMax
;++theHash){
67
const
CaloCell
* theCell = theCont->
findCell
(
IdentifierHash
(theHash)) ;
68
CaloCell
*nCell;
69
if
(!theCell) {
70
Identifier
cellid =
m_theCaloCCIDM
->cell_id(theHash);
71
HWIdentifier
chid =
m_onlineHelper
->channel_Id(
m_theCaloCCIDM
->calo_cell_hash(cellid));
72
if
(!chid.
get_identifier32
().
get_compact
())
continue
;
73
const
CaloDetDescrElement
* cDDE = caloMgr->
get_element
(cellid);
74
if
(!cDDE)
continue
;
75
if
(cDDE->
is_lar_hec
()) {
76
nCell =
new
CaloCell
(cDDE,0.,0.,0.,
CaloGain::LARMEDIUMGAIN
);
77
}
78
else
{
79
nCell =
new
CaloCell
(cDDE,0.,0.,0.,
CaloGain::LARHIGHGAIN
);
80
}
81
ATH_MSG_VERBOSE
(
"Adding 0. energy cell: "
<<
m_theCaloCCIDM
->cell_id(theHash));
82
theCont->
push_back
(nCell);
83
}
84
}
85
86
theCont->
order
();
87
88
return
returnSc ;
89
}
90
91
92
93
94
95
96
97
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
CaloCellContainer.h
CaloCell_ID.h
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
LArOnlineID.h
TBCellContainerFillerTool.h
CaloCellContainer
Container class for CaloCell.
Definition
CaloCellContainer.h:55
CaloCellContainer::findCell
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
Definition
CaloCellContainer.cxx:345
CaloCellContainer::push_back
void push_back(CaloCell *)
reimplementation of const push_back
Definition
CaloCellContainer.cxx:74
CaloCellContainer::order
void order()
order container
Definition
CaloCellContainer.cxx:474
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrElement::calo_hash
IdentifierHash calo_hash() const
cell calo hash
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:412
CaloDetDescrElement::eta
float eta() const
cell eta
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloDetDescrElement::phi
float phi() const
cell phi
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
CaloDetDescrElement::is_lar_hec
bool is_lar_hec() const
cell belongs to HEC
Definition
CaloDetDescrElement.cxx:129
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition
CaloDetDescrManager.cxx:159
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition
CaloDetDescrManager.h:469
DataVector< CaloCell >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
HWIdentifier
Definition
HWIdentifier.h:13
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition
Identifier32.h:47
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::isValid
bool isValid()
Definition
ReadCondHandle.h:205
TBCellContainerFillerTool::TBCellContainerFillerTool
TBCellContainerFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TBCellContainerFillerTool.cxx:13
TBCellContainerFillerTool::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition
TBCellContainerFillerTool.h:33
TBCellContainerFillerTool::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition
TBCellContainerFillerTool.h:39
TBCellContainerFillerTool::process
virtual StatusCode process(CaloCellContainer *theCellContainer, const EventContext &ctx) const override
Definition
TBCellContainerFillerTool.cxx:38
TBCellContainerFillerTool::m_hashMax
unsigned int m_hashMax
Definition
TBCellContainerFillerTool.h:40
TBCellContainerFillerTool::initialize
virtual StatusCode initialize() override
Definition
TBCellContainerFillerTool.cxx:24
TBCellContainerFillerTool::m_theCaloCCIDM
const CaloCell_ID * m_theCaloCCIDM
Definition
TBCellContainerFillerTool.h:38
CaloGain::LARMEDIUMGAIN
@ LARMEDIUMGAIN
Definition
CaloGain.h:18
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition
CaloGain.h:18
Identifier
Definition
IdentifierFieldParser.cxx:14
index
Definition
index.py:1
type
Generated on
for ATLAS Offline Software by
1.17.0