ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::TrackingDetails Namespace Reference

Typedefs

using GenVecFourMom_t = ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> >
 Base 4 Momentum type for TrackParticle.

Enumerations

enum  covMatrixIndex {
  d0_index =0 , z0_index =1 , phi_index =2 , th_index =3 ,
  qp_index =4
}

Functions

float charge (float qOverP)
GenVecFourMom_t genvecP4 (float qOverP, float thetaT, float phiT, double m)
bool definingParametersCovMatrixOffDiagCompr (std::span< const float > covMatrixOffDiag)
xAOD::ParametersCovMatrix_t definingParametersCovMatrix (std::span< const float > covMatrixDiag, std::span< const float > covMatrixOffDiag, bool &valid)

Variables

constexpr std::size_t COVMATRIX_OFFDIAG_VEC_COMPR_SIZE = 6
constexpr std::array< std::pair< covMatrixIndex, covMatrixIndex >, COVMATRIX_OFFDIAG_VEC_COMPR_SIZEcovMatrixComprIndexPairs

Typedef Documentation

◆ GenVecFourMom_t

using xAOD::TrackingDetails::GenVecFourMom_t = ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> >

Base 4 Momentum type for TrackParticle.

Definition at line 38 of file TrackingDetails.h.

Enumeration Type Documentation

◆ covMatrixIndex

Enumerator
d0_index 
z0_index 
phi_index 
th_index 
qp_index 

Definition at line 40 of file TrackingDetails.h.

Function Documentation

◆ charge()

float xAOD::TrackingDetails::charge ( float qOverP)
inlinenodiscard

Definition at line 47 of file TrackingDetails.h.

47 {
48 return (qOverP > 0) ? 1 : ((qOverP < 0) ? -1 : 0);
49 }

◆ definingParametersCovMatrix()

xAOD::ParametersCovMatrix_t xAOD::TrackingDetails::definingParametersCovMatrix ( std::span< const float > covMatrixDiag,
std::span< const float > covMatrixOffDiag,
bool & valid )
inlinenodiscard

Definition at line 74 of file TrackingDetails.h.

74 {
75
76 // Set up the result matrix.
77 xAOD::ParametersCovMatrix_t cov;
78 cov.setZero();
79 valid = true;
80
81 // Set the diagonal elements of the matrix.
82 if( ( static_cast< int >( covMatrixDiag.size() ) == cov.rows() ) ) {
83
84 // Access the "raw" variable.
85 // Set the diagonal elements using the raw variable.
86 for( int i = 0; i < cov.rows(); ++i ) {
87 cov( i, i ) = covMatrixDiag[ i ];
88 }
89 } else {
90 valid = false;
91 // If the variable is not available/set, set the matrix to identity.
92 cov.setIdentity();
93 }
94
95 bool offDiagCompr = definingParametersCovMatrixOffDiagCompr(covMatrixOffDiag);
96
97 // Set the off-diagonal elements of the matrix.
98 if(!offDiagCompr){
99
100 if( ( static_cast< int >( covMatrixOffDiag.size() ) == ( ( ( cov.rows() - 1 ) * cov.rows() ) / 2 ) ) ) {
101
102 // Set the off-diagonal elements using the raw variable.
103 std::size_t vecIndex = 0;
104 for( int i = 1; i < cov.rows(); ++i ) {
105 for( int j = 0; j < i; ++j, ++vecIndex ) {
106 float offDiagCoeff = cov(i,i)>0 && cov(j,j)>0 ? covMatrixOffDiag[vecIndex]*sqrt(cov(i,i)*cov(j,j)) : 0;
107 cov.fillSymmetric( i, j, offDiagCoeff );
108 }
109 }
110 }
111
112 else valid = false;
113
114 }
115
116 else{ //Compressed case
117
118 if( ( static_cast< int >( covMatrixOffDiag.size() ) == COVMATRIX_OFFDIAG_VEC_COMPR_SIZE ) ) {
119 // Set the off-diagonal elements using the raw variable.
120
121 const auto& vecPairIndex = covMatrixComprIndexPairs;
122
123 for(unsigned int k=0; k<COVMATRIX_OFFDIAG_VEC_COMPR_SIZE; ++k){
124 std::pair<covMatrixIndex,covMatrixIndex> pairIndex = vecPairIndex[k];
125 covMatrixIndex i = pairIndex.first;
126 covMatrixIndex j = pairIndex.second;
127 float offDiagCoeff = cov(i,i)>0 && cov(j,j)>0 ? covMatrixOffDiag[k]*sqrt(cov(i,i)*cov(j,j)) : 0;
128 cov.fillSymmetric( i, j, offDiagCoeff );
129 }
130
131 }
132
133 else valid = false;
134
135 }
136
137
138 // Return the filled matrix.
139 return cov;
140
141 }
list valid
Definition calibdata.py:44
bool definingParametersCovMatrixOffDiagCompr(std::span< const float > covMatrixOffDiag)
constexpr std::size_t COVMATRIX_OFFDIAG_VEC_COMPR_SIZE
constexpr std::array< std::pair< covMatrixIndex, covMatrixIndex >, COVMATRIX_OFFDIAG_VEC_COMPR_SIZE > covMatrixComprIndexPairs

◆ definingParametersCovMatrixOffDiagCompr()

bool xAOD::TrackingDetails::definingParametersCovMatrixOffDiagCompr ( std::span< const float > covMatrixOffDiag)
inlinenodiscard

Definition at line 65 of file TrackingDetails.h.

65 {
66
67 bool flag = false;
68 flag = (static_cast< int >(covMatrixOffDiag.size())==COVMATRIX_OFFDIAG_VEC_COMPR_SIZE);
69 return flag;
70 }

◆ genvecP4()

GenVecFourMom_t xAOD::TrackingDetails::genvecP4 ( float qOverP,
float thetaT,
float phiT,
double m )
inlinenodiscard

Definition at line 52 of file TrackingDetails.h.

52 {
53 using namespace std;
54 float p = 10.e6; // 10 TeV (default value for very high pt muons, with qOverP==0)
55 if (fabs(qOverP)>0.) p = 1/fabs(qOverP);
56 float sinTheta= sin(thetaT);
57 float px = p*sinTheta*cos(phiT);
58 float py = p*sinTheta*sin(phiT);
59 float pz = p*cos(thetaT);
60 return GenVecFourMom_t(px, py, pz, m);
61 }
STL namespace.
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzM4D< double > > GenVecFourMom_t
Base 4 Momentum type for TrackParticle.

Variable Documentation

◆ COVMATRIX_OFFDIAG_VEC_COMPR_SIZE

std::size_t xAOD::TrackingDetails::COVMATRIX_OFFDIAG_VEC_COMPR_SIZE = 6
constexpr

Definition at line 41 of file TrackingDetails.h.

◆ covMatrixComprIndexPairs

std::array< std::pair<covMatrixIndex,covMatrixIndex>, COVMATRIX_OFFDIAG_VEC_COMPR_SIZE > xAOD::TrackingDetails::covMatrixComprIndexPairs
constexpr