ATLAS Offline Software
Loading...
Searching...
No Matches
CalibratedSpacePoint.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONSPACEPOINT_CALIBSPACEPOINT_H
5#define MUONSPACEPOINT_CALIBSPACEPOINT_H
6
8#include "Acts/Utilities/OstreamFormatter.hpp"
9
10namespace MuonR4{
16 public:
27 enum class State : std::uint8_t {
28 Valid = 1,
32 };
33
34 static std::string toString(const State s);
36 inline friend std::ostream& operator<<(std::ostream& ostr, const State s){
37 return (ostr<<toString(s));
38 }
39
43 CalibratedSpacePoint(const SpacePoint* uncalibSpacePoint,
44 Amg::Vector3D&& posInChamber,
45 State st = State::Valid);
46
48 /*** @brief: Position of the space point inside the chamber */
49 const Amg::Vector3D& localPosition() const;
50 /*** @brief: Returns the direction parallel to the primary channel, i.e. the strip or the wire */
51 const Amg::Vector3D& sensorDirection() const;
52 /*** @brief: Returns the vector pointing to the adjacent channel in the chamber */
53 const Amg::Vector3D& toNextSensor() const;
55 const Amg::Vector3D& planeNormal() const;
57 double time() const;
59 bool isStraw() const;
61 bool hasTime() const;
63 bool measuresLoc0() const;
65 bool measuresLoc1() const;
67 double driftRadius() const;
69 const Cov_t& covariance() const;
70
72 void setCovariance(const Cov_t& cov);
75 void setDriftRadius(const double r);
76
78 const SpacePoint* spacePoint() const;
84 void setTimeMeasurement(double t);
86 bool measuresPhi() const;
88 bool measuresEta() const;
90 State fitState() const;
92 void setFitState(State st);
94 unsigned dimension() const;
96 bool hasChi2() const;
98 double chi2Term() const;
100 void setBeamDirection(Amg::Vector3D&& beamDir);
103 void setChi2Term(const double chi2);
104
105 friend std::ostream& operator<<(std::ostream& ostr, const CalibratedSpacePoint& sp) {
106 sp.print(ostr);
107 return ostr;
108 }
109 private:
111 void print(std::ostream& ostr) const;
113 Amg::Vector3D m_posInChamber{Amg::Vector3D::Zero()};
115 Cov_t m_cov{Acts::filledArray<double, 3>(0.)};
117 double m_driftRadius{0.};
119 double m_time{0.};
122 const SpacePoint* m_parent{nullptr};
124 std::shared_ptr<Amg::Vector3D> m_beamLine{};
126 State m_state{State::Valid};
130 std::optional<double> m_chi2Term{};
131
132 };
133 static_assert(Acts::Experimental::CompositeSpacePoint<CalibratedSpacePoint>);
134}
136#endif
ACTS_OSTREAM_FORMATTER(MuonR4::CalibratedSpacePoint::State)
static Double_t sp
double driftRadius() const
: Returns the size of the drift radius
Amg::Vector3D m_posInChamber
Calibrated position.
std::optional< double > m_chi2Term
The chi2 term w.r.t the associated segment.
void setDriftRadius(const double r)
Update the drift radius of the space point measurement.
void setTimeMeasurement(double t)
Set the time measurement.
const Amg::Vector3D & toNextSensor() const
bool hasChi2() const
Returns whether the space point has a defined chi2.
const Amg::Vector3D & sensorDirection() const
bool hasTime() const
Returns whether the measurement carries time information.
bool m_measuresTime
time flag (By default true for Mdt detectors)
void setBeamDirection(Amg::Vector3D &&beamDir)
Sets the beamline direction.
bool measuresEta() const
Returns whether the calibrated space point measures eta.
const Amg::Vector3D & planeNormal() const
Returns the vector pointing out of the measurement plane.
double m_time
Calibrated time (Acts units).
const Amg::Vector3D & localPosition() const
bool isStraw() const
Returns whether the measurement is a Mdt.
static std::string toString(const State s)
Converts the state enum into a string.
void setFitState(State st)
Set the state of the calibrated space point.
bool measuresLoc1() const
Returns whether the measurement constains the bending direction.
friend std::ostream & operator<<(std::ostream &ostr, const CalibratedSpacePoint &sp)
bool measuresLoc0() const
Returns whether the measurement constains the non-bending direction.
void setCovariance(const Cov_t &cov)
Set the covariance matrix of the calibrated space point.
double time() const
Returns the measurement's recorded time.
State m_state
Calibration state.
CalibratedSpacePoint(const SpacePoint *uncalibSpacePoint, Amg::Vector3D &&posInChamber, State st=State::Valid)
Standard constructor.
void print(std::ostream &ostr) const
Print function.
friend std::ostream & operator<<(std::ostream &ostr, const State s)
Define the ostream operator.
const SpacePoint * spacePoint() const
The pointer to the space point out of which this space point has been built.
void setChi2Term(const double chi2)
Sets the chi2 term w.r.t.
xAOD::UncalibMeasType type() const
Returns the space point type.
std::shared_ptr< Amg::Vector3D > m_beamLine
Direction of the beamline (Beamspot constraint).
const Cov_t & covariance() const
Returns the covariance array.
bool measuresPhi() const
Returns whether the calibrated space point measures phi.
unsigned dimension() const
Returns the local dimension of the measurement.
const SpacePoint * m_parent
Uncalibrated space point from which this space point is constructed.
State
State flag to distinguish different space point states.
double m_driftRadius
Calibrated drift radius.
double chi2Term() const
Returns the cached chi2 term w.r.t.
State fitState() const
Returns the state of the calibrated space point.
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
std::array< double, 3 > Cov_t
Abrivation of the covariance type.
double chi2(TH1 *h0, TH1 *h1)
int r
Definition globals.cxx:22
Eigen::Matrix< double, 3, 1 > Vector3D
This header ties the generic definitions in this package.
CalibratedSpacePoint::State State
UncalibMeasType
Define the type of the uncalibrated measurement.