ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
eflowRec
src
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
"
13
#include "
eflowDepthCalculator.h
"
14
#include "
eflowTrackExtrapolatorBaseAlgTool.h
"
15
16
#include "
AthenaKernel/errorcheck.h
"
17
#include "GaudiKernel/StatusCode.h"
18
19
20
eflowRecTrack::eflowRecTrack
(
21
const
EventContext& ctx,
22
const
ElementLink<xAOD::TrackParticleContainer>
& trackElemLink,
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),
29
m_isInDenseEnvironment
(false),
30
m_isSubtracted
(false),
31
m_isRecovered
(false),
32
m_hasBin
(true),
33
m_trackCaloPoints
(theTrackExtrapolatorTool->execute(ctx,
m_track
))
34
{
35
}
36
37
eflowRecTrack::eflowRecTrack
(
const
eflowRecTrack
&
eflowRecTrack
)
38
:
m_trackId
(
eflowRecTrack
.
m_trackId
),
39
m_trackElemLink
(
eflowRecTrack
.
m_trackElemLink
),
40
m_track
(*
m_trackElemLink
),
41
m_type
(
eflowRecTrack
.
m_type
),
42
m_pull15
(
eflowRecTrack
.
m_pull15
),
43
m_layerHED
(
eflowRecTrack
.
m_layerHED
),
44
m_eExpect
(
eflowRecTrack
.
m_eExpect
),
45
m_varEExpect
(
eflowRecTrack
.
m_varEExpect
),
46
m_isInDenseEnvironment
(
eflowRecTrack
.
m_isInDenseEnvironment
),
47
m_isSubtracted
(
eflowRecTrack
.
m_isSubtracted
),
48
m_isRecovered
(
eflowRecTrack
.
m_isRecovered
),
49
m_hasBin
(
eflowRecTrack
.
m_hasBin
),
50
m_trackCaloPoints
(
std
::make_unique<
eflowTrackCaloPoints
>(*
eflowRecTrack
.
m_trackCaloPoints
))
51
{
52
}
53
54
eflowRecTrack
&
eflowRecTrack::operator =
(
const
eflowRecTrack
& originalEflowRecTrack){
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
;
60
m_track
= *
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
75
eflowRecTrack::~eflowRecTrack
() =
default
;
76
77
void
eflowRecTrack::setCaloDepthArray
(
const
double
* depthArray) {
78
m_caloDepthArray
.assign(depthArray, depthArray +
eflowDepthCalculator::NDepth
() + 1);
79
}
80
81
const
std::vector<eflowTrackClusterLink*>*
eflowRecTrack::getAlternativeClusterMatches
(std::string_view key)
const
{
82
83
auto
thisIterator =
m_alternativeClusterMatches
.find(key);
84
if
(thisIterator !=
m_alternativeClusterMatches
.end())
return
&(thisIterator->second);
85
return
nullptr
;
86
87
}
88
89
void
eflowRecTrack::insertTruthEnergyPair
(
const
CaloCell
* cell,
double
truthEnergy){
90
if
(
m_cellTruthEnergyStore
.count(cell->ID()) == 0)
m_cellTruthEnergyStore
[cell->ID()] = truthEnergy;
91
else
m_cellTruthEnergyStore
[cell->ID()] += truthEnergy;
92
}
93
94
double
eflowRecTrack::getCellTruthEnergy
(
const
CaloCell
* cell)
const
{
95
if
(
m_cellTruthEnergyStore
.count(cell->ID()) == 0)
return
0.0;
96
else
return
m_cellTruthEnergyStore
.at(cell->ID());
97
}
98
99
void
eflowRecTrack::setSubtracted
() {
100
if
(
isSubtracted
()){
101
REPORT_MESSAGE_WITH_CONTEXT
(MSG::WARNING,
"eflowRecTrack"
)
102
<<
"Invoke setSubtracted() on track that is subtracted already!"
<<
endmsg
;
103
return
;
104
}
//if track was already subtracted then print a warning to the user about that and return
105
m_isSubtracted
=
true
;
106
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
errorcheck.h
Helpers for checking error return status codes and reporting errors.
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:345
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
eflowDepthCalculator::NDepth
static int NDepth()
Definition
eflowDepthCalculator.h:34
eflowRecTrack::operator=
eflowRecTrack & operator=(const eflowRecTrack &originalEflowRecTrack)
Definition
eflowRecTrack.cxx:54
eflowRecTrack::m_varEExpect
double m_varEExpect
Definition
eflowRecTrack.h:136
eflowRecTrack::m_alternativeClusterMatches
std::map< std::string, std::vector< eflowTrackClusterLink * >, std::less<> > m_alternativeClusterMatches
Definition
eflowRecTrack.h:151
eflowRecTrack::m_trackElemLink
ElementLink< xAOD::TrackParticleContainer > m_trackElemLink
Definition
eflowRecTrack.h:125
eflowRecTrack::m_caloDepthArray
std::vector< double > m_caloDepthArray
Definition
eflowRecTrack.h:144
eflowRecTrack::isSubtracted
bool isSubtracted() const
Definition
eflowRecTrack.h:84
eflowRecTrack::~eflowRecTrack
virtual ~eflowRecTrack()
eflowRecTrack::m_trackCaloPoints
std::unique_ptr< eflowTrackCaloPoints > m_trackCaloPoints
Definition
eflowRecTrack.h:146
eflowRecTrack::m_hasBin
bool m_hasBin
Definition
eflowRecTrack.h:142
eflowRecTrack::m_trackId
int m_trackId
Definition
eflowRecTrack.h:124
eflowRecTrack::m_isRecovered
bool m_isRecovered
Tells us whether this track underwent split shower revovery.
Definition
eflowRecTrack.h:141
eflowRecTrack::eflowRecTrack
eflowRecTrack(const EventContext &ctx, const ElementLink< xAOD::TrackParticleContainer > &trackElemLink, const ToolHandle< eflowTrackExtrapolatorBaseAlgTool > &theTrackExtrapolatorTool)
Definition
eflowRecTrack.cxx:20
eflowRecTrack::setSubtracted
void setSubtracted()
Definition
eflowRecTrack.cxx:99
eflowRecTrack::m_cellTruthEnergyStore
std::map< Identifier, double > m_cellTruthEnergyStore
Definition
eflowRecTrack.h:155
eflowRecTrack::insertTruthEnergyPair
void insertTruthEnergyPair(const CaloCell *cell, double truthEnergy)
Definition
eflowRecTrack.cxx:89
eflowRecTrack::m_isSubtracted
bool m_isSubtracted
Definition
eflowRecTrack.h:139
eflowRecTrack::getCellTruthEnergy
double getCellTruthEnergy(const CaloCell *cell) const
Definition
eflowRecTrack.cxx:94
eflowRecTrack::m_pull15
double m_pull15
Definition
eflowRecTrack.h:128
eflowRecTrack::setCaloDepthArray
void setCaloDepthArray(const double *depthArray)
Definition
eflowRecTrack.cxx:77
eflowRecTrack::getAlternativeClusterMatches
const std::vector< eflowTrackClusterLink * > * getAlternativeClusterMatches(std::string_view key) const
Definition
eflowRecTrack.cxx:81
eflowRecTrack::m_isInDenseEnvironment
bool m_isInDenseEnvironment
Definition
eflowRecTrack.h:138
eflowRecTrack::m_layerHED
int m_layerHED
Definition
eflowRecTrack.h:130
eflowRecTrack::m_eExpect
double m_eExpect
Definition
eflowRecTrack.h:135
eflowRecTrack::m_track
const xAOD::TrackParticle * m_track
Definition
eflowRecTrack.h:126
eflowRecTrack::m_type
int m_type
Definition
eflowRecTrack.h:127
eflowTrackCaloPoints
This class stores a map of calorimeter layers and track parameters (the result of the track extrapola...
Definition
eflowTrackCaloPoints.h:30
eflowDepthCalculator.h
eflowRecTrack.h
eflowTrackExtrapolatorBaseAlgTool.h
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0