ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
eflowRec
src
eflowSubtractor.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/*
6
* eflowSubtractor.cxx
7
*
8
* Created on: Feb 25, 2015
9
* Author: zhangrui
10
*/
11
12
#include "
eflowSubtractor.h
"
13
#include "
eflowCaloObject.h
"
14
#include "
eflowCellSubtractionFacilitator.h
"
15
#include "
eflowEEtaBinnedParameters.h
"
16
#include "
eflowLayerIntegrator.h
"
17
#include "
eflowRecCluster.h
"
18
#include "
eflowRecTrack.h
"
19
#include "
eflowRingSubtractionManager.h
"
20
#include "
eflowTrackClusterLink.h
"
21
#include "
xAODCaloEvent/CaloCluster.h
"
22
#include "
xAODCaloEvent/CaloClusterKineHelper.h
"
23
24
namespace
eflowSubtract
{
25
26
void
27
Subtractor::subtractTracksFromClusters
(
28
eflowRecTrack
* efRecTrack,
29
std::vector<std::pair<xAOD::CaloCluster*, bool>>& clusterSubtractionList,
bool
addCPData)
const
30
{
31
32
/* Make ordered cell list */
33
/* (Invokes newCluster() on orderedCells, than adds all the cells in
34
* tracksClus) */
35
eflowCellList
orderedCells;
36
makeOrderedCellList
(
37
efRecTrack->
getTrackCaloPoints
(), clusterSubtractionList, orderedCells);
38
39
/* Get the cellSubtractionManager from the eflowCaloObject */
40
eflowRingSubtractionManager
& ranking =
41
efRecTrack->
getCellSubtractionManager
();
42
43
bool
annFlag;
44
m_facilitator
.subtractCells(
45
ranking, *efRecTrack, clusterSubtractionList, orderedCells, annFlag, addCPData);
46
47
orderedCells.
eraseList
();
48
}
49
50
void
51
Subtractor::makeOrderedCellList
(
52
const
eflowTrackCaloPoints
& trackCalo,
53
const
std::vector<std::pair<xAOD::CaloCluster*, bool>>& clusters,
54
eflowCellList
& orderedCells)
55
{
56
orderedCells.
setNewExtrapolatedTrack
(trackCalo);
57
58
unsigned
int
countMatchedClusters = 0;
59
for
(
const
auto
& thisPair : clusters) {
60
61
xAOD::CaloCluster
* thisCluster = thisPair.first;
62
63
const
CaloClusterCellLink
* theCellLink = thisCluster->
getCellLinks
();
64
CaloClusterCellLink::const_iterator
firstCell = theCellLink->
begin
();
65
CaloClusterCellLink::const_iterator
lastCell = theCellLink->
end
();
66
67
/* Loop over cells in cluster */
68
for
(; firstCell != lastCell; ++firstCell) {
69
std::pair<const CaloCell*, int> myPair((*firstCell),
70
countMatchedClusters);
71
orderedCells.
addCell
(myPair);
72
}
73
countMatchedClusters++;
74
}
75
}
76
77
void
78
Subtractor::annihilateClusters
(
79
std::vector<std::pair<xAOD::CaloCluster*, bool>>& clusters)
80
{
81
82
for
(
auto
& thisPair : clusters) {
83
annihilateCluster
(thisPair.first);
84
// mark subtraction status as true
85
thisPair.second =
true
;
86
}
87
}
88
89
void
90
Subtractor::annihilateCluster
(
xAOD::CaloCluster
* cluster)
91
{
92
93
CaloClusterCellLink
* theCellLink = cluster->
getOwnCellLinks
();
94
theCellLink->
clear
();
95
96
cluster->
setE
(0.0);
97
cluster->
setRawE
(0.0);
98
CaloClusterKineHelper::calculateKine
(cluster,
true
,
true
);
99
}
100
101
}
// namespace eflowSubtract
CaloClusterKineHelper.h
CaloCluster.h
CaloClusterCellLink::const_iterator
const_iterator to loop over cells belonging to a cluster
Definition
CaloClusterCellLink.h:57
CaloClusterCellLink
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
Definition
CaloClusterCellLink.h:24
CaloClusterCellLink::end
const_iterator end() const
const end method
Definition
CaloClusterCellLink.h:112
CaloClusterCellLink::clear
void clear()
Method to remove all cells;.
Definition
CaloClusterCellLink.h:220
CaloClusterCellLink::begin
const_iterator begin() const
const begin method
Definition
CaloClusterCellLink.h:107
CaloClusterKineHelper::calculateKine
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.
Definition
CaloClusterKineHelper.cxx:223
eflowCellList
Concrete class derived class from pure virtual eflowAbstractCellList.
Definition
eflowCellList.h:42
eflowCellList::setNewExtrapolatedTrack
void setNewExtrapolatedTrack(const eflowTrackCaloPoints *trackCalo)
Definition
eflowCellList.cxx:35
eflowCellList::eraseList
void eraseList()
Definition
eflowCellList.h:76
eflowCellList::addCell
void addCell(const std::pair< const CaloCell *, int > &cell)
Definition
eflowCellList.cxx:53
eflowRecTrack
This class extends the information about a xAOD::Track.
Definition
eflowRecTrack.h:49
eflowRecTrack::getTrackCaloPoints
const eflowTrackCaloPoints & getTrackCaloPoints() const
Definition
eflowRecTrack.h:60
eflowRecTrack::getCellSubtractionManager
eflowRingSubtractionManager & getCellSubtractionManager()
Definition
eflowRecTrack.h:67
eflowRingSubtractionManager
This stores information, a rank and ring thickness, about cell rings in an ordered way.
Definition
eflowRingSubtractionManager.h:31
eflowSubtract::Subtractor::makeOrderedCellList
static void makeOrderedCellList(const eflowTrackCaloPoints &trackCalo, const std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusters, eflowCellList &orderedCells)
Definition
eflowSubtractor.cxx:51
eflowSubtract::Subtractor::annihilateClusters
static void annihilateClusters(std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusters)
Definition
eflowSubtractor.cxx:78
eflowSubtract::Subtractor::annihilateCluster
static void annihilateCluster(xAOD::CaloCluster *cluster)
Definition
eflowSubtractor.cxx:90
eflowSubtract::Subtractor::m_facilitator
eflowCellSubtractionFacilitator m_facilitator
Definition
eflowSubtractor.h:56
eflowSubtract::Subtractor::subtractTracksFromClusters
void subtractTracksFromClusters(eflowRecTrack *efRecTrack, std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusterSubtractionList, bool addCPData) const
Definition
eflowSubtractor.cxx:27
eflowTrackCaloPoints
This class stores a map of calorimeter layers and track parameters (the result of the track extrapola...
Definition
eflowTrackCaloPoints.h:30
xAOD::CaloCluster_v1::getCellLinks
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version).
Definition
CaloCluster_v1.cxx:829
xAOD::CaloCluster_v1::setRawE
void setRawE(flt_t)
Set Energy for signal state UNCALIBRATED.
Definition
CaloCluster_v1.cxx:284
xAOD::CaloCluster_v1::getOwnCellLinks
CaloClusterCellLink * getOwnCellLinks()
Get a pointer to the owned CaloClusterCellLink object (non-const version).
Definition
CaloCluster_v1.h:765
xAOD::CaloCluster_v1::setE
void setE(flt_t)
Definition
CaloCluster_v1.cxx:375
eflowCaloObject.h
eflowCellSubtractionFacilitator.h
eflowEEtaBinnedParameters.h
eflowLayerIntegrator.h
eflowRecCluster.h
eflowRecTrack.h
eflowRingSubtractionManager.h
eflowSubtractor.h
eflowTrackClusterLink.h
eflowSubtract
Definition
eflowSubtractor.cxx:24
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
Generated on
for ATLAS Offline Software by
1.17.0