ATLAS Offline Software
Loading...
Searching...
No Matches
TrackParametersHelper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef INDETTRACKPERFMON_TRKPARAMETERSHELPER_H
6#define INDETTRACKPERFMON_TRKPARAMETERSHELPER_H
7
16
20
22#include <vector>
23#include <cmath> // std::fabs, std::copysign
24
27
28
29namespace IDTPM {
30
32 template< class U >
33 inline float pT( const U& p ) { return p.pt(); }
34
36 template< class U >
37 inline float pTsig( const U& p ) {
38 return p.charge() ? std::copysign( pT(p), p.charge() ) : 0.;
39 }
40
42 template< class U >
43 inline float eta( const U& p ) { return p.eta(); }
44
46 inline float getTheta( const xAOD::TrackParticle& p ) { return p.theta(); }
47 inline float getTheta( const xAOD::TruthParticle& p ) {
48 static thread_local SG::ConstAccessor<float> thetaAcc("theta");
49 return (thetaAcc.isAvailable(p)) ? thetaAcc(p) : -9999.;
50 }
51 template< class U >
52 inline float theta( const U& p ) { return getTheta( p ); }
53
55 inline float getPhi( const xAOD::TrackParticle& p ) { return p.phi0(); }
56 inline float getPhi( const xAOD::TruthParticle& p ) {
57 static thread_local SG::ConstAccessor<float> phiAcc("phi");
58 return (phiAcc.isAvailable(p)) ? phiAcc(p) : -9999.;
59 }
60 template< class U >
61 inline float phi( const U& p ) { return getPhi( p ); }
62 //template< class U >
63 //inline float phi( const U& p ) { return p.phi(); }
64
66 inline float getZ0( const xAOD::TrackParticle& p ) { return p.z0(); }
67 inline float getZ0( const xAOD::TruthParticle& p ) {
68 static thread_local SG::ConstAccessor<float> z0Acc("z0");
69 return (z0Acc.isAvailable(p)) ? z0Acc(p) : -9999.;
70 }
71 template< class U >
72 inline float z0( const U& p ) { return getZ0( p ); }
73
74 template< class U >
75 inline float z0SinTheta( const U& p ) { return z0( p ) * std::sin( theta( p ) ); }
76
78 inline float getD0( const xAOD::TrackParticle& p ) { return p.d0(); }
79 inline float getD0( const xAOD::TruthParticle& p ) {
80 static thread_local SG::ConstAccessor<float> d0Acc("d0");
81 return (d0Acc.isAvailable(p)) ? d0Acc(p) : -9999.;
82 }
83 template< class U >
84 inline float d0( const U& p ) { return getD0( p ); }
85
87 inline float getProdR( const xAOD::TrackParticle& ) { return -9999.; }
88 inline float getProdR( const xAOD::TruthParticle& p ) {
89 static thread_local SG::ConstAccessor<float> prodRAcc("prodR");
90 return (prodRAcc.isAvailable(p)) ? prodRAcc(p) : -9999.;
91 }
92 template< class U >
93 inline float prodR( const U& p ) { return getProdR( p ); }
94
96 inline float getProdZ( const xAOD::TrackParticle& ) { return -9999.; }
97 inline float getProdZ( const xAOD::TruthParticle& p ) {
98 static thread_local SG::ConstAccessor<float> prodZAcc("prodZ");
99 return (prodZAcc.isAvailable(p)) ? prodZAcc(p) : -9999.;
100 }
101 template< class U >
102 inline float prodZ( const U& p ) { return getProdZ( p ); }
103
105 inline float getQoverP( const xAOD::TrackParticle& p ) { return p.qOverP(); }
106 inline float getQoverP( const xAOD::TruthParticle& p ) {
107 static thread_local SG::ConstAccessor<float> qOverPAcc("qOverP");
108 return (qOverPAcc.isAvailable(p)) ? qOverPAcc(p) : -9999.;
109 }
110 template< class U >
111 inline float qOverP( const U& p ) { return getQoverP( p ); }
112
113 template< class U >
114 inline float qOverPT( const U& p ) { return theta(p)==0 ? -9999. : qOverP(p) / std::sin( theta(p) ); }
115
117 template< class U >
118 inline float eTot( const U& p ) { return p.e(); }
119
121 template< class U >
122 inline float eT( const U& p ) { return p.p4().Et(); }
123
125 inline float getChiSquared( const xAOD::TrackParticle& p ) { return p.chiSquared(); }
126 inline float getChiSquared( const xAOD::TruthParticle& ) { return -9999; }
127 template< class U >
128 inline float chiSquared( const U& p ) { return getChiSquared(p); }
129
131 inline float getNdof( const xAOD::TrackParticle& p ) { return p.numberDoF(); }
132 inline float getNdof( const xAOD::TruthParticle& ) { return -9999; }
133 template< class U >
134 inline float ndof( const U& p ) { return getNdof(p); }
135
137 inline std::vector< unsigned int > getAuthor( const xAOD::TrackParticle& p ) {
138 std::vector< unsigned int > authorVec;
139 std::bitset< xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo > patternInfo = p.patternRecoInfo();
140 for( unsigned int i = 0 ; i < xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo ; i++ ) {
141 if( patternInfo.test(i) ) authorVec.push_back(i);
142 }
143 return authorVec;
144 }
145 inline std::vector< unsigned int > getAuthor( const xAOD::TruthParticle& ) { return {}; }
146 template< class U >
147 inline std::vector< unsigned int > author( const U& p ) { return getAuthor(p); }
148
150 inline uint8_t getHasValidTime( const xAOD::TrackParticle& p ) { return p.hasValidTime(); }
151 inline uint8_t getHasValidTime( const xAOD::TruthParticle& ) { return 0; }
152 template< class U >
153 inline uint8_t hasValidTime( const U& p ) { return getHasValidTime(p); }
154
156 inline float getTime( const xAOD::TrackParticle& p ) { return p.time(); }
157 inline float getTime( const xAOD::TruthParticle& ) { return -9999.; }
158 template< class U >
159 inline float time( const U& p ) { return getTime(p); }
160
162 inline float getCov( const xAOD::TrackParticle& p, Trk::ParamDefs par1, Trk::ParamDefs par2 ) {
163 return p.definingParametersCovMatrix()( par1, par2 ); }
164 inline float getCov( const xAOD::TruthParticle&, Trk::ParamDefs, Trk::ParamDefs ) { return 0.; }
165 template< class U >
166 inline float cov( const U& p, Trk::ParamDefs par1, Trk::ParamDefs par2 ) {
167 return getCov( p, par1, par2 ); }
168
170 inline float getError( const xAOD::TrackParticle& p, Trk::ParamDefs par ) {
171 return ( cov(p, par, par) < 0 ) ? 0. : std::sqrt( cov(p, par, par) ); }
172 inline float getError( const xAOD::TruthParticle&, Trk::ParamDefs ) { return 0.; }
173 template< class U >
174 inline float error( const U& p, Trk::ParamDefs par ) { return getError( p, par ); }
175
177 inline std::vector< float > getCovVec( const xAOD::TrackParticle& p ) {
178 return p.definingParametersCovMatrixVec(); }
179 inline std::vector< float > getCovVec( const xAOD::TruthParticle& ) { return {}; }
180 template< class U >
181 inline std::vector< float > covVec( const U& p ) { return getCovVec( p ); }
182
184 inline float getQOverPTError( const xAOD::TrackParticle& p ) {
185 float invSinTheta = 1. / std::sin( theta(p) );
186 float cosTheta = std::cos( theta(p) );
187 float qOverPTerr2 =
188 std::pow( error(p, Trk::qOverP) * invSinTheta, 2 )
189 + std::pow( error(p, Trk::theta) * qOverP(p) * cosTheta * std::pow(invSinTheta, 2), 2 )
190 - 2 * qOverP(p) * cosTheta * cov(p, Trk::theta, Trk::qOverP) * std::pow(invSinTheta, 3);
191 return qOverPTerr2 > 0 ? std::sqrt( qOverPTerr2 ) : 0.;
192 }
193 inline float getQOverPTError( const xAOD::TruthParticle& ) { return 0.; }
194 template< class U >
195 inline float qOverPTError( const U& p ) { return getQOverPTError(p); }
196
198 inline float getPTError( const xAOD::TrackParticle& p ) {
199 std::vector< float > covs = covVec(p);
200 if( covs.size() < 15 ) {
201 throw std::runtime_error(
202 "TrackParticle without covariance matrix for defining parameters or the covariance matrix is wrong dimensionality.");
203 }
204 if( qOverP(p) <= 0. ) return 0.;
205 float diff_qp = - pT(p) / std::fabs( qOverP(p) );
206 float diff_theta = theta(p) == 0. ? 0. : pT(p) / std::tan( theta(p) );
207 float pTerr2 = diff_qp * (diff_qp * covs[14] + diff_theta * covs[13]) + diff_theta * diff_theta * covs[9];
208 return pTerr2 > 0. ? std::sqrt( pTerr2 ) : 0.;
209 }
210 inline float getPTError( const xAOD::TruthParticle& ) { return 0.; }
211 template< class U >
212 inline float pTError( const U& p ) { return getPTError(p); }
213
215 inline float getEtaError( const xAOD::TrackParticle& p ) {
216 float etaErr =
217 error(p, Trk::theta) / ( -2 * std::sin( theta(p) ) * std::cos( theta(p) ) );
218 return std::fabs( etaErr ); }
219 inline float getEtaError( const xAOD::TruthParticle& ) { return 0.; }
220 template< class U >
221 inline float etaError( const U& p ) { return getEtaError(p); }
222
224 inline float getZ0SinThetaError( const xAOD::TrackParticle& p ) {
225 float z0sinErr2 =
226 std::pow( error(p, Trk::z0) * std::sin( theta(p) ), 2 )
227 + std::pow( z0(p) * error(p, Trk::theta) * std::cos( theta(p) ), 2)
228 + 2 * z0(p) * std::sin( theta(p) ) * std::cos( theta(p) ) * cov(p, Trk::z0, Trk::theta);
229 return z0sinErr2 > 0. ? std::sqrt( z0sinErr2 ) : 0.;
230 }
231 inline float getZ0SinThetaError( const xAOD::TruthParticle& ) { return 0.; }
232 template< class U >
233 inline float z0SinThetaError( const U& p ) { return getZ0SinThetaError(p); }
234
236 template< class U1, class U2=U1 >
237 inline float deltaPhi( const U1& p1, const U2& p2 ) {
238 return p1.p4().DeltaPhi( p2.p4() );
239 }
240
242 template< class U1, class U2=U1 >
243 inline float deltaEta( const U1& p1, const U2& p2 ) {
244 return ( eta(p1) - eta(p2) );
245 }
246
248 template< class U1, class U2=U1 >
249 inline float deltaR( const U1& p1, const U2& p2 ) {
250 return p1.p4().DeltaR( p2.p4() );
251 }
252
254 inline float getIsHadron( const xAOD::TrackParticle& ) { return 0; }
255 inline float getIsHadron( const xAOD::TruthParticle& p ) { return p.isHadron();}
256 template< class U >
257 inline float isHadron( const U& p ) { return getIsHadron( p ); }
258
260 inline float getIsPion( const xAOD::TrackParticle& ) { return 0; }
261 inline float getIsPion( const xAOD::TruthParticle& p ) { return (p.pdgId() == 111 or p.pdgId() == 211);}
262 template< class U >
263 inline float isPion( const U& p ) { return getIsPion( p ); }
264
265
267 inline int getTruthType( const xAOD::TrackParticle& ) { return -9999; }
268 inline int getTruthType( const xAOD::TruthParticle& p ) {
269 SG::ConstAccessor<int> type( "Truth_truthType" );
270 return type.isAvailable(p) ? type(p) : -9999;
271 }
272 template< class U >
273 inline int truthType( const U& p ) { return getTruthType( p ); }
274
276 inline int getTruthOrigin( const xAOD::TrackParticle& ) { return -9999; }
277 inline int getTruthOrigin( const xAOD::TruthParticle& p ) {
278 SG::ConstAccessor<int> origin( "Truth_truthOrigin" );
279 return origin.isAvailable(p) ? origin(p) : -9999;
280 }
281 template< class U >
282 inline int truthOrigin( const U& p ) { return getTruthOrigin( p ); }
283
284
287 uint8_t iInnerMostPixelHits(0);
288 return p.summaryValue( iInnerMostPixelHits, xAOD::numberOfInnermostPixelLayerHits ) ?
289 float( iInnerMostPixelHits ) : -9999.;
290 }
291 inline float getNInnerMostPixelHits( const xAOD::TruthParticle& ) { return -9999.; }
292 template< class U >
293 inline float nInnerMostPixelHits( const U& p ) { return getNInnerMostPixelHits( p ); }
294
297 uint8_t iInnerMostPixelEndcapHits(0);
298 return p.summaryValue( iInnerMostPixelEndcapHits, xAOD::numberOfInnermostPixelLayerEndcapHits ) ?
299 float( iInnerMostPixelEndcapHits ) : -9999.;
300 }
301 inline float getNInnerMostPixelEndcapHits( const xAOD::TruthParticle& ) { return -9999.; }
302 template< class U >
303 inline float nInnerMostPixelEndcapHits( const U& p ) { return getNInnerMostPixelEndcapHits( p ); }
304
307 uint8_t iNextToInnerMostPixelHits(0);
308 return p.summaryValue( iNextToInnerMostPixelHits, xAOD::numberOfNextToInnermostPixelLayerHits ) ?
309 float( iNextToInnerMostPixelHits ) : -9999.;
310 }
311 inline float getNNextToInnerMostPixelHits( const xAOD::TruthParticle& ) { return -9999.; }
312 template< class U >
313 inline float nNextToInnerMostPixelHits( const U& p ) { return getNNextToInnerMostPixelHits( p ); }
314
317 uint8_t iNextToInnerMostPixelEndcapHits(0);
318 return p.summaryValue( iNextToInnerMostPixelEndcapHits, xAOD::numberOfNextToInnermostPixelLayerEndcapHits ) ?
319 float( iNextToInnerMostPixelEndcapHits ) : -9999.;
320 }
321 inline float getNNextToInnerMostPixelEndcapHits( const xAOD::TruthParticle& ) { return -9999.; }
322 template< class U >
323 inline float nNextToInnerMostPixelEndcapHits( const U& p ) { return getNNextToInnerMostPixelEndcapHits( p ); }
324
327 uint8_t iInnerMostPixelSharedHits(0);
328 return p.summaryValue( iInnerMostPixelSharedHits, xAOD::numberOfInnermostPixelLayerSharedHits ) ?
329 float( iInnerMostPixelSharedHits ) : -9999.;
330 }
331 inline float getNInnerMostPixelSharedHits( const xAOD::TruthParticle& ) { return -9999.; }
332 template< class U >
333 inline float nInnerMostPixelSharedHits( const U& p ) { return getNInnerMostPixelSharedHits( p ); }
334
337 uint8_t iInnerMostPixelSharedEndcapHits(0);
338 return p.summaryValue( iInnerMostPixelSharedEndcapHits, xAOD::numberOfInnermostPixelLayerSharedEndcapHits ) ?
339 float( iInnerMostPixelSharedEndcapHits ) : -9999.;
340 }
341 inline float getNInnerMostPixelSharedEndcapHits( const xAOD::TruthParticle& ) { return -9999.; }
342 template< class U >
343 inline float nInnerMostPixelSharedEndcapHits( const U& p ) { return getNInnerMostPixelSharedEndcapHits( p ); }
344
346 inline float getNPixelHits( const xAOD::TrackParticle& p ) {
347 uint8_t iPixelHits(0);
348 return p.summaryValue( iPixelHits, xAOD::numberOfPixelHits ) ?
349 float( iPixelHits ) : -9999.;
350 }
351 inline float getNPixelHits( const xAOD::TruthParticle& ) { return -9999.; }
352 template< class U >
353 inline float nPixelHits( const U& p ) { return getNPixelHits( p ); }
354
356 inline float getNPixelHoles( const xAOD::TrackParticle& p ) {
357 uint8_t iPixHoles(0);
358 return p.summaryValue( iPixHoles, xAOD::numberOfPixelHoles ) ?
359 float( iPixHoles ) : -9999.;
360 }
361 inline float getNPixelHoles( const xAOD::TruthParticle& ) { return -9999.; }
362 template< class U >
363 inline float nPixelHoles( const U& p ) { return getNPixelHoles( p ); }
364
366 inline float getNPixelSharedHits( const xAOD::TrackParticle& p ) {
367 uint8_t iPixelShared(0);
368 return p.summaryValue( iPixelShared, xAOD::numberOfPixelSharedHits ) ?
369 float( iPixelShared ) : -9999.;
370 }
371 inline float getNPixelSharedHits( const xAOD::TruthParticle& ) { return -9999.; }
372 template< class U >
373 inline float nPixelSharedHits( const U& p ) { return getNPixelSharedHits( p ); }
374
376 inline float getPixeldEdx( const xAOD::TrackParticle& p ) {
377 float iPixeldEdx(0);
378 return p.summaryValue( iPixeldEdx, xAOD::pixeldEdx ) ? iPixeldEdx : -9999.;
379 }
380 inline float getPixeldEdx( const xAOD::TruthParticle& ) { return -9999.; }
381 template< class U >
382 inline float pixeldEdx( const U& p ) { return getPixeldEdx( p ); }
383
385 inline float getNSCTHits( const xAOD::TrackParticle& p ) {
386 uint8_t iSctHits(0);
387 return p.summaryValue( iSctHits, xAOD::numberOfSCTHits ) ?
388 float( iSctHits ) : -9999.;
389 }
390 inline float getNSCTHits( const xAOD::TruthParticle& ) { return -9999.; }
391 template< class U >
392 inline float nSCTHits( const U& p ) { return getNSCTHits( p ); }
393
395 inline float getNSCTHoles( const xAOD::TrackParticle& p ) {
396 uint8_t iSctHoles(0);
397 return p.summaryValue( iSctHoles, xAOD::numberOfSCTHoles ) ?
398 float( iSctHoles ) : -9999.;
399 }
400 inline float getNSCTHoles( const xAOD::TruthParticle& ) { return -9999.; }
401 template< class U >
402 inline float nSCTHoles( const U& p ) { return getNSCTHoles( p ); }
403
405 inline float getNSCTSharedHits( const xAOD::TrackParticle& p ) {
406 uint8_t iSCTShared(0);
407 return p.summaryValue( iSCTShared, xAOD::numberOfSCTSharedHits ) ?
408 float( iSCTShared ) : -9999.;
409 }
410 inline float getNSCTSharedHits( const xAOD::TruthParticle& ) { return -9999.; }
411 template< class U >
412 inline float nSCTSharedHits( const U& p ) { return getNSCTSharedHits( p ); }
413
415 inline float getNSiHits( const xAOD::TrackParticle& p ) {
416 if( nPixelHits(p)<0 or nSCTHits(p)<0 ) return -9999.;
417 float pnPixelHits = ( nPixelHits(p) >= 0 ) ? nPixelHits(p) : 0.;
418 float pnSCTHits = ( nSCTHits(p) >= 0 ) ? nSCTHits(p) : 0.;
419 return ( pnPixelHits + pnSCTHits );
420 }
421 inline float getNSiHits( const xAOD::TruthParticle& p ) {
422 static thread_local SG::ConstAccessor<float> prodNSiHits( "nSilHits" );
423 return prodNSiHits.isAvailable(p) ? prodNSiHits(p) : -9999.;
424 }
425 template< class U >
426 inline float nSiHits( const U& p ) { return getNSiHits( p ); }
427
429 template< class U >
430 inline float nSiHoles( const U& p ) {
431 if( nPixelHoles(p)<0 or nSCTHoles(p)<0 ) return -9999.;
432 float pnPixelHoles = ( nPixelHoles(p) >= 0 ) ? nPixelHoles(p) : 0.;
433 float pnSCTHoles = ( nSCTHoles(p) >= 0 ) ? nSCTHoles(p) : 0.;
434 return ( pnPixelHoles + pnSCTHoles );
435 }
436
438 inline float getNTRTHits( const xAOD::TrackParticle& p ) {
439 uint8_t iTrtHits(0);
440 return p.summaryValue( iTrtHits, xAOD::numberOfTRTHits ) ?
441 float( iTrtHits ) : -9999.;
442 }
443 inline float getNTRTHits( const xAOD::TruthParticle& ) { return -9999.; }
444 template< class U >
445 inline float nTRTHits( const U& p ) { return getNTRTHits( p ); }
446
448 inline float getNTRTHitsXe( const xAOD::TrackParticle& p ) {
449 uint8_t iTrtHitsXe(0);
450 return p.summaryValue( iTrtHitsXe, xAOD::numberOfTRTXenonHits ) ?
451 float( iTrtHitsXe ) : -9999.;
452 }
453 inline float getNTRTHitsXe( const xAOD::TruthParticle& ) { return -9999.; }
454 template< class U >
455 inline float nTRTHitsXe( const U& p ) { return getNTRTHitsXe( p ); }
456
458 inline float getNTRTHitsAr( const xAOD::TrackParticle& p ) {
459 if( nTRTHits(p)<0 or nTRTHitsXe(p)<0 ) return -9999.;
460 float pnTRTHits = ( nTRTHits(p) >= 0 ) ? nTRTHits(p) : 0.;
461 float pnTRTHitsXe = ( nTRTHitsXe(p) >= 0 ) ? nTRTHitsXe(p) : 0.;
462 return ( pnTRTHits - pnTRTHitsXe );
463 }
464 inline float getNTRTHitsAr( const xAOD::TruthParticle& ) { return -9999.; }
465 template< class U >
466 inline float nTRTHitsAr( const U& p ) { return getNTRTHitsAr( p ); }
467
470 uint8_t iTrtHighThresholdHits(0);
471 return p.summaryValue( iTrtHighThresholdHits, xAOD::numberOfTRTHighThresholdHitsTotal ) ?
472 float( iTrtHighThresholdHits ) : -9999.;
473 }
474 inline float getNTRTHighThresholdHits( const xAOD::TruthParticle& ) { return -9999.; }
475 template< class U >
476 inline float nTRTHighThresholdHits( const U& p ) { return getNTRTHighThresholdHits( p ); }
477
480 uint8_t iTrtHighThresholdHitsXe(0);
481 return p.summaryValue( iTrtHighThresholdHitsXe, xAOD::numberOfTRTHighThresholdHits ) ?
482 float( iTrtHighThresholdHitsXe ) : -9999.;
483 }
484 inline float getNTRTHighThresholdHitsXe( const xAOD::TruthParticle& ) { return -9999.; }
485 template< class U >
486 inline float nTRTHighThresholdHitsXe( const U& p ) { return getNTRTHighThresholdHitsXe( p ); }
487
490 if( nTRTHighThresholdHits(p)<0 or nTRTHighThresholdHitsXe(p)<0 ) return -9999.;
491 float pnTRTHighThresholdHits = ( nTRTHighThresholdHits(p) >= 0 ) ? nTRTHighThresholdHits(p) : 0.;
492 float pnTRTHighThresholdHitsXe = ( nTRTHighThresholdHitsXe(p) >= 0 ) ? nTRTHighThresholdHitsXe(p) : 0.;
493 return ( pnTRTHighThresholdHits - pnTRTHighThresholdHitsXe );
494 }
495 inline float getNTRTHighThresholdHitsAr( const xAOD::TruthParticle& ) { return -9999.; }
496 template< class U >
497 inline float nTRTHighThresholdHitsAr( const U& p ) { return getNTRTHighThresholdHitsAr( p ); }
498
499 //EXPERT PLOTS
500
503 uint8_t iInnerMostPixelOutliers(0);
504 return p.summaryValue( iInnerMostPixelOutliers, xAOD::numberOfInnermostPixelLayerOutliers ) ?
505 float( iInnerMostPixelOutliers ) : -9999.;
506 }
507 inline float getNInnerMostPixelOutliers( const xAOD::TruthParticle& ) { return -9999.; }
508 template< class U >
509 inline float nInnerMostPixelOutliers( const U& p ) { return getNInnerMostPixelOutliers( p ); }
510
511
512
515 uint8_t iInnerMostPixelEndcapOutliers(0);
516 return p.summaryValue( iInnerMostPixelEndcapOutliers, xAOD::numberOfInnermostPixelLayerEndcapOutliers ) ?
517 float( iInnerMostPixelEndcapOutliers ) : -9999.;
518 }
519 inline float getNInnerMostPixelEndcapOutliers( const xAOD::TruthParticle& ) { return -9999.; }
520 template< class U >
521 inline float nInnerMostPixelEndcapOutliers( const U& p ) { return getNInnerMostPixelEndcapOutliers( p ); }
522
523
524
527 uint8_t iInnerMostPixelSplitHits(0);
528 return p.summaryValue( iInnerMostPixelSplitHits, xAOD::numberOfPixelSplitHits ) ?
529 float( iInnerMostPixelSplitHits ) : -9999.;
530 }
531 inline float getNInnerMostPixelSplitHits( const xAOD::TruthParticle& ) { return -9999.; }
532 template< class U >
533 inline float nInnerMostPixelSplitHits( const U& p ) { return getNInnerMostPixelSplitHits( p ); }
534
535
536
539 uint8_t iInnerMostPixelSplitEndcapHits(0);
540 return p.summaryValue( iInnerMostPixelSplitEndcapHits, xAOD::numberOfInnermostPixelLayerSplitEndcapHits ) ?
541 float( iInnerMostPixelSplitEndcapHits ) : -9999.;
542 }
543 inline float getNInnerMostPixelSplitEndcapHits( const xAOD::TruthParticle& ) { return -9999.; }
544 template< class U >
545 inline float nInnerMostPixelSplitEndcapHits( const U& p ) { return getNInnerMostPixelSplitEndcapHits( p ); }
546
547
548
551 uint8_t iNExpectedInnerMostPixelHits(0);
552 return p.summaryValue( iNExpectedInnerMostPixelHits, xAOD::expectInnermostPixelLayerHit ) ?
553 float( iNExpectedInnerMostPixelHits ) : -9999.;
554 }
555 inline float getNExpectedInnerMostPixelHits( const xAOD::TruthParticle& ) { return -9999.; }
556 template< class U >
557 inline float nExpectedInnerMostPixelHits( const U& p ) { return getNExpectedInnerMostPixelHits( p ); }
558
559
560
563 uint8_t iNExpectedNextToInnerMostPixelHits(0);
564 return p.summaryValue( iNExpectedNextToInnerMostPixelHits, xAOD::expectNextToInnermostPixelLayerHit ) ?
565 float( iNExpectedNextToInnerMostPixelHits ) : -9999.;
566 }
567 inline float getNExpectedNextToInnerMostPixelHits( const xAOD::TruthParticle& ) { return -9999.; }
568 template< class U >
570
571
572
574 inline float getNPixelOutliers( const xAOD::TrackParticle& p ) {
575 uint8_t iNPixelOutliers(0);
576 return p.summaryValue( iNPixelOutliers, xAOD::numberOfPixelOutliers ) ?
577 float( iNPixelOutliers ) : -9999.;
578 }
579 inline float getNPixelOutliers( const xAOD::TruthParticle& ) { return -9999.; }
580 template< class U >
581 inline float nPixelOutliers( const U& p ) { return getNPixelOutliers( p ); }
582
583
584
587 uint8_t iNPixelContribLayers(0);
588 return p.summaryValue( iNPixelContribLayers, xAOD::numberOfContribPixelLayers ) ?
589 float( iNPixelContribLayers ) : -9999.;
590 }
591 inline float getNPixelContribLayers( const xAOD::TruthParticle& ) { return -9999.; }
592 template< class U >
593 inline float nPixelContribLayers( const U& p ) { return getNPixelContribLayers( p ); }
594
595
596
598 inline float getNPixelSplitHits( const xAOD::TrackParticle& p ) {
599 uint8_t iNPixelSplitHits(0);
600 return p.summaryValue( iNPixelSplitHits, xAOD::numberOfPixelSplitHits ) ?
601 float( iNPixelSplitHits ) : -9999.;
602 }
603 inline float getNPixelSplitHits( const xAOD::TruthParticle& ) { return -9999.; }
604 template< class U >
605 inline float nPixelSplitHits( const U& p ) { return getNPixelSplitHits( p ); }
606
607
608
610 inline float getNPixelGangedHits( const xAOD::TrackParticle& p ) {
611 uint8_t iNPixelGangedHits(0);
612 return p.summaryValue( iNPixelGangedHits, xAOD::numberOfGangedPixels ) ?
613 float( iNPixelGangedHits ) : -9999.;
614 }
615 inline float getNPixelGangedHits( const xAOD::TruthParticle& ) { return -9999.; }
616 template< class U >
617 inline float nPixelGangedHits( const U& p ) { return getNPixelGangedHits( p ); }
618
619
620
623 uint8_t iNPixelGangedHitsFlaggedFakes(0);
624 return p.summaryValue( iNPixelGangedHitsFlaggedFakes, xAOD::numberOfGangedFlaggedFakes ) ?
625 float( iNPixelGangedHitsFlaggedFakes ) : -9999.;
626 }
627 inline float getNPixelGangedHitsFlaggedFakes( const xAOD::TruthParticle& ) { return -9999.; }
628 template< class U >
629 inline float nPixelGangedHitsFlaggedFakes( const U& p ) { return getNPixelGangedHitsFlaggedFakes( p ); }
630
631
632
634 inline float getNPixelDeadSensors( const xAOD::TrackParticle& p ) {
635 uint8_t iNPixelDeadSensors(0);
636 return p.summaryValue( iNPixelDeadSensors, xAOD::numberOfPixelDeadSensors ) ?
637 float( iNPixelDeadSensors ) : -9999.;
638 }
639 inline float getNPixelDeadSensors( const xAOD::TruthParticle& ) { return -9999.; }
640 template< class U >
641 inline float nPixelDeadSensors( const U& p ) { return getNPixelDeadSensors( p ); }
642
643
644
646 inline float getNSCTOutliers( const xAOD::TrackParticle& p ) {
647 uint8_t iNSCTOutliers(0);
648 return p.summaryValue( iNSCTOutliers, xAOD::numberOfSCTOutliers ) ?
649 float( iNSCTOutliers ) : -9999.;
650 }
651 inline float getNSCTOutliers( const xAOD::TruthParticle& ) { return -9999.; }
652 template< class U >
653 inline float nSCTOutliers( const U& p ) { return getNSCTOutliers( p ); }
654
655
656
658 inline float getNSCTDoubleHoles( const xAOD::TrackParticle& p ) {
659 uint8_t iNSCTDoubleHoles(0);
660 return p.summaryValue( iNSCTDoubleHoles, xAOD::numberOfSCTDoubleHoles ) ?
661 float( iNSCTDoubleHoles ) : -9999.;
662 }
663 inline float getNSCTDoubleHoles( const xAOD::TruthParticle& ) { return -9999.; }
664 template< class U >
665 inline float nSCTDoubleHoles( const U& p ) { return getNSCTDoubleHoles( p ); }
666
667
668
670 inline float getNSCTDeadSensors( const xAOD::TrackParticle& p ) {
671 uint8_t iNSCTDeadSensors(0);
672 return p.summaryValue( iNSCTDeadSensors, xAOD::numberOfSCTDeadSensors ) ?
673 float( iNSCTDeadSensors ) : -9999.;
674 }
675 inline float getNSCTDeadSensors( const xAOD::TruthParticle& ) { return -9999.; }
676 template< class U >
677 inline float nSCTDeadSensors( const U& p ) { return getNSCTDeadSensors( p ); }
678
679
680
681
682} // namespace IDTPM
683
684#endif // > ! INDETTRACKPERFMON_TRKPARAMETERSHELPER_H
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Scalar theta() const
theta method
Utility methods to access reco/truth vertices parmeters in a consitent way across this package.
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Athena include(s).
float getD0(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of d0.
std::vector< float > getCovVec(const xAOD::TrackParticle &p)
Accessor utility function for getting the track parameters covariance vector.
float nTRTHighThresholdHits(const U &p)
float nInnerMostPixelSharedEndcapHits(const U &p)
float getNPixelContribLayers(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NPixelContribLayers.
float nInnerMostPixelSplitHits(const U &p)
float getNSCTOutliers(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NSCTOutliers.
float getNNextToInnerMostPixelHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nNextToInnerMostPixelHits.
float nSiHoles(const U &p)
Accessor utility function for getting the value of nSiHoles.
float getNInnerMostPixelEndcapOutliers(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NInnerMostPixelEndcapOutliers.
float getNInnerMostPixelHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nInnerMostPixelHits.
float getNPixelSharedHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nPixelSharedHits.
int getTruthType(const xAOD::TrackParticle &)
Accessor utility function for getting the value of truthType.
float getZ0SinThetaError(const xAOD::TrackParticle &p)
Accessor utility function for getting the z0SinTheta error.
float getNTRTHitsXe(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHitsXe.
float getQOverPTError(const xAOD::TrackParticle &p)
Accessor utility function for getting the QOverPt error.
float getNPixelSplitHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NPixelSplitHits.
float nInnerMostPixelSplitEndcapHits(const U &p)
float getTime(const xAOD::TrackParticle &p)
Accessor utility function for getting the track time.
float nExpectedInnerMostPixelHits(const U &p)
float nPixelHoles(const U &p)
float getNPixelGangedHitsFlaggedFakes(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NPixelGangedHitsFlaggedFakes.
float nPixelSharedHits(const U &p)
uint8_t getHasValidTime(const xAOD::TrackParticle &p)
Accessor utility function for getting the track hasValidTime.
float pT(const U &p)
Accessor utility function for getting the value of pT.
float z0SinTheta(const U &p)
float getNExpectedNextToInnerMostPixelHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NExpectedNextToInnerMostPixelHits.
float getNPixelOutliers(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NPixelOutliers.
float eT(const U &p)
Accessor utility function for getting the value of Tranverse energy.
float getPhi(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of phi.
float nNextToInnerMostPixelHits(const U &p)
float getNTRTHighThresholdHitsAr(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHighThresholdHitsAr.
float nPixelContribLayers(const U &p)
float getNInnerMostPixelSharedHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nInnerMostPixelSharedHits.
float getNSCTHoles(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nSCTHoles.
float getNSCTHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nSCTHits.
float getNPixelGangedHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NPixelGangedHits.
float getPixeldEdx(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of pixeldEdx.
float getNSCTDoubleHoles(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NSCTDoubleHoles.
float prodZ(const U &p)
float getPTError(const xAOD::TrackParticle &p)
Accessor utility function for getting the Pt error.
float qOverP(const U &p)
float getError(const xAOD::TrackParticle &p, Trk::ParamDefs par)
Accessor utility function for getting the track parameters error.
float nPixelGangedHits(const U &p)
float eTot(const U &p)
Accessor utility function for getting the value of Energy.
std::vector< unsigned int > getAuthor(const xAOD::TrackParticle &p)
Accessor utility function for getting the track author.
float getProdR(const xAOD::TrackParticle &)
Accessor utility function for getting the value of R.
float nInnerMostPixelEndcapOutliers(const U &p)
float getNdof(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of dof.
float nSCTSharedHits(const U &p)
float getIsHadron(const xAOD::TrackParticle &)
Accessor utility function for getting the value of isHadron.
float chiSquared(const U &p)
float qOverPT(const U &p)
float deltaPhi(const U1 &p1, const U2 &p2)
Accessor utility function for getting the DeltaPhi betwen two tracks.
float getNInnerMostPixelSplitEndcapHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NInnerMostPixelSplitEndcapHits.
float getNSCTSharedHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nSCTSharedHits.
float nPixelDeadSensors(const U &p)
float nSCTHoles(const U &p)
float nTRTHighThresholdHitsXe(const U &p)
float nNextToInnerMostPixelEndcapHits(const U &p)
float nSCTHits(const U &p)
float qOverPTError(const U &p)
float pTError(const U &p)
float nSCTDeadSensors(const U &p)
float getNSCTDeadSensors(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NSCTDeadSensors.
std::vector< float > covVec(const U &p)
float isPion(const U &p)
float z0(const U &p)
float nSCTDoubleHoles(const U &p)
float nInnerMostPixelSharedHits(const U &p)
float getNPixelHoles(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nPixelHoles.
float nTRTHits(const U &p)
float nTRTHitsAr(const U &p)
float pixeldEdx(const U &p)
float getNInnerMostPixelOutliers(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NInnerMostPixelOutliers.
float nTRTHighThresholdHitsAr(const U &p)
float getTheta(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of theta.
float getNNextToInnerMostPixelEndcapHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nNextToInnerMostPixelEndcapHits.
float getChiSquared(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of chi^2.
float getNExpectedInnerMostPixelHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NExpectedInnerMostPixelHits.
float getNPixelDeadSensors(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NPixelDeadSensors.
float d0(const U &p)
float nTRTHitsXe(const U &p)
float prodR(const U &p)
float getNPixelHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nPixelHits.
float pTsig(const U &p)
Accessor utility function for getting the value of signed pT.
float ndof(const U &p)
float nInnerMostPixelHits(const U &p)
int truthOrigin(const U &p)
float getNInnerMostPixelSplitHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of NInnerMostPixelSplitHits.
float nPixelOutliers(const U &p)
float time(const U &p)
float getNTRTHitsAr(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHitsAr.
float getQoverP(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of qOverP.
float getEtaError(const xAOD::TrackParticle &p)
Accessor utility function for getting the Eta error.
float getNInnerMostPixelSharedEndcapHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nInnerMostPixelSharedEndcapHits.
float deltaR(const U1 &p1, const U2 &p2)
Accessor utility function for getting the DeltaR betwen two tracks.
float nInnerMostPixelOutliers(const U &p)
float nSiHits(const U &p)
float nPixelSplitHits(const U &p)
std::vector< unsigned int > author(const U &p)
float getProdZ(const xAOD::TrackParticle &)
Accessor utility function for getting the value of Z.
float getCov(const xAOD::TrackParticle &p, Trk::ParamDefs par1, Trk::ParamDefs par2)
Accessor utility function for getting the track parameters covariance.
int getTruthOrigin(const xAOD::TrackParticle &)
Accessor utility function for getting the value of truthOrigin.
float nPixelHits(const U &p)
float getZ0(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of z0.
float etaError(const U &p)
int truthType(const U &p)
float getNSiHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nSiHits.
float nExpectedNextToInnerMostPixelHits(const U &p)
float cov(const U &p, Trk::ParamDefs par1, Trk::ParamDefs par2)
float z0SinThetaError(const U &p)
float nSCTOutliers(const U &p)
uint8_t hasValidTime(const U &p)
float getNTRTHighThresholdHitsXe(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHighThresholdHitsXe.
float getNTRTHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHits.
float getNInnerMostPixelEndcapHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nInnerMostPixelEndcapHits.
float isHadron(const U &p)
float nInnerMostPixelEndcapHits(const U &p)
float nPixelGangedHitsFlaggedFakes(const U &p)
float getIsPion(const xAOD::TrackParticle &)
Accessor utility function for getting the value of isPion.
float deltaEta(const U1 &p1, const U2 &p2)
Accessor utility function for getting the DeltaEta betwen two tracks.
float getNTRTHighThresholdHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHighThresholdHits.
ParamDefs
This file defines the parameter enums in the Trk namespace.
Definition ParamDefs.h:32
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ z0
Definition ParamDefs.h:64
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.
@ numberOfInnermostPixelLayerSharedEndcapHits
number of Pixel 0th layer endcap hits shared by several tracks.
@ numberOfGangedPixels
number of pixels which have a ganged ambiguity [unit8_t].
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfInnermostPixelLayerEndcapHits
these are the hits in the 0th pixel layer endcap [unit8_t].
@ numberOfContribPixelLayers
number of contributing layers of the pixel detector [unit8_t].
@ pixeldEdx
the dE/dx estimate, calculated using the pixel clusters [?
@ numberOfPixelSplitHits
number of Pixel all-layer hits split by cluster splitting [unit8_t].
@ numberOfInnermostPixelLayerEndcapOutliers
number of 0th layer endcap outliers
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
@ numberOfPixelOutliers
these are the pixel outliers, including the b-layer [unit8_t].
@ numberOfTRTXenonHits
number of TRT hits on track in straws with xenon [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
@ numberOfGangedFlaggedFakes
number of Ganged Pixels flagged as fakes [unit8_t].
@ numberOfInnermostPixelLayerOutliers
number of 0th layer barrel outliers
@ numberOfTRTHighThresholdHitsTotal
total number of TRT hits which pass the high threshold [unit8_t].
@ numberOfNextToInnermostPixelLayerEndcapHits
these are the hits in the 0.5th and 1st pixel layer endcap rings [unit8_t].
@ expectNextToInnermostPixelLayerHit
Do we expect a 1st-layer barrel hit for this track?
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfSCTDoubleHoles
number of Holes in both sides of a SCT module [unit8_t].
@ numberOfSCTOutliers
number of SCT outliers [unit8_t].
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfInnermostPixelLayerSplitEndcapHits
number of Pixel 0th layer endcap hits shared by several tracks.
@ numberOfTRTHighThresholdHits
number of TRT hits which pass the high threshold (only xenon counted) [unit8_t].
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].
@ NumberOfTrackRecoInfo
maximum number of enums