Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
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 }

◆ 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
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.


The documentation for this class was generated from the following files:
CaloCellContCopyTool::m_srcCellContainerKey
SG::ReadHandleKey< CaloCellContainer > m_srcCellContainerKey
Definition: CaloCellContCopyTool.h:34
TileCell
Definition: TileCell.h:57
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloDetDescrElement::is_tile
bool is_tile() const
cell belongs to Tile
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:442
CaloCellContCopyTool::initialize
virtual StatusCode initialize() override
Definition: CaloCellContCopyTool.cxx:11
LArCell
Data object for LAr calorimeter readout cell.
Definition: LArCell.h:53
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
DataPool
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
Definition: DataPool.h:63