ATLAS Offline Software
Loading...
Searching...
No Matches
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
10
12
13 ATH_MSG_INFO( "In initialize ");
15 return StatusCode::SUCCESS;
16}
17
18
20 const EventContext& ctx) const {
21 // Retrieve source cell container
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
virtual StatusCode process(CaloCellContainer *theCellContainer, const EventContext &ctx) const override
virtual StatusCode initialize() override
SG::ReadHandleKey< CaloCellContainer > m_srcCellContainerKey
Container class for CaloCell.
void push_back_fast(CaloCell *)
reimplementation of push_back to gain speed in readin
void resetLookUpTable()
reset look up table
void setHasTotalSize(const bool)
If @ flag is true, then the container size equals the maximum hash.
std::vector< bool > m_hasCalo
true if given cell from given calo has been filled (even if none)
void setIsOrderedAndComplete(const bool ordered)
indicate that the container is complete and in order
void setIsOrdered(const bool ordered)
indicates that the container is ordered
void updateCaloIterators()
fill calo iterators and the index of first and last cell IT IS THE RESPONSABILITY OF THE PRODUCER TO ...
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
This class groups all DetDescr information related to a CaloCell.
a typed memory pool that saves time spent allocation small object.
Definition DataPool.h:63
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
Data object for LAr calorimeter readout cell.
Definition LArCell.h:53