ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::TrackDiff Class Reference

This validation tool writes the differences between two tracks into a ntuple. More...

#include <TrackDiff.h>

Inheritance diagram for Trk::TrackDiff:
Collaboration diagram for Trk::TrackDiff:

Public Member Functions

 TrackDiff (const std::string &, const std::string &, const IInterface *)
 ~TrackDiff ()
StatusCode initialize ()
StatusCode finalize ()
 finalize
virtual StatusCode diff (const Trk::Track &referenceTrack, const Trk::Track &comparedTrack)
 diff of two given tracks
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Interface ID, declared here, and defined below.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

DataVector< const Trk::TrackStateData > * extractDataFromTrack (const Trk::Track &) const
 extract data from a Trk::Track into a list of Trk::TrackStateData
void resetVariables ()
 reset the ntuple variables
Trk::TrackState::MeasurementType detectorType (const Trk::RIO_OnTrack &ROT, std::string &detTypeName) const
 get detector type and name by identifier of Trk::RIO_OnTrack
bool diffStateInfo (const Trk::TrackStateData *refTrackStateData, const Trk::TrackStateData *compareTrackStateData)
 diff of two given track state data
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

TTree * m_nt
 Pointer to the NTuple tree.
AtlasDetectorIDm_idHelper
 Used to find out the sub-det from PRD->identify().
std::string m_ntupleFileName
 jobOption: Ntuple file name
std::string m_ntupleDirName
 jobOption: Ntuple directory name
std::string m_ntupleTreeName
 jobOption: Ntuple tree name
bool m_compareOutliers
 jobOption: compare track states of type "outlier"
bool m_compareAll
 jobOption: compare track states of all types
bool m_writeNtuple
 jobOption: write data to ntuple?
bool m_writeCompetingROT
 jobOption: write data about TrkCompetingRIOsOnTrack?
int m_eventNumber
int m_nRefStates [Trk::TrackState::NumberOfMeasurementTypes]
int m_nCompStates [Trk::TrackState::NumberOfMeasurementTypes]
int m_fakes [Trk::TrackState::NumberOfMeasurementTypes]
int m_missed [Trk::TrackState::NumberOfMeasurementTypes]
int m_wrongType [Trk::TrackState::NumberOfMeasurementTypes]
int m_missingType [Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
int m_fakeType [Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
int m_refType [Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
int m_compareType [Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
int m_PRD_Mismatches [Trk::TrackState::NumberOfMeasurementTypes]
int m_driftCircleSignFlips
int m_noDriftTime
int m_nDiffs
std::vector< int > * m_detectorType
std::vector< int > * m_isFake
 vector<bool> would be more efficient, but vector<bool> is not a normal vector<> and seems to make trouble
std::vector< int > * m_isMissing
std::vector< int > * m_isPRD_Mismatch
std::vector< int > * m_isFlippedSign
std::vector< int > * m_isNoDriftTime
std::vector< int > * m_refIsMeasurement
std::vector< int > * m_refIsOutlier
std::vector< int > * m_compIsMeasurement
std::vector< int > * m_compIsOutlier
std::vector< float > * m_maxAssignProb
std::vector< float > * m_sumAssignProb
std::vector< float > * m_surfX
std::vector< float > * m_surfY
std::vector< float > * m_surfZ
float m_trackEta
float m_trackPhi
int m_nRefStatesSum [Trk::TrackState::NumberOfMeasurementTypes]
int m_nCompStatesSum [Trk::TrackState::NumberOfMeasurementTypes]
int m_fakesSum [Trk::TrackState::NumberOfMeasurementTypes]
int m_missedSum [Trk::TrackState::NumberOfMeasurementTypes]
int m_wrongTypeSum [Trk::TrackState::NumberOfMeasurementTypes]
int m_PRD_MismatchesSum [Trk::TrackState::NumberOfMeasurementTypes]
int m_trackSum
SG::ReadHandleKey< xAOD::EventInfom_evt {this, "EvtInfo", "EventInfo", "EventInfo name"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Static Private Attributes

static const int s_maxHits = 300

Detailed Description

This validation tool writes the differences between two tracks into a ntuple.

A detailed report of the differences found is written to the message stream in DEBUG mode.

In the finalize function a summary of all tracks is given.

Ntuple variables of Trk::TrackDiff

EventNumberNumber of the event the tracks belong toint
RefTrackPhi0Phi0 of the reference trackfloat
RefTrackEta0Eta0 of the reference trackfloat
nRefStatesnumber of reference TSoS for each detector typeint[detTypes]
nCompareStatesnumber of TSoS of the compared track (for each detector type)int[detTypes]
nFakeStatesnumber of TSoS of the compared track which are not included in the reference track (does not include wrong types), (for each detector type)int[detTypes]
nMissedStatesnumber of TSoS of the reference track which are not included in the compared track (does not include wrong types, (for each detector type))int[detTypes]
nWrongTypenumber of TSoS which have different types in the reference and the compared track (for each detector type)int[detTypes]
nPRD_Mismatchesnumber of TSoS on the same detector surface which have different Trk::PrepRawData pointers (for each detector type)int[detTypes]
nDriftCircleSignFlipsnumber of Trk::RIO_OnTrack in the TRT which have flipped drift radii signsint
nRefTypesnumber of reference TSoS for each TSoS typeint[tsosTypes]
nCompareTypesnumber of compared TSoS for each TSoS typeint[tsosTypes]
nMissedTypesnumber of TSoS which are not on the compared track (for each TSoS type)int[tsosTypes]
nFakeTypesnumber of TSoS which are not on the reference track (for each TSoS type)int[tsosTypes]
nDiffsnumber of differences foundint
MeasurementTypedetector type in which the difference was foundint[nDiffs]
IsFakeis the difference a fake state?vector<int> [nDiffs]
IsMissingis the difference a missing state?vector<int> [nDiffs]
IsPRD_Mismatchis the diff as PRD mismatch?vector<int> [nDiffs]
IsFlippedSignhas the diff flipped sign?vector<int> [nDiffs]
IsNoDriftTimehas the diff !NoDriftTime?vector<int> [nDiffs]
RefIsMeasurementis reference state a measurement?vector<int> [nDiffs]
RefIsOutlieris reference state an outlier?vector<int> [nDiffs]
ComparedIsMeasurementis compared state a measurement?vector<int> [nDiffs]
ComparedIsOutlieris compared state an outlier?vector<int> [nDiffs]
MaxAssgnProbjust if WriteCompetingROTdata=True: maximum assignment probability of the compared statevector<float> [nDiffs]
SumAssgnProbjust if WriteCompetingROTdata=True: sum of assignment probabilities of the compared statevector<float> [nDiffs]

All numbers contain just the Trk::TrackStateOnSurface which have the types selected in the jobOptions, i.e. in the standard configuration only Measurements and Outliers.

Author
Sebas.nosp@m.tian.nosp@m..Flei.nosp@m.schm.nosp@m.ann@c.nosp@m.ern..nosp@m.ch

Definition at line 76 of file TrackDiff.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrackDiff()

Trk::TrackDiff::TrackDiff ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 34 of file TrackDiff.cxx.

38 :
39 AthAlgTool(t,n,p),
40 m_nt(nullptr),
41 m_idHelper(nullptr),
42 //strings initialised in job options
44 m_compareAll(false),
45 m_writeNtuple(true),
50 m_fakes{},
51
52 m_missed{},
55 m_fakeType{},
56 m_refType{},
61 m_nDiffs{},
63 m_isFake{},
74 m_surfX{},
75 m_surfY{},
76 m_surfZ{},
77 m_trackEta{},
78 m_trackPhi{},
81 m_fakesSum{},
85 m_trackSum(0) {
86 declareInterface<ITrackDiff>(this);
87 // Declare the properties
88 //declareProperty("BookNewNtuple", m_bookNewNtuple = true);
89 declareProperty("NtupleFileName", m_ntupleFileName = "/NTUPLES");
90 declareProperty("NtupleDirectoryName", m_ntupleDirName = "TrackValidation");
91 declareProperty("NtupleTreeName", m_ntupleTreeName = "TrackDiff");
92 //declareProperty("CompareMeasurements", m_compareMeasurements = true);
93 declareProperty("CompareOutliers", m_compareOutliers = true);
94 declareProperty("CompareAllTSoS", m_compareAll = false);
95 declareProperty("WriteNtuple", m_writeNtuple = true);
96 declareProperty("WriteCompetingROTdata",m_writeCompetingROT = false);
97}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
int m_PRD_Mismatches[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:124
std::vector< int > * m_isNoDriftTime
Definition TrackDiff.h:134
int m_driftCircleSignFlips
Definition TrackDiff.h:125
std::vector< int > * m_compIsOutlier
Definition TrackDiff.h:138
int m_nRefStates[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:114
int m_missed[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:118
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
int m_wrongTypeSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:153
std::vector< float > * m_sumAssignProb
Definition TrackDiff.h:140
int m_refType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
Definition TrackDiff.h:122
std::string m_ntupleTreeName
jobOption: Ntuple tree name
Definition TrackDiff.h:105
int m_fakeType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
Definition TrackDiff.h:121
bool m_compareOutliers
jobOption: compare track states of type "outlier"
Definition TrackDiff.h:107
int m_missedSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:152
std::vector< int > * m_isPRD_Mismatch
Definition TrackDiff.h:132
int m_PRD_MismatchesSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:154
std::vector< int > * m_detectorType
Definition TrackDiff.h:129
int m_wrongType[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:119
int m_fakesSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:151
bool m_compareAll
jobOption: compare track states of all types
Definition TrackDiff.h:108
std::string m_ntupleDirName
jobOption: Ntuple directory name
Definition TrackDiff.h:104
int m_nCompStatesSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:150
int m_compareType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
Definition TrackDiff.h:123
std::string m_ntupleFileName
jobOption: Ntuple file name
Definition TrackDiff.h:103
std::vector< float > * m_surfZ
Definition TrackDiff.h:143
int m_missingType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
Definition TrackDiff.h:120
TTree * m_nt
Pointer to the NTuple tree.
Definition TrackDiff.h:98
std::vector< float > * m_maxAssignProb
Definition TrackDiff.h:139
std::vector< int > * m_compIsMeasurement
Definition TrackDiff.h:137
bool m_writeCompetingROT
jobOption: write data about TrkCompetingRIOsOnTrack?
Definition TrackDiff.h:110
std::vector< int > * m_isMissing
Definition TrackDiff.h:131
int m_fakes[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:116
AtlasDetectorID * m_idHelper
Used to find out the sub-det from PRD->identify().
Definition TrackDiff.h:100
std::vector< int > * m_isFlippedSign
Definition TrackDiff.h:133
std::vector< float > * m_surfX
Definition TrackDiff.h:141
std::vector< float > * m_surfY
Definition TrackDiff.h:142
std::vector< int > * m_refIsMeasurement
Definition TrackDiff.h:135
int m_nRefStatesSum[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:149
std::vector< int > * m_refIsOutlier
Definition TrackDiff.h:136
bool m_writeNtuple
jobOption: write data to ntuple?
Definition TrackDiff.h:109
int m_nCompStates[Trk::TrackState::NumberOfMeasurementTypes]
Definition TrackDiff.h:115

◆ ~TrackDiff()

Trk::TrackDiff::~TrackDiff ( )
default

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detectorType()

Trk::TrackState::MeasurementType Trk::TrackDiff::detectorType ( const Trk::RIO_OnTrack & ROT,
std::string & detTypeName ) const
private

get detector type and name by identifier of Trk::RIO_OnTrack

determine detector type

Definition at line 488 of file TrackDiff.cxx.

489 {
490 // identify by ROT of reference track:
491 Identifier id = ROT.identify();
492
493 // get dector type
494 if ( id.is_valid()) {
495 if (m_idHelper->is_pixel(id) ) {
496 detTypeName = "Pixel";
498 } else if (m_idHelper->is_sct(id)) {
499 detTypeName = "SCT";
501 } else if (m_idHelper->is_trt(id)) {
502 detTypeName = "TRT";
504 } else if (m_idHelper->is_mdt(id)) {
505 detTypeName = "MDT";
507 } else if (m_idHelper->is_csc(id)) {
508 detTypeName = "CSC";
510 } else if (m_idHelper->is_rpc(id)) {
511 detTypeName = "RPC";
513 } else if (m_idHelper->is_tgc(id)) {
514 detTypeName = "TGC";
516 }
517 }
518 detTypeName = "unidentified";
520}
Identifier identify() const
return the identifier -extends MeasurementBase

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ diff()

StatusCode Trk::TrackDiff::diff ( const Trk::Track & referenceTrack,
const Trk::Track & comparedTrack )
virtual

diff of two given tracks

diff of two tracks

Implements Trk::ITrackDiff.

Definition at line 223 of file TrackDiff.cxx.

225 {
226
227 ATH_MSG_VERBOSE ( "in diff(trk, trk)" );
229
230 // ---------------------------------------
231 // fill event data
232 SG::ReadHandle<xAOD::EventInfo> evt(m_evt);
233 if (!evt.isValid()) {
234 ATH_MSG_ERROR ("Could not retrieve event info");
235 return StatusCode::FAILURE;
236 }
237
238 m_eventNumber = evt->eventNumber();
239 if (referenceTrack.perigeeParameters()) {
240 m_trackPhi = referenceTrack.perigeeParameters()->parameters()[Trk::phi0];
241 m_trackEta = referenceTrack.perigeeParameters()->eta();
242 } else {
243 m_trackPhi = -1000.;
244 m_trackEta = -1000.;
245 }
246
247
248 // list of track state data of the reference track
249 DataVector< const Trk::TrackStateData > *refTrackStateData;
250 // list of track state data of the compared track
251 DataVector< const Trk::TrackStateData > *compareTrackStateData;
252 // get data from the track states to be able to compare the surfaces and PrepRawData
253 refTrackStateData = extractDataFromTrack(referenceTrack);
254 compareTrackStateData = extractDataFromTrack(comparedTrack);
255
256 ATH_MSG_VERBOSE ( "number of track states: ref=" << refTrackStateData->size() << ", compare=" << compareTrackStateData->size() );
257 ATH_MSG_VERBOSE ( "reference track: eta_0 = " << m_trackEta << ", phi_0 = " << m_trackPhi );
258 ATH_MSG_DEBUG ( " Ref Comp other diffs detector " );
259 //----------------------------------------------
260 // loop over the track states of the reference track
261 // and try to find the related measurements on the
262 // comparison track
263 DataVector< const Trk::TrackStateData >::iterator refIter = refTrackStateData->begin();
264 DataVector< const Trk::TrackStateData >::iterator compIter = compareTrackStateData->begin();
265 for (; refIter != refTrackStateData->end(); ++refIter) {
266 // count the reference states by detector type
267 //m_nRefStates[ refIter->detType() ]++;
268 // loop over trackstates of the comparison track till we find
269 // a track state with the same surface or the same PRD
270 bool foundMatchingState = false;
271 //bool foundDiff = false;
272 // cache the pointer to reference PRD, so we do not have get it again and again
273 const Trk::PrepRawData* refPRD = nullptr;
274 if ((*refIter)->rot()) {
275 refPRD = (*refIter)->rot()->prepRawData();
276 }
277 compIter = compareTrackStateData->begin();
278 for ( ; compIter != compareTrackStateData->end(); ++compIter ) {
279 // compare the surfaces of the reference and the compared track state
280 if ( (*compIter)->surface() == (*refIter)->surface() ) {
281 // we found a track state on the same surface!
282 foundMatchingState = true;
283 //m_nCompStates[ compIter->detType() ]++;
284 //if (diffStateInfo( refIter, compIter ) {
285 // foundDiff = true;
286 //}
287 // there should be at maximum only one track state
288 // per surface, so we do not have to search further!
289 break;
290 } else if ( refPRD && (*compIter)->rot() ) {
291 // try to match the PrepRawData, if we did not succeed with the surfaces
292 // this is only needed in the case of dynamically created surfaces,
293 // which contain track specific corrections (e.g. "wire sagging")
294 if ( refPRD == ((*compIter)->rot()->prepRawData()) ) {
295 // we found a track state belonging to the same PrepRawData
296 foundMatchingState = true;
297
298 // there should be only one track state
299 // belonging to the same PRD, so we can stop searching!
300 break;
301 } // end if PRD match
302 } // end else if( refPRD && compIter->rot() )
303 } // end loop over compared states
304 if (!foundMatchingState) {
305 // we have a state in the reference, which is not contained in the
306 // compared track!
307 diffStateInfo((*refIter), nullptr);
308 } else {
309 diffStateInfo((*refIter), (*compIter));
310 // drop the compared track state from our list:
311 compareTrackStateData->erase(compIter);
312 }
313
314 } // end loop over reference states
315
316 // loop over the remaining compared states: They are fakes
317 compIter = compareTrackStateData->begin();
318 for (; compIter != compareTrackStateData->end(); ++compIter) {
319 diffStateInfo(nullptr, (*compIter));
320 }
321 // -----------------------
322 // output some statistics:
323
324 ATH_MSG_VERBOSE ( "reference TSoS (Pixel/SCT/TRT): " << m_nRefStates[Trk::TrackState::Pixel] << "/" << m_nRefStates[Trk::TrackState::SCT] << "/" << m_nRefStates[Trk::TrackState::TRT] );
326 ATH_MSG_VERBOSE ( "missed TSoS (Pixel/SCT/TRT): " << m_missed[Trk::TrackState::Pixel] << "/" << m_missed[Trk::TrackState::SCT] << "/" << m_missed[Trk::TrackState::TRT] );
327 ATH_MSG_VERBOSE ( "faked TSoS (Pixel/SCT/TRT): " << m_fakes[Trk::TrackState::Pixel] << "/" << m_fakes[Trk::TrackState::SCT] << "/" << m_fakes[Trk::TrackState::TRT] );
328 ATH_MSG_VERBOSE ( "wrong type TSoS (Pixel/SCT/TRT): " << m_wrongType[Trk::TrackState::Pixel] << "/" << m_wrongType[Trk::TrackState::SCT] << "/" << m_wrongType[Trk::TrackState::TRT] );
332 if (m_writeNtuple) {
333 //----------------------------------------------
334 // write the ntuple record out (once per call)
335 m_nt->Fill();
336 }
337 m_trackSum++;
338 // clean up
339 delete refTrackStateData;
340 delete compareTrackStateData;
341 return StatusCode::SUCCESS;
342}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
DataModel_detail::iterator< DataVector > iterator
Standard iterator.
Definition DataVector.h:842
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
iterator erase(iterator position)
Remove element at a given position.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
double eta() const
Access method for pseudorapidity - from momentum.
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition TrackDiff.h:157
DataVector< const Trk::TrackStateData > * extractDataFromTrack(const Trk::Track &) const
extract data from a Trk::Track into a list of Trk::TrackStateData
bool diffStateInfo(const Trk::TrackStateData *refTrackStateData, const Trk::TrackStateData *compareTrackStateData)
diff of two given track state data
void resetVariables()
reset the ntuple variables
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
const Perigee * perigeeParameters() const
return Perigee.
@ phi0
Definition ParamDefs.h:65

◆ diffStateInfo()

bool Trk::TrackDiff::diffStateInfo ( const Trk::TrackStateData * refTrackStateData,
const Trk::TrackStateData * compareTrackStateData )
private

diff of two given track state data

diff two TrackStateData

Definition at line 523 of file TrackDiff.cxx.

524 {
525
526 bool foundDiff = false;
527
528 bool isFake = false;
529 bool isMissing = false;
530 bool isPRD_Mismatch = false;
531 bool isFlippedSign = false;
532 bool isNoDriftTime = false;
533 bool refIsMeasurement = false;
534 bool refIsOutlier = false;
535 bool compIsMeasurement = false;
536 bool compIsOutlier = false;
537 bool wrongType = false;
538 std::string detTypeName = "unidentified";
540 //std::stringstream surfaceCenter;
541
542 //ATH_MSG_VERBOSE ( "Writing info for states: " << (refTrackState ? "REF ": "") << (refTrackState ? m_refIndex : 0) << " " << (compareTrackState ? "CMP " : "" ) << (compareTrackState ? m_compIndex : 0) );
543
544 // info about the state types
545 if (refTrackState){
546 refIsMeasurement = refTrackState->trackStateOnSurface()->type(Trk::TrackStateOnSurface::Measurement);
547 refIsOutlier = refTrackState->trackStateOnSurface()->type(Trk::TrackStateOnSurface::Outlier);
548 if (!compareTrackState) {
549 // we have a ref state without compared state
550 isMissing = true;
551 foundDiff = true;
552 m_missed[ refTrackState->detType() ]++;
553 }
554 // count the reference states by detector type
555 m_nRefStates[ refTrackState->detType() ]++;
556 detType = refTrackState->detType();
557 detTypeName = refTrackState->detTypeName();
558 //surfaceCenter << "(" << refTrackState->surface()->center().x() << ", " << refTrackState->surface()->center().y() << "," <<refTrackState->surface()->center().z() << ")";
559 }
560 else if (compareTrackState) {
561 // we have a compared state without ref state
562 isFake = true;
563 foundDiff = true;
564 m_fakes[ compareTrackState->detType() ]++;
565 detType = compareTrackState->detType();
566 detTypeName = compareTrackState->detTypeName();
567 } // end if (refTrackState)
568 if (compareTrackState){
569 compIsMeasurement = compareTrackState->trackStateOnSurface()->type(Trk::TrackStateOnSurface::Measurement);
570 compIsOutlier = compareTrackState->trackStateOnSurface()->type(Trk::TrackStateOnSurface::Outlier);
571 // count the compared states by detector type
572 m_nCompStates[ compareTrackState->detType() ]++;
573 }//end if (compareTrackState)
574
575 // find differences if both states exist
576 if (refTrackState && compareTrackState) {
577
578 // find differences in the TrackStateOnSurface types:
579 if (m_compareAll) {
580
581 } else {
582 if (m_compareOutliers && (refIsOutlier != compIsOutlier)) {
583 foundDiff = true;
584 wrongType = true;
585 if (refIsOutlier) {
587 } else {
589 }
590 } // end if differ in outlier type
591 if (refIsMeasurement != compIsMeasurement ) {
592 foundDiff = true;
593 wrongType = true;
594 if (refIsMeasurement) {
596 } else {
598 }
599 } // end if differ in measurement type
600 } // end else (compare all types)
601
602 // find differences in the ROTs:
603 const Trk::RIO_OnTrack* refROT = refTrackState->rot();
604 const Trk::RIO_OnTrack* compareROT = compareTrackState->rot();
605 if (refROT && compareROT) {
606 if (refROT->prepRawData() != compareROT->prepRawData()) {
607 isPRD_Mismatch = true;
608 (m_PRD_Mismatches[detType])++;
609 }
610 if (detType == Trk::TrackState::TRT) {
611 isFlippedSign = ((refROT->localParameters()[Trk::locR]) * (compareROT->localParameters()[Trk::locR]) < 0. );
612 if (isFlippedSign) m_driftCircleSignFlips++;
613 isNoDriftTime = ((refROT->localParameters()[Trk::locR] != 0. ) && (compareROT->localParameters()[Trk::locR] == 0. ) );
614 if (isNoDriftTime) m_noDriftTime++;
615 }
616 foundDiff = (foundDiff || isPRD_Mismatch || isFlippedSign || isNoDriftTime );
617 } // end if (both states have ROTs)
618 } // end if (both states exist)
619 if (foundDiff) {
620 double surfX = 0;
621 double surfY = 0;
622 double surfZ = 0;
623 // give some info about the diff:
624 msg(MSG::DEBUG) << "Diff:";
625 if (isFake){ msg(MSG::DEBUG) << " -- ";}
626 else {msg(MSG::DEBUG) << (refIsOutlier ? " O" : " ") << (refIsMeasurement ? "M " : " ");}
627 if (isMissing){ msg(MSG::DEBUG) << " -- ";}
628 else {msg(MSG::DEBUG) << (compIsOutlier ? " O" : " ") << (compIsMeasurement ? "M " : " ");}
629 msg(MSG::DEBUG) << (isFake ? " FakeState " : "")
630 << (isMissing ? " MissingState " : "")
631 << (wrongType ? " Wrong TSoS type" : "")
632 << (isPRD_Mismatch ? " PRD mismatch " : "")
633 << (isFlippedSign ? " Flipped Sign " : "")
634 << (isNoDriftTime ? " NoDriftTime " : "")
635 << " in " << detTypeName
636 << " detector at surface with center " << endmsg; //<< surfaceCenter
637 if (refTrackState) {
638 surfX = refTrackState->surface()->center().x();
639 surfY = refTrackState->surface()->center().y();
640 surfZ = refTrackState->surface()->center().z();
641 } else {
642 surfX = compareTrackState->surface()->center().x();
643 surfY = compareTrackState->surface()->center().y();
644 surfZ = compareTrackState->surface()->center().z();
645 }
646 ATH_MSG_DEBUG ( "(" << surfX << ", " << surfY << "," << surfZ << ")");
647 if (m_writeNtuple) {
649 // write some data specific to TrkCompetingRIOsOnTrack
650 float maxAssgnProb = -1.;
651 float sumAssgnProb = -1.;
652 if (compareTrackState) {
653 const Trk::CompetingRIOsOnTrack* competingROT = dynamic_cast< const Trk::CompetingRIOsOnTrack* > (compareTrackState->trackStateOnSurface()->measurementOnTrack());
654 if (competingROT) {
655 maxAssgnProb = competingROT->assignmentProbability(competingROT->indexOfMaxAssignProb());
656 // sum up all assignment probs:
657 sumAssgnProb = 0.;
658 for (unsigned int index = 0; index < competingROT->numberOfContainedROTs(); index++) {
659 sumAssgnProb += competingROT->assignmentProbability(index);
660 }
661 } // end if competingROT
662 } // end if compareTrackState
663 m_maxAssignProb->push_back(maxAssgnProb);
664 m_sumAssignProb->push_back(sumAssgnProb);
665 } // end if writeComepetingROT
666
667 // push data into the vectors
668 m_isFake->push_back(isFake?1:0);
669 m_isMissing->push_back(isMissing?1:0);
670 m_detectorType->push_back(detType);
671 m_isPRD_Mismatch->push_back(isPRD_Mismatch?1:0);
672 m_isFlippedSign->push_back(isFlippedSign?1:0);
673 m_isNoDriftTime->push_back(isNoDriftTime?1:0);
674 m_refIsOutlier->push_back(refIsOutlier?1:0);
675 m_refIsMeasurement->push_back(refIsMeasurement?1:0);
676 m_compIsOutlier->push_back(compIsOutlier?1:0);
677 m_compIsMeasurement->push_back(compIsMeasurement?1:0);
678 m_surfX->push_back(surfX);
679 m_surfY->push_back(surfY);
680 m_surfZ->push_back(surfZ);
681 } // end if (writeNtuple)
682 m_nDiffs++;
683 } // end if (foundDiff)
684 return (foundDiff);
685
686}
#define endmsg
MsgStream & msg() const
AssignmentProb assignmentProbability(unsigned int indx) const
returns the AssignmentProbability depending on the integer.
virtual unsigned int numberOfContainedROTs() const =0
Number of RIO_OnTracks to be contained by this CompetingRIOsOnTrack.
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
str index
Definition DeMoScan.py:362
MeasurementType
enum describing the flavour of MeasurementBase
@ locR
Definition ParamDefs.h:44

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extractDataFromTrack()

DataVector< const Trk::TrackStateData > * Trk::TrackDiff::extractDataFromTrack ( const Trk::Track & track) const
private

extract data from a Trk::Track into a list of Trk::TrackStateData

extract track state data from the track

Definition at line 345 of file TrackDiff.cxx.

345 {
346
347 // Get pointer to track state on surfaces
348 const Trk::TrackStates* trackStates = track.trackStateOnSurfaces();
349 if (!trackStates) {
350 ATH_MSG_ERROR ( "track containes no track states, diff impossible" );
351 return nullptr;
352 }
353
354 // create the vector of extracted data
355 DataVector< const Trk::TrackStateData >* trackStateData = new DataVector< const Trk::TrackStateData >;
356
357 // track state iterator
359 // Loop over all track states on surfaces
360 // to extract the measurements
361 for (; iter != trackStates->end(); ++iter) {
362 if (!(*iter)) {
363 ATH_MSG_WARNING ( "TrackStateOnSurface == Null" );
364 continue;
365 }
366 if (!m_compareAll) {
367 // just use TSoS of type "measurement" or "outlier"
368 if (m_compareOutliers) {
369 if (!( (*iter)->type(Trk::TrackStateOnSurface::Measurement) ||
370 (*iter)->type(Trk::TrackStateOnSurface::Outlier) ) ) {
371 continue;
372 }
373 } else {
374 if (!( (*iter)->type(Trk::TrackStateOnSurface::Measurement) ) ) {
375 continue;
376 }
377 } // end if (compareOutliers)
378 } // end if (!compareAll)
379
380 // Get pointer to measurement on track
381 const Trk::MeasurementBase *measurement = (*iter)->measurementOnTrack();
382 if (!measurement && !m_compareAll) {
383 ATH_MSG_ERROR ( "measurementOnTrack == Null for a TrackStateOnSurface "
384 << "of type Measurement or Outlier" );
385 continue;
386 } // end if (!measurement)
387 const Trk::Surface& surface = measurement ?
388 (measurement->associatedSurface()) :
389 (*iter)->trackParameters()->associatedSurface();
390 // we need the RIO_OnTrack to decide if we have the same PrepRawData
391 // on the track
392 const Trk::RIO_OnTrack* ROT = dynamic_cast< const Trk::RIO_OnTrack* > (measurement);
393 if (!ROT) {
394 // try to cast to CompetingRIOsOnTrack
395 const Trk::CompetingRIOsOnTrack* compROT = dynamic_cast< const Trk::CompetingRIOsOnTrack* > (measurement);
396 if (compROT) {
397 ROT = &compROT->rioOnTrack( compROT->indexOfMaxAssignProb() );
398// // quick hack to identify DAF ouliers:
399// if (!m_compareOutliers && (compROT->assignmentProbability(compROT->indexOfMaxAssignProb()) < 0.4)) {
400// continue;
401// }
402 // use surface of the most prob. ROT:
403 // FIXME put back in place: surface = compROT->rioOnTrack( compROT->indexOfMaxAssignProb() ).associatedSurface();
404 } // end if (compROT)
405 }
406 // if we just compare Measurements and Outliers, we demand a ROT.
407 if ( !ROT && !m_compareAll ) {
408 continue;
409 }
410 // try to identify detector type by ROT
411 std::string detTypeName = "unidentified";
413 if ( ROT ) {
414 detType = detectorType(*ROT, detTypeName);
415 }
416 // add the extracted data to the vector:
417 const Trk::TrackStateData *tsData = new const Trk::TrackStateData( (*iter),
418 ROT,
419 &surface,
420 detTypeName,
421 detType);
422 trackStateData->push_back(tsData);
423 //ATH_MSG_VERBOSE ( detTypeName << " surf: " << surface << " (" << surface->center().x() << ", " << surface->center().y() << "," << surface->center().z() << ")"
424 // << " ROT: " << ROT << " PRD: " << (ROT ? ROT->prepRawData() : 0) << " PRD detEl: " << (ROT ? ROT->prepRawData()->detectorElement() : 0) );
425 } // end for loop over trackstates
426 return trackStateData;
427}
#define ATH_MSG_WARNING(x)
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
value_type push_back(value_type pElem)
Add an element to the end of the collection.
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
virtual const Surface & associatedSurface() const =0
Interface method to get the associated Surface.
Trk::TrackState::MeasurementType detectorType(const Trk::RIO_OnTrack &ROT, std::string &detTypeName) const
get detector type and name by identifier of Trk::RIO_OnTrack
DataVector< const Trk::TrackStateOnSurface > TrackStates

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode Trk::TrackDiff::finalize ( )

finalize

Definition at line 207 of file TrackDiff.cxx.

207 {
208 ATH_MSG_INFO ( "sums for " << m_trackSum << " compared tracks" );
211 ATH_MSG_INFO ( "missed TSoS (Pixel/SCT/TRT): " << m_missedSum[Trk::TrackState::Pixel] << "/" << m_missedSum[Trk::TrackState::SCT] << "/" << m_missedSum[Trk::TrackState::TRT] );
212 ATH_MSG_INFO ( "faked TSoS (Pixel/SCT/TRT): " << m_fakesSum[Trk::TrackState::Pixel] << "/" << m_fakesSum[Trk::TrackState::SCT] << "/" << m_fakesSum[Trk::TrackState::TRT] );
213 ATH_MSG_INFO ( "wrong type TSoS (Pixel/SCT/TRT): " << m_wrongTypeSum[Trk::TrackState::Pixel] << "/" << m_wrongTypeSum[Trk::TrackState::SCT] << "/" << m_wrongTypeSum[Trk::TrackState::TRT] );
215
216 ATH_MSG_INFO ( "finalize() successful in " << name() );
217 return StatusCode::SUCCESS;
218}
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode Trk::TrackDiff::initialize ( )

Definition at line 105 of file TrackDiff.cxx.

105 {
106
107 ATH_CHECK( m_evt.initialize() );
108
110 if (m_writeNtuple) {
111 // ---------------------------
112 // retrieve pointer to THistSvc
113 SmartIF<ITHistSvc> tHistSvc{service("THistSvc")};
114 ATH_CHECK( tHistSvc.isValid() );
115
116 // ---------------------------
117 // create tree and register it to THistSvc
118 m_nt = new TTree(TString(m_ntupleTreeName), "Track diff output");
119 // NB: we must not delete the tree, this is done by THistSvc
120 std::string fullNtupleName = "/"+m_ntupleFileName+"/"+m_ntupleDirName+"/"+m_ntupleTreeName;
121 ATH_CHECK( tHistSvc->regTree(fullNtupleName, m_nt) );
122
123 //-----------------
124 // add items
125 // event info:
126 m_nt->Branch("EventNumber", &m_eventNumber );
127 m_nt->Branch("RefTrackPhi0", &m_trackPhi );
128 m_nt->Branch("RefTrackEta0", &m_trackEta );
129
130 m_nt->Branch("nRefStates", &m_nRefStates, "nRefStates[8]/I");
131 m_nt->Branch("nCompareStates", &m_nCompStates, "nRefStates[8]/I");
132 m_nt->Branch("nFakeStates", &m_fakes, "nFakeStates[8]/I");
133 m_nt->Branch("nMissedStates", &m_missed, "nMissedStates[8]/I");
134 m_nt->Branch("nWrongType", &m_wrongType, "nWrongType[8]/I");
135 m_nt->Branch("nPRD_Mismatches", &m_PRD_Mismatches, "nPRD_Mismatches[8]/I");
136 m_nt->Branch("nDriftCircleSignFlips", &m_driftCircleSignFlips );
137 m_nt->Branch("nNoDriftTime", &m_noDriftTime );
138 m_nt->Branch("nRefTypes", &m_refType, "nRefTypes[8]/I");
139 m_nt->Branch("nCompareTypes", &m_compareType, "nCompareTypes[8]/I");
140 m_nt->Branch("nMissedTypes", &m_missingType, "nMissedTypes[8]/I");
141 m_nt->Branch("nFakeTypes", &m_fakeType, "nFakeTypes[8]/I");
142 // entries for each difference
143 m_nt->Branch("nDiffs", &m_nDiffs );
144 m_detectorType = new std::vector<int>();
145 m_isFake = new std::vector<int>();
146 m_isMissing = new std::vector<int>();
147 m_isPRD_Mismatch = new std::vector<int>();
148 m_isFlippedSign = new std::vector<int>();
149 m_isNoDriftTime = new std::vector<int>();
150 m_refIsMeasurement = new std::vector<int>();
151 m_refIsOutlier = new std::vector<int>();
152 m_compIsMeasurement = new std::vector<int>();
153 m_compIsOutlier = new std::vector<int>();
154 m_surfX = new std::vector<float>();
155 m_surfY = new std::vector<float>();
156 m_surfZ = new std::vector<float>();
157
158 m_nt->Branch("DetectorType", &m_detectorType);
159 m_nt->Branch("IsFake", &m_isFake);
160 m_nt->Branch("IsMissing", &m_isMissing);
161 m_nt->Branch("IsPRD_Mismatch", &m_isPRD_Mismatch);
162 m_nt->Branch("IsFlippedSign", &m_isFlippedSign);
163 m_nt->Branch("IsNoDriftTime", &m_isNoDriftTime);
164 m_nt->Branch("RefIsMeasurement", &m_refIsMeasurement);
165 m_nt->Branch("RefIsOutlier", &m_refIsOutlier);
166 m_nt->Branch("ComparedIsMeasurement", &m_compIsMeasurement);
167 m_nt->Branch("ComparedIsOutlier", &m_compIsOutlier);
168 m_nt->Branch("SurfaceX" , &m_surfX);
169 m_nt->Branch("SurfaceY" , &m_surfY);
170 m_nt->Branch("SurfaceZ" , &m_surfZ);
171
173 m_maxAssignProb = new std::vector<float>();
174 m_sumAssignProb = new std::vector<float>();
175 m_nt->Branch("MaxAssgnProb", &m_maxAssignProb);
176 m_nt->Branch("SumAssgnProb", &m_sumAssignProb);
177 } // end if writeComepetingROT
178 } // end if (m_writeNtuple)
179 // ---------------------------------------
180 // Get the detector helper to be able to identify sub-det technologies
181 if (detStore()->retrieve(m_idHelper, "AtlasID").isFailure()) {
182 ATH_MSG_ERROR ("Could not get AtlasDetectorID helper" );
183 return StatusCode::FAILURE;
184 }
185
186 for (int detType = 0; detType < Trk::TrackState::NumberOfMeasurementTypes; detType++) {
187 m_fakesSum[detType] = 0;
188 m_missedSum[detType] = 0;
189 m_PRD_MismatchesSum[detType] = 0;
190 m_nRefStatesSum[detType] = 0;
191 m_nCompStatesSum[detType] = 0;
192 m_wrongTypeSum[detType] = 0;
193 m_fakes[detType] = 0;
194 m_missed[detType] = 0;
195 m_PRD_Mismatches[detType] = 0;
196 m_nRefStates[detType] = 0;
197 m_nCompStates[detType] = 0;
198 m_wrongType[detType] = 0;
199 }
200
201 return StatusCode::SUCCESS;
202}
#define ATH_CHECK
Evaluate an expression and check for errors.
static Double_t sc
const ServiceHandle< StoreGateSvc > & detStore() const
::StatusCode StatusCode
StatusCode definition for legacy code.
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & Trk::ITrackDiff::interfaceID ( )
inlinestaticinherited

Interface ID, declared here, and defined below.

Definition at line 40 of file ITrackDiff.h.

40 {
41 return IID_ITrackDiff;
42}
static const InterfaceID IID_ITrackDiff("ITrackDiff", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ resetVariables()

void Trk::TrackDiff::resetVariables ( )
private

reset the ntuple variables

reset variables

Definition at line 431 of file TrackDiff.cxx.

431 {
432 // reset the counters
433 //m_fakes = 0;
434 //m_missed = 0;
436 m_noDriftTime = 0;
437 m_nDiffs = 0;
438 for (int detType = 0; detType < Trk::TrackState::NumberOfMeasurementTypes; detType++) {
439 m_fakesSum[detType] += m_fakes[detType];
440 m_fakes[detType] = 0;
441 m_missedSum[detType] += m_missed[detType];
442 m_missed[detType] = 0;
443 m_PRD_MismatchesSum[detType] += m_PRD_Mismatches[detType];
444 m_PRD_Mismatches[detType] = 0;
445 m_nRefStatesSum[detType] += m_nRefStates[detType];
446 m_nRefStates[detType] = 0;
447 m_nCompStatesSum[detType] += m_nCompStates[detType];
448 m_nCompStates[detType] = 0;
449 m_wrongType[detType] += m_wrongType[detType];
450 m_wrongType[detType] = 0;
451 }
452 for (int TSoSType = 0; TSoSType < Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes; TSoSType++) {
453 m_missingType[TSoSType] = 0;
454 m_fakeType[TSoSType] = 0;
455 m_refType[TSoSType] = 0;
456 m_compareType[TSoSType] = 0;
457 }
458// m_missingType->clear();
459// m_missingType->resize(Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes, 0);
460// m_fakeType->clear();
461// m_fakeType->resize(Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes, 0);
462// m_PRD_Mismatches->clear();
463// m_PRD_Mismatches->resize(8, 0);
464 if (m_writeNtuple) {
465 m_detectorType->clear();
466 m_isFake->clear();
467 m_isMissing->clear();
468 m_isPRD_Mismatch->clear();
469 m_isFlippedSign->clear();
470 m_isNoDriftTime->clear();
471 m_refIsMeasurement->clear();
472 m_refIsOutlier->clear();
473 m_compIsMeasurement->clear();
474 m_compIsOutlier->clear();
475 m_surfX->clear();
476 m_surfY->clear();
477 m_surfZ->clear();
478
480 m_maxAssignProb->clear();
481 m_sumAssignProb->clear();
482 } // end if writeComepetingROT
483 }
484
485}

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_compareAll

bool Trk::TrackDiff::m_compareAll
private

jobOption: compare track states of all types

Definition at line 108 of file TrackDiff.h.

◆ m_compareOutliers

bool Trk::TrackDiff::m_compareOutliers
private

jobOption: compare track states of type "outlier"

Definition at line 107 of file TrackDiff.h.

◆ m_compareType

int Trk::TrackDiff::m_compareType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
private

Definition at line 123 of file TrackDiff.h.

◆ m_compIsMeasurement

std::vector<int>* Trk::TrackDiff::m_compIsMeasurement
private

Definition at line 137 of file TrackDiff.h.

◆ m_compIsOutlier

std::vector<int>* Trk::TrackDiff::m_compIsOutlier
private

Definition at line 138 of file TrackDiff.h.

◆ m_detectorType

std::vector<int>* Trk::TrackDiff::m_detectorType
private

Definition at line 129 of file TrackDiff.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_driftCircleSignFlips

int Trk::TrackDiff::m_driftCircleSignFlips
private

Definition at line 125 of file TrackDiff.h.

◆ m_eventNumber

int Trk::TrackDiff::m_eventNumber
private

Definition at line 112 of file TrackDiff.h.

◆ m_evt

SG::ReadHandleKey<xAOD::EventInfo> Trk::TrackDiff::m_evt {this, "EvtInfo", "EventInfo", "EventInfo name"}
private

Definition at line 157 of file TrackDiff.h.

157{this, "EvtInfo", "EventInfo", "EventInfo name"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fakes

int Trk::TrackDiff::m_fakes[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 116 of file TrackDiff.h.

◆ m_fakesSum

int Trk::TrackDiff::m_fakesSum[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 151 of file TrackDiff.h.

◆ m_fakeType

int Trk::TrackDiff::m_fakeType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
private

Definition at line 121 of file TrackDiff.h.

◆ m_idHelper

AtlasDetectorID* Trk::TrackDiff::m_idHelper
private

Used to find out the sub-det from PRD->identify().

Definition at line 100 of file TrackDiff.h.

◆ m_isFake

std::vector<int>* Trk::TrackDiff::m_isFake
private

vector<bool> would be more efficient, but vector<bool> is not a normal vector<> and seems to make trouble

Definition at line 130 of file TrackDiff.h.

◆ m_isFlippedSign

std::vector<int>* Trk::TrackDiff::m_isFlippedSign
private

Definition at line 133 of file TrackDiff.h.

◆ m_isMissing

std::vector<int>* Trk::TrackDiff::m_isMissing
private

Definition at line 131 of file TrackDiff.h.

◆ m_isNoDriftTime

std::vector<int>* Trk::TrackDiff::m_isNoDriftTime
private

Definition at line 134 of file TrackDiff.h.

◆ m_isPRD_Mismatch

std::vector<int>* Trk::TrackDiff::m_isPRD_Mismatch
private

Definition at line 132 of file TrackDiff.h.

◆ m_maxAssignProb

std::vector<float>* Trk::TrackDiff::m_maxAssignProb
private

Definition at line 139 of file TrackDiff.h.

◆ m_missed

int Trk::TrackDiff::m_missed[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 118 of file TrackDiff.h.

◆ m_missedSum

int Trk::TrackDiff::m_missedSum[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 152 of file TrackDiff.h.

◆ m_missingType

int Trk::TrackDiff::m_missingType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
private

Definition at line 120 of file TrackDiff.h.

◆ m_nCompStates

int Trk::TrackDiff::m_nCompStates[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 115 of file TrackDiff.h.

◆ m_nCompStatesSum

int Trk::TrackDiff::m_nCompStatesSum[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 150 of file TrackDiff.h.

◆ m_nDiffs

int Trk::TrackDiff::m_nDiffs
private

Definition at line 128 of file TrackDiff.h.

◆ m_noDriftTime

int Trk::TrackDiff::m_noDriftTime
private

Definition at line 126 of file TrackDiff.h.

◆ m_nRefStates

int Trk::TrackDiff::m_nRefStates[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 114 of file TrackDiff.h.

◆ m_nRefStatesSum

int Trk::TrackDiff::m_nRefStatesSum[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 149 of file TrackDiff.h.

◆ m_nt

TTree* Trk::TrackDiff::m_nt
private

Pointer to the NTuple tree.

Definition at line 98 of file TrackDiff.h.

◆ m_ntupleDirName

std::string Trk::TrackDiff::m_ntupleDirName
private

jobOption: Ntuple directory name

Definition at line 104 of file TrackDiff.h.

◆ m_ntupleFileName

std::string Trk::TrackDiff::m_ntupleFileName
private

jobOption: Ntuple file name

Definition at line 103 of file TrackDiff.h.

◆ m_ntupleTreeName

std::string Trk::TrackDiff::m_ntupleTreeName
private

jobOption: Ntuple tree name

Definition at line 105 of file TrackDiff.h.

◆ m_PRD_Mismatches

int Trk::TrackDiff::m_PRD_Mismatches[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 124 of file TrackDiff.h.

◆ m_PRD_MismatchesSum

int Trk::TrackDiff::m_PRD_MismatchesSum[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 154 of file TrackDiff.h.

◆ m_refIsMeasurement

std::vector<int>* Trk::TrackDiff::m_refIsMeasurement
private

Definition at line 135 of file TrackDiff.h.

◆ m_refIsOutlier

std::vector<int>* Trk::TrackDiff::m_refIsOutlier
private

Definition at line 136 of file TrackDiff.h.

◆ m_refType

int Trk::TrackDiff::m_refType[Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes]
private

Definition at line 122 of file TrackDiff.h.

◆ m_sumAssignProb

std::vector<float>* Trk::TrackDiff::m_sumAssignProb
private

Definition at line 140 of file TrackDiff.h.

◆ m_surfX

std::vector<float>* Trk::TrackDiff::m_surfX
private

Definition at line 141 of file TrackDiff.h.

◆ m_surfY

std::vector<float>* Trk::TrackDiff::m_surfY
private

Definition at line 142 of file TrackDiff.h.

◆ m_surfZ

std::vector<float>* Trk::TrackDiff::m_surfZ
private

Definition at line 143 of file TrackDiff.h.

◆ m_trackEta

float Trk::TrackDiff::m_trackEta
private

Definition at line 145 of file TrackDiff.h.

◆ m_trackPhi

float Trk::TrackDiff::m_trackPhi
private

Definition at line 146 of file TrackDiff.h.

◆ m_trackSum

int Trk::TrackDiff::m_trackSum
private

Definition at line 155 of file TrackDiff.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeCompetingROT

bool Trk::TrackDiff::m_writeCompetingROT
private

jobOption: write data about TrkCompetingRIOsOnTrack?

Definition at line 110 of file TrackDiff.h.

◆ m_writeNtuple

bool Trk::TrackDiff::m_writeNtuple
private

jobOption: write data to ntuple?

Definition at line 109 of file TrackDiff.h.

◆ m_wrongType

int Trk::TrackDiff::m_wrongType[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 119 of file TrackDiff.h.

◆ m_wrongTypeSum

int Trk::TrackDiff::m_wrongTypeSum[Trk::TrackState::NumberOfMeasurementTypes]
private

Definition at line 153 of file TrackDiff.h.

◆ s_maxHits

const int Trk::TrackDiff::s_maxHits = 300
staticprivate

Definition at line 96 of file TrackDiff.h.


The documentation for this class was generated from the following files: