ATLAS Offline Software
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 
14 namespace Rec {
15 
17  public:
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
CaloClusterStoreHelper::makeCluster
static std::unique_ptr< xAOD::CaloCluster > makeCluster(const CaloCellContainer *cellCont)
Creates a valid CaloCluster with a private Aux-Store and CellLink container.
Definition: CaloClusterStoreHelper.cxx:13
index
Definition: index.py:1
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
CaloCluster.h
Rec
Name: MuonSpContainer.h Package : offline/Reconstruction/MuonIdentification/muonEvent.
Definition: FakeTrackBuilder.h:10
Trk::association
@ association
Definition: TrackingGeometry.h:46
Rec::CrossedCaloCellHelper::crossedCells
static xAOD::CaloCluster * crossedCells(const Rec::ParticleCellAssociation &association, const CaloCellContainer &cellContainer, xAOD::CaloClusterContainer &clusterContainer)
Definition: CrossedCaloCellHelper.h:18
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
Rec::CrossedCaloCellHelper
Definition: CrossedCaloCellHelper.h:16
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
ParticleCellAssociation.h
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloClusterStoreHelper.h
xAOD::CaloCluster_v1::addCell
bool addCell(const unsigned index, const double weight)
Method to add a cell to the cluster (Beware: Kinematics not updated!)
Definition: CaloCluster_v1.h:771
CaloClusterContainer.h
CaloCellContainer::findIndex
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
Definition: CaloCellContainer.cxx:363
Rec::ParticleCellAssociation
class storing calorimeter cell association with IParticle objects
Definition: ParticleCellAssociation.h:19