ATLAS Offline Software
eflowRecTrack.h
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.h
7  *
8  * Created on: 30.09.2013
9  * Author: tlodd
10  */
11 
12 #ifndef EFLOWRECTRACK_H_
13 #define EFLOWRECTRACK_H_
14 
15 #include <iostream>
16 #include <cassert>
17 #include <map>
18 #include <string>
19 
20 #include "CaloEvent/CaloCell.h"
22 
23 #include "GaudiKernel/MsgStream.h"
24 #include "GaudiKernel/ToolHandle.h"
25 
26 #include "CxxUtils/fpcompare.h"
27 
28 #include "AthLinks/ElementLink.h"
29 
31 
35 
38 
41 
42 
47 public:
49  const ToolHandle<eflowTrackExtrapolatorBaseAlgTool>& theTrackExtrapolatorTool);
50  eflowRecTrack(const eflowRecTrack& originalEflowRecTrack);
51  eflowRecTrack& operator = (const eflowRecTrack& originalEflowRecTrack);
52  virtual ~eflowRecTrack();
53 
54  const xAOD::TrackParticle* getTrack() const { return m_track; }
55 
57 
59  void addClusterMatch(eflowTrackClusterLink* clusterMatch) { m_clusterMatches.push_back(clusterMatch); }
60  void addDeltaRPrime(const float& dRPrime){ m_deltaRPrimes.push_back(dRPrime);}
61  void addAlternativeClusterMatch(eflowTrackClusterLink* clusterMatch, const std::string& key) { m_alternativeClusterMatches[key].push_back(clusterMatch); }
62 
64 
65  int getType() const { return m_type; }
66 
67  const std::vector<eflowTrackClusterLink*>& getClusterMatches() const { return m_clusterMatches; }
68  const std::vector<float>& getDRPrimes() const { return m_deltaRPrimes;}
69  //This must also clear deltaRPrime, which corresponds to dRPrime between the track and each cluster
71 
72  const std::vector<eflowTrackClusterLink*>* getAlternativeClusterMatches(const std::string& key) const;// { return m_alternativeClusterMatches.at(key); }
73 
74  bool hasBin() const { return m_hasBin; }
75  void setHasBin(bool hasBin) { m_hasBin = hasBin; }
76 
77  void setCaloDepthArray(const double* depthArray);
78  const std::vector<double>& getCaloDepthArray() const { return m_caloDepthArray; }
79 
80  bool isSubtracted() const { return m_isSubtracted; }
81  void setSubtracted();
82 
83  void setEExpect(double eExpect, double varEExpect){ m_eExpect = eExpect; m_varEExpect = varEExpect; }
84  double getEExpect() const { return m_eExpect; }
85  double getVarEExpect() const { return m_varEExpect; }
86  int getTrackId() const { return m_trackId; }
87  void setTrackId(int trackId) { m_trackId = trackId; }
88 
89 
90  int getLayerHED() const { return m_layerHED; }
91  void setLayerHED(int layerHED) { m_layerHED = layerHED; }
92 
93  const std::vector<int>& getLayerCellOrderVector() const { return m_layerCellOrderVector; }
94  void setLayerCellOrderVector(const std::vector<int>& layerToStoreVector) { m_layerCellOrderVector = layerToStoreVector; }
95 
96  const std::vector<float>& getRadiusCellOrderVector() const { return m_radiusCellOrderVector; }
97  void setRadiusCellOrderVector(const std::vector<float>& radiusToStoreVector) { m_radiusCellOrderVector = radiusToStoreVector; }
98 
99  const std::vector<float>& getAvgEDensityCellOrderVector() const { return m_avgEdensityCellOrderVector; }
100  void setAvgEDensityCellOrderVector(const std::vector<float>& avgEdensityToStoreVector) { m_avgEdensityCellOrderVector = avgEdensityToStoreVector; }
101 
102 
105 
106  bool isRecovered() const { return m_isRecovered;}
107  void setIsRecovered() { m_isRecovered= true; }
108 
109  void setpull15(double pull15){ m_pull15 = pull15; }
110  double getpull15() const { return m_pull15; }
111 
112  void insertTruthEnergyPair (const CaloCell* cell, double truthEnergy);
113  double getCellTruthEnergy (const CaloCell* cell) const;
114 
115  void addSubtractedCaloCell(ElementLink<CaloCellContainer> theCellLink, const double& weight) { m_subtractedCells.push_back(std::make_pair(theCellLink,weight)); }
116  const std::vector<std::pair<ElementLink<CaloCellContainer>, double> >& getSubtractedCaloCells() const { return m_subtractedCells; }
117 
118 private:
119 
123  int m_type;
124  double m_pull15;
125 
126  int m_layerHED{};
127  std::vector<int> m_layerCellOrderVector;
128  std::vector<float> m_radiusCellOrderVector;
129  std::vector<float> m_avgEdensityCellOrderVector;
130 
131  double m_eExpect;
132  double m_varEExpect;
133 
138  bool m_hasBin;
139 
140  std::vector<double> m_caloDepthArray;
141 
142  std::unique_ptr<eflowTrackCaloPoints> m_trackCaloPoints;
144  std::vector<eflowTrackClusterLink*> m_clusterMatches;
146  std::vector<float> m_deltaRPrimes;
147  std::map<std::string,std::vector<eflowTrackClusterLink*> > m_alternativeClusterMatches;
148 
149  //for truth cheating mode only, we store the list of cells and their truth energies
150  std::vector<std::pair<const CaloCell*, double> > m_cellTruthEnergyList;
151  std::map<Identifier,double> m_cellTruthEnergyStore;
152 
153  //list of cells that were removed from CaloCluster (only used in doCPData mode)
154  std::vector<std::pair<ElementLink<CaloCellContainer>, double> > m_subtractedCells;
155 
156 public:
158  public:
159  bool operator()(const eflowRecTrack* a, const eflowRecTrack* b) {
160  return CxxUtils::fpcompare::greater(a->getTrack()->pt(),
161  b->getTrack()->pt());
162  }
163  };
164 };
165 
170 public:
171  eflowRecMatchTrack(const eflowRecTrack* efRecTrack): m_efRecTrack(efRecTrack) { assert(m_efRecTrack); }
172  virtual ~eflowRecMatchTrack() { }
173 
176  else {
177  std::cerr << "eflowRecMatchTrack ERROR: Invalid pointer to eflowRecTrack " << std::endl;
178  return eflowEtaPhiPosition(-999.,-999.);
179  }
180  }
181 
182 private:
184 };
185 
187 #include "AthenaKernel/CLASS_DEF.h"
188 
189 class eflowRecTrackContainer : public DataVector< eflowRecTrack >
190 
191 {
192 
193  public:
194 
195  void print() { };
196 
197 };
198 
200 #endif /* EFLOWRECTRACK_H_ */
eflowRecTrack::m_track
const xAOD::TrackParticle * m_track
Definition: eflowRecTrack.h:122
eflowRecTrack::addClusterMatch
void addClusterMatch(eflowTrackClusterLink *clusterMatch)
Definition: eflowRecTrack.h:59
PFMatchInterfaces.h
eflowRecTrack::m_isSubtracted
bool m_isSubtracted
Definition: eflowRecTrack.h:135
eflowRecTrack::isRecovered
bool isRecovered() const
Definition: eflowRecTrack.h:106
eflowTrackCaloPoints
This class stores a map of calorimeter layers and track parameters (the result of the track extrapola...
Definition: eflowTrackCaloPoints.h:30
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
eflowRecTrack::setRadiusCellOrderVector
void setRadiusCellOrderVector(const std::vector< float > &radiusToStoreVector)
Definition: eflowRecTrack.h:97
eflowRecTrack::clearClusterMatches
void clearClusterMatches()
Definition: eflowRecTrack.h:70
eflowRecTrack::getCaloDepthArray
const std::vector< double > & getCaloDepthArray() const
Definition: eflowRecTrack.h:78
eflowRecTrack::getAlternativeClusterMatches
const std::vector< eflowTrackClusterLink * > * getAlternativeClusterMatches(const std::string &key) const
Definition: eflowRecTrack.cxx:80
eflowRecTrack::getRadiusCellOrderVector
const std::vector< float > & getRadiusCellOrderVector() const
Definition: eflowRecTrack.h:96
eflowRecTrack::isInDenseEnvironment
bool isInDenseEnvironment() const
Definition: eflowRecTrack.h:103
eflowRecTrack::setCaloDepthArray
void setCaloDepthArray(const double *depthArray)
Definition: eflowRecTrack.cxx:76
eflowRecTrack::setAvgEDensityCellOrderVector
void setAvgEDensityCellOrderVector(const std::vector< float > &avgEdensityToStoreVector)
Definition: eflowRecTrack.h:100
eflowRecTrack::getCellTruthEnergy
double getCellTruthEnergy(const CaloCell *cell) const
Definition: eflowRecTrack.cxx:95
eflowRecTrack::m_varEExpect
double m_varEExpect
Definition: eflowRecTrack.h:132
eflowRecTrackContainer::print
void print()
Definition: eflowRecTrack.h:195
eflowRecTrack::m_type
int m_type
Definition: eflowRecTrack.h:123
eflowEtaPhiPosition
Definition: eflowUtil.h:85
eflowRecTrack::hasBin
bool hasBin() const
Definition: eflowRecTrack.h:74
CaloCell.h
eflowRecTrack::getTrackElemLink
ElementLink< xAOD::TrackParticleContainer > getTrackElemLink() const
Definition: eflowRecTrack.h:58
eflowTrackExtrapolatorBaseAlgTool
Definition: eflowTrackExtrapolatorBaseAlgTool.h:28
eflowRecTrack::m_layerCellOrderVector
std::vector< int > m_layerCellOrderVector
Definition: eflowRecTrack.h:127
eflowRecTrack::setIsRecovered
void setIsRecovered()
Definition: eflowRecTrack.h:107
eflowRecTrack::setLayerCellOrderVector
void setLayerCellOrderVector(const std::vector< int > &layerToStoreVector)
Definition: eflowRecTrack.h:94
eflowTrackCaloPoints.h
eflowRecTrack::m_subtractedCells
std::vector< std::pair< ElementLink< CaloCellContainer >, double > > m_subtractedCells
Definition: eflowRecTrack.h:154
eflowRecTrack::insertTruthEnergyPair
void insertTruthEnergyPair(const CaloCell *cell, double truthEnergy)
Definition: eflowRecTrack.cxx:90
CxxUtils::fpcompare::greater
bool greater(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:140
eflowRecTrack::getLayerHED
int getLayerHED() const
Definition: eflowRecTrack.h:90
eflowRecTrack::setpull15
void setpull15(double pull15)
Definition: eflowRecTrack.h:109
eflowRecTrack::getDRPrimes
const std::vector< float > & getDRPrimes() const
Definition: eflowRecTrack.h:68
eflowRecTrack::setTrackId
void setTrackId(int trackId)
Definition: eflowRecTrack.h:87
eflowRecTrack::setIsInDenseEnvironment
void setIsInDenseEnvironment()
Definition: eflowRecTrack.h:104
eflowRecTrack::m_trackElemLink
ElementLink< xAOD::TrackParticleContainer > m_trackElemLink
Definition: eflowRecTrack.h:121
eflowRecTrack::m_clusterMatches
std::vector< eflowTrackClusterLink * > m_clusterMatches
Definition: eflowRecTrack.h:144
eflowRecTrack::addSubtractedCaloCell
void addSubtractedCaloCell(ElementLink< CaloCellContainer > theCellLink, const double &weight)
Definition: eflowRecTrack.h:115
eflowRecTrack::m_eExpect
double m_eExpect
Definition: eflowRecTrack.h:131
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
eflowRecTrack::m_hasBin
bool m_hasBin
Definition: eflowRecTrack.h:138
eflowRecMatchTrack
This class, which inherits from the pure virtual ITrack, stores a pointer to an eflowRecTrack and has...
Definition: eflowRecTrack.h:169
eflowRecTrack
This class extends the information about a xAOD::Track.
Definition: eflowRecTrack.h:46
eflowRecTrack::getCellSubtractionManager
eflowRingSubtractionManager & getCellSubtractionManager()
Definition: eflowRecTrack.h:63
eflowRecTrack::setSubtracted
void setSubtracted()
Definition: eflowRecTrack.cxx:100
eflowRecTrack::addDeltaRPrime
void addDeltaRPrime(const float &dRPrime)
Definition: eflowRecTrack.h:60
eflowRecTrack::getClusterMatches
const std::vector< eflowTrackClusterLink * > & getClusterMatches() const
Definition: eflowRecTrack.h:67
eflowRecMatchTrack::~eflowRecMatchTrack
virtual ~eflowRecMatchTrack()
Definition: eflowRecTrack.h:172
eflowRecTrack::getAvgEDensityCellOrderVector
const std::vector< float > & getAvgEDensityCellOrderVector() const
Definition: eflowRecTrack.h:99
PFMatch::ITrack
Definition: PFMatchInterfaces.h:28
eflowRecTrack::isSubtracted
bool isSubtracted() const
Definition: eflowRecTrack.h:80
eflowRecTrack::getpull15
double getpull15() const
Definition: eflowRecTrack.h:110
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
fpcompare.h
Workaround x86 precision issues for FP inequality comparisons.
eflowRecTrack::getTrackId
int getTrackId() const
Definition: eflowRecTrack.h:86
eflowRecTrack::m_ringSubtractionManager
eflowRingSubtractionManager m_ringSubtractionManager
Definition: eflowRecTrack.h:143
eflowRecTrack::m_deltaRPrimes
std::vector< float > m_deltaRPrimes
List of distance measurements between track and cluster used in first pass matching - i....
Definition: eflowRecTrack.h:146
eflowRecTrack::getEExpect
double getEExpect() const
Definition: eflowRecTrack.h:84
eflowRecTrack::SortDescendingPt
Definition: eflowRecTrack.h:157
eflowRecTrack::getSubtractedCaloCells
const std::vector< std::pair< ElementLink< CaloCellContainer >, double > > & getSubtractedCaloCells() const
Definition: eflowRecTrack.h:116
eflowRecTrack::m_cellTruthEnergyList
std::vector< std::pair< const CaloCell *, double > > m_cellTruthEnergyList
Definition: eflowRecTrack.h:150
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
eflowRecTrack::m_layerHED
int m_layerHED
Definition: eflowRecTrack.h:126
eflowRingSubtractionManager.h
eflowRecTrack::~eflowRecTrack
virtual ~eflowRecTrack()
eflowRecTrack::setLayerHED
void setLayerHED(int layerHED)
Definition: eflowRecTrack.h:91
eflowRingSubtractionManager
This stores information, a rank and ring thickness, about cell rings in an ordered way.
Definition: eflowRingSubtractionManager.h:31
eflowRecTrack::m_cellTruthEnergyStore
std::map< Identifier, double > m_cellTruthEnergyStore
Definition: eflowRecTrack.h:151
eflowRecTrack::operator=
eflowRecTrack & operator=(const eflowRecTrack &originalEflowRecTrack)
Definition: eflowRecTrack.cxx:53
eflowRecTrack::getTrack
const xAOD::TrackParticle * getTrack() const
Definition: eflowRecTrack.h:54
eflowRecTrack::setHasBin
void setHasBin(bool hasBin)
Definition: eflowRecTrack.h:75
eflowRecTrack::getType
int getType() const
Definition: eflowRecTrack.h:65
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
eflowRecMatchTrack::eflowRecMatchTrack
eflowRecMatchTrack(const eflowRecTrack *efRecTrack)
Definition: eflowRecTrack.h:171
CaloCellContainer.h
eflowRecTrack::m_caloDepthArray
std::vector< double > m_caloDepthArray
Definition: eflowRecTrack.h:140
eflowRecTrack::getTrackCaloPoints
const eflowTrackCaloPoints & getTrackCaloPoints() const
Definition: eflowRecTrack.h:56
eflowRecTrack::m_isRecovered
bool m_isRecovered
Tells us whether this track underwent split shower revovery.
Definition: eflowRecTrack.h:137
eflowRecTrackContainer
Definition: eflowRecTrack.h:191
TrackParticle.h
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
eflowCalo::LAYER
LAYER
Definition: eflowCaloRegions.h:36
a
TList * a
Definition: liststreamerinfos.cxx:10
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
eflowRecTrack::m_pull15
double m_pull15
Definition: eflowRecTrack.h:124
eflowRecTrack::m_radiusCellOrderVector
std::vector< float > m_radiusCellOrderVector
Definition: eflowRecTrack.h:128
eflowRecTrack::getVarEExpect
double getVarEExpect() const
Definition: eflowRecTrack.h:85
eflowTrackCaloPoints::getEtaPhiPos
const eflowEtaPhiPosition & getEtaPhiPos(eflowCalo::LAYER layer) const
Definition: eflowTrackCaloPoints.cxx:86
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
eflowRecTrack::m_alternativeClusterMatches
std::map< std::string, std::vector< eflowTrackClusterLink * > > m_alternativeClusterMatches
Definition: eflowRecTrack.h:147
eflowRecMatchTrack::etaPhiInLayer
virtual eflowEtaPhiPosition etaPhiInLayer(PFMatch::LayerType layer) const
Definition: eflowRecTrack.h:174
eflowRecTrack::setEExpect
void setEExpect(double eExpect, double varEExpect)
Definition: eflowRecTrack.h:83
eflowRecMatchTrack::m_efRecTrack
const eflowRecTrack * m_efRecTrack
Definition: eflowRecTrack.h:183
eflowRecTrack::m_avgEdensityCellOrderVector
std::vector< float > m_avgEdensityCellOrderVector
Definition: eflowRecTrack.h:129
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
eflowRecTrack::SortDescendingPt::operator()
bool operator()(const eflowRecTrack *a, const eflowRecTrack *b)
Definition: eflowRecTrack.h:159
eflowRecTrack::getLayerCellOrderVector
const std::vector< int > & getLayerCellOrderVector() const
Definition: eflowRecTrack.h:93
eflowRecTrack::eflowRecTrack
eflowRecTrack(const ElementLink< xAOD::TrackParticleContainer > &trackElemLink, const ToolHandle< eflowTrackExtrapolatorBaseAlgTool > &theTrackExtrapolatorTool)
Definition: eflowRecTrack.cxx:20
CLASS_DEF.h
macros to associate a CLID to a type
eflowRecTrack::m_isInDenseEnvironment
bool m_isInDenseEnvironment
Definition: eflowRecTrack.h:134
eflowRecTrack::addAlternativeClusterMatch
void addAlternativeClusterMatch(eflowTrackClusterLink *clusterMatch, const std::string &key)
Definition: eflowRecTrack.h:61
TrackParticleContainer.h
eflowRecTrack::m_trackCaloPoints
std::unique_ptr< eflowTrackCaloPoints > m_trackCaloPoints
Definition: eflowRecTrack.h:142
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TrackParticleContainer.h
eflowRecTrack::m_trackId
int m_trackId
Definition: eflowRecTrack.h:120