ATLAS Offline Software
TrackDiff.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrackDiff.h
7 // Header file for TrackDiff
9 // (c) ATLAS Detector software
11 // Sebastian.Fleischmann@cern.ch
13 
14 #ifndef TRK_TRACKDIFF_H
15 #define TRK_TRACKDIFF_H
16 
25 
26 class AtlasDetectorID;
27 class TTree;
28 
29 namespace Trk {
30 
31  class RIO_OnTrack;
32  class Track;
33  class Surface;
76 class TrackDiff : virtual public Trk::ITrackDiff, public AthAlgTool {
77 public:
78 
79  // standard AlgToolmethods
80  TrackDiff(const std::string&,const std::string&,const IInterface*);
82 
83  // standard Athena methods
86 
87 
89  virtual StatusCode diff (
90  const Trk::Track& referenceTrack,
91  const Trk::Track& comparedTrack);
92 
93 
94 private:
95 
96  static const int s_maxHits = 300; // maximal number of hits per track
97 
98  TTree* m_nt;
99 
101 
102  // jobOptions
103  std::string m_ntupleFileName;
104  std::string m_ntupleDirName;
105  std::string m_ntupleTreeName;
106  //bool m_compareMeasurements; //!< jobOption: compare track states of type "measurement"
111 
113 
117 
127 
128  int m_nDiffs;
129  std::vector<int>* m_detectorType;
130  std::vector<int>* m_isFake;
131  std::vector<int>* m_isMissing;
132  std::vector<int>* m_isPRD_Mismatch;
133  std::vector<int>* m_isFlippedSign;
134  std::vector<int>* m_isNoDriftTime;
135  std::vector<int>* m_refIsMeasurement;
136  std::vector<int>* m_refIsOutlier;
137  std::vector<int>* m_compIsMeasurement;
138  std::vector<int>* m_compIsOutlier;
139  std::vector<float>* m_maxAssignProb;
140  std::vector<float>* m_sumAssignProb;
141  std::vector<float>* m_surfX;
142  std::vector<float>* m_surfY;
143  std::vector<float>* m_surfZ;
144 
145  float m_trackEta;
146  float m_trackPhi;
147 
148 
156 
157  SG::ReadHandleKey<xAOD::EventInfo> m_evt {this, "EvtInfo", "EventInfo", "EventInfo name"};
158 
161 
163  void resetVariables();
164 
167  std::string &detTypeName ) const;
168 
170  bool diffStateInfo(const Trk::TrackStateData* refTrackStateData,
171  const Trk::TrackStateData* compareTrackStateData);
172 
173 };
174 
175 
176 } // end of namespace
177 
178 #endif // TRK_TRACKDIFF_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
Trk::TrackDiff::m_refIsOutlier
std::vector< int > * m_refIsOutlier
Definition: TrackDiff.h:136
Trk::TrackDiff::m_fakesSum
int m_fakesSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:151
Trk::TrackDiff
Definition: TrackDiff.h:76
Trk::TrackDiff::m_driftCircleSignFlips
int m_driftCircleSignFlips
Definition: TrackDiff.h:125
Trk::TrackDiff::m_compIsOutlier
std::vector< int > * m_compIsOutlier
Definition: TrackDiff.h:138
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::TrackDiff::m_missedSum
int m_missedSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:152
TrackStateDefs.h
Trk::TrackDiff::m_PRD_MismatchesSum
int m_PRD_MismatchesSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:154
Trk::TrackDiff::m_eventNumber
int m_eventNumber
Definition: TrackDiff.h:112
Trk::TrackDiff::initialize
StatusCode initialize()
Definition: TrackDiff.cxx:105
Trk::TrackDiff::finalize
StatusCode finalize()
finalize
Definition: TrackDiff.cxx:207
Trk::TrackDiff::m_PRD_Mismatches
int m_PRD_Mismatches[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:124
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
Trk::TrackDiff::m_surfY
std::vector< float > * m_surfY
Definition: TrackDiff.h:142
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::TrackDiff::m_compareAll
bool m_compareAll
jobOption: compare track states of all types
Definition: TrackDiff.h:108
TrackStateData.h
Trk::TrackDiff::diffStateInfo
bool diffStateInfo(const Trk::TrackStateData *refTrackStateData, const Trk::TrackStateData *compareTrackStateData)
diff of two given track state data
Definition: TrackDiff.cxx:523
Trk::TrackDiff::m_trackEta
float m_trackEta
Definition: TrackDiff.h:145
SG::ReadHandleKey< xAOD::EventInfo >
Trk::TrackDiff::m_detectorType
std::vector< int > * m_detectorType
Definition: TrackDiff.h:129
Trk::ITrackDiff
Definition: ITrackDiff.h:29
ITrackDiff.h
Trk::TrackDiff::m_nCompStatesSum
int m_nCompStatesSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:150
Trk::TrackDiff::m_isFlippedSign
std::vector< int > * m_isFlippedSign
Definition: TrackDiff.h:133
Trk::TrackDiff::m_trackSum
int m_trackSum
Definition: TrackDiff.h:155
Trk::TrackDiff::resetVariables
void resetVariables()
reset the ntuple variables
Definition: TrackDiff.cxx:431
Trk::TrackDiff::m_ntupleFileName
std::string m_ntupleFileName
jobOption: Ntuple file name
Definition: TrackDiff.h:103
Trk::TrackDiff::m_refType
int m_refType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
Definition: TrackDiff.h:122
Trk::TrackDiff::m_writeNtuple
bool m_writeNtuple
jobOption: write data to ntuple?
Definition: TrackDiff.h:109
Trk::TrackDiff::m_wrongType
int m_wrongType[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:119
Trk::TrackDiff::m_missingType
int m_missingType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
Definition: TrackDiff.h:120
Trk::TrackDiff::m_isFake
std::vector< int > * m_isFake
vector<bool> would be more efficient, but vector<bool> is not a normal vector<> and seems to make tro...
Definition: TrackDiff.h:130
Trk::TrackDiff::TrackDiff
TrackDiff(const std::string &, const std::string &, const IInterface *)
Definition: TrackDiff.cxx:34
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::TrackDiff::m_trackPhi
float m_trackPhi
Definition: TrackDiff.h:146
Trk::TrackDiff::s_maxHits
static const int s_maxHits
Definition: TrackDiff.h:96
AthAlgTool.h
Trk::TrackDiff::m_compareType
int m_compareType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
Definition: TrackDiff.h:123
Trk::TrackState::MeasurementType
MeasurementType
enum describing the flavour of MeasurementBase
Definition: TrackStateDefs.h:26
Trk::TrackDiff::m_surfZ
std::vector< float > * m_surfZ
Definition: TrackDiff.h:143
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
Trk::TrackDiff::m_wrongTypeSum
int m_wrongTypeSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:153
Trk::TrackDiff::m_ntupleDirName
std::string m_ntupleDirName
jobOption: Ntuple directory name
Definition: TrackDiff.h:104
Trk::TrackDiff::m_isNoDriftTime
std::vector< int > * m_isNoDriftTime
Definition: TrackDiff.h:134
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::TrackDiff::m_writeCompetingROT
bool m_writeCompetingROT
jobOption: write data about TrkCompetingRIOsOnTrack?
Definition: TrackDiff.h:110
Trk::TrackDiff::m_refIsMeasurement
std::vector< int > * m_refIsMeasurement
Definition: TrackDiff.h:135
Trk::TrackDiff::m_isPRD_Mismatch
std::vector< int > * m_isPRD_Mismatch
Definition: TrackDiff.h:132
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
Trk::TrackDiff::m_maxAssignProb
std::vector< float > * m_maxAssignProb
Definition: TrackDiff.h:139
Trk::TrackDiff::m_sumAssignProb
std::vector< float > * m_sumAssignProb
Definition: TrackDiff.h:140
EventInfo.h
Trk::TrackDiff::m_missed
int m_missed[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:118
Trk::TrackDiff::m_compareOutliers
bool m_compareOutliers
jobOption: compare track states of type "outlier"
Definition: TrackDiff.h:107
Trk::TrackDiff::m_nCompStates
int m_nCompStates[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:115
Trk::TrackDiff::m_compIsMeasurement
std::vector< int > * m_compIsMeasurement
Definition: TrackDiff.h:137
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
Trk::TrackDiff::m_fakeType
int m_fakeType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
Definition: TrackDiff.h:121
Trk::TrackDiff::detectorType
Trk::TrackState::MeasurementType detectorType(const Trk::RIO_OnTrack &ROT, std::string &detTypeName) const
get detector type and name by identifier of Trk::RIO_OnTrack
Definition: TrackDiff.cxx:488
Trk::TrackDiff::m_idHelper
AtlasDetectorID * m_idHelper
Used to find out the sub-det from PRD->identify().
Definition: TrackDiff.h:100
Trk::TrackDiff::m_ntupleTreeName
std::string m_ntupleTreeName
jobOption: Ntuple tree name
Definition: TrackDiff.h:105
Trk::TrackStateData
Definition: TrackStateData.h:30
Trk::TrackDiff::m_surfX
std::vector< float > * m_surfX
Definition: TrackDiff.h:141
Trk::TrackDiff::m_nRefStates
int m_nRefStates[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:114
Trk::TrackDiff::m_fakes
int m_fakes[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:116
Trk::TrackDiff::extractDataFromTrack
DataVector< const Trk::TrackStateData > * extractDataFromTrack(const Trk::Track &) const
extract data from a Trk::Track into a list of Trk::TrackStateData
Definition: TrackDiff.cxx:345
Trk::TrackDiff::m_isMissing
std::vector< int > * m_isMissing
Definition: TrackDiff.h:131
Trk::TrackDiff::m_nRefStatesSum
int m_nRefStatesSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition: TrackDiff.h:149
Trk::TrackDiff::~TrackDiff
~TrackDiff()
Trk::TrackDiff::m_nDiffs
int m_nDiffs
Definition: TrackDiff.h:128
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
AthAlgTool
Definition: AthAlgTool.h:26
Trk::TrackDiff::m_noDriftTime
int m_noDriftTime
Definition: TrackDiff.h:126
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes
@ NumberOfTrackStateOnSurfaceTypes
Definition: TrackStateOnSurface.h:152
Trk::TrackState::NumberOfMeasurementTypes
@ NumberOfMeasurementTypes
Definition: TrackStateDefs.h:43
TrackStateOnSurface.h
Trk::TrackDiff::m_nt
TTree * m_nt
Pointer to the NTuple tree.
Definition: TrackDiff.h:98
Trk::TrackDiff::diff
virtual StatusCode diff(const Trk::Track &referenceTrack, const Trk::Track &comparedTrack)
diff of two given tracks
Definition: TrackDiff.cxx:223
Trk::TrackDiff::m_evt
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition: TrackDiff.h:157