Belle II Software development
CDCTangent.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#include <tracking/trackFindingCDC/eventdata/hits/CDCTangent.h>
9
10#include <tracking/trackFindingCDC/eventdata/hits/CDCRecoHit2D.h>
11#include <tracking/trackFindingCDC/eventdata/hits/CDCRLWireHitPair.h>
12#include <tracking/trackFindingCDC/eventdata/hits/CDCRLWireHit.h>
13
14#include <tracking/trackFindingCDC/geometry/ParameterLine2D.h>
15#include <tracking/trackFindingCDC/geometry/Vector2D.h>
16
17#include <tracking/trackFindingCDC/numerics/ERightLeft.h>
18
19#include <iostream>
20
21using namespace Belle2;
22using namespace TrackFindingCDC;
23
25 CDCRLWireHitPair(rlWireHitPair), m_line()
26{
27 adjustLine();
28}
29
31 const CDCRLWireHit& toRLWireHit):
32 CDCRLWireHitPair(fromRLWireHit, toRLWireHit), m_line()
33{
34 adjustLine();
35}
36
38 const ParameterLine2D& line):
39 CDCRLWireHitPair(rlWireHitPair),
40 m_line(line)
41{}
42
44 const CDCRLWireHit& toRLWireHit,
45 const ParameterLine2D& line):
46 CDCRLWireHitPair(fromRLWireHit, toRLWireHit),
47 m_line(line)
48{}
49
51{
53 static_cast<double>(getFromRLInfo()) * getFromRLWireHit().getRefDriftLength(),
54 getToRLWireHit().getRefPos2D(),
55 static_cast<double>(getToRLInfo()) * getToRLWireHit().getRefDriftLength());
56}
57
59{
60 ERightLeft newFromRLInfo = getLine().isRightOrLeft(getFromRLWireHit().getRefPos2D());
61 setFromRLInfo(newFromRLInfo);
62
63 ERightLeft newToRLInfo = getLine().isRightOrLeft(getToRLWireHit().getRefPos2D());
64 setToRLInfo(newToRLInfo);
65}
66
68{
70
71 //reverse the direction of flight
73
74 //adjust the support point to be now at the other wirehit touch position
76}
77
79{
82}
83
85{
87}
88
90{
92}
93
95{
97}
98
100{
102}
103
104std::ostream& TrackFindingCDC::operator<<(std::ostream& output, const CDCTangent& tangent)
105{
106 output << "Tangent" << std::endl;
107 output << "From : " << tangent.getFromRLWireHit() << " " << tangent.getFromRecoDisp2D() << std::endl;
108 output << "To : " << tangent.getToRLWireHit() << " " << tangent.getToRecoDisp2D() << std::endl;
109 return output;
110}
void reverse()
Reverses the oriented wire hit pair inplace.
CDCRLWireHit & getToRLWireHit()
Getter for the second oriented wire hit.
void setFromRLInfo(ERightLeft fromRLInfo)
Setter for the right left passage information of the first oriented wire hit.
void setToRLInfo(ERightLeft toRLInfo)
Setter for the right left passage information of the second oriented wire hit.
ERightLeft getFromRLInfo() const
Getter for the right left passage information of the first oriented wire hit.
CDCRLWireHitPair reversed() const
Constructs a oriented wire hit pair that is the reverse of this one.
CDCRLWireHit & getFromRLWireHit()
Getter for the first oriented wire hit.
ERightLeft getToRLInfo() const
Getter for the right left passage information of the second oriented wire hit.
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:41
const Vector2D & getRefPos2D() const
The two dimensional reference position of the underlying wire.
Class representing a two dimensional reconstructed hit in the central drift chamber.
Definition: CDCRecoHit2D.h:47
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:84
Class representing a linear track piece between two oriented wire hits.
Definition: CDCTangent.h:40
const Vector2D & getFromRecoPos2D() const
Getter for the touching point of the tangent to the first drift circle.
Definition: CDCTangent.h:63
void adjustRLInfo()
Adjusts the right left passage information according to the tangent line.
Definition: CDCTangent.cc:58
CDCTangent()=default
Default constructor for ROOT.
void reverse()
Reverses the tangent inplace.
Definition: CDCTangent.cc:67
Vector2D getToRecoDisp2D() const
Getter for displacement of the touching point from the second wire in the reference plane.
Definition: CDCTangent.cc:89
ParameterLine2D m_line
Memory for the line between the two touching points. The first touch point at(0), second at(1).
Definition: CDCTangent.h:114
Vector2D getFromRecoDisp2D() const
Getter for displacement of the touching point from the first wire in the reference plane.
Definition: CDCTangent.cc:84
Vector2D getToRecoPos2D() const
Getter for the touching point of the tangent to the second drift circle.
Definition: CDCTangent.h:70
CDCRecoHit2D getToRecoHit2D() const
Getter for the reconstructed hit on the second oriented wire hit using reconstructed touch point as p...
Definition: CDCTangent.cc:99
void adjustLine()
Adjusts the line to touch the drift circles with the correct right left passage information.
Definition: CDCTangent.cc:50
CDCRecoHit2D getFromRecoHit2D() const
Getter for the reconstructed hit on the first oriented wire hit using reconstructed touch point as po...
Definition: CDCTangent.cc:94
const ParameterLine2D & getLine() const
Getter for the line representation of the line.
Definition: CDCTangent.h:109
CDCTangent reversed() const
Same as reverse but returns a copy.
Definition: CDCTangent.cc:78
A line with a support point and tangential vector.
void reverse()
Reverses the tangential vector inplace.
void passiveMoveAtBy(const double delta)
Moves the support point by the given amount of the parameter in the forward direction.
ERightLeft isRightOrLeft(const Vector2D &point) const
Return if the point given is right or left of the line.
static ParameterLine2D touchingCircles(const Vector2D &fromCenter, double fromSignedRadius, const Vector2D &toCenter, double toSignedRadius)
Constructs a line touching two circles in one point each.
static ParameterLine2D throughPoints(const Vector2D &start, const Vector2D &end)
Static constructor for a line between to points.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition: Vector2D.h:32
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:25
Abstract base class for different kinds of events.