Belle II Software  release-05-02-19
WireLine.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/topology/WireLine.h>
11 
12 #include <framework/logging/Logger.h>
13 
14 using namespace Belle2;
15 using namespace TrackFindingCDC;
16 
18  const Vector3D& backward,
19  double sagCoeff)
20  : m_refPos3D{(backward * forward.z() - forward * backward.z()) / (forward.z() - backward.z()) }
21  , m_nominalMovePerZ{(forward.xy() - backward.xy()) / (forward.z() - backward.z())}
22  , m_forwardZ{forward.z()}
23  , m_backwardZ{backward.z()}
24  , m_sagCoeff(sagCoeff)
25 {
26  B2ASSERT("Wire reference position is not at 0", m_refPos3D.z() == 0);
27 }
28 
29 WireLine WireLine::movedBy(const Vector3D& offset) const
30 {
31  WireLine moved = *this;
32  moved.m_refPos3D += offset.xy() + nominalMovePerZ() * offset.z();
33  moved.m_forwardZ += offset.z();
34  moved.m_backwardZ += offset.z();
35  return moved;
36 }
37 
38 WireLine WireLine::movedBy(const Vector2D& offset) const
39 {
40  WireLine moved = *this;
41  moved.m_refPos3D += offset;
42  return moved;
43 }
Belle2::TrackFindingCDC::Vector2D
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:37
Belle2::TrackFindingCDC::WireLine::m_refPos3D
Vector3D m_refPos3D
Memory for the reference postion.
Definition: WireLine.h:246
Belle2::TrackFindingCDC::WireLine::m_backwardZ
double m_backwardZ
Memory for the backward end z coordinate.
Definition: WireLine.h:255
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::WireLine
A three dimensional limited line represented by its closest approach to the z-axes (reference positio...
Definition: WireLine.h:41
Belle2::TrackFindingCDC::Vector3D
A three dimensional vector.
Definition: Vector3D.h:34
Belle2::TrackFindingCDC::WireLine::WireLine
WireLine()
Default constructor initialising to all members to zero.
Definition: WireLine.h:45
Belle2::TrackFindingCDC::WireLine::nominalMovePerZ
const Vector2D & nominalMovePerZ() const
Gives the positional move in the xy projection per unit z.
Definition: WireLine.h:81
Belle2::TrackFindingCDC::Vector3D::xy
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Definition: Vector3D.h:500
Belle2::TrackFindingCDC::Vector3D::z
double z() const
Getter for the z coordinate.
Definition: Vector3D.h:488
Belle2::TrackFindingCDC::WireLine::m_forwardZ
double m_forwardZ
Memory for the forward end z coordinate.
Definition: WireLine.h:252
Belle2::TrackFindingCDC::WireLine::movedBy
WireLine movedBy(const Vector3D &offset) const
Returns a copy of the wire line moved by a three dimensional offset.
Definition: WireLine.cc:29