ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkUtilityPackages
TrkDriftCircleMath
TrkDriftCircleMath
Line.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef DCMATH_LINE_H
6
#define DCMATH_LINE_H
7
8
#include <cmath>
9
#include <iostream>
10
#include <ostream>
11
12
#include "
TrkDriftCircleMath/LocVec2D.h
"
13
#include "
TrkDriftCircleMath/RotPhi.h
"
14
15
namespace
TrkDriftCircleMath
{
16
17
class
Line
{
18
public
:
22
Line
(
const
LocVec2D
& pos,
const
LocVec2D
& dir) :
Line
{pos,
std
::atan2(dir.
y
(), dir.
x
())} {}
23
24
Line
(
const
LocVec2D
& pos,
double
phi
) :
m_phi
{
phi
},
m_pos
{pos} {
updateLocalParameters
(); }
25
26
Line
(
LocVec2D
&& pos,
const
LocVec2D
& dir) :
Line
{pos,
std
::atan2(dir.
y
(), dir.
x
())} {}
27
28
Line
(
LocVec2D
&& pos,
double
phi
) :
m_phi
{
phi
},
m_pos
{pos} {
updateLocalParameters
(); }
29
30
Line
(
double
x0
,
double
y0
,
double
phi
) :
m_phi
{
phi
},
m_loc_pos
{
x0
,
y0
} {
updateGlobalParameters
(); }
31
32
~Line
() =
default
;
33
35
void
set
(
const
LocVec2D
& pos,
const
LocVec2D
& dir) {
set
(pos, std::atan2(dir.y(), dir.x())); }
36
37
void
set
(
const
LocVec2D
& pos,
double
phi
) {
38
m_phi
=
phi
;
39
m_pos
= pos;
40
updateLocalParameters
();
41
}
42
43
void
set
(
double
x0
,
double
y0
,
double
phi
) {
44
m_phi
=
phi
;
45
m_loc_pos
.set(
x0
,
y0
);
46
updateGlobalParameters
();
47
}
48
49
void
updateLocalParameters
() {
50
RotPhi
rot(
m_phi
);
51
m_dir
.set(rot.
cosphi
(), rot.
sinphi
());
52
m_loc_pos
= (rot *
m_pos
);
53
}
54
55
void
updateGlobalParameters
() {
56
RotPhi
rot{-
m_phi
};
57
m_pos
= rot *
m_loc_pos
;
59
m_dir
.set(rot.
cosphi
(), -rot.
sinphi
());
60
}
61
62
double
phi
()
const
{
return
m_phi
; }
63
double
x0
()
const
{
return
m_loc_pos
.x(); }
64
double
y0
()
const
{
return
m_loc_pos
.y(); }
65
const
LocVec2D
&
position
()
const
{
return
m_pos
; }
66
const
LocVec2D
&
direction
()
const
{
return
m_dir
; }
67
68
private
:
69
double
m_phi
{0};
70
LocVec2D
m_pos
{0., 0.};
71
LocVec2D
m_dir
{0., 0.};
72
LocVec2D
m_loc_pos
{0., 0.};
73
};
74
75
std::ostream&
operator<<
(std::ostream& os,
const
TrkDriftCircleMath::Line
& l);
76
77
}
// namespace TrkDriftCircleMath
78
79
#endif
LocVec2D.h
RotPhi.h
y
#define y
x
#define x
TrkDriftCircleMath::Line
Definition
Line.h:17
TrkDriftCircleMath::Line::direction
const LocVec2D & direction() const
Definition
Line.h:66
TrkDriftCircleMath::Line::m_dir
LocVec2D m_dir
Definition
Line.h:71
TrkDriftCircleMath::Line::m_phi
double m_phi
Definition
Line.h:69
TrkDriftCircleMath::Line::x0
double x0() const
Definition
Line.h:63
TrkDriftCircleMath::Line::Line
Line(LocVec2D &&pos, double phi)
Definition
Line.h:28
TrkDriftCircleMath::Line::m_pos
LocVec2D m_pos
Definition
Line.h:70
TrkDriftCircleMath::Line::position
const LocVec2D & position() const
Definition
Line.h:65
TrkDriftCircleMath::Line::~Line
~Line()=default
TrkDriftCircleMath::Line::Line
Line(const LocVec2D &pos, const LocVec2D &dir)
Constructors starting from the global parameters.
Definition
Line.h:22
TrkDriftCircleMath::Line::m_loc_pos
LocVec2D m_loc_pos
Definition
Line.h:72
TrkDriftCircleMath::Line::Line
Line(LocVec2D &&pos, const LocVec2D &dir)
Definition
Line.h:26
TrkDriftCircleMath::Line::set
void set(const LocVec2D &pos, const LocVec2D &dir)
set methods to reduce copying of data
Definition
Line.h:35
TrkDriftCircleMath::Line::phi
double phi() const
Definition
Line.h:62
TrkDriftCircleMath::Line::Line
Line(const LocVec2D &pos, double phi)
Definition
Line.h:24
TrkDriftCircleMath::Line::updateGlobalParameters
void updateGlobalParameters()
Definition
Line.h:55
TrkDriftCircleMath::Line::set
void set(const LocVec2D &pos, double phi)
Definition
Line.h:37
TrkDriftCircleMath::Line::updateLocalParameters
void updateLocalParameters()
Definition
Line.h:49
TrkDriftCircleMath::Line::Line
Line(double x0, double y0, double phi)
Definition
Line.h:30
TrkDriftCircleMath::Line::y0
double y0() const
Definition
Line.h:64
TrkDriftCircleMath::Line::set
void set(double x0, double y0, double phi)
Definition
Line.h:43
TrkDriftCircleMath::LocVec2D
Implementation of 2 dimensional vector class.
Definition
LocVec2D.h:16
TrkDriftCircleMath::RotPhi
Definition
RotPhi.h:14
TrkDriftCircleMath::RotPhi::cosphi
double cosphi() const
Definition
RotPhi.h:25
TrkDriftCircleMath::RotPhi::sinphi
double sinphi() const
Definition
RotPhi.h:26
TrkDriftCircleMath
Function object to check whether two Segments are sub/super sets or different.
Definition
IMdtSegmentFinder.h:13
TrkDriftCircleMath::operator<<
std::ostream & operator<<(std::ostream &os, const TrkDriftCircleMath::ClusterId &id)
Definition
ClusterId.cxx:9
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0