ATLAS Offline Software
Loading...
Searching...
No Matches
eflowRecTrack.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 * eflowRecTrack.cxx
7 *
8 * Created on: 30.09.2013
9 * Author: tlodd
10 */
11
12#include "eflowRecTrack.h"
15
17#include "GaudiKernel/StatusCode.h"
18
19
21 const EventContext& ctx,
23 const ToolHandle<eflowTrackExtrapolatorBaseAlgTool>& theTrackExtrapolatorTool) :
24 m_trackId(-1), m_trackElemLink(trackElemLink), m_track(*trackElemLink), m_type(5),
25 m_pull15(0.0),
26 m_layerHED(-1),
27 m_eExpect(1.0),
28 m_varEExpect(0.0),
30 m_isSubtracted(false),
31 m_isRecovered(false),
32 m_hasBin(true),
33 m_trackCaloPoints(theTrackExtrapolatorTool->execute(ctx, m_track))
34{
35}
36
53
55 if (this == &originalEflowRecTrack) return *this;
56 //if not assigning to self, then we copy the data to the new object
57 else{
58 m_trackId = originalEflowRecTrack.m_trackId;
59 m_trackElemLink = originalEflowRecTrack.m_trackElemLink;
61 m_type = originalEflowRecTrack.m_type;
62 m_pull15 = originalEflowRecTrack.m_pull15;
63 m_eExpect = originalEflowRecTrack.m_eExpect;
64 m_varEExpect = originalEflowRecTrack.m_varEExpect;
65 m_isInDenseEnvironment = originalEflowRecTrack.m_isInDenseEnvironment;
66 m_isSubtracted = originalEflowRecTrack.m_isSubtracted;
67 m_isRecovered = originalEflowRecTrack.m_isRecovered;
68 m_hasBin = originalEflowRecTrack.m_hasBin;
69 m_trackCaloPoints = std::make_unique<eflowTrackCaloPoints>(*originalEflowRecTrack.m_trackCaloPoints);
70 m_layerHED = originalEflowRecTrack.m_layerHED;
71 return *this;
72 }//if not assigning to self, then we have copied the data to the new object
73}
74
76
77void eflowRecTrack::setCaloDepthArray(const double* depthArray) {
78 m_caloDepthArray.assign(depthArray, depthArray + eflowDepthCalculator::NDepth() + 1);
79}
80
81const std::vector<eflowTrackClusterLink*>* eflowRecTrack::getAlternativeClusterMatches(const std::string& key) const {
82
83 std::map<std::string,std::vector<eflowTrackClusterLink*> >::const_iterator thisIterator = m_alternativeClusterMatches.find(key);
84 if (thisIterator != m_alternativeClusterMatches.end()) return &m_alternativeClusterMatches.at(key);
85 else return nullptr;
86
87 return nullptr;
88
89}
90
91void eflowRecTrack::insertTruthEnergyPair (const CaloCell* cell, double truthEnergy){
92 if (m_cellTruthEnergyStore.count(cell->ID()) == 0) m_cellTruthEnergyStore[cell->ID()] = truthEnergy;
93 else m_cellTruthEnergyStore[cell->ID()] += truthEnergy;
94}
95
97 if (m_cellTruthEnergyStore.count(cell->ID()) == 0) return 0.0;
98 else return m_cellTruthEnergyStore.at(cell->ID());
99}
100
102 if (isSubtracted()){
103 REPORT_MESSAGE_WITH_CONTEXT(MSG::WARNING, "eflowRecTrack")
104 << "Invoke setSubtracted() on track that is subtracted already!" << endmsg;
105 return;
106 }//if track was already subtracted then print a warning to the user about that and return
107 m_isSubtracted = true;
108}
#define endmsg
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
eflowRecTrack & operator=(const eflowRecTrack &originalEflowRecTrack)
std::map< std::string, std::vector< eflowTrackClusterLink * > > m_alternativeClusterMatches
ElementLink< xAOD::TrackParticleContainer > m_trackElemLink
std::vector< double > m_caloDepthArray
bool isSubtracted() const
virtual ~eflowRecTrack()
std::unique_ptr< eflowTrackCaloPoints > m_trackCaloPoints
bool m_isRecovered
Tells us whether this track underwent split shower revovery.
eflowRecTrack(const EventContext &ctx, const ElementLink< xAOD::TrackParticleContainer > &trackElemLink, const ToolHandle< eflowTrackExtrapolatorBaseAlgTool > &theTrackExtrapolatorTool)
std::map< Identifier, double > m_cellTruthEnergyStore
void insertTruthEnergyPair(const CaloCell *cell, double truthEnergy)
double getCellTruthEnergy(const CaloCell *cell) const
void setCaloDepthArray(const double *depthArray)
const std::vector< eflowTrackClusterLink * > * getAlternativeClusterMatches(const std::string &key) const
bool m_isInDenseEnvironment
const xAOD::TrackParticle * m_track
This class stores a map of calorimeter layers and track parameters (the result of the track extrapola...
STL namespace.