ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
EMB1CellsFromCaloClusters Class Reference

#include <EMB1CellsFromCaloClusters.h>

Inheritance diagram for EMB1CellsFromCaloClusters:
Collaboration diagram for EMB1CellsFromCaloClusters:

Public Member Functions

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

Private Attributes

SG::ReadHandleKey< xAOD::CaloClusterContainerm_caloClustersKey
 

Detailed Description

Definition at line 16 of file EMB1CellsFromCaloClusters.h.

Constructor & Destructor Documentation

◆ EMB1CellsFromCaloClusters()

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

Definition at line 8 of file EMB1CellsFromCaloClusters.cxx.

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

◆ ~EMB1CellsFromCaloClusters()

virtual EMB1CellsFromCaloClusters::~EMB1CellsFromCaloClusters ( )
inlinevirtual

Definition at line 25 of file EMB1CellsFromCaloClusters.h.

25 {};

Member Function Documentation

◆ cells()

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

Definition at line 21 of file EMB1CellsFromCaloClusters.cxx.

22  {
23  // Read in a container containing CaloClusters
24 
25  auto h_caloClusters = SG::makeHandle(m_caloClustersKey, ctx);
26  CHECK(h_caloClusters.isValid());
27 
28  auto dvec = *h_caloClusters;
29  ATH_MSG_DEBUG("number of retrieved clusters: " << dvec.size());
30 
31  const CaloCell_ID* calocell_id{nullptr};
32  CHECK(detStore()->retrieve (calocell_id, "CaloCell_ID"));
33 
34  // selector
35  auto EMB1_sel = [&calocell_id](const CaloCell* cell) {
36  return
37  calocell_id->calo_sample(calocell_id->calo_cell_hash(cell->ID())) ==
39  };
40 
41 
42 
43 
44  for(const auto& cl : dvec){
45  const auto *cell_links = cl->getCellLinks();
46  if (!cell_links){
47  ATH_MSG_ERROR("No link from cluster to cells");
48  return StatusCode::FAILURE;
49  } else {
50  ATH_MSG_DEBUG("Number of cells from cell_links " << cell_links->size());
51  }
52 
53 
54  auto c_iter = cell_links->begin();
55  auto c_end = cell_links->end();
56 
57  std::vector<const CaloCell*> cluster_cells;
58  std::copy_if(c_iter,
59  c_end,
60  std::back_inserter(cluster_cells),
61  EMB1_sel);
62 
63  // having less than two cells in the selected cell container
64  // will mess up the simple seed selection procedure, so
65  // add a requirement on the number of selected cells.
66  if (cluster_cells.size() > 1) {
67  cells.push_back(cluster_cells);
68  }
69  }
70 
71  return StatusCode::SUCCESS;
72 }

◆ initialize()

StatusCode EMB1CellsFromCaloClusters::initialize ( )
overridevirtual

Definition at line 14 of file EMB1CellsFromCaloClusters.cxx.

14  {
16 
17  return StatusCode::SUCCESS;
18 }

Member Data Documentation

◆ m_caloClustersKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> EMB1CellsFromCaloClusters::m_caloClustersKey
private
Initial value:
{
this, "caloClusters", "CaloTopoClusters",
"key to read in a CaloCluster container"}

Definition at line 33 of file EMB1CellsFromCaloClusters.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
EMB1CellsFromCaloClusters::cells
virtual StatusCode cells(std::vector< std::vector< const CaloCell * >> &, const EventContext &) const override
Definition: EMB1CellsFromCaloClusters.cxx:21
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
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
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
EMB1CellsFromCaloClusters::m_caloClustersKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClustersKey
Definition: EMB1CellsFromCaloClusters.h:33
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26