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

#include <EMB1CellsFromCaloCells.h>

Inheritance diagram for GlobalSim::EMB1CellsFromCaloCells:
Collaboration diagram for GlobalSim::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< const CaloCell * > &, const EventContext &) const override

Private Attributes

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

Detailed Description

Constructor & Destructor Documentation

◆ EMB1CellsFromCaloCells()

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

Definition at line 9 of file Global/GlobalSimulation/src/FirstChain/EMB1CellsFromCaloCells.cxx.

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

◆ ~EMB1CellsFromCaloCells()

virtual GlobalSim::EMB1CellsFromCaloCells::~EMB1CellsFromCaloCells ( )
inlinevirtual

Member Function Documentation

◆ cells()

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

Definition at line 21 of file Global/GlobalSimulation/src/FirstChain/EMB1CellsFromCaloCells.cxx.

22 {
23
24 // Read in a container containing all CaloCells
25
26 SG::ReadHandle<CaloCellContainer> h_caloCells;
27
28 h_caloCells = SG::makeHandle(m_caloCellsKey, ctx);
29 CHECK(h_caloCells.isValid());
30
31 const auto& allCaloCells = *h_caloCells;
32 ATH_MSG_DEBUG("allCaloCells size " << allCaloCells.size());
34 if(!allCaloCells.checkOrderedAndComplete()){
35 ATH_MSG_ERROR("CaloCellCollection fails checks");
36 return StatusCode::FAILURE;
37 }
38 }
39
40
41 // lambda to select EMB1 cells
42 auto EMB1_sel = [](const CaloCell* cell) {
43 return cell->caloDDE()->getSampling() == CaloCell_Base_ID::EMB1;
44 };
45
46
47 std::copy_if(allCaloCells.beginConstCalo(CaloCell_ID::LAREM),
48 allCaloCells.endConstCalo(CaloCell_ID::LAREM),
49 std::back_inserter(cells),
50 EMB1_sel);
51
52
53 return StatusCode::SUCCESS;
54 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode cells(std::vector< const CaloCell * > &, const EventContext &) const override
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 EMB1CellsFromCaloCells::initialize ( )
overridevirtual

Definition at line 15 of file Global/GlobalSimulation/src/FirstChain/EMB1CellsFromCaloCells.cxx.

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

Member Data Documentation

◆ m_caloCellsKey

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

Definition at line 33 of file Global/GlobalSimulation/src/FirstChain/EMB1CellsFromCaloCells.h.

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

◆ m_makeCaloCellContainerChecks

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

Definition at line 36 of file Global/GlobalSimulation/src/FirstChain/EMB1CellsFromCaloCells.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: