ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
EMB1CellsFromCaloCells Class Reference

#include <EMB1CellsFromCaloCells.h>

Inheritance diagram for EMB1CellsFromCaloCells:
Collaboration diagram for EMB1CellsFromCaloCells:

Public Member Functions

 EMB1CellsFromCaloCells (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~EMB1CellsFromCaloCells ()
 
virtual StatusCode initialize () override
 
virtual StatusCode cells (std::vector< std::vector< const CaloCell * >> &, const EventContext &) const override
 

Private Attributes

SG::ReadHandleKey< CaloCellContainerm_caloCellsKey
 
const CaloCell_IDm_calocell_id {nullptr}
 

Detailed Description

Definition at line 18 of file TrigGepPerf/src/EMB1CellsFromCaloCells.h.

Constructor & Destructor Documentation

◆ EMB1CellsFromCaloCells()

EMB1CellsFromCaloCells::EMB1CellsFromCaloCells ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 7 of file TrigGepPerf/src/EMB1CellsFromCaloCells.cxx.

9  :
10  base_class(type, name, parent){
11 }

◆ ~EMB1CellsFromCaloCells()

virtual EMB1CellsFromCaloCells::~EMB1CellsFromCaloCells ( )
inlinevirtual

Definition at line 27 of file TrigGepPerf/src/EMB1CellsFromCaloCells.h.

27 {};

Member Function Documentation

◆ cells()

StatusCode EMB1CellsFromCaloCells::cells ( std::vector< std::vector< const CaloCell * >> &  cells,
const EventContext &  ctx 
) const
overridevirtual

Definition at line 21 of file TrigGepPerf/src/EMB1CellsFromCaloCells.cxx.

22  {
23  // Read in a container containing (all) CaloCells
24 
25  auto h_caloCells = SG::makeHandle(m_caloCellsKey, ctx);
26  CHECK(h_caloCells.isValid());
27 
28  auto allCaloCells = *h_caloCells;
29 
30 
31  // limit cells to LAREM CaloCells
32  if(! allCaloCells.hasCalo(m_calocell_id->LAREM)){
33  ATH_MSG_ERROR("CaloCellCollection does not contain LAREM cells");
34  return StatusCode::FAILURE;
35  }
36 
37  std::vector<const CaloCell*>
38  laremCells(allCaloCells.beginConstCalo(CaloCell_ID::LAREM),
39  allCaloCells.endConstCalo(CaloCell_ID::LAREM));
40 
41  // selector
42  auto EMB1_sel = [&calocell_id=m_calocell_id](const CaloCell* cell) {
43  return
44  calocell_id->calo_sample(calocell_id->calo_cell_hash(cell->ID())) ==
46  };
47 
48 
49  std::vector<const CaloCell*> emb1_cells;
50  std::copy_if(laremCells.cbegin(),
51  laremCells.cend(),
52  std::back_inserter(emb1_cells),
53  EMB1_sel);
54 
55  cells.push_back(emb1_cells);
56 
57  return StatusCode::SUCCESS;
58 }

◆ initialize()

StatusCode EMB1CellsFromCaloCells::initialize ( )
overridevirtual

Definition at line 13 of file TrigGepPerf/src/EMB1CellsFromCaloCells.cxx.

13  {
15  CHECK(detStore()->retrieve (m_calocell_id, "CaloCell_ID"));
16 
17  return StatusCode::SUCCESS;
18 }

Member Data Documentation

◆ m_calocell_id

const CaloCell_ID* EMB1CellsFromCaloCells::m_calocell_id {nullptr}
private

Definition at line 38 of file TrigGepPerf/src/EMB1CellsFromCaloCells.h.

◆ m_caloCellsKey

SG::ReadHandleKey<CaloCellContainer> EMB1CellsFromCaloCells::m_caloCellsKey
private
Initial value:
{
this, "caloCells", "AllCalo", "key to read in a CaloCell constainer"}

Definition at line 35 of file TrigGepPerf/src/EMB1CellsFromCaloCells.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
EMB1CellsFromCaloCells::m_caloCellsKey
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
Definition: TrigGepPerf/src/EMB1CellsFromCaloCells.h:35
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AnalysisUtils::copy_if
Out copy_if(In first, const In &last, Out res, const Pred &p)
Definition: IFilterUtils.h:30
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
EMB1CellsFromCaloCells::cells
virtual StatusCode cells(std::vector< std::vector< const CaloCell * >> &, const EventContext &) const override
Definition: TrigGepPerf/src/EMB1CellsFromCaloCells.cxx:21
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
EMB1CellsFromCaloCells::m_calocell_id
const CaloCell_ID * m_calocell_id
Definition: TrigGepPerf/src/EMB1CellsFromCaloCells.h:38
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46