|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef INDETTRACKPERFMON_TRKPARAMETERSHELPER_H
6 #define INDETTRACKPERFMON_TRKPARAMETERSHELPER_H
33 inline float pT(
const U&
p ) {
return p.pt(); }
38 return p.charge() ? std::copysign(
pT(
p),
p.charge() ) : 0.;
43 inline float eta(
const U&
p ) {
return p.eta(); }
49 return (thetaAcc.isAvailable(
p)) ? thetaAcc(
p) : -9999.;
58 return (phiAcc.isAvailable(
p)) ? phiAcc(
p) : -9999.;
69 return (z0Acc.isAvailable(
p)) ? z0Acc(
p) : -9999.;
72 inline float z0(
const U&
p ) {
return getZ0(
p ); }
81 return (d0Acc.isAvailable(
p)) ? d0Acc(
p) : -9999.;
84 inline float d0(
const U&
p ) {
return getD0(
p ); }
90 return (prodRAcc.isAvailable(
p)) ? prodRAcc(
p) : -9999.;
99 return (prodZAcc.isAvailable(
p)) ? prodZAcc(
p) : -9999.;
108 return (qOverPAcc.isAvailable(
p)) ? qOverPAcc(
p) : -9999.;
118 inline float eTot(
const U&
p ) {
return p.e(); }
122 inline float eT(
const U&
p ) {
return p.p4().Et(); }
138 std::vector< unsigned int > authorVec;
139 std::bitset< xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo > patternInfo =
p.patternRecoInfo();
141 if( patternInfo.test(
i) ) authorVec.push_back(
i);
163 return p.definingParametersCovMatrix()( par1, par2 ); }
167 return getCov(
p, par1, par2 ); }
178 return p.definingParametersCovMatrixVec(); }
191 return qOverPTerr2 > 0 ? std::sqrt( qOverPTerr2 ) : 0.;
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.");
205 if(
qOverP(
p) <= 0. )
return 0.;
206 float diff_qp = -
pT(
p) / std::fabs(
qOverP(
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.;
219 return std::fabs( etaErr ); }
230 return z0sinErr2 > 0. ? std::sqrt( z0sinErr2 ) : 0.;
237 template<
class U1,
class U2=U1 >
239 return p1.p4().DeltaPhi(
p2.p4() );
243 template<
class U1,
class U2=U1 >
249 template<
class U1,
class U2=U1 >
251 return p1.p4().DeltaR(
p2.p4() );
288 uint8_t iInnerMostPixelHits(0);
290 float( iInnerMostPixelHits ) : -9999.;
298 uint8_t iInnerMostPixelEndcapHits(0);
300 float( iInnerMostPixelEndcapHits ) : -9999.;
308 uint8_t iNextToInnerMostPixelHits(0);
310 float( iNextToInnerMostPixelHits ) : -9999.;
318 uint8_t iNextToInnerMostPixelEndcapHits(0);
320 float( iNextToInnerMostPixelEndcapHits ) : -9999.;
328 uint8_t iInnerMostPixelSharedHits(0);
330 float( iInnerMostPixelSharedHits ) : -9999.;
338 uint8_t iInnerMostPixelSharedEndcapHits(0);
340 float( iInnerMostPixelSharedEndcapHits ) : -9999.;
350 float( iPixelHits ) : -9999.;
360 float( iPixHoles ) : -9999.;
370 float( iPixelShared ) : -9999.;
389 float( iSctHits ) : -9999.;
399 float( iSctHoles ) : -9999.;
409 float( iSCTShared ) : -9999.;
420 return ( pnPixelHits + pnSCTHits );
424 return prodNSiHits.isAvailable(
p) ? prodNSiHits(
p) : -9999.;
435 return ( pnPixelHoles + pnSCTHoles );
442 float( iTrtHits ) : -9999.;
452 float( iTrtHitsXe ) : -9999.;
463 return ( pnTRTHits - pnTRTHitsXe );
471 uint8_t iTrtHighThresholdHits(0);
473 float( iTrtHighThresholdHits ) : -9999.;
481 uint8_t iTrtHighThresholdHitsXe(0);
483 float( iTrtHighThresholdHitsXe ) : -9999.;
494 return ( pnTRTHighThresholdHits - pnTRTHighThresholdHitsXe );
502 #endif // > ! INDETTRACKPERFMON_TRKPARAMETERSHELPER_H
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
float getNSiHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nSiHits.
float nNextToInnerMostPixelEndcapHits(const U &p)
float getNTRTHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHits.
std::vector< unsigned int > getAuthor(const xAOD::TrackParticle &p)
Accessor utility function for getting the track author.
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
float getNInnerMostPixelEndcapHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nInnerMostPixelEndcapHits.
std::vector< float > covVec(const U &p)
float pixeldEdx(const U &p)
float getNTRTHitsAr(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHitsAr.
Utility methods to access reco/truth vertices parmeters in a consitent way across this package.
float getPhi(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of phi.
@ numberOfInnermostPixelLayerSharedEndcapHits
number of Pixel 0th layer endcap hits shared by several tracks.
float nPixelHoles(const U &p)
float getNSCTHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nSCTHits.
@ numberOfTRTXenonHits
number of TRT hits on track in straws with xenon [unit8_t].
float isHadron(const U &p)
uint8_t getHasValidTime(const xAOD::TrackParticle &p)
Accessor utility function for getting the track hasValidTime.
float getProdZ(const xAOD::TrackParticle &)
Accessor utility function for getting the value of Z.
float getNPixelHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nPixelHits.
float getQOverPTError(const xAOD::TrackParticle &p)
Accessor utility function for getting the QOverPt error.
float getNSCTHoles(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nSCTHoles.
float getNInnerMostPixelSharedEndcapHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nInnerMostPixelSharedEndcapHits.
float nInnerMostPixelSharedHits(const U &p)
float getPixeldEdx(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of pixeldEdx.
float getNTRTHighThresholdHitsXe(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHighThresholdHitsXe.
float getTime(const xAOD::TrackParticle &p)
Accessor utility function for getting the track time.
float nTRTHitsAr(const U &p)
float getNNextToInnerMostPixelHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nNextToInnerMostPixelHits.
float getNTRTHighThresholdHitsAr(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHighThresholdHitsAr.
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
float pTsig(const U &p)
Accessor utility function for getting the value of signed pT.
@ numberOfTRTHits
number of TRT hits [unit8_t].
float eTot(const U &p)
Accessor utility function for getting the value of Energy.
float nPixelHits(const U &p)
float getCov(const xAOD::TrackParticle &p, Trk::ParamDefs par1, Trk::ParamDefs par2)
Accessor utility function for getting the track parameters covariance.
float getQoverP(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of qOverP.
int truthType(const U &p)
float pTError(const U &p)
float nSiHoles(const U &p)
Accessor utility function for getting the value of nSiHoles.
float nTRTHighThresholdHitsXe(const U &p)
@ numberOfTRTHighThresholdHits
number of TRT hits which pass the high threshold (only xenon counted) [unit8_t].
@ numberOfTRTHighThresholdHitsTotal
total number of TRT hits which pass the high threshold [unit8_t].
float getNNextToInnerMostPixelEndcapHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nNextToInnerMostPixelEndcapHits.
float z0SinTheta(const U &p)
float nSCTSharedHits(const U &p)
float getError(const xAOD::TrackParticle &p, Trk::ParamDefs par)
Accessor utility function for getting the track parameters error.
int truthOrigin(const U &p)
float getNSCTSharedHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nSCTSharedHits.
float getNInnerMostPixelHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nInnerMostPixelHits.
@ numberOfInnermostPixelLayerEndcapHits
these are the hits in the 0th pixel layer endcap [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
float cov(const U &p, Trk::ParamDefs par1, Trk::ParamDefs par2)
float getIsPion(const xAOD::TrackParticle &)
Accessor utility function for getting the value of isPion.
float qOverPT(const U &p)
float eT(const U &p)
Accessor utility function for getting the value of Tranverse energy.
float eta(const U &p)
Accessor utility function for getting the value of eta.
float nSCTHits(const U &p)
float nTRTHits(const U &p)
Class describing a truth particle in the MC record.
float nTRTHitsXe(const U &p)
float getEtaError(const xAOD::TrackParticle &p)
Accessor utility function for getting the Eta error.
float deltaEta(const U1 &p1, const U2 &p2)
Accessor utility function for getting the DeltaEta betwen two tracks.
float pT(const U &p)
Accessor utility function for getting the value of pT.
float deltaR(const U1 &p1, const U2 &p2)
Accessor utility function for getting the DeltaR betwen two tracks.
@ numberOfSCTHoles
number of SCT holes [unit8_t].
float nSCTHoles(const U &p)
float deltaPhi(const U1 &p1, const U2 &p2)
Accessor utility function for getting the DeltaPhi betwen two tracks.
float getZ0(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of z0.
@ numberOfNextToInnermostPixelLayerEndcapHits
these are the hits in the 0.5th and 1st pixel layer endcap rings [unit8_t].
float nTRTHighThresholdHitsAr(const U &p)
float getIsHadron(const xAOD::TrackParticle &)
Accessor utility function for getting the value of isHadron.
float z0SinThetaError(const U &p)
float qOverPTError(const U &p)
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
float nInnerMostPixelEndcapHits(const U &p)
float etaError(const U &p)
float getChiSquared(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of chi^2.
float getPTError(const xAOD::TrackParticle &p)
Accessor utility function for getting the Pt error.
float getD0(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of d0.
float nInnerMostPixelSharedEndcapHits(const U &p)
float getProdR(const xAOD::TrackParticle &)
Accessor utility function for getting the value of R.
float getNPixelSharedHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nPixelSharedHits.
float chiSquared(const U &p)
@ pixeldEdx
the dE/dx estimate, calculated using the pixel clusters [?]
@ NumberOfTrackRecoInfo
maximum number of enums
float nPixelSharedHits(const U &p)
float getNPixelHoles(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nPixelHoles.
float getNTRTHitsXe(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHitsXe.
std::vector< float > getCovVec(const xAOD::TrackParticle &p)
Accessor utility function for getting the track parameters covariance vector.
float nInnerMostPixelHits(const U &p)
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
float getNInnerMostPixelSharedHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nInnerMostPixelSharedHits.
@ numberOfSCTHits
number of hits in SCT [unit8_t].
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
float error(const U &p, Trk::ParamDefs par)
int getTruthOrigin(const xAOD::TrackParticle &)
Accessor utility function for getting the value of truthOrigin.
float getNTRTHighThresholdHits(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of nTRTHighThresholdHits.
Class describing a TrackParticle.
uint8_t hasValidTime(const U &p)
float nTRTHighThresholdHits(const U &p)
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.
constexpr int pow(int base, int exp) noexcept
float getNdof(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of #dof.
float nNextToInnerMostPixelHits(const U &p)
float getTheta(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of theta.
float nSiHits(const U &p)
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
std::vector< unsigned int > author(const U &p)