ATLAS Offline Software
Loading...
Searching...
No Matches
eflowRecTrack.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 * eflowRecTrack.cxx
7 *
8 * Created on: 30.09.2013
9 * Author: tlodd
10 */
11
15
17#include "GaudiKernel/StatusCode.h"
18
19
22 const ToolHandle<eflowTrackExtrapolatorBaseAlgTool>& theTrackExtrapolatorTool) :
23 m_trackId(-1), m_trackElemLink(trackElemLink), m_track(*trackElemLink), m_type(5),
24 m_pull15(0.0),
25 m_layerHED(-1),
26 m_eExpect(1.0),
27 m_varEExpect(0.0),
29 m_isSubtracted(false),
30 m_isRecovered(false),
31 m_hasBin(true),
32 m_trackCaloPoints(theTrackExtrapolatorTool->execute(m_track))
33{
34}
35
52
54 if (this == &originalEflowRecTrack) return *this;
55 //if not assigning to self, then we copy the data to the new object
56 else{
57 m_trackId = originalEflowRecTrack.m_trackId;
58 m_trackElemLink = originalEflowRecTrack.m_trackElemLink;
60 m_type = originalEflowRecTrack.m_type;
61 m_pull15 = originalEflowRecTrack.m_pull15;
62 m_eExpect = originalEflowRecTrack.m_eExpect;
63 m_varEExpect = originalEflowRecTrack.m_varEExpect;
64 m_isInDenseEnvironment = originalEflowRecTrack.m_isInDenseEnvironment;
65 m_isSubtracted = originalEflowRecTrack.m_isSubtracted;
66 m_isRecovered = originalEflowRecTrack.m_isRecovered;
67 m_hasBin = originalEflowRecTrack.m_hasBin;
68 m_trackCaloPoints = std::make_unique<eflowTrackCaloPoints>(*originalEflowRecTrack.m_trackCaloPoints);
69 m_layerHED = originalEflowRecTrack.m_layerHED;
70 return *this;
71 }//if not assigning to self, then we have copied the data to the new object
72}
73
75
76void eflowRecTrack::setCaloDepthArray(const double* depthArray) {
77 m_caloDepthArray.assign(depthArray, depthArray + eflowDepthCalculator::NDepth() + 1);
78}
79
80const std::vector<eflowTrackClusterLink*>* eflowRecTrack::getAlternativeClusterMatches(const std::string& key) const {
81
82 std::map<std::string,std::vector<eflowTrackClusterLink*> >::const_iterator thisIterator = m_alternativeClusterMatches.find(key);
83 if (thisIterator != m_alternativeClusterMatches.end()) return &m_alternativeClusterMatches.at(key);
84 else return nullptr;
85
86 return nullptr;
87
88}
89
90void eflowRecTrack::insertTruthEnergyPair (const CaloCell* cell, double truthEnergy){
91 if (m_cellTruthEnergyStore.count(cell->ID()) == 0) m_cellTruthEnergyStore[cell->ID()] = truthEnergy;
92 else m_cellTruthEnergyStore[cell->ID()] += truthEnergy;
93}
94
96 if (m_cellTruthEnergyStore.count(cell->ID()) == 0) return 0.0;
97 else return m_cellTruthEnergyStore.at(cell->ID());
98}
99
101 if (isSubtracted()){
102 REPORT_MESSAGE_WITH_CONTEXT(MSG::WARNING, "eflowRecTrack")
103 << "Invoke setSubtracted() on track that is subtracted already!" << endmsg;
104 return;
105 }//if track was already subtracted then print a warning to the user about that and return
106 m_isSubtracted = true;
107}
#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.
std::map< Identifier, double > m_cellTruthEnergyStore
void insertTruthEnergyPair(const CaloCell *cell, double truthEnergy)
double getCellTruthEnergy(const CaloCell *cell) const
eflowRecTrack(const ElementLink< xAOD::TrackParticleContainer > &trackElemLink, const ToolHandle< eflowTrackExtrapolatorBaseAlgTool > &theTrackExtrapolatorTool)
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.