ATLAS Offline Software
IDAlignMonResidualsAlg.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 // IDAlignMonResiduals.cxx
7 // AUTHORS: Beate Heinemann, Tobias Golling, Ben Cooper, John Alison, Pierfrancesco Butti
8 // Adapted to AthenaMT 2021-2022 by Per Johansson
9 // **********************************************************************
10 
11 #ifndef IDAlignMonResidualsAlg_H
12 #define IDAlignMonResidualsAlg_H
13 
15 
19 #include "GaudiKernel/ToolHandle.h"
24 
25 #include <memory>
26 #include <string>
27 #include <vector>
28 
29 class AtlasDetectorID;
30 class PixelID;
31 class SCT_ID;
32 class TRT_ID;
33 
34 namespace InDetDD{
35  class PixelDetectorManager;
36  class SCT_DetectorManager;
37 }
38 
39 namespace Trk {
40  class Track;
41  class TrackStateOnSurface;
42 }
43 
44 class EventContext;
45 class ComTime;
46 
48 
49  public:
50 
51  IDAlignMonResidualsAlg( const std::string & name, ISvcLocator* pSvcLocator );
52  virtual ~IDAlignMonResidualsAlg();
53  virtual StatusCode initialize() override;
54  virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
55 
56  private:
57  void fillTRTHistograms(int barrel_ec, int layer_or_wheel, int phi_module, float predictR, float hitR, float residualR, float pullR, bool isTubeHit, float trketa) const;
58  void fillTRTBarrelHistograms(int barrel_ec, int layer_or_wheel, int phi_module, float predictR, float hitR, float residualR, float pullR, bool LRcorrect, bool isTubeHit, float trketa) const;
59  void fillTRTEndcapHistograms(int barrel_ec, int phi_module, float predictR, float hitR, float residualR, float pullR, bool LRcorrect, bool isTubeHit, float trketa) const;
61 
62  StatusCode getSiResiduals(const Trk::Track*, const Trk::TrackStateOnSurface*, bool, double*) const;
63  std::unique_ptr <Trk::TrackParameters> getUnbiasedTrackParameters(const Trk::Track*, const Trk::TrackStateOnSurface*) const;
64 
65  bool trackRequiresRefit(const Trk::Track*) const;
66 
67  //tools
71  const PixelID* m_pixelID{};
72  const SCT_ID* m_sctID{};
73  const TRT_ID* m_trtID{};
74 
75  SG::ReadHandleKey<TrackCollection> m_tracksKey {this,"TrackName2", "CombinedInDetTracks", "track data key"};
76  SG::ReadHandleKey<TrackCollection> m_tracksName {this,"TrackName","CombinedInDetTracks", "track data key"};
77 
78  ToolHandle<ITRT_CalDbTool> m_trtcaldbTool;
79  ToolHandle<Trk::IUpdator> m_iUpdator;
80  ToolHandle<Trk::IPropagator> m_propagator;
81  ToolHandle<Trk::IResidualPullCalculator> m_residualPullCalculator;
82  ToolHandle<InDet::IInDetTrackSelectionTool> m_trackSelection; // baseline
83  ToolHandle<IInDetAlignHitQualSelTool> m_hitQualityTool;
84 
85  std::string m_Pixel_Manager;
86  std::string m_SCT_Manager;
88  bool m_doHitQuality{false};
89  int m_checkrate {};
90  bool m_doPulls {};
91  bool m_applyTrkSel{};
92 
93  static const int m_nSiBlayers{4}; //
94  static const int m_nPixEClayers{3}; //
95  static const int m_nSCTEClayers{9}; //
96  static const int m_nTRTBlayers{3}; //
97  static const int m_nTRTEClayers{2}; //
98  std::vector<int> m_pixResidualX;
99  std::vector<int> m_pixResidualX_2DProf;
100  std::vector<int> m_pixResidualY;
101  std::vector<int> m_pixResidualY_2DProf;
102  std::vector<int> m_pixPullX;
103  std::vector<int> m_pixPullY;
104  std::vector<int> m_pixResidualXvsEta;
105  std::vector<int> m_pixResidualYvsEta;
106  std::vector<int> m_pixResidualXvsPhi;
107  std::vector<int> m_pixResidualYvsPhi;
108  std::vector<int> m_pixECAResidualX;
109  std::vector<int> m_pixECAResidualY;
110  std::vector<int> m_pixECResidualX_2DProf;
111  std::vector<int> m_pixECResidualY_2DProf;
112  std::vector<int> m_pixECCResidualX;
113  std::vector<int> m_pixECCResidualY;
114  std::vector<int> m_sctResidualX;
115  std::vector<int> m_sctResidualX_2DProf;
116  std::vector<int> m_sct_s0_ResidualX_2DProf;
117  std::vector<int> m_sct_s1_ResidualX_2DProf;
118  std::vector<int> m_sctECAResidualX_2DProf;
121  std::vector<int> m_sctECCResidualX_2DProf;
124  std::vector<int> m_sctPullX;
125  std::vector<int> m_sctResidualXvsEta;
126  std::vector<int> m_sctResidualXvsPhi;
127  std::vector<int> m_trtBPredictedR;
128  std::vector<int> m_trtBMeasuredR;
129  std::vector<int> m_trtBResidualR;
130  std::vector<int> m_trtBPullR;
131  std::vector<int> m_trtBResidualRNoTube;
132  std::vector<int> m_trtBPullRNoTube;
133  std::vector<int> m_trtBLR;
134  std::vector<std::vector<int>> m_trtBResVsEta;
135  std::vector<std::vector<int>> m_trtBResVsPhiSec;
136  std::vector<std::vector<int>> m_trtBLRVsPhiSec;
137  std::vector<int> m_trtECPredictedR;
138  std::vector<int> m_trtECMeasuredR;
139  std::vector<int> m_trtECResidualR;
140  std::vector<int> m_trtECPullR;
141  std::vector<int> m_trtECResidualRNoTube;
142  std::vector<int> m_trtECPullRNoTube;
143  std::vector<int> m_trtECLR;
144  std::vector<int> m_trtECResVsEta;
145  std::vector<int> m_trtECResVsPhiSec;
146  std::vector<int> m_trtECLRVsPhiSec;
147 };
148 
149 #endif
IDAlignMonResidualsAlg::m_trtECResVsEta
std::vector< int > m_trtECResVsEta
Definition: IDAlignMonResidualsAlg.h:144
IDAlignMonResidualsAlg::m_Pixel_Manager
std::string m_Pixel_Manager
Definition: IDAlignMonResidualsAlg.h:85
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
IDAlignMonResidualsAlg::m_trtBPredictedR
std::vector< int > m_trtBPredictedR
Definition: IDAlignMonResidualsAlg.h:127
IDAlignMonResidualsAlg::m_pixPullY
std::vector< int > m_pixPullY
Definition: IDAlignMonResidualsAlg.h:103
IDAlignMonResidualsAlg::m_trtECLR
std::vector< int > m_trtECLR
Definition: IDAlignMonResidualsAlg.h:143
IDAlignMonResidualsAlg::m_tracksKey
SG::ReadHandleKey< TrackCollection > m_tracksKey
Definition: IDAlignMonResidualsAlg.h:75
InDetDD::SCT_DetectorManager
Definition: SCT_DetectorManager.h:49
IDAlignMonResidualsAlg::m_hitQualityTool
ToolHandle< IInDetAlignHitQualSelTool > m_hitQualityTool
Definition: IDAlignMonResidualsAlg.h:83
IDAlignMonResidualsAlg::m_trtBLRVsPhiSec
std::vector< std::vector< int > > m_trtBLRVsPhiSec
Definition: IDAlignMonResidualsAlg.h:136
IDAlignMonResidualsAlg::m_trtBResidualR
std::vector< int > m_trtBResidualR
Definition: IDAlignMonResidualsAlg.h:129
IDAlignMonResidualsAlg::m_pixECCResidualX
std::vector< int > m_pixECCResidualX
Definition: IDAlignMonResidualsAlg.h:112
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
IDAlignMonResidualsAlg::m_pixPullX
std::vector< int > m_pixPullX
Definition: IDAlignMonResidualsAlg.h:102
IDAlignMonResidualsAlg::m_sctECAResidualX_2DProf
std::vector< int > m_sctECAResidualX_2DProf
Definition: IDAlignMonResidualsAlg.h:118
IDAlignMonResidualsAlg::m_nTRTEClayers
static const int m_nTRTEClayers
Definition: IDAlignMonResidualsAlg.h:97
IDAlignMonResidualsAlg::m_tracksName
SG::ReadHandleKey< TrackCollection > m_tracksName
Definition: IDAlignMonResidualsAlg.h:76
IDAlignMonResidualsAlg::m_sctECA_s0_ResidualX_2DProf
std::vector< int > m_sctECA_s0_ResidualX_2DProf
Definition: IDAlignMonResidualsAlg.h:119
IDAlignMonResidualsAlg::m_propagator
ToolHandle< Trk::IPropagator > m_propagator
Definition: IDAlignMonResidualsAlg.h:80
IDAlignMonResidualsAlg::m_trtECResidualRNoTube
std::vector< int > m_trtECResidualRNoTube
Definition: IDAlignMonResidualsAlg.h:141
IDAlignMonResidualsAlg::m_trtECResidualR
std::vector< int > m_trtECResidualR
Definition: IDAlignMonResidualsAlg.h:139
IDAlignMonResidualsAlg::~IDAlignMonResidualsAlg
virtual ~IDAlignMonResidualsAlg()
Definition: IDAlignMonResidualsAlg.cxx:69
IDAlignMonResidualsAlg::m_nPixEClayers
static const int m_nPixEClayers
Definition: IDAlignMonResidualsAlg.h:94
IDAlignMonResidualsAlg::m_pixECCResidualY
std::vector< int > m_pixECCResidualY
Definition: IDAlignMonResidualsAlg.h:113
IDAlignMonResidualsAlg::m_residualPullCalculator
ToolHandle< Trk::IResidualPullCalculator > m_residualPullCalculator
The residual and pull calculator tool handle.
Definition: IDAlignMonResidualsAlg.h:81
IDAlignMonResidualsAlg::getSiResiduals
StatusCode getSiResiduals(const Trk::Track *, const Trk::TrackStateOnSurface *, bool, double *) const
Definition: IDAlignMonResidualsAlg.cxx:684
IDAlignMonResidualsAlg::m_sctResidualX
std::vector< int > m_sctResidualX
Definition: IDAlignMonResidualsAlg.h:114
IDAlignMonResidualsAlg::m_sctResidualXvsPhi
std::vector< int > m_sctResidualXvsPhi
Definition: IDAlignMonResidualsAlg.h:126
IPropagator.h
IDAlignMonResidualsAlg::m_sctResidualX_2DProf
std::vector< int > m_sctResidualX_2DProf
Definition: IDAlignMonResidualsAlg.h:115
IDAlignMonResidualsAlg::m_applyTrkSel
bool m_applyTrkSel
Definition: IDAlignMonResidualsAlg.h:91
IDAlignMonResidualsAlg
Definition: IDAlignMonResidualsAlg.h:47
IDAlignMonResidualsAlg::m_trtBPullR
std::vector< int > m_trtBPullR
Definition: IDAlignMonResidualsAlg.h:130
IDAlignMonResidualsAlg::m_trtECPullRNoTube
std::vector< int > m_trtECPullRNoTube
Definition: IDAlignMonResidualsAlg.h:142
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
ComTime
Definition: ComTime.h:17
IDAlignMonResidualsAlg::m_sct_s1_ResidualX_2DProf
std::vector< int > m_sct_s1_ResidualX_2DProf
Definition: IDAlignMonResidualsAlg.h:117
IDAlignMonResidualsAlg::fillTRTHistograms
void fillTRTHistograms(int barrel_ec, int layer_or_wheel, int phi_module, float predictR, float hitR, float residualR, float pullR, bool isTubeHit, float trketa) const
Definition: IDAlignMonResidualsAlg.cxx:774
IDAlignMonResidualsAlg::m_trtECLRVsPhiSec
std::vector< int > m_trtECLRVsPhiSec
Definition: IDAlignMonResidualsAlg.h:146
IDAlignMonResidualsAlg::m_trtBResVsEta
std::vector< std::vector< int > > m_trtBResVsEta
Definition: IDAlignMonResidualsAlg.h:134
IDAlignMonResidualsAlg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: IDAlignMonResidualsAlg.cxx:146
IUpdator.h
IDAlignMonResidualsAlg::m_PIX_Mgr
const InDetDD::PixelDetectorManager * m_PIX_Mgr
Definition: IDAlignMonResidualsAlg.h:69
IDAlignMonResidualsAlg::m_SCT_Mgr
const InDetDD::SCT_DetectorManager * m_SCT_Mgr
Definition: IDAlignMonResidualsAlg.h:70
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
IDAlignMonResidualsAlg::m_sctResidualXvsEta
std::vector< int > m_sctResidualXvsEta
Definition: IDAlignMonResidualsAlg.h:125
IDAlignMonResidualsAlg::m_pixResidualX_2DProf
std::vector< int > m_pixResidualX_2DProf
Definition: IDAlignMonResidualsAlg.h:99
IDAlignMonResidualsAlg::m_pixECResidualX_2DProf
std::vector< int > m_pixECResidualX_2DProf
Definition: IDAlignMonResidualsAlg.h:110
IDAlignMonResidualsAlg::m_trtBPullRNoTube
std::vector< int > m_trtBPullRNoTube
Definition: IDAlignMonResidualsAlg.h:132
IDAlignMonResidualsAlg::m_pixECAResidualX
std::vector< int > m_pixECAResidualX
Definition: IDAlignMonResidualsAlg.h:108
IDAlignMonResidualsAlg::m_iUpdator
ToolHandle< Trk::IUpdator > m_iUpdator
Definition: IDAlignMonResidualsAlg.h:79
IDAlignMonResidualsAlg::m_pixResidualYvsEta
std::vector< int > m_pixResidualYvsEta
Definition: IDAlignMonResidualsAlg.h:105
IInDetAlignHitQualSelTool.h
IDAlignMonResidualsAlg::m_trtECPullR
std::vector< int > m_trtECPullR
Definition: IDAlignMonResidualsAlg.h:140
IDAlignMonResidualsAlg::m_trtBMeasuredR
std::vector< int > m_trtBMeasuredR
Definition: IDAlignMonResidualsAlg.h:128
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IDAlignMonResidualsAlg::m_checkrate
int m_checkrate
Definition: IDAlignMonResidualsAlg.h:89
IDAlignMonResidualsAlg::fillTRTEndcapHistograms
void fillTRTEndcapHistograms(int barrel_ec, int phi_module, float predictR, float hitR, float residualR, float pullR, bool LRcorrect, bool isTubeHit, float trketa) const
Definition: IDAlignMonResidualsAlg.cxx:857
AthMonitorAlgorithm.h
IDAlignMonResidualsAlg::m_trtECResVsPhiSec
std::vector< int > m_trtECResVsPhiSec
Definition: IDAlignMonResidualsAlg.h:145
IDAlignMonResidualsAlg::m_pixECAResidualY
std::vector< int > m_pixECAResidualY
Definition: IDAlignMonResidualsAlg.h:109
IDAlignMonResidualsAlg::m_trtBLR
std::vector< int > m_trtBLR
Definition: IDAlignMonResidualsAlg.h:133
IDAlignMonResidualsAlg::m_sctECA_s1_ResidualX_2DProf
std::vector< int > m_sctECA_s1_ResidualX_2DProf
Definition: IDAlignMonResidualsAlg.h:120
IDAlignMonResidualsAlg::m_trtECPredictedR
std::vector< int > m_trtECPredictedR
Definition: IDAlignMonResidualsAlg.h:137
ITRT_CalDbTool.h
abstract interface to TRT calibration constants
IDAlignMonResidualsAlg::m_SCT_Manager
std::string m_SCT_Manager
Definition: IDAlignMonResidualsAlg.h:86
IInDetTrackSelectionTool.h
IDAlignMonResidualsAlg::m_pixECResidualY_2DProf
std::vector< int > m_pixECResidualY_2DProf
Definition: IDAlignMonResidualsAlg.h:111
IDAlignMonResidualsAlg::setupTools
StatusCode setupTools()
Definition: IDAlignMonResidualsAlg.cxx:1043
IDAlignMonResidualsAlg::m_pixResidualX
std::vector< int > m_pixResidualX
Definition: IDAlignMonResidualsAlg.h:98
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
IDAlignMonResidualsAlg::m_trtECMeasuredR
std::vector< int > m_trtECMeasuredR
Definition: IDAlignMonResidualsAlg.h:138
IDAlignMonResidualsAlg::getUnbiasedTrackParameters
std::unique_ptr< Trk::TrackParameters > getUnbiasedTrackParameters(const Trk::Track *, const Trk::TrackStateOnSurface *) const
Definition: IDAlignMonResidualsAlg.cxx:901
InDetDD::PixelDetectorManager
Definition: PixelDetectorManager.h:47
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
IDAlignMonResidualsAlg::m_trtcaldbTool
ToolHandle< ITRT_CalDbTool > m_trtcaldbTool
Definition: IDAlignMonResidualsAlg.h:78
IDAlignMonResidualsAlg::m_sct_s0_ResidualX_2DProf
std::vector< int > m_sct_s0_ResidualX_2DProf
Definition: IDAlignMonResidualsAlg.h:116
IDAlignMonResidualsAlg::m_nSiBlayers
static const int m_nSiBlayers
Definition: IDAlignMonResidualsAlg.h:93
IDAlignMonResidualsAlg::m_nTRTBlayers
static const int m_nTRTBlayers
Definition: IDAlignMonResidualsAlg.h:96
IDAlignMonResidualsAlg::m_extendedPlots
bool m_extendedPlots
Definition: IDAlignMonResidualsAlg.h:87
IResidualPullCalculator.h
IDAlignMonResidualsAlg::fillTRTBarrelHistograms
void fillTRTBarrelHistograms(int barrel_ec, int layer_or_wheel, int phi_module, float predictR, float hitR, float residualR, float pullR, bool LRcorrect, bool isTubeHit, float trketa) const
Definition: IDAlignMonResidualsAlg.cxx:810
IDAlignMonResidualsAlg::m_pixResidualYvsPhi
std::vector< int > m_pixResidualYvsPhi
Definition: IDAlignMonResidualsAlg.h:107
IDAlignMonResidualsAlg::m_sctPullX
std::vector< int > m_sctPullX
Definition: IDAlignMonResidualsAlg.h:124
IDAlignMonResidualsAlg::trackRequiresRefit
bool trackRequiresRefit(const Trk::Track *) const
Definition: IDAlignMonResidualsAlg.cxx:1114
IDAlignMonResidualsAlg::m_pixResidualXvsPhi
std::vector< int > m_pixResidualXvsPhi
Definition: IDAlignMonResidualsAlg.h:106
IDAlignMonResidualsAlg::m_trtBResVsPhiSec
std::vector< std::vector< int > > m_trtBResVsPhiSec
Definition: IDAlignMonResidualsAlg.h:135
IDAlignMonResidualsAlg::m_pixResidualY_2DProf
std::vector< int > m_pixResidualY_2DProf
Definition: IDAlignMonResidualsAlg.h:101
TRT_ID
Definition: TRT_ID.h:84
SCT_ID
Definition: SCT_ID.h:68
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
IDAlignMonResidualsAlg::m_trtBResidualRNoTube
std::vector< int > m_trtBResidualRNoTube
Definition: IDAlignMonResidualsAlg.h:131
IDAlignMonResidualsAlg::m_trackSelection
ToolHandle< InDet::IInDetTrackSelectionTool > m_trackSelection
Definition: IDAlignMonResidualsAlg.h:82
IDAlignMonResidualsAlg::m_sctECCResidualX_2DProf
std::vector< int > m_sctECCResidualX_2DProf
Definition: IDAlignMonResidualsAlg.h:121
IDAlignMonResidualsAlg::m_pixelID
const PixelID * m_pixelID
Definition: IDAlignMonResidualsAlg.h:71
IDAlignMonResidualsAlg::m_sctECC_s1_ResidualX_2DProf
std::vector< int > m_sctECC_s1_ResidualX_2DProf
Definition: IDAlignMonResidualsAlg.h:123
IDAlignMonResidualsAlg::m_sctECC_s0_ResidualX_2DProf
std::vector< int > m_sctECC_s0_ResidualX_2DProf
Definition: IDAlignMonResidualsAlg.h:122
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
IDAlignMonResidualsAlg::IDAlignMonResidualsAlg
IDAlignMonResidualsAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: IDAlignMonResidualsAlg.cxx:47
IDAlignMonResidualsAlg::m_trtID
const TRT_ID * m_trtID
Definition: IDAlignMonResidualsAlg.h:73
IDAlignMonResidualsAlg::initialize
virtual StatusCode initialize() override
initialize
Definition: IDAlignMonResidualsAlg.cxx:71
IDAlignMonResidualsAlg::m_doPulls
bool m_doPulls
Definition: IDAlignMonResidualsAlg.h:90
IDAlignMonResidualsAlg::m_pixResidualXvsEta
std::vector< int > m_pixResidualXvsEta
Definition: IDAlignMonResidualsAlg.h:104
IDAlignMonResidualsAlg::m_nSCTEClayers
static const int m_nSCTEClayers
Definition: IDAlignMonResidualsAlg.h:95
IDAlignMonResidualsAlg::m_sctID
const SCT_ID * m_sctID
Definition: IDAlignMonResidualsAlg.h:72
PixelID
Definition: PixelID.h:67
IDAlignMonResidualsAlg::m_pixResidualY
std::vector< int > m_pixResidualY
Definition: IDAlignMonResidualsAlg.h:100
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
IDAlignMonResidualsAlg::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: IDAlignMonResidualsAlg.h:68
IDAlignMonResidualsAlg::m_doHitQuality
bool m_doHitQuality
Definition: IDAlignMonResidualsAlg.h:88