ATLAS Offline Software
Loading...
Searching...
No Matches
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 8 of file TrigGepPerf/src/EMB1CellsFromCaloCells.cxx.

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

◆ ~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 22 of file TrigGepPerf/src/EMB1CellsFromCaloCells.cxx.

23 {
24 // Read in a container containing (all) CaloCells
25
26 auto h_caloCells = SG::makeHandle(m_caloCellsKey, ctx);
27 CHECK(h_caloCells.isValid());
28
29 const auto & allCaloCells = *h_caloCells;
30
31
32 // limit cells to LAREM CaloCells
33 if(! allCaloCells.hasCalo(m_calocell_id->LAREM)){
34 ATH_MSG_ERROR("CaloCellCollection does not contain LAREM cells");
35 return StatusCode::FAILURE;
36 }
37
38 std::vector<const CaloCell*>
39 laremCells(allCaloCells.beginConstCalo(CaloCell_ID::LAREM),
40 allCaloCells.endConstCalo(CaloCell_ID::LAREM));
41
42 // selector
43 auto EMB1_sel = [&calocell_id=m_calocell_id](const CaloCell* cell) {
44 return
45 calocell_id->calo_sample(calocell_id->calo_cell_hash(cell->ID())) ==
46 CaloCell_Base_ID::EMB1;
47 };
48
49
50 std::vector<const CaloCell*> emb1_cells;
51 std::copy_if(laremCells.cbegin(),
52 laremCells.cend(),
53 std::back_inserter(emb1_cells),
54 EMB1_sel);
55
56 cells.push_back(std::move(emb1_cells));
57
58 return StatusCode::SUCCESS;
59}
#define ATH_MSG_ERROR(x)
#define CHECK(...)
Evaluate an expression and check for errors.
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
virtual StatusCode cells(std::vector< std::vector< const CaloCell * > > &, const EventContext &) const override
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ initialize()

StatusCode EMB1CellsFromCaloCells::initialize ( )
overridevirtual

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

14 {
15 CHECK(m_caloCellsKey.initialize());
16 CHECK(detStore()->retrieve (m_calocell_id, "CaloCell_ID"));
17
18 return StatusCode::SUCCESS;
19}

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.

38{nullptr};

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

35 {
36 this, "caloCells", "AllCalo", "key to read in a CaloCell constainer"};

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