ATLAS Offline Software
Typedefs | Enumerations | Functions
MuonR4::SegmentFit Namespace Reference

Typedefs

using Parameters = AmgVector(toInt(ParamDefs::nPars))
 
using Covariance = AmgSymMatrix(toInt(ParamDefs::nPars))
 

Enumerations

enum  ParamDefs {
  ParamDefs::y0 = 0, ParamDefs::theta = 1, ParamDefs::x0 = 2, ParamDefs::phi = 3,
  ParamDefs::time = 4, ParamDefs::nPars
}
 This file defines the parameter enums in the Trk namespace. More...
 
enum  AxisDefs { AxisDefs::phi = 0, AxisDefs::eta = 1, AxisDefs::t0 = 2 }
 

Functions

constexpr int toInt (const ParamDefs p)
 
constexpr int toInt (const AxisDefs a)
 
std::pair< Amg::Vector3D, Amg::Vector3DmakeLine (const Parameters &pars)
 Returns the parsed parameters into an Eigen line parametrization. More...
 
std::string makeLabel (const Parameters &pars)
 
std::string toString (const Parameters &pars)
 
std::string toString (const ParamDefs par)
 
Amg::Vector3D dirFromTangents (const double tanPhi, const double tanTheta)
 Constructs a direction vector from tanPhi & tanTheta. More...
 
Amg::Vector3D dirFromAngles (const double phi, const double theta)
 Constructs a direction vector from the polar theta & phi angles. More...
 
Parameters localSegmentPars (const xAOD::MuonSegment &seg)
 Returns the localSegPars decoration from a xAODMuon::Segment. More...
 
Parameters localSegmentPars (const ActsGeometryContext &gctx, const Segment &segment)
 Returns the local segment parameters from a segment object. More...
 

Typedef Documentation

◆ Covariance

Definition at line 49 of file MuonHoughDefs.h.

◆ Parameters

Definition at line 48 of file MuonHoughDefs.h.

Enumeration Type Documentation

◆ AxisDefs

Enumerator
phi 
eta 
t0 

Definition at line 37 of file MuonHoughDefs.h.

37  {
38  phi = 0,
39  eta = 1,
40  t0 = 2,
41  };

◆ ParamDefs

This file defines the parameter enums in the Trk namespace.

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
y0 
theta 
x0 
phi 
time 
nPars 

Definition at line 29 of file MuonHoughDefs.h.

29  {
30  y0 = 0,
31  theta = 1,
32  x0 = 2,
33  phi = 3,
34  time = 4,
35  nPars
36  };

Function Documentation

◆ dirFromAngles()

Amg::Vector3D MuonR4::SegmentFit::dirFromAngles ( const double  phi,
const double  theta 
)

Constructs a direction vector from the polar theta & phi angles.

Parameters
phiPolar angle in the [x]-[y] plane
thetaAzimuthal angle mesured from the positive [z]-axis

Definition at line 26 of file SegmentFitterEventData.cxx.

26  {
27  const CxxUtils::sincos csPhi{phi}, csTheta{theta};
28  return Amg::Vector3D{csPhi.cs*csTheta.sn,csPhi.sn*csTheta.sn, csTheta.cs};
29  }

◆ dirFromTangents()

Amg::Vector3D MuonR4::SegmentFit::dirFromTangents ( const double  tanPhi,
const double  tanTheta 
)

Constructs a direction vector from tanPhi & tanTheta.

Parameters
tanPhiTangent of the [x] to [z] axis
tanThetaTangent of the [y] to [z] axis

Definition at line 23 of file SegmentFitterEventData.cxx.

23  {
24  return Amg::Vector3D(tanPhi, tanTheta, 1.).unit();
25  }

◆ localSegmentPars() [1/2]

Parameters MuonR4::SegmentFit::localSegmentPars ( const ActsGeometryContext gctx,
const Segment segment 
)

Returns the local segment parameters from a segment object.

Parameters
gctxGeometry context storing the local -> global transformation
segmentReference to the segment

Definition at line 40 of file SegmentFitterEventData.cxx.

41  {
43  const Amg::Transform3D globToLoc = segment.msSector()->globalToLocalTrans(gctx);
44  const Amg::Vector3D locPos = globToLoc * segment.position();
45  const Amg::Vector3D locDir = globToLoc.linear() * segment.direction();
46  pars[toInt(ParamDefs::x0)] = locPos.x();
47  pars[toInt(ParamDefs::y0)] = locPos.y();
48  pars[toInt(ParamDefs::theta)] = locDir.theta();
49  pars[toInt(ParamDefs::phi)] = locDir.phi();
50  pars[toInt(ParamDefs::time)] = segment.segementT0();
51  return pars;
52  }

◆ localSegmentPars() [2/2]

Parameters MuonR4::SegmentFit::localSegmentPars ( const xAOD::MuonSegment seg)

Returns the localSegPars decoration from a xAODMuon::Segment.

Definition at line 36 of file SegmentFitterEventData.cxx.

36  {
37  static const SG::Accessor<xAOD::MeasVector<toInt(ParamDefs::nPars)>> acc{"localSegPars"};
38  return xAOD::toEigen(xAOD::ConstVectorMap<toInt(ParamDefs::nPars)>{acc(seg).data()});
39  }

◆ makeLabel()

std::string MuonR4::SegmentFit::makeLabel ( const Parameters pars)

Definition at line 54 of file SegmentFitterEventData.cxx.

54  {
55  std::stringstream sstr{};
56  sstr<<"x_{0}="<<std::format("{:.2f}", pars[toInt(ParamDefs::x0)])<<", ";
57  sstr<<"y_{0}="<<std::format("{:.2f}", pars[toInt(ParamDefs::y0)])<<", ";
58  sstr<<std::format("#theta={:.3f}", pars[toInt(ParamDefs::theta)] / Gaudi::Units::deg )<<", ";
59  sstr<<std::format("#phi={:.3f}", pars[toInt(ParamDefs::phi)] / Gaudi::Units::deg)<<", ";
60  sstr<<"t_{0}="<<std::format("{:.1f}", pars[toInt(ParamDefs::time)]);
61  return sstr.str();
62  }

◆ makeLine()

std::pair< Amg::Vector3D, Amg::Vector3D > MuonR4::SegmentFit::makeLine ( const Parameters pars)

Returns the parsed parameters into an Eigen line parametrization.

The first operand is the position. The other is the direction.

Definition at line 30 of file SegmentFitterEventData.cxx.

30  {
31  return std::make_pair(Amg::Vector3D(pars[toInt(ParamDefs::x0)],
32  pars[toInt(ParamDefs::y0)],0.),
35  }

◆ toInt() [1/2]

constexpr int MuonR4::SegmentFit::toInt ( const AxisDefs  a)
constexpr

Definition at line 45 of file MuonHoughDefs.h.

45  {
46  return static_cast<int>(a);
47  }

◆ toInt() [2/2]

constexpr int MuonR4::SegmentFit::toInt ( const ParamDefs  p)
constexpr

Definition at line 42 of file MuonHoughDefs.h.

42  {
43  return static_cast<int>(p);
44  }

◆ toString() [1/2]

std::string MuonR4::SegmentFit::toString ( const ParamDefs  par)

Definition at line 72 of file SegmentFitterEventData.cxx.

72  {
73  switch (a){
74  case ParamDefs::x0:{
75  return "x0";
76  break;
77  } case ParamDefs::y0: {
78  return "y0";
79  break;
80  } case ParamDefs::theta: {
81  return "theta";
82  break;
83  } case ParamDefs::phi: {
84  return "phi";
85  break;
86  } case ParamDefs::time: {
87  return "time";
88  break;
89  } case ParamDefs::nPars:
90  break;
91  }
92  return "";
93  }

◆ toString() [2/2]

std::string MuonR4::SegmentFit::toString ( const Parameters pars)

Definition at line 63 of file SegmentFitterEventData.cxx.

63  {
64  std::stringstream sstr{};
65  sstr<< std::format("{}={:.2f}, ",toString(ParamDefs::x0), pars[toInt(ParamDefs::x0)]);
66  sstr<< std::format("{}={:.2f}, ",toString(ParamDefs::y0), pars[toInt(ParamDefs::y0)]);
70  return sstr.str();
71  }
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
MuonR4::SegmentFit::Parameters
AmgVector(toInt(ParamDefs::nPars)) Parameters
Definition: MuonHoughDefs.h:48
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
vtune_athena.format
format
Definition: vtune_athena.py:14
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
deg
#define deg
Definition: SbPolyhedron.cxx:17
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
MuonR4::SegmentFit::ParamDefs::x0
@ x0
xAOD::MeasVector
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
Definition: MeasurementDefs.h:52
MuonR4::SegmentFit::ParamDefs::y0
@ y0
MuonR4::SegmentFit::toInt
constexpr int toInt(const ParamDefs p)
Definition: MuonHoughDefs.h:42
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.copyTCTOutput.locDir
locDir
Definition: copyTCTOutput.py:113
a
TList * a
Definition: liststreamerinfos.cxx:10
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
CxxUtils::sincos
Helper to simultaneously calculate sin and cos of the same angle.
Definition: sincos.h:76
MuonR4::SegmentFit::dirFromAngles
Amg::Vector3D dirFromAngles(const double phi, const double theta)
Constructs a direction vector from the polar theta & phi angles.
Definition: SegmentFitterEventData.cxx:26
MuonR4::SegmentFit::ParamDefs::nPars
@ nPars
xAOD::ConstVectorMap
Eigen::Map< const MeasVector< N > > ConstVectorMap
Definition: MeasurementDefs.h:59
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5