Belle II Software development
CDCFacet.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/CDCFacet.h>
9
10#include <tracking/trackingUtilities/eventdata/hits/CDCRLWireHitTriple.h>
11#include <tracking/trackingUtilities/eventdata/hits/CDCTangent.h>
12#include <tracking/trackingUtilities/eventdata/hits/CDCRecoHit2D.h>
13#include <tracking/trackingUtilities/eventdata/hits/CDCRLWireHit.h>
14#include <tracking/trackingUtilities/eventdata/hits/CDCWireHit.h>
15
16#include <cdc/topology/CDCWire.h>
17
18#include <tracking/trackingUtilities/geometry/UncertainParameterLine2D.h>
19#include <tracking/trackingUtilities/geometry/ParameterLine2D.h>
20
21#include <tracking/trackingUtilities/ca/AutomatonCell.h>
22
23using namespace Belle2;
24using namespace CDC;
25using namespace TrackingUtilities;
26
27CDCFacet::CDCFacet(const CDCRLWireHit& startRLWireHit,
28 const CDCRLWireHit& middleRLWireHit,
29 const CDCRLWireHit& endRLWireHit)
30 : CDCRLWireHitTriple(startRLWireHit, middleRLWireHit, endRLWireHit),
31 m_fitLine(),
33{
35}
36
37CDCFacet::CDCFacet(const CDCRLWireHit& startRLWireHit,
38 const CDCRLWireHit& middleRLWireHit,
39 const CDCRLWireHit& endRLWireHit,
40 const UncertainParameterLine2D& fitLine)
41 : CDCRLWireHitTriple(startRLWireHit, middleRLWireHit, endRLWireHit),
42 m_fitLine(fitLine),
44{
45}
46
48{
50 m_fitLine.reverse();
51}
52
53// cppcheck-suppress duplInheritedMember ; intentionally hides the base class member to return the derived type
61
66
68{
69 m_fitLine.invalidate();
70}
71
72ROOT::Math::XYVector CDCFacet::getStartRecoPos2D() const
73{
74 return getFitLine()->closest(getStartWire().getRefPos2D());
75}
76
77ROOT::Math::XYVector CDCFacet::getMiddleRecoPos2D() const
78{
79 return getFitLine()->closest(getMiddleWire().getRefPos2D());
80}
81
82ROOT::Math::XYVector CDCFacet::getEndRecoPos2D() const
83{
84 return getFitLine()->closest(getEndWire().getRefPos2D());
85}
86
88{
90 getStartRLWireHit().getSignedRefDriftLength(),
91 getMiddleRLWireHit().getRefPos2D(),
92 getMiddleRLWireHit().getSignedRefDriftLength());
93}
94
96{
98 getStartRLWireHit().getSignedRefDriftLength(),
99 getEndRLWireHit().getRefPos2D(),
100 getEndRLWireHit().getSignedRefDriftLength());
101}
102
104{
106 getMiddleRLWireHit().getSignedRefDriftLength(),
107 getEndRLWireHit().getRefPos2D(),
108 getEndRLWireHit().getSignedRefDriftLength());
109}
110
115
120
125
130
135
140
148
156
158{
159 if (getStartWireHit().getAutomatonCell().hasMaskedFlag() or
160 getMiddleWireHit().getAutomatonCell().hasMaskedFlag() or
161 getEndWireHit().getAutomatonCell().hasMaskedFlag()) {
162
164 }
165}
void setMaskedFlag(bool setTo=true)
Sets the masked flag to the given value. Default value true.
void unsetMaskedFlag()
Resets the masked flag to false.
ROOT::Math::XYVector getMiddleRecoPos2D() const
Getter for the reconstructed position at the second hit on the fit line.
Definition CDCFacet.cc:77
void adjustFitLine() const
Adjusts the contained fit line to touch such that it touches the first and third hit.
Definition CDCFacet.cc:62
ParameterLine2D getStartToEndLine() const
Getter for the tangential line from the first to the third hit.
Definition CDCFacet.cc:95
CDCRecoHit2D getEndRecoHit2D() const
Getter for the third reconstructed hit.
Definition CDCFacet.cc:121
ROOT::Math::XYVector getEndRecoPos2D() const
Getter for the reconstructed position at the third hit on the fit line.
Definition CDCFacet.cc:82
CDCRecoHit2D getMiddleRecoHit2D() const
Getter for the second reconstructed hit.
Definition CDCFacet.cc:116
CDCFacet()=default
Default constructor for ROOT.
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition CDCFacet.h:132
UncertainParameterLine2D m_fitLine
Memory for a line fit to the three contained hits.
Definition CDCFacet.h:139
void setAndForwardMaskedFlag() const
Sets the masked flag of the facet's automaton cell and of the three contained wire hits.
Definition CDCFacet.cc:149
void unsetAndForwardMaskedFlag() const
Unset the masked flag of the facet's automaton cell and of the three contained wire hits.
Definition CDCFacet.cc:141
const UncertainParameterLine2D & getFitLine() const
Getter for the contained line fit information.
Definition CDCFacet.h:63
CDCRecoHit2D getStartRecoHit2D() const
Getter for the first reconstructed hit.
Definition CDCFacet.cc:111
void invalidateFitLine()
Clear all information in the fit.
Definition CDCFacet.cc:67
CDCTangent getStartToEnd() const
Getter for the tangential line including the hits from the first to the third hit.
Definition CDCFacet.cc:131
CDCFacet reversed() const
Constructs the reverse triple from this one.
Definition CDCFacet.cc:54
CDCTangent getMiddleToEnd() const
Getter for the tangential line including the hits from the second to the third hit.
Definition CDCFacet.cc:136
ROOT::Math::XYVector getStartRecoPos2D() const
Getter for the reconstructed position at the first hit on the fit line.
Definition CDCFacet.cc:72
AutomatonCell m_automatonCell
Memory for the cellular automaton cell associated with the facet.
Definition CDCFacet.h:142
void reverse() override
Reverses the facet in place including the fit line.
Definition CDCFacet.cc:47
void receiveMaskedFlag() const
If one of the contained wire hits is marked as masked this facet is set be masked as well.
Definition CDCFacet.cc:157
ParameterLine2D getStartToMiddleLine() const
Getter for the tangential line from the first to the second hit.
Definition CDCFacet.cc:87
CDCTangent getStartToMiddle() const
Getter for the tangential line including the hits from the first to the second hit.
Definition CDCFacet.cc:126
ParameterLine2D getMiddleToEndLine() const
Getter for the tangential line from the second to the third hit.
Definition CDCFacet.cc:103
const CDCWireHit & getMiddleWireHit() const
Getter for the hit wire of the second oriented wire hit.
virtual void reverse()
Reverses the triple inplace.
CDCRLWireHitTriple()=default
Default constructor for ROOT.
const CDC::CDCWire & getStartWire() const
Getter for the wire the first oriented wire hit is based on.
const CDC::CDCWire & getMiddleWire() const
Getter for the wire the second oriented wire hit is based on.
CDCRLWireHit & getStartRLWireHit()
Getter for the first oriented wire hit.
const CDC::CDCWire & getEndWire() const
Getter for the wire the third oriented wire hit is based on.
const CDCWireHit & getEndWireHit() const
Getter for the hit wire of the third oriented wire hit.
const CDCWireHit & getStartWireHit() const
Getter for the hit wire of the first oriented wire hit.
CDCRLWireHit & getEndRLWireHit()
Getter for the third oriented wire hit.
CDCRLWireHit & getMiddleRLWireHit()
Getter for the second oriented wire hit.
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
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
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition CDCWireHit.h:287
A line with a support point and tangential vector.
ROOT::Math::XYVector closest(const ROOT::Math::XYVector &point) const
Gives the position at the closest approach on the line to point.
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.
A parameter line including including an line covariance matrix which is interpreted as located in the...
Abstract base class for different kinds of events.