ATLAS Offline Software
Loading...
Searching...
No Matches
ResidualValidationNtupleHelper.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// ResidualValidationNtupleHelper.h
7// Header file for ResidualValidationNtupleHelper
9// (c) ATLAS Detector software
11// Sebastian.Fleischmann@cern.ch
13
14#ifndef TRK_RESIDUALVALIDATIONNTUPLEHELPER_H
15#define TRK_RESIDUALVALIDATIONNTUPLEHELPER_H
16
18#include "GaudiKernel/ToolHandle.h"
19
23
24class AtlasDetectorID;
25class TTree;
26
27namespace Trk {
28
29class MeasurementBase;
31
36
38public:
39
40 // standard AlgToolmethods
41 ResidualValidationNtupleHelper(const std::string&,const std::string&,const IInterface*);
43
44 // standard Athena methods
45 StatusCode initialize();
46 StatusCode finalize();
47
49 virtual StatusCode fillMeasurementData (
52 //const NTuple::Item<long>& numberOfHits,
53 //const std::bitset<8>& detectorType
54 const int& detectorType,
55 const bool& isOutlier );
56
58 virtual StatusCode fillHoleData (
60 const int&);
61
62
65 virtual StatusCode addNtupleItems (
66 TTree* tree,
67 const int& detectorType );
68
70 virtual StatusCode resetVariables (
71 const int& detectorType );
72
73private:
74
75 double calcPull(
76 const double residual,
77 const double locMesCov,
78 const double locTrkCov ) const;
79 void givePullWarning() const;
80 void fillValues(const int& detectorType, double res1=-1000., double pull1=-1000., double res2=-1000., double pull2=-1000.);
81
82 bool m_pullWarning = false;
84
86 ToolHandle<Trk::IResidualPullCalculator> m_residualPullCalculator;
87
89
91
92 // --- ntuple variables, documentation picked up by scripts for wiki tables ---
93 std::vector<float>* m_PixPullPhi;
94 std::vector<float>* m_PixPullEta;
95 std::vector<float>* m_PixResPhi;
96 std::vector<float>* m_PixResEta;
97
98 std::vector<float>* m_SCTPull;
99 std::vector<float>* m_SCTRes;
100
101 std::vector<float>* m_TRTPull;
102 std::vector<float>* m_TRTRes;
103
104 std::vector<float>* m_MDTPull;
105 std::vector<float>* m_MDTRes;
106
107 std::vector<float>* m_RPCPull;
108 std::vector<float>* m_RPCRes;
109
110 std::vector<float>* m_TGCPull;
111 std::vector<float>* m_TGCRes;
112
113 std::vector<float>* m_CSCPull;
114 std::vector<float>* m_CSCRes;
115
116};
117
119 [[maybe_unused]] static const bool pullWarningOnce = [&]() {
120 msg(MSG::WARNING) << "no covariance of the track parameters given, can not calc pull!" << endmsg;
121 msg(MSG::WARNING) << "you may want to use the jobOption 'IgnoreMissingTrackCovariance' to calculate it anyhow." << endmsg;
122 return true;
123 }();
124 }
125 inline void Trk::ResidualValidationNtupleHelper::fillValues(const int& detectorType, double res1, double pull1, double res2, double pull2) {
126 if (detectorType==TrackState::Pixel) {
127 m_PixResPhi->push_back(res1);
128 m_PixResEta->push_back(res2);
129 m_PixPullPhi->push_back(pull1);
130 m_PixPullEta->push_back(pull2);
131 } else if (detectorType==TrackState::SCT) {
132 m_SCTRes->push_back(res1);
133 m_SCTPull->push_back(pull1);
134 } else if (detectorType==TrackState::TRT) {
135 m_TRTRes->push_back(res1);
136 m_TRTPull->push_back(pull1);
137 } else if (detectorType==TrackState::MDT) {
138 m_MDTRes->push_back(res1);
139 m_MDTPull->push_back(pull1);
140 } else if (detectorType==TrackState::RPC) {
141 m_RPCRes->push_back(res1);
142 m_RPCPull->push_back(pull1);
143 } else if (detectorType==TrackState::TGC) {
144 m_TGCRes->push_back(res1);
145 m_TGCPull->push_back(pull1);
146 } else if (detectorType==TrackState::CSC) {
147 m_CSCRes->push_back(res1);
148 m_CSCPull->push_back(pull1);
149 }
150}
151
152} // end of namespace
153
154#endif // TRK_RESIDUALVALIDATIONNTUPLEHELPER_H
#define endmsg
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
provides the interface for tools which calculate residuals and pulls.
provides the interface for validation helper tools which write special information about generated tr...
This class is the pure abstract base class for all fittable tracking measurements.
std::vector< float > * m_TGCRes
hit residual in TGC strip coordinate for each TGC meas't, vector of size nTGCHits UNIT:mm
std::vector< float > * m_TGCPull
hit pull in TGC strip coordinate for each TGC meas't (corrects for fan-shaped strip arrangement),...
std::vector< float > * m_CSCRes
hit residual in CSC ?
std::vector< float > * m_TRTRes
hit residual in TRT drift radius for each TRT meas't, vector of size nTRTHits UNIT:mm
std::vector< float > * m_PixPullPhi
hit pull in pixel local phi coord for each Pixel meas't, vector of size nPixelHits UNIT:1
std::vector< float > * m_MDTPull
hit pull in MDT drift radius for each MDT meas't, vector of size nMDTHits UNIT:1
std::vector< float > * m_PixResPhi
hit residual in pixel local phi for each Pixel meas't, vector of size nPixelHits UNIT:mm
virtual StatusCode fillMeasurementData(const Trk::MeasurementBase *, const Trk::TrackParameters *, const int &detectorType, const bool &isOutlier)
fill residual data
virtual StatusCode resetVariables(const int &detectorType)
reset ntuple variables
ResidualValidationNtupleHelper(const std::string &, const std::string &, const IInterface *)
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
The residual and pull calculator tool.
std::vector< float > * m_RPCPull
hit pull in RPC strip coordinate for each RPC meas't, vector of size nRPCHits UNIT:1
virtual StatusCode fillHoleData(const Trk::TrackStateOnSurface &, const int &)
fill special data about holes on track (here: do nothing)
void fillValues(const int &detectorType, double res1=-1000., double pull1=-1000., double res2=-1000., double pull2=-1000.)
std::vector< float > * m_PixPullEta
hit pull in pixel local eta coord for each Pixel meas't, vector of size nPixelHits UNIT:1
std::vector< float > * m_SCTRes
hit residual in SCT local strip coord for each SCT meas't (corrects for fan-shaped strip arrangement ...
bool m_pullWarning
warn only once, if pull cannot be calculated
std::vector< float > * m_MDTRes
hit residual in MDT drift radius for each MDT meas't, vector of size nMDTHits UNIT:mm
std::vector< float > * m_RPCRes
hit residual in RPC coordinate for each RPC meas't, vector of size nRPCHits UNIT:mm
bool m_trkParametersWarning
warn only once, if no track parameters exist
std::vector< float > * m_SCTPull
hit pull in SCT local strip coord for each SCT meas't (corrects for fan-shaped strip arrangement in e...
std::vector< float > * m_PixResEta
hit residual in pixel local eta for each Pixel meas't, vector of size nPixelHits UNIT:mm
double calcPull(const double residual, const double locMesCov, const double locTrkCov) const
virtual StatusCode addNtupleItems(TTree *tree, const int &detectorType)
add items to the ntuple and configure the helper tool: should be called once (per detector type) by t...
std::vector< float > * m_CSCPull
hit pull in CSC ?
std::vector< float > * m_TRTPull
hit pull in TRT drift radius for each TRT meas't, vector of size nTRTHits UNIT:1
represents the track state (measurement, material, fit parameters and quality) at a surface.
Ensure that the ATLAS eigen extensions are properly loaded.
ParametersBase< TrackParametersDim, Charged > TrackParameters
MsgStream & msg
Definition testRead.cxx:32
TChain * tree