ATLAS Offline Software
Loading...
Searching...
No Matches
TrackParametersHelper.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#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 return 0.;
204 }
205 if( qOverP(p) <= 0. ) return 0.;
206 float diff_qp = - pT(p) / std::fabs( qOverP(p) );
207 float diff_theta = theta(p) == 0. ? 0. : pT(p) / std::tan( theta(p) );
208 float pTerr2 = diff_qp * (diff_qp * covs[14] + diff_theta * covs[13]) + diff_theta * diff_theta * covs[9];
209 return pTerr2 > 0. ? std::sqrt( pTerr2 ) : 0.;
210 }
211 inline float getPTError( const xAOD::TruthParticle& ) { return 0.; }
212 template< class U >
213 inline float pTError( const U& p ) { return getPTError(p); }
214
216 inline float getEtaError( const xAOD::TrackParticle& p ) {
217 float etaErr =
218 error(p, Trk::theta) / ( -2 * std::sin( theta(p) ) * std::cos( theta(p) ) );
219 return std::fabs( etaErr ); }
220 inline float getEtaError( const xAOD::TruthParticle& ) { return 0.; }
221 template< class U >
222 inline float etaError( const U& p ) { return getEtaError(p); }
223
225 inline float getZ0SinThetaError( const xAOD::TrackParticle& p ) {
226 float z0sinErr2 =
227 std::pow( error(p, Trk::z0) * std::sin( theta(p) ), 2 )
228 + std::pow( z0(p) * error(p, Trk::theta) * std::cos( theta(p) ), 2)
229 + 2 * z0(p) * std::sin( theta(p) ) * std::cos( theta(p) ) * cov(p, Trk::z0, Trk::theta);
230 return z0sinErr2 > 0. ? std::sqrt( z0sinErr2 ) : 0.;
231 }
232 inline float getZ0SinThetaError( const xAOD::TruthParticle& ) { return 0.; }
233 template< class U >
234 inline float z0SinThetaError( const U& p ) { return getZ0SinThetaError(p); }
235
237 template< class U1, class U2=U1 >
238 inline float deltaPhi( const U1& p1, const U2& p2 ) {
239 return p1.p4().DeltaPhi( p2.p4() );
240 }
241
243 template< class U1, class U2=U1 >
244 inline float deltaEta( const U1& p1, const U2& p2 ) {
245 return ( eta(p1) - eta(p2) );
246 }
247
249 template< class U1, class U2=U1 >
250 inline float deltaR( const U1& p1, const U2& p2 ) {
251 return p1.p4().DeltaR( p2.p4() );
252 }
253
255 inline float getIsHadron( const xAOD::TrackParticle& ) { return 0; }
256 inline float getIsHadron( const xAOD::TruthParticle& p ) { return p.isHadron();}
257 template< class U >
258 inline float isHadron( const U& p ) { return getIsHadron( p ); }
259
261 inline float getIsPion( const xAOD::TrackParticle& ) { return 0; }
262 inline float getIsPion( const xAOD::TruthParticle& p ) { return (p.pdgId() == 111 or p.pdgId() == 211);}
263 template< class U >
264 inline float isPion( const U& p ) { return getIsPion( p ); }
265
266
268 inline int getTruthType( const xAOD::TrackParticle& ) { return -9999; }
269 inline int getTruthType( const xAOD::TruthParticle& p ) {
270 SG::ConstAccessor<int> type( "Truth_truthType" );
271 return type.isAvailable(p) ? type(p) : -9999;
272 }
273 template< class U >
274 inline int truthType( const U& p ) { return getTruthType( p ); }
275
277 inline int getTruthOrigin( const xAOD::TrackParticle& ) { return -9999; }
278 inline int getTruthOrigin( const xAOD::TruthParticle& p ) {
279 SG::ConstAccessor<int> origin( "Truth_truthOrigin" );
280 return origin.isAvailable(p) ? origin(p) : -9999;
281 }
282 template< class U >
283 inline int truthOrigin( const U& p ) { return getTruthOrigin( p ); }
284
285
288 uint8_t iInnerMostPixelHits(0);
289 return p.summaryValue( iInnerMostPixelHits, xAOD::numberOfInnermostPixelLayerHits ) ?
290 float( iInnerMostPixelHits ) : -9999.;
291 }
292 inline float getNInnerMostPixelHits( const xAOD::TruthParticle& ) { return -9999.; }
293 template< class U >
294 inline float nInnerMostPixelHits( const U& p ) { return getNInnerMostPixelHits( p ); }
295
298 uint8_t iInnerMostPixelEndcapHits(0);
299 return p.summaryValue( iInnerMostPixelEndcapHits, xAOD::numberOfInnermostPixelLayerEndcapHits ) ?
300 float( iInnerMostPixelEndcapHits ) : -9999.;
301 }
302 inline float getNInnerMostPixelEndcapHits( const xAOD::TruthParticle& ) { return -9999.; }
303 template< class U >
304 inline float nInnerMostPixelEndcapHits( const U& p ) { return getNInnerMostPixelEndcapHits( p ); }
305
308 uint8_t iNextToInnerMostPixelHits(0);
309 return p.summaryValue( iNextToInnerMostPixelHits, xAOD::numberOfNextToInnermostPixelLayerHits ) ?
310 float( iNextToInnerMostPixelHits ) : -9999.;
311 }
312 inline float getNNextToInnerMostPixelHits( const xAOD::TruthParticle& ) { return -9999.; }
313 template< class U >
314 inline float nNextToInnerMostPixelHits( const U& p ) { return getNNextToInnerMostPixelHits( p ); }
315
318 uint8_t iNextToInnerMostPixelEndcapHits(0);
319 return p.summaryValue( iNextToInnerMostPixelEndcapHits, xAOD::numberOfNextToInnermostPixelLayerEndcapHits ) ?
320 float( iNextToInnerMostPixelEndcapHits ) : -9999.;
321 }
322 inline float getNNextToInnerMostPixelEndcapHits( const xAOD::TruthParticle& ) { return -9999.; }
323 template< class U >
324 inline float nNextToInnerMostPixelEndcapHits( const U& p ) { return getNNextToInnerMostPixelEndcapHits( p ); }
325
328 uint8_t iInnerMostPixelSharedHits(0);
329 return p.summaryValue( iInnerMostPixelSharedHits, xAOD::numberOfInnermostPixelLayerSharedHits ) ?
330 float( iInnerMostPixelSharedHits ) : -9999.;
331 }
332 inline float getNInnerMostPixelSharedHits( const xAOD::TruthParticle& ) { return -9999.; }
333 template< class U >
334 inline float nInnerMostPixelSharedHits( const U& p ) { return getNInnerMostPixelSharedHits( p ); }
335
338 uint8_t iInnerMostPixelSharedEndcapHits(0);
339 return p.summaryValue( iInnerMostPixelSharedEndcapHits, xAOD::numberOfInnermostPixelLayerSharedEndcapHits ) ?
340 float( iInnerMostPixelSharedEndcapHits ) : -9999.;
341 }
342 inline float getNInnerMostPixelSharedEndcapHits( const xAOD::TruthParticle& ) { return -9999.; }
343 template< class U >
344 inline float nInnerMostPixelSharedEndcapHits( const U& p ) { return getNInnerMostPixelSharedEndcapHits( p ); }
345
347 inline float getNPixelHits( const xAOD::TrackParticle& p ) {
348 uint8_t iPixelHits(0);
349 return p.summaryValue( iPixelHits, xAOD::numberOfPixelHits ) ?
350 float( iPixelHits ) : -9999.;
351 }
352 inline float getNPixelHits( const xAOD::TruthParticle& ) { return -9999.; }
353 template< class U >
354 inline float nPixelHits( const U& p ) { return getNPixelHits( p ); }
355
357 inline float getNPixelHoles( const xAOD::TrackParticle& p ) {
358 uint8_t iPixHoles(0);
359 return p.summaryValue( iPixHoles, xAOD::numberOfPixelHoles ) ?
360 float( iPixHoles ) : -9999.;
361 }
362 inline float getNPixelHoles( const xAOD::TruthParticle& ) { return -9999.; }
363 template< class U >
364 inline float nPixelHoles( const U& p ) { return getNPixelHoles( p ); }
365
367 inline float getNPixelSharedHits( const xAOD::TrackParticle& p ) {
368 uint8_t iPixelShared(0);
369 return p.summaryValue( iPixelShared, xAOD::numberOfPixelSharedHits ) ?
370 float( iPixelShared ) : -9999.;
371 }
372 inline float getNPixelSharedHits( const xAOD::TruthParticle& ) { return -9999.; }
373 template< class U >
374 inline float nPixelSharedHits( const U& p ) { return getNPixelSharedHits( p ); }
375
377 inline float getPixeldEdx( const xAOD::TrackParticle& p ) {
378 float iPixeldEdx(0);
379 return p.summaryValue( iPixeldEdx, xAOD::pixeldEdx ) ? iPixeldEdx : -9999.;
380 }
381 inline float getPixeldEdx( const xAOD::TruthParticle& ) { return -9999.; }
382 template< class U >
383 inline float pixeldEdx( const U& p ) { return getPixeldEdx( p ); }
384
386 inline float getNSCTHits( const xAOD::TrackParticle& p ) {
387 uint8_t iSctHits(0);
388 return p.summaryValue( iSctHits, xAOD::numberOfSCTHits ) ?
389 float( iSctHits ) : -9999.;
390 }
391 inline float getNSCTHits( const xAOD::TruthParticle& ) { return -9999.; }
392 template< class U >
393 inline float nSCTHits( const U& p ) { return getNSCTHits( p ); }
394
396 inline float getNSCTHoles( const xAOD::TrackParticle& p ) {
397 uint8_t iSctHoles(0);
398 return p.summaryValue( iSctHoles, xAOD::numberOfSCTHoles ) ?
399 float( iSctHoles ) : -9999.;
400 }
401 inline float getNSCTHoles( const xAOD::TruthParticle& ) { return -9999.; }
402 template< class U >
403 inline float nSCTHoles( const U& p ) { return getNSCTHoles( p ); }
404
406 inline float getNSCTSharedHits( const xAOD::TrackParticle& p ) {
407 uint8_t iSCTShared(0);
408 return p.summaryValue( iSCTShared, xAOD::numberOfSCTSharedHits ) ?
409 float( iSCTShared ) : -9999.;
410 }
411 inline float getNSCTSharedHits( const xAOD::TruthParticle& ) { return -9999.; }
412 template< class U >
413 inline float nSCTSharedHits( const U& p ) { return getNSCTSharedHits( p ); }
414
416 inline float getNSiHits( const xAOD::TrackParticle& p ) {
417 if( nPixelHits(p)<0 or nSCTHits(p)<0 ) return -9999.;
418 float pnPixelHits = ( nPixelHits(p) >= 0 ) ? nPixelHits(p) : 0.;
419 float pnSCTHits = ( nSCTHits(p) >= 0 ) ? nSCTHits(p) : 0.;
420 return ( pnPixelHits + pnSCTHits );
421 }
422 inline float getNSiHits( const xAOD::TruthParticle& p ) {
423 static thread_local SG::ConstAccessor<float> prodNSiHits( "nSilHits" );
424 return prodNSiHits.isAvailable(p) ? prodNSiHits(p) : -9999.;
425 }
426 template< class U >
427 inline float nSiHits( const U& p ) { return getNSiHits( p ); }
428
430 template< class U >
431 inline float nSiHoles( const U& p ) {
432 if( nPixelHoles(p)<0 or nSCTHoles(p)<0 ) return -9999.;
433 float pnPixelHoles = ( nPixelHoles(p) >= 0 ) ? nPixelHoles(p) : 0.;
434 float pnSCTHoles = ( nSCTHoles(p) >= 0 ) ? nSCTHoles(p) : 0.;
435 return ( pnPixelHoles + pnSCTHoles );
436 }
437
439 inline float getNTRTHits( const xAOD::TrackParticle& p ) {
440 uint8_t iTrtHits(0);
441 return p.summaryValue( iTrtHits, xAOD::numberOfTRTHits ) ?
442 float( iTrtHits ) : -9999.;
443 }
444 inline float getNTRTHits( const xAOD::TruthParticle& ) { return -9999.; }
445 template< class U >
446 inline float nTRTHits( const U& p ) { return getNTRTHits( p ); }
447
449 inline float getNTRTHitsXe( const xAOD::TrackParticle& p ) {
450 uint8_t iTrtHitsXe(0);
451 return p.summaryValue( iTrtHitsXe, xAOD::numberOfTRTXenonHits ) ?
452 float( iTrtHitsXe ) : -9999.;
453 }
454 inline float getNTRTHitsXe( const xAOD::TruthParticle& ) { return -9999.; }
455 template< class U >
456 inline float nTRTHitsXe( const U& p ) { return getNTRTHitsXe( p ); }
457
459 inline float getNTRTHitsAr( const xAOD::TrackParticle& p ) {
460 if( nTRTHits(p)<0 or nTRTHitsXe(p)<0 ) return -9999.;
461 float pnTRTHits = ( nTRTHits(p) >= 0 ) ? nTRTHits(p) : 0.;
462 float pnTRTHitsXe = ( nTRTHitsXe(p) >= 0 ) ? nTRTHitsXe(p) : 0.;
463 return ( pnTRTHits - pnTRTHitsXe );
464 }
465 inline float getNTRTHitsAr( const xAOD::TruthParticle& ) { return -9999.; }
466 template< class U >
467 inline float nTRTHitsAr( const U& p ) { return getNTRTHitsAr( p ); }
468
471 uint8_t iTrtHighThresholdHits(0);
472 return p.summaryValue( iTrtHighThresholdHits, xAOD::numberOfTRTHighThresholdHitsTotal ) ?
473 float( iTrtHighThresholdHits ) : -9999.;
474 }
475 inline float getNTRTHighThresholdHits( const xAOD::TruthParticle& ) { return -9999.; }
476 template< class U >
477 inline float nTRTHighThresholdHits( const U& p ) { return getNTRTHighThresholdHits( p ); }
478
481 uint8_t iTrtHighThresholdHitsXe(0);
482 return p.summaryValue( iTrtHighThresholdHitsXe, xAOD::numberOfTRTHighThresholdHits ) ?
483 float( iTrtHighThresholdHitsXe ) : -9999.;
484 }
485 inline float getNTRTHighThresholdHitsXe( const xAOD::TruthParticle& ) { return -9999.; }
486 template< class U >
487 inline float nTRTHighThresholdHitsXe( const U& p ) { return getNTRTHighThresholdHitsXe( p ); }
488
491 if( nTRTHighThresholdHits(p)<0 or nTRTHighThresholdHitsXe(p)<0 ) return -9999.;
492 float pnTRTHighThresholdHits = ( nTRTHighThresholdHits(p) >= 0 ) ? nTRTHighThresholdHits(p) : 0.;
493 float pnTRTHighThresholdHitsXe = ( nTRTHighThresholdHitsXe(p) >= 0 ) ? nTRTHighThresholdHitsXe(p) : 0.;
494 return ( pnTRTHighThresholdHits - pnTRTHighThresholdHitsXe );
495 }
496 inline float getNTRTHighThresholdHitsAr( const xAOD::TruthParticle& ) { return -9999.; }
497 template< class U >
498 inline float nTRTHighThresholdHitsAr( const U& p ) { return getNTRTHighThresholdHitsAr( p ); }
499
500 //EXPERT PLOTS
501
504 uint8_t iInnerMostPixelOutliers(0);
505 return p.summaryValue( iInnerMostPixelOutliers, xAOD::numberOfInnermostPixelLayerOutliers ) ?
506 float( iInnerMostPixelOutliers ) : -9999.;
507 }
508 inline float getNInnerMostPixelOutliers( const xAOD::TruthParticle& ) { return -9999.; }
509 template< class U >
510 inline float nInnerMostPixelOutliers( const U& p ) { return getNInnerMostPixelOutliers( p ); }
511
512
513
516 uint8_t iInnerMostPixelEndcapOutliers(0);
517 return p.summaryValue( iInnerMostPixelEndcapOutliers, xAOD::numberOfInnermostPixelLayerEndcapOutliers ) ?
518 float( iInnerMostPixelEndcapOutliers ) : -9999.;
519 }
520 inline float getNInnerMostPixelEndcapOutliers( const xAOD::TruthParticle& ) { return -9999.; }
521 template< class U >
522 inline float nInnerMostPixelEndcapOutliers( const U& p ) { return getNInnerMostPixelEndcapOutliers( p ); }
523
524
525
528 uint8_t iInnerMostPixelSplitHits(0);
529 return p.summaryValue( iInnerMostPixelSplitHits, xAOD::numberOfPixelSplitHits ) ?
530 float( iInnerMostPixelSplitHits ) : -9999.;
531 }
532 inline float getNInnerMostPixelSplitHits( const xAOD::TruthParticle& ) { return -9999.; }
533 template< class U >
534 inline float nInnerMostPixelSplitHits( const U& p ) { return getNInnerMostPixelSplitHits( p ); }
535
536
537
540 uint8_t iInnerMostPixelSplitEndcapHits(0);
541 return p.summaryValue( iInnerMostPixelSplitEndcapHits, xAOD::numberOfInnermostPixelLayerSplitEndcapHits ) ?
542 float( iInnerMostPixelSplitEndcapHits ) : -9999.;
543 }
544 inline float getNInnerMostPixelSplitEndcapHits( const xAOD::TruthParticle& ) { return -9999.; }
545 template< class U >
546 inline float nInnerMostPixelSplitEndcapHits( const U& p ) { return getNInnerMostPixelSplitEndcapHits( p ); }
547
548
549
552 uint8_t iNExpectedInnerMostPixelHits(0);
553 return p.summaryValue( iNExpectedInnerMostPixelHits, xAOD::expectInnermostPixelLayerHit ) ?
554 float( iNExpectedInnerMostPixelHits ) : -9999.;
555 }
556 inline float getNExpectedInnerMostPixelHits( const xAOD::TruthParticle& ) { return -9999.; }
557 template< class U >
558 inline float nExpectedInnerMostPixelHits( const U& p ) { return getNExpectedInnerMostPixelHits( p ); }
559
560
561
564 uint8_t iNExpectedNextToInnerMostPixelHits(0);
565 return p.summaryValue( iNExpectedNextToInnerMostPixelHits, xAOD::expectNextToInnermostPixelLayerHit ) ?
566 float( iNExpectedNextToInnerMostPixelHits ) : -9999.;
567 }
568 inline float getNExpectedNextToInnerMostPixelHits( const xAOD::TruthParticle& ) { return -9999.; }
569 template< class U >
571
572
573
575 inline float getNPixelOutliers( const xAOD::TrackParticle& p ) {
576 uint8_t iNPixelOutliers(0);
577 return p.summaryValue( iNPixelOutliers, xAOD::numberOfPixelOutliers ) ?
578 float( iNPixelOutliers ) : -9999.;
579 }
580 inline float getNPixelOutliers( const xAOD::TruthParticle& ) { return -9999.; }
581 template< class U >
582 inline float nPixelOutliers( const U& p ) { return getNPixelOutliers( p ); }
583
584
585
588 uint8_t iNPixelContribLayers(0);
589 return p.summaryValue( iNPixelContribLayers, xAOD::numberOfContribPixelLayers ) ?
590 float( iNPixelContribLayers ) : -9999.;
591 }
592 inline float getNPixelContribLayers( const xAOD::TruthParticle& ) { return -9999.; }
593 template< class U >
594 inline float nPixelContribLayers( const U& p ) { return getNPixelContribLayers( p ); }
595
596
597
599 inline float getNPixelSplitHits( const xAOD::TrackParticle& p ) {
600 uint8_t iNPixelSplitHits(0);
601 return p.summaryValue( iNPixelSplitHits, xAOD::numberOfPixelSplitHits ) ?
602 float( iNPixelSplitHits ) : -9999.;
603 }
604 inline float getNPixelSplitHits( const xAOD::TruthParticle& ) { return -9999.; }
605 template< class U >
606 inline float nPixelSplitHits( const U& p ) { return getNPixelSplitHits( p ); }
607
608
609
611 inline float getNPixelGangedHits( const xAOD::TrackParticle& p ) {
612 uint8_t iNPixelGangedHits(0);
613 return p.summaryValue( iNPixelGangedHits, xAOD::numberOfGangedPixels ) ?
614 float( iNPixelGangedHits ) : -9999.;
615 }
616 inline float getNPixelGangedHits( const xAOD::TruthParticle& ) { return -9999.; }
617 template< class U >
618 inline float nPixelGangedHits( const U& p ) { return getNPixelGangedHits( p ); }
619
620
621
624 uint8_t iNPixelGangedHitsFlaggedFakes(0);
625 return p.summaryValue( iNPixelGangedHitsFlaggedFakes, xAOD::numberOfGangedFlaggedFakes ) ?
626 float( iNPixelGangedHitsFlaggedFakes ) : -9999.;
627 }
628 inline float getNPixelGangedHitsFlaggedFakes( const xAOD::TruthParticle& ) { return -9999.; }
629 template< class U >
630 inline float nPixelGangedHitsFlaggedFakes( const U& p ) { return getNPixelGangedHitsFlaggedFakes( p ); }
631
632
633
635 inline float getNPixelDeadSensors( const xAOD::TrackParticle& p ) {
636 uint8_t iNPixelDeadSensors(0);
637 return p.summaryValue( iNPixelDeadSensors, xAOD::numberOfPixelDeadSensors ) ?
638 float( iNPixelDeadSensors ) : -9999.;
639 }
640 inline float getNPixelDeadSensors( const xAOD::TruthParticle& ) { return -9999.; }
641 template< class U >
642 inline float nPixelDeadSensors( const U& p ) { return getNPixelDeadSensors( p ); }
643
644
645
647 inline float getNSCTOutliers( const xAOD::TrackParticle& p ) {
648 uint8_t iNSCTOutliers(0);
649 return p.summaryValue( iNSCTOutliers, xAOD::numberOfSCTOutliers ) ?
650 float( iNSCTOutliers ) : -9999.;
651 }
652 inline float getNSCTOutliers( const xAOD::TruthParticle& ) { return -9999.; }
653 template< class U >
654 inline float nSCTOutliers( const U& p ) { return getNSCTOutliers( p ); }
655
656
657
659 inline float getNSCTDoubleHoles( const xAOD::TrackParticle& p ) {
660 uint8_t iNSCTDoubleHoles(0);
661 return p.summaryValue( iNSCTDoubleHoles, xAOD::numberOfSCTDoubleHoles ) ?
662 float( iNSCTDoubleHoles ) : -9999.;
663 }
664 inline float getNSCTDoubleHoles( const xAOD::TruthParticle& ) { return -9999.; }
665 template< class U >
666 inline float nSCTDoubleHoles( const U& p ) { return getNSCTDoubleHoles( p ); }
667
668
669
671 inline float getNSCTDeadSensors( const xAOD::TrackParticle& p ) {
672 uint8_t iNSCTDeadSensors(0);
673 return p.summaryValue( iNSCTDeadSensors, xAOD::numberOfSCTDeadSensors ) ?
674 float( iNSCTDeadSensors ) : -9999.;
675 }
676 inline float getNSCTDeadSensors( const xAOD::TruthParticle& ) { return -9999.; }
677 template< class U >
678 inline float nSCTDeadSensors( const U& p ) { return getNSCTDeadSensors( p ); }
679
680
681
682
683} // namespace IDTPM
684
685#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