ATLAS Offline Software
Loading...
Searching...
No Matches
Reconstruction
RecoTools
TrackToCalo
TrackToCalo
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
8
#include "
CaloEvent/CaloCellContainer.h
"
9
#include "
CaloUtils/CaloClusterStoreHelper.h
"
10
#include "
ParticleCaloExtension/ParticleCellAssociation.h
"
11
#include "
xAODCaloEvent/CaloCluster.h
"
12
#include "
xAODCaloEvent/CaloClusterContainer.h
"
13
14
namespace
Rec
{
15
16
class
CrossedCaloCellHelper
{
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
CaloCellContainer.h
CaloClusterStoreHelper.h
CaloClusterContainer.h
CaloCluster.h
ParticleCellAssociation.h
CaloCellContainer
Container class for CaloCell.
Definition
CaloCellContainer.h:55
CaloCellContainer::findIndex
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
Definition
CaloCellContainer.cxx:363
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
Rec::CrossedCaloCellHelper
Definition
CrossedCaloCellHelper.h:16
Rec::CrossedCaloCellHelper::crossedCells
static xAOD::CaloCluster * crossedCells(const Rec::ParticleCellAssociation &association, const CaloCellContainer &cellContainer, xAOD::CaloClusterContainer &clusterContainer)
Definition
CrossedCaloCellHelper.h:18
Rec::ParticleCellAssociation
class storing calorimeter cell association with IParticle objects
Definition
ParticleCellAssociation.h:19
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:774
Rec
Gaudi Tools.
Definition
FakeTrackBuilder.h:10
index
Definition
index.py:1
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::CaloClusterContainer
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloClusterContainer.h:17
Generated on
for ATLAS Offline Software by
1.14.0