ATLAS Offline Software
Loading...
Searching...
No Matches
CrossedCaloCellHelper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef CROSSEDCALOCELLHELPER_H
6#define CROSSEDCALOCELLHELPER_H
7
13
14namespace Rec {
15
17 public:
18 static xAOD::CaloCluster* crossedCells(const Rec::ParticleCellAssociation& association, const CaloCellContainer& cellContainer,
19 xAOD::CaloClusterContainer& clusterContainer) {
20 // create cluster
21 xAOD::CaloCluster* cluster = CaloClusterStoreHelper::makeCluster(&clusterContainer, &cellContainer);
22 if (!cluster) { return nullptr; }
23
24 // loop over intersections and add cells to cluster
25 for (auto entry : association.cellIntersections()) {
26 if (!entry.first || !entry.first->caloDDE()) continue;
27 int index = cellContainer.findIndex(entry.first->caloDDE()->calo_hash());
28 if (index == -1) continue;
29 cluster->addCell(index, 1.);
30 }
31 return cluster;
32 }
33 };
34
35} // namespace Rec
36
37#endif
Container class for CaloCell.
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
static std::unique_ptr< xAOD::CaloCluster > makeCluster(const CaloCellContainer *cellCont)
Creates a valid CaloCluster with a private Aux-Store and CellLink container.
static xAOD::CaloCluster * crossedCells(const Rec::ParticleCellAssociation &association, const CaloCellContainer &cellContainer, xAOD::CaloClusterContainer &clusterContainer)
class storing calorimeter cell association with IParticle objects
bool addCell(const unsigned index, const double weight)
Method to add a cell to the cluster (Beware: Kinematics not updated!)
Gaudi Tools.
Definition index.py:1
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.