ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellContCopyTool Class Reference

Concrete tool for coping an entire CaloCellContainer. More...

#include <CaloCellContCopyTool.h>

Inheritance diagram for CaloCellContCopyTool:
Collaboration diagram for CaloCellContCopyTool:

Public Member Functions

virtual StatusCode initialize () override
virtual StatusCode process (CaloCellContainer *theCellContainer, const EventContext &ctx) const override

Private Attributes

SG::ReadHandleKey< CaloCellContainerm_srcCellContainerKey {this,"InputName","AllCalo"}

Detailed Description

Concrete tool for coping an entire CaloCellContainer.

CaloCellContCopyTool to be used by CaloCellMaker algorithms. The tool copies Calo cells from an existing CaloCellContainer to the one processed by the CaloCellMaker algorithm.

Definition at line 22 of file CaloCellContCopyTool.h.

Member Function Documentation

◆ initialize()

StatusCode CaloCellContCopyTool::initialize ( )
overridevirtual

Definition at line 11 of file CaloCellContCopyTool.cxx.

11 {
12
13 ATH_MSG_INFO( "In initialize ");
15 return StatusCode::SUCCESS;
16}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
virtual StatusCode initialize() override
SG::ReadHandleKey< CaloCellContainer > m_srcCellContainerKey

◆ process()

StatusCode CaloCellContCopyTool::process ( CaloCellContainer * theCellContainer,
const EventContext & ctx ) const
overridevirtual

Definition at line 19 of file CaloCellContCopyTool.cxx.

20 {
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}

Member Data Documentation

◆ m_srcCellContainerKey

SG::ReadHandleKey<CaloCellContainer> CaloCellContCopyTool::m_srcCellContainerKey {this,"InputName","AllCalo"}
private

Definition at line 34 of file CaloCellContCopyTool.h.

34{this,"InputName","AllCalo"};

The documentation for this class was generated from the following files: