ATLAS Offline Software
Global/GlobalSimulation/src/GlobalAlgs/EMB1CellsFromCaloCells.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 namespace GlobalSim {
8 
10  const std::string& name,
11  const IInterface* parent):
12  base_class(type, name, parent){
13  }
14 
17 
18  return StatusCode::SUCCESS;
19  }
20 
22  EMB1CellsFromCaloCells::cells(std::vector<const CaloCell*>& cells,
23  const EventContext& ctx) const {
24 
25  // Read in a container containing all CaloCells
26 
27  auto 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 cells
41  auto EMB1_sel = [](const CaloCell* cell) {
42  return cell->caloDDE()->getSampling() == CaloCell_Base_ID::EMB1;
43  };
44 
45 
46  std::copy_if(allCaloCells.beginConstCalo(CaloCell_ID::LAREM),
47  allCaloCells.endConstCalo(CaloCell_ID::LAREM),
48  std::back_inserter(cells),
49  EMB1_sel);
50 
51 
52  return StatusCode::SUCCESS;
53  }
54 }
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
GlobalSim::EMB1CellsFromCaloCells::m_caloCellsKey
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
Definition: Global/GlobalSimulation/src/GlobalAlgs/EMB1CellsFromCaloCells.h:33
GlobalSim::EMB1CellsFromCaloCells::cells
virtual StatusCode cells(std::vector< const CaloCell * > &, const EventContext &) const override
Definition: Global/GlobalSimulation/src/GlobalAlgs/EMB1CellsFromCaloCells.cxx:22
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
GlobalSim
AlgTool to obtain a selection of eFex RoIs read in from the event store.
Definition: dump.h:8
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
GlobalSim::EMB1CellsFromCaloCells::EMB1CellsFromCaloCells
EMB1CellsFromCaloCells(const std::string &type, const std::string &name, const IInterface *parent)
Definition: Global/GlobalSimulation/src/GlobalAlgs/EMB1CellsFromCaloCells.cxx:9
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
EMB1CellsFromCaloCells.h
GlobalSim::EMB1CellsFromCaloCells::initialize
virtual StatusCode initialize() override
Definition: Global/GlobalSimulation/src/GlobalAlgs/EMB1CellsFromCaloCells.cxx:15
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
GlobalSim::EMB1CellsFromCaloCells::m_makeCaloCellContainerChecks
Gaudi::Property< bool > m_makeCaloCellContainerChecks
Definition: Global/GlobalSimulation/src/GlobalAlgs/EMB1CellsFromCaloCells.h:37