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/trackingUtilities/eventdata/hits/CDCTangent.h>
9
10#include <tracking/trackingUtilities/eventdata/hits/CDCRecoHit2D.h>
11#include <tracking/trackingUtilities/eventdata/hits/CDCRLWireHitPair.h>
12#include <tracking/trackingUtilities/eventdata/hits/CDCRLWireHit.h>
13
14#include <tracking/trackingUtilities/geometry/ParameterLine2D.h>
15
16#include <tracking/trackingUtilities/numerics/ERightLeft.h>
17
18#include <iostream>
19
20using namespace Belle2;
21using namespace TrackingUtilities;
22
24 CDCRLWireHitPair(rlWireHitPair), m_line()
25{
26 adjustLine();
27}
28
30 const CDCRLWireHit& toRLWireHit):
31 CDCRLWireHitPair(fromRLWireHit, toRLWireHit), m_line()
32{
33 adjustLine();
34}
35
37 const ParameterLine2D& line):
38 CDCRLWireHitPair(rlWireHitPair),
39 m_line(line)
40{}
41
43 const CDCRLWireHit& toRLWireHit,
44 const ParameterLine2D& line):
45 CDCRLWireHitPair(fromRLWireHit, toRLWireHit),
46 m_line(line)
47{}
48
50{
52 static_cast<double>(getFromRLInfo()) * getFromRLWireHit().getRefDriftLength(),
53 getToRLWireHit().getRefPos2D(),
54 static_cast<double>(getToRLInfo()) * getToRLWireHit().getRefDriftLength());
55}
56
58{
59 ERightLeft newFromRLInfo = getLine().isRightOrLeft(getFromRLWireHit().getRefPos2D());
60 setFromRLInfo(newFromRLInfo);
61
62 ERightLeft newToRLInfo = getLine().isRightOrLeft(getToRLWireHit().getRefPos2D());
63 setToRLInfo(newToRLInfo);
64}
65
67{
69
70 //reverse the direction of flight
71 m_line.reverse();
72
73 //adjust the support point to be now at the other wirehit touch position
74 m_line.passiveMoveAtBy(-1);
75}
76
82
83ROOT::Math::XYVector CDCTangent::getFromRecoDisp2D() const
84{
86}
87
88ROOT::Math::XYVector CDCTangent::getToRecoDisp2D() const
89{
91}
92
97
102
103std::ostream& TrackingUtilities::operator<<(std::ostream& output, const CDCTangent& tangent)
104{
105 output << "Tangent" << std::endl;
106 output << "From : " << tangent.getFromRLWireHit() << " " << tangent.getFromRecoDisp2D() << std::endl;
107 output << "To : " << tangent.getToRLWireHit() << " " << tangent.getToRecoDisp2D() << std::endl;
108 return output;
109}
virtual 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.
CDCRLWireHitPair()=default
Default constructor for ROOT.
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 ...
const ROOT::Math::XYVector & getRefPos2D() const
The two dimensional reference position of the underlying wire.
Class representing a two dimensional reconstructed hit in the central drift chamber.
static CDCRecoHit2D fromRecoPos2D(const CDCRLWireHit &rlWireHit, const ROOT::Math::XYVector &recoPos2D, bool snap=true)
Constructs a two dimensional reconstructed hit from an absolute position.
Class representing a linear track piece between two oriented wire hits.
Definition CDCTangent.h:42
void adjustRLInfo()
Adjusts the right left passage information according to the tangent line.
Definition CDCTangent.cc:57
CDCTangent()=default
Default constructor for ROOT.
const ROOT::Math::XYVector & getFromRecoPos2D() const
Getter for the touching point of the tangent to the first drift circle.
Definition CDCTangent.h:65
ParameterLine2D m_line
Memory for the line between the two touching points. The first touch point at(0), second at(1).
Definition CDCTangent.h:116
ROOT::Math::XYVector getFromRecoDisp2D() const
Getter for displacement of the touching point from the first wire in the reference plane.
Definition CDCTangent.cc:83
CDCRecoHit2D getToRecoHit2D() const
Getter for the reconstructed hit on the second oriented wire hit using reconstructed touch point as p...
Definition CDCTangent.cc:98
ROOT::Math::XYVector getToRecoDisp2D() const
Getter for displacement of the touching point from the second wire in the reference plane.
Definition CDCTangent.cc:88
void reverse() override
Reverses the tangent inplace.
Definition CDCTangent.cc:66
void adjustLine()
Adjusts the line to touch the drift circles with the correct right left passage information.
Definition CDCTangent.cc:49
CDCRecoHit2D getFromRecoHit2D() const
Getter for the reconstructed hit on the first oriented wire hit using reconstructed touch point as po...
Definition CDCTangent.cc:93
const ParameterLine2D & getLine() const
Getter for the line representation of the line.
Definition CDCTangent.h:111
CDCTangent reversed() const
Same as reverse but returns a copy.
Definition CDCTangent.cc:77
ROOT::Math::XYVector getToRecoPos2D() const
Getter for the touching point of the tangent to the second drift circle.
Definition CDCTangent.h:72
A line with a support point and tangential vector.
static ParameterLine2D throughPoints(const ROOT::Math::XYVector &start, const ROOT::Math::XYVector &end)
Static constructor for a line between to points.
ERightLeft isRightOrLeft(const ROOT::Math::XYVector &point) const
Return if the point given is right or left of the line.
static ParameterLine2D touchingCircles(const ROOT::Math::XYVector &fromCenter, double fromSignedRadius, const ROOT::Math::XYVector &toCenter, double toSignedRadius)
Constructs a line touching two circles in one point each.
Abstract base class for different kinds of events.