ATLAS Offline Software
Loading...
Searching...
No Matches
ShiftingDerivCalcTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRK_SHIFTINGDERIVCALCTOOL_H
6#define TRK_SHIFTINGDERIVCALCTOOL_H
7
9#include "GaudiKernel/ToolHandle.h"
10
13
15
16
17#include <vector>
18#include <map>
19
31
32class TGraph;
33
34namespace Trk {
35
36 class TrackStateOnSurface;
37 class Track;
38 class IGlobalTrackFitter;
39 //class ITrackFitter;
41 class AlignModule;
42 class AlignTSOS;
43 class AlignTrack;
44 class AlignPar;
45 class IAlignModuleTool;
46
47 class ShiftingDerivCalcTool : virtual public IDerivCalcTool, public AthAlgTool {
48
49 public:
50 ShiftingDerivCalcTool(const std::string& type, const std::string& name,
51 const IInterface* parent);
52 virtual ~ShiftingDerivCalcTool();
53
54 StatusCode initialize();
55 StatusCode finalize();
56
58 bool setDerivatives(AlignTrack* track);
59
61
63 bool setResidualCovMatrix(AlignTrack* alignTrack) const;
64
65 protected:
66
67 // protected typedefs
68 typedef std::vector<Amg::VectorX> HitDerivative;
69 typedef std::map<const TrackStateOnSurface*,HitDerivative*> DerivativeMap;
70 typedef DerivativeMap::value_type DerivativePair;
71
72 // protected methods
74 int ipar, AlignPar* alignPar,
75 Amg::VectorX& derivativeErr, bool& resetIPar,
76 double& actualSecondDerivative);
77
78 void setChi2VAlignParam(const AlignTrack* alignTrack,
79 const AlignModule* module,
80 int nshifts=0);
82
83 double shiftSize(const AlignPar* alignPar) const;
84 bool setUnshiftedResiduals(AlignTrack* alignTrack);
85
86 private:
87 // private methods
88 const Trk::Track* bestPerigeeTrack(const Track* track) const;
89 bool scanShifts(const AlignTrack* alignTrack,
90 const std::vector<AlignModule*>& alignModules);
91
92 bool getAllDerivatives(AlignTrack* alignTrack, const AlignModule* alignModule,
93 std::vector<Amg::VectorX>& deriv_vec,
94 std::vector<Amg::VectorX>& derivErr_vec,
95 std::vector<double>& actualsecderiv_vec,
96 bool& resetIPar);
97
98 // private variables
99 ToolHandle<IGlobalTrackFitter> m_trackFitterTool;
100 ToolHandle<IGlobalTrackFitter> m_SLTrackFitterTool;
101 ToolHandle<IGlobalTrackFitter> m_fitter;
102 //ToolHandle<ITrackFitter> m_trackFitterTool;
103 //ToolHandle<ITrackFitter> m_SLTrackFitterTool;
104 //ToolHandle<ITrackFitter> m_fitter;
105
106 ToolHandle<IAlignResidualCalculator> m_residualCalculator;
107 ToolHandle<IAlignModuleTool> m_alignModuleTool;
108
109 double m_traSize;
110 double m_rotSize;
111
114
116
118
125
128
129 // stores double** for each module that track passes through
130 std::vector<double**> m_chi2VAlignParamVec;
131 std::vector<double**> m_chi2VAlignParamXVec;
132
136
137 // stores double*** for each module that track passes through
138 // (one double** for each TrackState::MeasurementType)
139 std::vector<double***> m_chi2VAlignParamVecMeasType;
140
143
145
147
149
151
153
165
167
168 }; // end class
169
170
171} // end namespace
172
173#endif // TRK_SHIFTINGDERIVCALCTOOL_H
AlignModule is a grouping of TrkDetElementBase objects, grouped according to the type of alignment,...
AlignPar contains all the information related to an alignment parameter of a particular align module ...
AlignTSOS is a TSOS with extra variables useful for alignment.
AlignTrack is a generalization of a Trk::Track, used as the basic object to contain track information...
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Interface for tool used to calculate residuals.
int m_minIter
set minimum number of iterations for first track fits
DerivativeMap::value_type DerivativePair
const Trk::Track * bestPerigeeTrack(const Track *track) const
std::vector< double ** > m_chi2VAlignParamVec
track chi2[idof][ichambershift]
ToolHandle< IGlobalTrackFitter > m_trackFitterTool
ToolHandle< IGlobalTrackFitter > m_fitter
int m_ntracksProcessed
number tracks processed
bool setUnshiftedResiduals(AlignTrack *alignTrack)
int m_ntracksPassSetUnshiftedRes
number tracks pass setting unshifted residuals
double shiftSize(const AlignPar *alignPar) const
int m_maxIter
reject track if exceed maximum number of iterations
void showStatistics()
write statistics to log file
bool getAllDerivatives(AlignTrack *alignTrack, const AlignModule *alignModule, std::vector< Amg::VectorX > &deriv_vec, std::vector< Amg::VectorX > &derivErr_vec, std::vector< double > &actualsecderiv_vec, bool &resetIPar)
ShiftingDerivCalcTool(const std::string &type, const std::string &name, const IInterface *parent)
int m_ntracksPassInitScan
number tracks pass initial scan
int m_ntracksPassGetDeriv
number tracks pass getting derivatives
ToolHandle< IAlignResidualCalculator > m_residualCalculator
int m_ntracksPassGetDerivSecPass
number tracks pass 2nd pass of getting derivatives
Amg::VectorX getDerivatives(AlignTrack *alignTrack, int ipar, AlignPar *alignPar, Amg::VectorX &derivativeErr, bool &resetIPar, double &actualSecondDerivative)
int m_ntracksPassGetDerivLastPass
number tracks pass 2nd pass of getting derivatives
bool setDerivatives(AlignTrack *track)
sets derivatives of residuals w.r.t.
int m_ntracksPassDerivatives
number tracks pass setting derivatives
bool m_removeScatteringBeforeRefit
flag to remove scattering before refitting track
ToolHandle< IAlignModuleTool > m_alignModuleTool
ParticleHypothesis m_particleHypothesis
std::vector< Amg::VectorX > HitDerivative
bool m_setMinIterations
fit track with AlignModules shifted up and down in each extreme, find the number of iterations fitter...
bool scanShifts(const AlignTrack *alignTrack, const std::vector< AlignModule * > &alignModules)
bool setResidualCovMatrix(AlignTrack *alignTrack) const
sets residual covariance matrix
ToolHandle< IGlobalTrackFitter > m_SLTrackFitterTool
std::map< const TrackStateOnSurface *, HitDerivative * > DerivativeMap
std::vector< double *** > m_chi2VAlignParamVecMeasType
track chi2[idof][imeastype][ichambershift]
void setChi2VAlignParam(const AlignTrack *alignTrack, const AlignModule *module, int nshifts=0)
double m_trackAlignParamCut
cut on value of track alignment parameter, determined from fit of chi2 vs.
std::vector< double ** > m_chi2VAlignParamXVec
chamber shift[idof][ichambershift]
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Ensure that the ATLAS eigen extensions are properly loaded.
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.