ATLAS Offline Software
EMB1CellsFromCaloCells.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8  const std::string& name,
9  const IInterface* parent):
10  base_class(type, name, parent){
11 }
12 
15  CHECK(detStore()->retrieve (m_calocell_id, "CaloCell_ID"));
16 
17  return StatusCode::SUCCESS;
18 }
19 
21 EMB1CellsFromCaloCells::cells(std::vector<std::vector<const CaloCell*>>& cells,
22  const EventContext& ctx) const {
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 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
EMB1CellsFromCaloCells::m_caloCellsKey
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
Definition: EMB1CellsFromCaloCells.h:35
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
EMB1CellsFromCaloCells.h
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
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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: EMB1CellsFromCaloCells.cxx:21
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
EMB1CellsFromCaloCells::EMB1CellsFromCaloCells
EMB1CellsFromCaloCells(const std::string &type, const std::string &name, const IInterface *parent)
Definition: EMB1CellsFromCaloCells.cxx:7
EMB1CellsFromCaloCells::m_calocell_id
const CaloCell_ID * m_calocell_id
Definition: 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
EMB1CellsFromCaloCells::initialize
virtual StatusCode initialize() override
Definition: EMB1CellsFromCaloCells.cxx:13