Belle II Software  release-05-01-25
CDCTangent.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/eventdata/hits/CDCTangent.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit2D.h>
13 #include <tracking/trackFindingCDC/eventdata/hits/CDCRLWireHitPair.h>
14 #include <tracking/trackFindingCDC/eventdata/hits/CDCRLWireHit.h>
15 
16 #include <tracking/trackFindingCDC/geometry/ParameterLine2D.h>
17 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
18 
19 #include <tracking/trackFindingCDC/numerics/ERightLeft.h>
20 
21 #include <iostream>
22 
23 using namespace Belle2;
24 using namespace TrackFindingCDC;
25 
27  CDCRLWireHitPair(rlWireHitPair), m_line()
28 {
29  adjustLine();
30 }
31 
32 CDCTangent::CDCTangent(const CDCRLWireHit& fromRLWireHit,
33  const CDCRLWireHit& toRLWireHit):
34  CDCRLWireHitPair(fromRLWireHit, toRLWireHit), m_line()
35 {
36  adjustLine();
37 }
38 
40  const ParameterLine2D& line):
41  CDCRLWireHitPair(rlWireHitPair),
42  m_line(line)
43 {}
44 
45 CDCTangent::CDCTangent(const CDCRLWireHit& fromRLWireHit,
46  const CDCRLWireHit& toRLWireHit,
47  const ParameterLine2D& line):
48  CDCRLWireHitPair(fromRLWireHit, toRLWireHit),
49  m_line(line)
50 {}
51 
53 {
55  getFromRLInfo() * getFromRLWireHit().getRefDriftLength(),
56  getToRLWireHit().getRefPos2D(),
57  getToRLInfo() * getToRLWireHit().getRefDriftLength());
58 }
59 
61 {
62  ERightLeft newFromRLInfo = getLine().isRightOrLeft(getFromRLWireHit().getRefPos2D());
63  setFromRLInfo(newFromRLInfo);
64 
65  ERightLeft newToRLInfo = getLine().isRightOrLeft(getToRLWireHit().getRefPos2D());
66  setToRLInfo(newToRLInfo);
67 }
68 
70 {
72 
73  //reverse the direction of flight
74  m_line.reverse();
75 
76  //adjust the support point to be now at the other wirehit touch position
78 }
79 
81 {
84 }
85 
87 {
89 }
90 
92 {
94 }
95 
97 {
99 }
100 
102 {
104 }
105 
106 std::ostream& TrackFindingCDC::operator<<(std::ostream& output, const CDCTangent& tangent)
107 {
108  output << "Tangent" << std::endl;
109  output << "From : " << tangent.getFromRLWireHit() << " " << tangent.getFromRecoDisp2D() << std::endl;
110  output << "To : " << tangent.getToRLWireHit() << " " << tangent.getToRecoDisp2D() << std::endl;
111  return output;
112 }
Belle2::TrackFindingCDC::ParameterLine2D::isRightOrLeft
ERightLeft isRightOrLeft(const Vector2D &point) const
Return if the point given is right or left of the line.
Definition: ParameterLine2D.h:237
Belle2::operator<<
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Definition: IntervalOfValidity.cc:196
Belle2::TrackFindingCDC::ParameterLine2D::touchingCircles
static ParameterLine2D touchingCircles(const Vector2D &fromCenter, double fromSignedRadius, const Vector2D &toCenter, double toSignedRadius)
Constructs a line touching two circles in one point each.
Definition: ParameterLine2D.cc:19
Belle2::TrackFindingCDC::ParameterLine2D::reverse
void reverse()
Reverses the tangential vector inplace.
Definition: ParameterLine2D.h:196
Belle2::TrackFindingCDC::Vector2D
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:37
Belle2::TrackFindingCDC::CDCRLWireHitPair::getFromRLInfo
ERightLeft getFromRLInfo() const
Getter for the right left passage information of the first oriented wire hit.
Definition: CDCRLWireHitPair.h:147
Belle2::TrackFindingCDC::CDCTangent::getLine
const ParameterLine2D & getLine() const
Getter for the line representation of the line.
Definition: CDCTangent.h:119
Belle2::TrackFindingCDC::CDCRLWireHitPair::getToRLInfo
ERightLeft getToRLInfo() const
Getter for the right left passage information of the second oriented wire hit.
Definition: CDCRLWireHitPair.h:153
Belle2::TrackFindingCDC::CDCRecoHit2D::fromRecoPos2D
static CDCRecoHit2D fromRecoPos2D(const CDCRLWireHit &rlWireHit, const Vector2D &recoPos2D, bool snap=true)
Constructs a two dimensional reconstructed hit from an absolute position.
Definition: CDCRecoHit2D.cc:88
Belle2::TrackFindingCDC::CDCTangent::reverse
void reverse()
Reverses the tangent inplace.
Definition: CDCTangent.cc:69
Belle2::TrackFindingCDC::CDCRLWireHitPair::getToRLWireHit
CDCRLWireHit & getToRLWireHit()
Getter for the second oriented wire hit.
Definition: CDCRLWireHitPair.h:165
Belle2::TrackFindingCDC::CDCTangent::getFromRecoHit2D
CDCRecoHit2D getFromRecoHit2D() const
Getter for the reconstructed hit on the first oriented wire hit using reconstructed touch point as po...
Definition: CDCTangent.cc:96
Belle2::TrackFindingCDC::CDCTangent::getFromRecoPos2D
const Vector2D & getFromRecoPos2D() const
Getter for the touching point of the tangent to the first drift circle.
Definition: CDCTangent.h:73
Belle2::TrackFindingCDC::CDCRLWireHitPair::setToRLInfo
void setToRLInfo(ERightLeft toRLInfo)
Setter for the right left passage information of the second oriented wire hit.
Definition: CDCRLWireHitPair.cc:61
Belle2::TrackFindingCDC::ParameterLine2D
A line with a support point and tangential vector.
Definition: ParameterLine2D.h:48
Belle2::TrackFindingCDC::CDCTangent::getToRecoDisp2D
Vector2D getToRecoDisp2D() const
Getter for displacement of the touching point from the second wire in the reference plane.
Definition: CDCTangent.cc:91
Belle2::TrackFindingCDC::CDCTangent::reversed
CDCTangent reversed() const
Same as reverse but returns a copy.
Definition: CDCTangent.cc:80
Belle2::TrackFindingCDC::CDCTangent::getToRecoPos2D
Vector2D getToRecoPos2D() const
Getter for the touching point of the tangent to the second drift circle.
Definition: CDCTangent.h:80
Belle2::TrackFindingCDC::CDCRLWireHitPair::getFromRLWireHit
CDCRLWireHit & getFromRLWireHit()
Getter for the first oriented wire hit.
Definition: CDCRLWireHitPair.h:159
Belle2::TrackFindingCDC::CDCRLWireHitPair::reversed
CDCRLWireHitPair reversed() const
Constructs a oriented wire hit pair that is the reverse of this one.
Definition: CDCRLWireHitPair.cc:39
Belle2::TrackFindingCDC::CDCRLWireHitPair::reverse
void reverse()
Reverses the oriented wire hit pair inplace.
Definition: CDCRLWireHitPair.cc:44
Belle2::TrackFindingCDC::CDCRecoHit2D
Class representing a two dimensional reconstructed hit in the central drift chamber.
Definition: CDCRecoHit2D.h:57
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCRLWireHit
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:51
Belle2::TrackFindingCDC::CDCTangent
Class representating a linear track piece between two oriented wire hits.
Definition: CDCTangent.h:50
Belle2::TrackFindingCDC::CDCTangent::getFromRecoDisp2D
Vector2D getFromRecoDisp2D() const
Getter for displacement of the touching point from the first wire in the reference plane.
Definition: CDCTangent.cc:86
Belle2::TrackFindingCDC::ParameterLine2D::throughPoints
static ParameterLine2D throughPoints(const Vector2D &start, const Vector2D &end)
Static constructor for a line between to points.
Definition: ParameterLine2D.h:92
Belle2::TrackFindingCDC::CDCTangent::CDCTangent
CDCTangent()=default
Default constructor for ROOT.
Belle2::TrackFindingCDC::NRightLeft::ERightLeft
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:35
Belle2::TrackFindingCDC::CDCTangent::adjustRLInfo
void adjustRLInfo()
Adjusts the right left passage information according to the tangent line.
Definition: CDCTangent.cc:60
Belle2::TrackFindingCDC::CDCTangent::getToRecoHit2D
CDCRecoHit2D getToRecoHit2D() const
Getter for the reconstructed hit on the second oriented wire hit using reconstructed touch point as p...
Definition: CDCTangent.cc:101
Belle2::TrackFindingCDC::CDCRLWireHitPair
A pair of oriented wire hits.
Definition: CDCRLWireHitPair.h:37
Belle2::TrackFindingCDC::CDCRLWireHit::getRefPos2D
const Vector2D & getRefPos2D() const
The two dimensional reference position of the underlying wire.
Definition: CDCRLWireHit.cc:158
Belle2::TrackFindingCDC::ParameterLine2D::passiveMoveAtBy
void passiveMoveAtBy(const double delta)
Moves the support point by the given amount of the parameter in the forward direction.
Definition: ParameterLine2D.h:333
Belle2::TrackFindingCDC::CDCTangent::m_line
ParameterLine2D m_line
Memory for the line between the two touching points. The first touch point at(0), second at(1).
Definition: CDCTangent.h:124
Belle2::TrackFindingCDC::CDCTangent::adjustLine
void adjustLine()
Adjusts the line to touch the drift circles with the correct right left passage information.
Definition: CDCTangent.cc:52
Belle2::TrackFindingCDC::CDCRLWireHitPair::setFromRLInfo
void setFromRLInfo(ERightLeft fromRLInfo)
Setter for the right left passage information of the first oriented wire hit.
Definition: CDCRLWireHitPair.cc:56