ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloRec
src
CaloCellContCopyTool.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
#include "
CaloEvent/CaloCellContainer.h
"
6
#include "
CaloCellContCopyTool.h
"
7
#include "
TileEvent/TileCell.h
"
8
#include "
LArRecEvent/LArCell.h
"
9
#include "
AthAllocators/DataPool.h
"
10
11
StatusCode
CaloCellContCopyTool::initialize
() {
12
13
ATH_MSG_INFO
(
"In initialize "
);
14
ATH_CHECK
(
m_srcCellContainerKey
.
initialize
());
15
return
StatusCode::SUCCESS;
16
}
17
18
19
StatusCode
CaloCellContCopyTool::process
(
CaloCellContainer
* theCont,
20
const
EventContext& ctx)
const
{
21
// Retrieve source cell container
22
SG::ReadHandle<CaloCellContainer>
srcCont(
m_srcCellContainerKey
, ctx);
23
24
//Copy indivial cells - profiting from DataPool to avoid small allocations
25
DataPool<LArCell>
lArPool(ctx,182468);
26
DataPool<TileCell>
tilePool(ctx,5217);
27
for
(
const
CaloCell
* oldCell : *srcCont) {
28
const
CaloDetDescrElement
* dde=oldCell->caloDDE();
29
if
(dde->
is_tile
()) {
30
TileCell
* tCell=tilePool.
nextElementPtr
();
31
const
TileCell
* oldtCell=
static_cast<
const
TileCell
*
>
(oldCell);
32
*tCell=*oldtCell;
33
theCont->
push_back_fast
(tCell);
34
}
35
else
{
36
LArCell
* pCell = lArPool.
nextElementPtr
();
37
const
LArCell
* oldlCell=
static_cast<
const
LArCell
*
>
(oldCell);
38
*pCell=*oldlCell;
39
theCont->
push_back_fast
(pCell);
40
}
41
}
42
43
//Copy container-properties
44
theCont->
setIsOrderedAndComplete
(srcCont->isOrderedAndComplete());
45
theCont->
setIsOrdered
(srcCont->isOrdered());
46
theCont->
setHasTotalSize
(srcCont->hasTotalSize());
47
theCont->
m_hasCalo
=srcCont->m_hasCalo;
48
theCont->
updateCaloIterators
();
49
theCont->
resetLookUpTable
();
50
51
return
StatusCode::SUCCESS;
52
}
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
CaloCellContCopyTool.h
CaloCellContainer.h
DataPool.h
LArCell.h
TileCell.h
CaloCellContCopyTool::process
virtual StatusCode process(CaloCellContainer *theCellContainer, const EventContext &ctx) const override
Definition
CaloCellContCopyTool.cxx:19
CaloCellContCopyTool::initialize
virtual StatusCode initialize() override
Definition
CaloCellContCopyTool.cxx:11
CaloCellContCopyTool::m_srcCellContainerKey
SG::ReadHandleKey< CaloCellContainer > m_srcCellContainerKey
Definition
CaloCellContCopyTool.h:34
CaloCellContainer
Container class for CaloCell.
Definition
CaloCellContainer.h:55
CaloCellContainer::push_back_fast
void push_back_fast(CaloCell *)
reimplementation of push_back to gain speed in readin
Definition
CaloCellContainer.cxx:102
CaloCellContainer::resetLookUpTable
void resetLookUpTable()
reset look up table
Definition
CaloCellContainer.cxx:462
CaloCellContainer::setHasTotalSize
void setHasTotalSize(const bool)
If @ flag is true, then the container size equals the maximum hash.
Definition
CaloCellContainer.cxx:169
CaloCellContainer::m_hasCalo
std::vector< bool > m_hasCalo
true if given cell from given calo has been filled (even if none)
Definition
CaloCellContainer.h:275
CaloCellContainer::setIsOrderedAndComplete
void setIsOrderedAndComplete(const bool ordered)
indicate that the container is complete and in order
Definition
CaloCellContainer.cxx:165
CaloCellContainer::setIsOrdered
void setIsOrdered(const bool ordered)
indicates that the container is ordered
Definition
CaloCellContainer.cxx:204
CaloCellContainer::updateCaloIterators
void updateCaloIterators()
fill calo iterators and the index of first and last cell IT IS THE RESPONSABILITY OF THE PRODUCER TO ...
Definition
CaloCellContainer.cxx:268
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::is_tile
bool is_tile() const
cell belongs to Tile
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:442
DataPool
a typed memory pool that saves time spent allocation small object.
Definition
DataPool.h:63
DataPool::nextElementPtr
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
LArCell
Data object for LAr calorimeter readout cell.
Definition
LArCell.h:53
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
TileCell
Definition
TileCell.h:57
Generated on
for ATLAS Offline Software by
1.17.0