ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
Global
GlobalSimulation
src
Lar_Preproc
EMBE1CellsFromCaloCells.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
EMBE1CellsFromCaloCells.h
"
6
7
namespace
GlobalSim
{
8
9
EMBE1CellsFromCaloCells::EMBE1CellsFromCaloCells
(
const
std::string&
type
,
10
const
std::string& name,
11
const
IInterface* parent):
12
base_class(
type
, name, parent){
13
}
14
15
StatusCode
EMBE1CellsFromCaloCells::initialize
() {
16
CHECK
(
m_caloCellsKey
.initialize());
17
return
StatusCode::SUCCESS;
18
}
19
20
StatusCode
21
EMBE1CellsFromCaloCells::cells
(std::vector<const CaloCell*>&
cells
,
22
const
EventContext& ctx)
const
{
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());
32
if
(
m_makeCaloCellContainerChecks
) {
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
}
58
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
EMBE1CellsFromCaloCells.h
CaloCell_Base_ID::LAREM
@ LAREM
Definition
CaloCell_Base_ID.h:45
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
GlobalSim::EMBE1CellsFromCaloCells::m_caloCellsKey
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
Definition
EMBE1CellsFromCaloCells.h:33
GlobalSim::EMBE1CellsFromCaloCells::initialize
virtual StatusCode initialize() override
Definition
EMBE1CellsFromCaloCells.cxx:15
GlobalSim::EMBE1CellsFromCaloCells::cells
virtual StatusCode cells(std::vector< const CaloCell * > &, const EventContext &) const override
Definition
EMBE1CellsFromCaloCells.cxx:21
GlobalSim::EMBE1CellsFromCaloCells::EMBE1CellsFromCaloCells
EMBE1CellsFromCaloCells(const std::string &type, const std::string &name, const IInterface *parent)
Definition
EMBE1CellsFromCaloCells.cxx:9
GlobalSim::EMBE1CellsFromCaloCells::m_makeCaloCellContainerChecks
Gaudi::Property< bool > m_makeCaloCellContainerChecks
Definition
EMBE1CellsFromCaloCells.h:36
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
GlobalSim
AlgTool to read in LArStripNeighborhoods, and run the BDT Algorithm.
Definition
Trigger/TrigT1/Global/GlobalSimulation/src/Egamma1BDT/Egamma1BDT/BDT.h:11
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
type
Generated on
for ATLAS Offline Software by
1.17.0