ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalSim::EMBE1CellsFromCaloCells Class Reference

#include <EMBE1CellsFromCaloCells.h>

Inheritance diagram for GlobalSim::EMBE1CellsFromCaloCells:
Collaboration diagram for GlobalSim::EMBE1CellsFromCaloCells:

Public Member Functions

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

Private Attributes

SG::ReadHandleKey< CaloCellContainerm_caloCellsKey
Gaudi::Property< bool > m_makeCaloCellContainerChecks

Detailed Description

Definition at line 15 of file EMBE1CellsFromCaloCells.h.

Constructor & Destructor Documentation

◆ EMBE1CellsFromCaloCells()

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

Definition at line 9 of file EMBE1CellsFromCaloCells.cxx.

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

◆ ~EMBE1CellsFromCaloCells()

virtual GlobalSim::EMBE1CellsFromCaloCells::~EMBE1CellsFromCaloCells ( )
inlinevirtual

Definition at line 24 of file EMBE1CellsFromCaloCells.h.

24{};

Member Function Documentation

◆ cells()

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

Definition at line 21 of file EMBE1CellsFromCaloCells.cxx.

22 {
23
24 // Read in a container containing all CaloCells
25 SG::ReadHandle<CaloCellContainer> h_caloCells;
26
27 h_caloCells = SG::makeHandle(m_caloCellsKey, ctx);
28 CHECK(h_caloCells.isValid());
29
30 const auto& allCaloCells = *h_caloCells;
31 ATH_MSG_DEBUG("allCaloCells size " << allCaloCells.size());
33 if(!allCaloCells.checkOrderedAndComplete()){
34 ATH_MSG_ERROR("CaloCellCollection fails checks");
35 return StatusCode::FAILURE;
36 }
37 }
38
39
40 // lambda to select EMB1 and EME1 cells
41 auto EMBE1_sel = [](const CaloCell* cell) {
42 if (cell->caloDDE()->getSampling() == CaloCell_Base_ID::EMB1 || cell->caloDDE()->getSampling() == CaloCell_Base_ID::EME1){
43 return true;
44 } else {
45 return false;
46 }
47 };
48
49
50 std::copy_if(allCaloCells.beginConstCalo(CaloCell_ID::LAREM),
51 allCaloCells.endConstCalo(CaloCell_ID::LAREM),
52 std::back_inserter(cells),
53 EMBE1_sel);
54
55
56 return StatusCode::SUCCESS;
57 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
virtual StatusCode cells(std::vector< const CaloCell * > &, const EventContext &) const override
Gaudi::Property< bool > m_makeCaloCellContainerChecks
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ initialize()

StatusCode GlobalSim::EMBE1CellsFromCaloCells::initialize ( )
overridevirtual

Definition at line 15 of file EMBE1CellsFromCaloCells.cxx.

15 {
16 CHECK(m_caloCellsKey.initialize());
17 return StatusCode::SUCCESS;
18 }

Member Data Documentation

◆ m_caloCellsKey

SG::ReadHandleKey<CaloCellContainer> GlobalSim::EMBE1CellsFromCaloCells::m_caloCellsKey
private
Initial value:
{
this, "caloCells", "SeedLessFS", "key to read in a CaloCell container"}

Definition at line 33 of file EMBE1CellsFromCaloCells.h.

33 {
34 this, "caloCells", "SeedLessFS", "key to read in a CaloCell container"};

◆ m_makeCaloCellContainerChecks

Gaudi::Property<bool> GlobalSim::EMBE1CellsFromCaloCells::m_makeCaloCellContainerChecks
private
Initial value:
{
this,
"makeCaloCellContainerChecks",
true,
"flag to run checks on read-in CaloCellContainer"}

Definition at line 36 of file EMBE1CellsFromCaloCells.h.

36 {
37 this,
38 "makeCaloCellContainerChecks",
39 true,
40 "flag to run checks on read-in CaloCellContainer"};

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