ATLAS Offline Software
Enumerations | Functions
Pmt Namespace Reference

Enumerations

enum  ParamDefs {
  d0 = 0, z0 = 1, phi0 = 2, theta = 3,
  qOverP = 4, x = 0, y = 1, z = 2
}
 This file defines the parameter enums in the Trk namespace. More...
 

Functions

Eigen::Vector3d getPosition (const xAOD::TrackParticle &trk)
 
double getSigmaD0 (const xAOD::TrackParticle &trk, const Eigen::Matrix2d &vtxCov)
 
double getSigmaD0 (const xAOD::TrackParticle &trk, const xAOD::Vertex &vtx)
 
double getSigmaD0WithRespectToBeamspot (const xAOD::TrackParticle &trk, const xAOD::EventInfo &evt)
 
double getSigmaZ0SinTheta (const xAOD::TrackParticle &trk, double vxZCov)
 
double getSigmaZ0SinTheta (const xAOD::TrackParticle &trk, const xAOD::Vertex &vtx)
 

Enumeration Type Documentation

◆ ParamDefs

This file defines the parameter enums in the Trk namespace.

Note that the enums refer to the [] operator and not to the () operator which makes a big difference in classes inherited or used from CLHEP. CLHEP::HepVector and not CLHEP::Hep2Vector is taken, as CLHEP::Hep2Vector provides additional functions like x(), y(), phi() which might be meaningless when using specific natural detector frames.

Usage examples:

  • Access the y-coordinate of the cartesian local frame:
    LocalPosition locpos(2.3, 4.5);
    double x = locpos[Trk::locX];
  • Access the eta-value of a track state on a surface (Tsos):
    double theEta = Tsos[Trk::eta]
  • Access the eta-value of a track state on a surface (Tsos):
    double theEta = Tsos[Trk::eta]
Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch
Enumerator
d0 
z0 
phi0 
theta 
qOverP 

Definition at line 26 of file PoorMansIpAugmenterAlg.cxx.

26  {
27  // Track defining parameters
28  d0 = 0,
29  z0 = 1,
30  phi0 = 2,
31  theta = 3,
32  qOverP = 4,
33  // Cartesian
34  x = 0,
35  y = 1,
36  z = 2,
37  };

Function Documentation

◆ getPosition()

Eigen::Vector3d Pmt::getPosition ( const xAOD::TrackParticle trk)

Definition at line 43 of file PoorMansIpAugmenterAlg.cxx.

44  {
45  double d0 = trk.d0();
46  double phi = trk.phi();
47  return Amg::Vector3D(
48  d0 * -std::sin(phi),
49  d0 * std::cos(phi),
50  trk.z0());
51  }

◆ getSigmaD0() [1/2]

double Pmt::getSigmaD0 ( const xAOD::TrackParticle trk,
const Eigen::Matrix2d &  vtxCov 
)

Definition at line 55 of file PoorMansIpAugmenterAlg.cxx.

56  {
57 
58  // start with the track part
59  double trackComponent = trk.definingParametersCovMatrixDiagVec().at(
60  Pmt::d0);
61 
62  // now do the vertex part
63  double phi = trk.phi();
64  // The sign seems inverted below, but maybe that doesn't
65  // matter. I'm just following TrackToVertexIPEstimator...
66  Eigen::Vector2d vtxJacobian(-std::sin(phi), std::cos(phi));
67  double vertexComponent = vtxJacobian.transpose()*vtxCov*vtxJacobian;
68 
69  return std::sqrt(trackComponent + vertexComponent);
70 
71  }

◆ getSigmaD0() [2/2]

double Pmt::getSigmaD0 ( const xAOD::TrackParticle trk,
const xAOD::Vertex vtx 
)

Definition at line 73 of file PoorMansIpAugmenterAlg.cxx.

74  {
75 
76  // first two elements of the vertex covariance is xy
77  Eigen::Matrix2d vtxCov = vtx.covariancePosition().block<2,2>(0,0);
78  return getSigmaD0(trk, vtxCov);
79 
80  }

◆ getSigmaD0WithRespectToBeamspot()

double Pmt::getSigmaD0WithRespectToBeamspot ( const xAOD::TrackParticle trk,
const xAOD::EventInfo evt 
)

Definition at line 82 of file PoorMansIpAugmenterAlg.cxx.

83  {
84  Eigen::Matrix2d bsCov;
85  // based on what I read in the beamspot code [1] and some code
86  // that copies it to the EventInfo [2] I'm pretty sure the
87  // beamPosSigmaX and beamPosSigmaY need to be squared in the
88  // covariance matrix, whereas beamPosSigmaXY does not.
89  //
90  // [1]: https://acode-browser1.usatlas.bnl.gov/lxr/source/athena/InnerDetector/InDetConditions/BeamSpotConditionsData/src/BeamSpotData.cxx
91  // [2]: https://acode-browser1.usatlas.bnl.gov/lxr/source/athena/Simulation/BeamEffects/src/BeamSpotFixerAlg.cxx#0068
92  bsCov(0, 0) = std::pow(evt.beamPosSigmaX(),2);
93  bsCov(0, 1) = evt.beamPosSigmaXY();
94  bsCov(1, 0) = evt.beamPosSigmaXY();
95  bsCov(1, 1) = std::pow(evt.beamPosSigmaY(),2);
96  return getSigmaD0(trk, bsCov);
97  }

◆ getSigmaZ0SinTheta() [1/2]

double Pmt::getSigmaZ0SinTheta ( const xAOD::TrackParticle trk,
const xAOD::Vertex vtx 
)

Definition at line 122 of file PoorMansIpAugmenterAlg.cxx.

123  {
124  double vxZCov = vtx.covariancePosition()(Pmt::z,Pmt::z);
125  return getSigmaZ0SinTheta(trk, vxZCov);
126  }

◆ getSigmaZ0SinTheta() [2/2]

double Pmt::getSigmaZ0SinTheta ( const xAOD::TrackParticle trk,
double  vxZCov 
)

Definition at line 100 of file PoorMansIpAugmenterAlg.cxx.

101  {
102 
103  // first do the track part
104  const auto& fullCov = trk.definingParametersCovMatrix();
105  Eigen::Matrix2d trkCov;
106  trkCov(0,0)=fullCov(Pmt::z0, Pmt::z0);
107  trkCov(0,1)=fullCov(Pmt::z0, Pmt::theta);
108  trkCov(1,0)=fullCov(Pmt::theta, Pmt::z0);
109  trkCov(1,1)=fullCov(Pmt::theta, Pmt::theta);
110  double theta = trk.theta();
111  Eigen::Vector2d trkJacobian(
112  std::sin(theta),
113  trk.z0()*std::cos(theta));
114  double trackComponent = trkJacobian.transpose()*trkCov*trkJacobian;
115 
116  // now do the vertex part
117  double vertexComponent = std::sin(theta)*vxZCov*std::sin(theta);
118 
119  return std::sqrt(trackComponent + vertexComponent);
120 
121  }
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
Pmt::theta
@ theta
Definition: PoorMansIpAugmenterAlg.cxx:31
Pmt::z
@ z
Definition: PoorMansIpAugmenterAlg.cxx:36
Pmt::z0
@ z0
Definition: PoorMansIpAugmenterAlg.cxx:29
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
xAOD::TrackParticle_v1::z0
float z0() const
Returns the parameter.
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
x
#define x
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
z
#define z
Pmt::qOverP
@ qOverP
Definition: PoorMansIpAugmenterAlg.cxx:32
xAOD::TrackParticle_v1::definingParametersCovMatrix
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:246
Pmt::d0
@ d0
Definition: PoorMansIpAugmenterAlg.cxx:28
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Pmt::getSigmaD0
double getSigmaD0(const xAOD::TrackParticle &trk, const xAOD::Vertex &vtx)
Definition: PoorMansIpAugmenterAlg.cxx:73
Pmt::getSigmaZ0SinTheta
double getSigmaZ0SinTheta(const xAOD::TrackParticle &trk, const xAOD::Vertex &vtx)
Definition: PoorMansIpAugmenterAlg.cxx:122
xAOD::TrackParticle_v1::definingParametersCovMatrixDiagVec
const std::vector< float > & definingParametersCovMatrixDiagVec() const
Returns the diagonal elements of the defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:375
y
#define y
Pmt::phi0
@ phi0
Definition: PoorMansIpAugmenterAlg.cxx:30
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
xAOD::TrackParticle_v1::theta
float theta() const
Returns the parameter, which has range 0 to .
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)