ATLAS Offline Software
ExtrapolationEngineTest.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 // ExtrapolationEngineTest.h, (c) ATLAS Detector software
8 
9 #ifndef TRKEXUNITTESTS_EXTRAPOLATIONENGINETEST_H
10 #define TRKEXUNITTESTS_EXTRAPOLATIONENGINETEST_H
11 
12 // Athena & Gaudi includes
13 #include "GaudiKernel/ServiceHandle.h"
14 #include "GaudiKernel/ToolHandle.h"
16 // Trk includes
19 #include "TString.h"
20 #include "TRandom.h"
21 
22 class TTree;
23 
24 class PixelID;
25 class SCT_ID;
26 class HGTD_ID;
27 class AtlasDetectorID;
28 
29 namespace Trk {
30  class IExtrapolationEngine;
31  class IPositionMomentumWriter;
32 
41  // ^ ExtrapolationEngine itself is not thread-safe
42  public:
44  ExtrapolationEngineTest(const std::string& name, ISvcLocator* pSvcLocator);
45 
46  /* finalize */
48 
49  /* specify the test here */
50  StatusCode runTest();
51 
52  /* specify the scan here */
53  StatusCode runScan();
54 
56  StatusCode initializeTest();
57 
58  /* book the TTree branches */
59  StatusCode bookTree();
60  private:
61  template <class T, class P> StatusCode runTestT();
62 
63  template <class T, class P> StatusCode fillStepInformationT(ExtrapolationCell<T>& eCell, int fwbw, std::vector<const Trk::Surface*>& stepSurfaces);
64 
66  ToolHandle<IExtrapolationEngine> m_extrapolationEngine;
67 
70  const SCT_ID* m_sct_ID;
71  const HGTD_ID* m_hgtd_ID;
72  bool m_useHGTD;
73 
74  bool m_parametersMode; // 0 - neutral, 1 - charged, 2 - multi
76 
82  double m_d0Min;
83  double m_d0Max;
84  double m_z0Min;
85  double m_z0Max;
86  std::vector<float> m_z0Values;
87 
88  double m_etaMin;
89  double m_etaMax;
90  double m_phiMin;
91  double m_phiMax;
92 
93  double m_ptMin;
94  double m_ptMax;
95 
96  double m_pathLimit;
97 
102 
105 
106 
110  std::vector< float > m_etaScans;
111  double m_currentEta;
112  std::vector< float > m_phiScans;
113  double m_currentPhi;
115 
117 
119  ToolHandle<IPositionMomentumWriter> m_posmomWriter;
120 
121  std::string m_treeName;
122  std::string m_treeFolder;
123  std::string m_treeDescription;
124  TTree* m_tree = nullptr;
125  TRandom m_tRandom;
126 
127 
128  float m_startPositionX = 0.0F;
129  float m_startPositionY = 0.0F;
130  float m_startPositionZ = 0.0F;
131  float m_startPositionR = 0.0F;
132  float m_startPhi = 0.0F;
133  float m_startTheta = 0.0F;
134  float m_startEta = 0.0F;
135  float m_startP = 0.0F;
136  float m_startPt = 0.0F;
137  float m_charge;
138 
139  int m_endSuccessful = 0;
140  float m_endPositionX = 0.0F;
141  float m_endPositionY = 0.0F;
142  float m_endPositionZ = 0.0F;
143  float m_endPositionR = 0.0F;
144  float m_endPhi = 0.0F;
145  float m_endTheta = 0.0F;
146  float m_endEta = 0.0F;
147  float m_endP = 0.0F;
148  float m_endPt = 0.0F;
149  float m_endPathLength = 0.0F;
150 
151  int m_backSuccessful = 0;
152  float m_backPositionX = 0.0F;
153  float m_backPositionY = 0.0F;
154  float m_backPositionZ = 0.0F;
155  float m_backPositionR = 0.0F;
156  float m_backPhi;
157  float m_backTheta;
158  float m_backEta;
159  float m_backP;
160  float m_backPt;
161 
162  std::vector<TString> m_parameterNames;
163  std::vector< std::vector< float >* > m_pPositionX;
164  std::vector< std::vector< float >* > m_pPositionY;
165  std::vector< std::vector< float >* > m_pPositionZ;
166  std::vector< std::vector< float >* > m_pPositionR;
167  std::vector< std::vector< float >* > m_pPhi;
168  std::vector< std::vector< float >* > m_pTheta;
169  std::vector< std::vector< float >* > m_pEta;
170  std::vector< std::vector< float >* > m_pP;
171  std::vector< std::vector< float >* > m_pPt;
172 
173  std::vector< int >* m_sensitiveSurfaceType = nullptr;
174  std::vector< int >* m_sensitiveLayerIndex;
175  std::vector< float >* m_sensitiveLocalPosX;
176  std::vector< float >* m_sensitiveLocalPosY;
177  std::vector< float >* m_sensitiveCenterPosX;
178  std::vector< float >* m_sensitiveCenterPosY;
179  std::vector< float >* m_sensitiveCenterPosZ;
180  std::vector< float >* m_sensitiveCenterPosR;
181  std::vector< float >* m_sensitiveCenterPosPhi;
182  std::vector< float >* m_sensitiveLocalPosR = nullptr;
183  std::vector< float >* m_sensitiveLocalPosPhi = nullptr;
184  std::vector< int >* m_sensitiveDetector = nullptr;
185  std::vector< int >* m_sensitiveIsInnermost = nullptr;
186  std::vector< int >* m_sensitiveIsNextToInnermost = nullptr;
187  std::vector< int >* m_sensitiveBarrelEndcap = nullptr;
188  std::vector< int >* m_sensitiveLayerDisc = nullptr;
189  std::vector< int >* m_sensitiveEtaModule = nullptr;
190  std::vector< int >* m_sensitivePhiModule = nullptr;
191  std::vector< int >* m_sensitiveSide = nullptr;
192  std::vector< int >* m_sensitiveNearBondGap = nullptr;
193  std::vector< int >* m_sensitiveisInside = nullptr;
194  std::vector< int >* m_sensitiveisInsideBound = nullptr;
195  std::vector< float >* m_materialtInX0AccumulatedUpTo = nullptr;
196 
201 
204 
208 
212 
213  std::vector< float >* m_materialThicknessInX0Accumulated;
214  std::vector< float >* m_materialThicknessInX0Steps;
215  std::vector< float >* m_materialThicknessInL0Steps;
216  std::vector< float >* m_materialPositionX;
217  std::vector< float >* m_materialPositionY;
218  std::vector< float >* m_materialPositionZ;
219  std::vector< float >* m_materialPositionR;
220  std::vector< float >* m_materialPositionP;
221  std::vector< float >* m_materialPositionPt;
222  std::vector< float >* m_materialScaling;
223  std::vector< int >* m_stepDirection;
224 
232  float m_endStepEta;
233  float m_endStepP;
234  float m_endStepPt;
237 
238  };
239 }
240 
241 // include the templated function
243 
244 #endif
Trk::ExtrapolationEngineTest::m_materialThicknessInX0Steps
std::vector< float > * m_materialThicknessInX0Steps
Definition: ExtrapolationEngineTest.h:214
Trk::ExtrapolationEngineTest::m_pPositionX
std::vector< std::vector< float > * > m_pPositionX
Definition: ExtrapolationEngineTest.h:163
Trk::ExtrapolationEngineTest::m_stepsPhi
int m_stepsPhi
scanning parameters
Definition: ExtrapolationEngineTest.h:108
Trk::ExtrapolationEngineTest::m_materialThicknessInL0Steps
std::vector< float > * m_materialThicknessInL0Steps
Definition: ExtrapolationEngineTest.h:215
Trk::ExtrapolationEngineTest::m_endStepPositionY
float m_endStepPositionY
Definition: ExtrapolationEngineTest.h:227
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
Trk::ExtrapolationEngineTest::m_materialThicknessInX0Bwd
float m_materialThicknessInX0Bwd
Definition: ExtrapolationEngineTest.h:202
Trk::ExtrapolationEngineTest::m_endStepPathLength
float m_endStepPathLength
Definition: ExtrapolationEngineTest.h:235
Trk::ExtrapolationEngineTest::m_smearProductionVertex
bool m_smearProductionVertex
Definition: ExtrapolationEngineTest.h:77
Trk::ExtrapolationEngineTest::m_endStepThicknessInX0
float m_endStepThicknessInX0
Definition: ExtrapolationEngineTest.h:236
Trk::ExtrapolationEngineTest::m_smearFlatOriginT
bool m_smearFlatOriginT
Definition: ExtrapolationEngineTest.h:78
Trk::ExtrapolationEngineTest::m_materialThicknessInL0
float m_materialThicknessInL0
Definition: ExtrapolationEngineTest.h:198
Trk::ExtrapolationEngineTest::m_materialThicknessInX0Accumulated
std::vector< float > * m_materialThicknessInX0Accumulated
Definition: ExtrapolationEngineTest.h:213
Trk::ExtrapolationEngineTest::m_sigmaOriginT
double m_sigmaOriginT
Definition: ExtrapolationEngineTest.h:80
Trk::ExtrapolationEngineTest::m_backP
float m_backP
Definition: ExtrapolationEngineTest.h:159
Trk::ExtrapolationEngineTest::m_backExtrapolation
bool m_backExtrapolation
Definition: ExtrapolationEngineTest.h:103
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
Trk::ExtrapolationEngineTest::m_sensitiveCenterPosY
std::vector< float > * m_sensitiveCenterPosY
Definition: ExtrapolationEngineTest.h:178
Trk::ExtrapolationEngineTest::runTestT
StatusCode runTestT()
Trk::ExtrapolationEngineTest::m_materialThicknessInX0Boundary
float m_materialThicknessInX0Boundary
Definition: ExtrapolationEngineTest.h:207
Trk::ExtrapolationEngineTest::m_parametersMode
bool m_parametersMode
Definition: ExtrapolationEngineTest.h:74
Trk::ExtrapolationEngineTest::m_sensitiveCenterPosR
std::vector< float > * m_sensitiveCenterPosR
Definition: ExtrapolationEngineTest.h:180
Trk::ExtrapolationEngineTest::m_parameterNames
std::vector< TString > m_parameterNames
Definition: ExtrapolationEngineTest.h:162
Trk::ExtrapolationEngineTest::m_endStepPhi
float m_endStepPhi
Definition: ExtrapolationEngineTest.h:230
Trk::ExtrapolationEngineTest::m_ptMax
double m_ptMax
Definition: ExtrapolationEngineTest.h:94
Trk::ExtrapolationEngineTest::m_pP
std::vector< std::vector< float > * > m_pP
Definition: ExtrapolationEngineTest.h:170
Trk::ExtrapolationEngineTest::m_pPositionR
std::vector< std::vector< float > * > m_pPositionR
Definition: ExtrapolationEngineTest.h:166
Trk::ExtrapolationEngineTest::m_d0Max
double m_d0Max
Definition: ExtrapolationEngineTest.h:83
Trk::ExtrapolationEngineTest::m_sensitiveLocalPosY
std::vector< float > * m_sensitiveLocalPosY
Definition: ExtrapolationEngineTest.h:176
Trk::ExtrapolationEngineTest::m_endStepPositionX
float m_endStepPositionX
Definition: ExtrapolationEngineTest.h:226
Trk::ExtrapolationEngineTest::m_materialThicknessInX0Passive
float m_materialThicknessInX0Passive
Definition: ExtrapolationEngineTest.h:206
Trk::ExtrapolationEngineTest::m_pEta
std::vector< std::vector< float > * > m_pEta
Definition: ExtrapolationEngineTest.h:169
Trk::ExtrapolationEngineTest::m_treeName
std::string m_treeName
Definition: ExtrapolationEngineTest.h:121
Trk::ExtrapolationEngineTest::m_phiMax
double m_phiMax
Definition: ExtrapolationEngineTest.h:91
Trk::ExtrapolationEngineTest::m_materialPositionY
std::vector< float > * m_materialPositionY
Definition: ExtrapolationEngineTest.h:217
Trk::ExtrapolationEngineTest::m_pTheta
std::vector< std::vector< float > * > m_pTheta
Definition: ExtrapolationEngineTest.h:168
Trk::ExtrapolationEngineTest::m_materialThicknessInX0Cylinder
float m_materialThicknessInX0Cylinder
Definition: ExtrapolationEngineTest.h:209
Trk::ExtrapolationEngineTest::m_endStepP
float m_endStepP
Definition: ExtrapolationEngineTest.h:233
Trk::ExtrapolationEngineTest::m_z0Values
std::vector< float > m_z0Values
Definition: ExtrapolationEngineTest.h:86
Trk::ExtrapolationEngineTest::m_pPositionY
std::vector< std::vector< float > * > m_pPositionY
Definition: ExtrapolationEngineTest.h:164
Trk::ExtrapolationEngineTest::m_z0Max
double m_z0Max
Definition: ExtrapolationEngineTest.h:85
Trk::ExtrapolationEngineTest::m_endStepEta
float m_endStepEta
Definition: ExtrapolationEngineTest.h:232
Trk::ExtrapolationEngineTest::m_stepDirection
std::vector< int > * m_stepDirection
Definition: ExtrapolationEngineTest.h:223
Trk::ExtrapolationEngineTest::m_materialThicknessInX0Disc
float m_materialThicknessInX0Disc
Definition: ExtrapolationEngineTest.h:210
Trk::ExtrapolationEngineTest::m_pixel_ID
const PixelID * m_pixel_ID
Handle to the ID helper.
Definition: ExtrapolationEngineTest.h:69
Trk::ExtrapolationEngineTest::m_materialScaling
std::vector< float > * m_materialScaling
Definition: ExtrapolationEngineTest.h:222
Trk::ExtrapolationEngineTest::m_currentEta
double m_currentEta
Definition: ExtrapolationEngineTest.h:111
Trk::ExtrapolationEngineTest::m_etaMax
double m_etaMax
Definition: ExtrapolationEngineTest.h:89
Trk::ExtrapolationEngineTest::m_etaScans
std::vector< float > m_etaScans
Definition: ExtrapolationEngineTest.h:110
Trk::ExtrapolationEngineTest::m_materialThicknessInX0Sensitive
float m_materialThicknessInX0Sensitive
Definition: ExtrapolationEngineTest.h:205
TrkExUnitTestBase.h
Trk::ExtrapolationEngineTest::m_etaMin
double m_etaMin
Definition: ExtrapolationEngineTest.h:88
Trk::ExtrapolationEngineTest::fillStepInformationT
StatusCode fillStepInformationT(ExtrapolationCell< T > &eCell, int fwbw, std::vector< const Trk::Surface * > &stepSurfaces)
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::ExtrapolationEngineTest::m_writeTTree
bool m_writeTTree
Definition: ExtrapolationEngineTest.h:118
Trk::ExtrapolationEngineTest::m_backPhi
float m_backPhi
Definition: ExtrapolationEngineTest.h:156
Trk::ExtrapolationEngineTest::m_posmomWriter
ToolHandle< IPositionMomentumWriter > m_posmomWriter
Definition: ExtrapolationEngineTest.h:119
Trk::ExtrapolationEngineTest
Definition: ExtrapolationEngineTest.h:40
Trk::ExtrapolationEngineTest::m_hgtd_ID
const HGTD_ID * m_hgtd_ID
Handle to the ID helper.
Definition: ExtrapolationEngineTest.h:71
Trk::ExtrapolationEngineTest::m_backEta
float m_backEta
Definition: ExtrapolationEngineTest.h:158
Trk::ExtrapolationEngineTest::m_smearFlatOriginZ
bool m_smearFlatOriginZ
Definition: ExtrapolationEngineTest.h:79
Trk::ExtrapolationEngineTest::m_pPt
std::vector< std::vector< float > * > m_pPt
Definition: ExtrapolationEngineTest.h:171
HGTD_ID
Definition: HGTD_ID.h:47
Trk::ExtrapolationEngineTest::m_materialPositionPt
std::vector< float > * m_materialPositionPt
Definition: ExtrapolationEngineTest.h:221
Trk::ExtrapolationEngineTest::m_stepwiseExtrapolation
bool m_stepwiseExtrapolation
Definition: ExtrapolationEngineTest.h:104
Trk::ExtrapolationEngineTest::m_materialPositionZ
std::vector< float > * m_materialPositionZ
Definition: ExtrapolationEngineTest.h:218
Trk::ExtrapolationEngineTest::m_particleHypothesis
int m_particleHypothesis
Definition: ExtrapolationEngineTest.h:75
Trk::ExtrapolationEngineTest::m_endStepPositionR
float m_endStepPositionR
Definition: ExtrapolationEngineTest.h:229
Trk::ExtrapolationEngineTest::m_sigmaOriginZ
double m_sigmaOriginZ
Definition: ExtrapolationEngineTest.h:81
Trk::ExtrapolationEngineTest::m_collectMaterial
bool m_collectMaterial
Definition: ExtrapolationEngineTest.h:101
Trk::ExtrapolationEngineTest::m_treeDescription
std::string m_treeDescription
Definition: ExtrapolationEngineTest.h:123
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::ExtrapolationEngineTest::m_collectBoundary
bool m_collectBoundary
Definition: ExtrapolationEngineTest.h:100
Trk::ExtrapolationEngineTest::m_useHGTD
bool m_useHGTD
Definition: ExtrapolationEngineTest.h:72
Trk::ExtrapolationEngineTest::m_phiScans
std::vector< float > m_phiScans
Definition: ExtrapolationEngineTest.h:112
Trk::ExtrapolationEngineTest::m_collectSensitive
bool m_collectSensitive
Definition: ExtrapolationEngineTest.h:98
Trk::ExtrapolationEngineTest::m_extrapolationEngine
ToolHandle< IExtrapolationEngine > m_extrapolationEngine
retrieve it
Definition: ExtrapolationEngineTest.h:66
Trk::ExtrapolationEngineTest::m_materialThicknessInX0
float m_materialThicknessInX0
Definition: ExtrapolationEngineTest.h:197
Trk::ExtrapolationEngineTest::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: ExtrapolationEngineTest.h:68
Trk::ExtrapolationCell
Definition: ExtrapolationCell.h:231
Trk::ExtrapolationEngineTest::m_splitCharge
bool m_splitCharge
the tree
Definition: ExtrapolationEngineTest.h:114
Trk::ExtrapolationEngineTest::m_endStepSuccessful
int m_endStepSuccessful
Definition: ExtrapolationEngineTest.h:225
Trk::ExtrapolationEngineTest::m_z0Min
double m_z0Min
Definition: ExtrapolationEngineTest.h:84
Trk::ExtrapolationEngineTest::m_pPositionZ
std::vector< std::vector< float > * > m_pPositionZ
Definition: ExtrapolationEngineTest.h:165
Trk::ExtrapolationEngineTest::m_sensitiveLocalPosX
std::vector< float > * m_sensitiveLocalPosX
Definition: ExtrapolationEngineTest.h:175
Trk::ExtrapolationEngineTest::m_pPhi
std::vector< std::vector< float > * > m_pPhi
Definition: ExtrapolationEngineTest.h:167
SCT_ID
Definition: SCT_ID.h:68
Trk::ExtrapolationEngineTest::m_materialThicknessZARho
float m_materialThicknessZARho
Definition: ExtrapolationEngineTest.h:199
Trk::ExtrapolationEngineTest::m_materialThicknessInX0Plane
float m_materialThicknessInX0Plane
Definition: ExtrapolationEngineTest.h:211
Trk::ExtrapolationEngineTest::m_endStepPt
float m_endStepPt
Definition: ExtrapolationEngineTest.h:234
Trk::ExtrapolationEngineTest::m_treeFolder
std::string m_treeFolder
Definition: ExtrapolationEngineTest.h:122
Trk::ExtrapolationEngineTest::m_currentPhiStep
int m_currentPhiStep
Definition: ExtrapolationEngineTest.h:109
Trk::ExtrapolationEngineTest::m_charge
float m_charge
Definition: ExtrapolationEngineTest.h:137
Trk::ExtrapolationEngineTest::m_materialThicknessInL0Bwd
float m_materialThicknessInL0Bwd
Definition: ExtrapolationEngineTest.h:203
Trk::ExtrapolationEngineTest::m_sensitiveCenterPosX
std::vector< float > * m_sensitiveCenterPosX
Definition: ExtrapolationEngineTest.h:177
Trk::ExtrapolationEngineTest::m_sct_ID
const SCT_ID * m_sct_ID
Handle to the ID helper.
Definition: ExtrapolationEngineTest.h:70
Trk::ExtrapolationEngineTest::m_materialEmulatedIonizationLoss
float m_materialEmulatedIonizationLoss
Definition: ExtrapolationEngineTest.h:200
Trk::TrkExUnitTestBase
Definition: TrkExUnitTestBase.h:25
Trk::ExtrapolationEngineTest::m_endStepTheta
float m_endStepTheta
Definition: ExtrapolationEngineTest.h:231
Trk::ExtrapolationEngineTest::m_tRandom
TRandom m_tRandom
Definition: ExtrapolationEngineTest.h:125
Trk::ExtrapolationEngineTest::m_sensitiveLayerIndex
std::vector< int > * m_sensitiveLayerIndex
Definition: ExtrapolationEngineTest.h:174
ExtrapolationEngineTest.icc
Trk::ExtrapolationEngineTest::m_currentPhi
double m_currentPhi
Definition: ExtrapolationEngineTest.h:113
Trk::ExtrapolationEngineTest::m_materialPositionP
std::vector< float > * m_materialPositionP
Definition: ExtrapolationEngineTest.h:220
checker_macros.h
Define macros for attributes used to control the static checker.
Trk::ExtrapolationEngineTest::m_backTheta
float m_backTheta
Definition: ExtrapolationEngineTest.h:157
PixelID
Definition: PixelID.h:67
Trk::ExtrapolationEngineTest::m_d0Min
double m_d0Min
Definition: ExtrapolationEngineTest.h:82
Trk::ExtrapolationEngineTest::m_backPt
float m_backPt
Definition: ExtrapolationEngineTest.h:160
IExtrapolationEngine.h
Trk::ExtrapolationEngineTest::m_materialPositionR
std::vector< float > * m_materialPositionR
Definition: ExtrapolationEngineTest.h:219
Trk::ExtrapolationEngineTest::m_pathLimit
double m_pathLimit
Definition: ExtrapolationEngineTest.h:96
Trk::ExtrapolationEngineTest::m_endStepPositionZ
float m_endStepPositionZ
Definition: ExtrapolationEngineTest.h:228
Trk::ExtrapolationEngineTest::m_ptMin
double m_ptMin
Definition: ExtrapolationEngineTest.h:93
Trk::ExtrapolationEngineTest::m_phiMin
double m_phiMin
Definition: ExtrapolationEngineTest.h:90
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
Trk::ExtrapolationEngineTest::m_collectPassive
bool m_collectPassive
Definition: ExtrapolationEngineTest.h:99
Trk::ExtrapolationEngineTest::m_sensitiveCenterPosZ
std::vector< float > * m_sensitiveCenterPosZ
Definition: ExtrapolationEngineTest.h:179
Trk::ExtrapolationEngineTest::m_materialPositionX
std::vector< float > * m_materialPositionX
Definition: ExtrapolationEngineTest.h:216
Trk::ExtrapolationEngineTest::m_sensitiveCenterPosPhi
std::vector< float > * m_sensitiveCenterPosPhi
Definition: ExtrapolationEngineTest.h:181