ATLAS Offline Software
Loading...
Searching...
No Matches
eflowSubtractor.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 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
23
24namespace eflowSubtract {
25
26void
28 eflowRecTrack* efRecTrack,
29 std::vector<std::pair<xAOD::CaloCluster*, bool>>& clusterSubtractionList, const 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;
37 efRecTrack->getTrackCaloPoints(), clusterSubtractionList, orderedCells);
38
39 /* Get the cellSubtractionManager from the eflowCaloObject */
41 efRecTrack->getCellSubtractionManager();
42
43 bool annFlag;
44 m_facilitator.subtractCells(
45 ranking, *efRecTrack, clusterSubtractionList, orderedCells, annFlag, addCPData);
46
47 orderedCells.eraseList();
48}
49
50void
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 (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
77void
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
89void
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
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.
Concrete class derived class from pure virtual eflowAbstractCellList.
void addCell(std::pair< const CaloCell *, int > cell)
void setNewExtrapolatedTrack(const eflowTrackCaloPoints *trackCalo)
This class extends the information about a xAOD::Track.
const eflowTrackCaloPoints & getTrackCaloPoints() const
eflowRingSubtractionManager & getCellSubtractionManager()
This stores information, a rank and ring thickness, about cell rings in an ordered way.
static void makeOrderedCellList(const eflowTrackCaloPoints &trackCalo, const std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusters, eflowCellList &orderedCells)
static void annihilateClusters(std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusters)
static void annihilateCluster(xAOD::CaloCluster *cluster)
void subtractTracksFromClusters(eflowRecTrack *efRecTrack, std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusterSubtractionList, const bool &addCPData) const
eflowCellSubtractionFacilitator m_facilitator
This class stores a map of calorimeter layers and track parameters (the result of the track extrapola...
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
void setRawE(flt_t)
Set Energy for signal state UNCALIBRATED.
CaloClusterCellLink * getOwnCellLinks()
Get a pointer to the owned CaloClusterCellLink object (non-const version)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.