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
60
65
67{
68 m_fitLine.invalidate();
69}
70
71ROOT::Math::XYVector CDCFacet::getStartRecoPos2D() const
72{
73 return getFitLine()->closest(getStartWire().getRefPos2D());
74}
75
76ROOT::Math::XYVector CDCFacet::getMiddleRecoPos2D() const
77{
78 return getFitLine()->closest(getMiddleWire().getRefPos2D());
79}
80
81ROOT::Math::XYVector CDCFacet::getEndRecoPos2D() const
82{
83 return getFitLine()->closest(getEndWire().getRefPos2D());
84}
85
87{
89 getStartRLWireHit().getSignedRefDriftLength(),
90 getMiddleRLWireHit().getRefPos2D(),
91 getMiddleRLWireHit().getSignedRefDriftLength());
92}
93
95{
97 getStartRLWireHit().getSignedRefDriftLength(),
98 getEndRLWireHit().getRefPos2D(),
99 getEndRLWireHit().getSignedRefDriftLength());
100}
101
103{
105 getMiddleRLWireHit().getSignedRefDriftLength(),
106 getEndRLWireHit().getRefPos2D(),
107 getEndRLWireHit().getSignedRefDriftLength());
108}
109
114
119
124
129
134
139
147
155
157{
158 if (getStartWireHit().getAutomatonCell().hasMaskedFlag() or
159 getMiddleWireHit().getAutomatonCell().hasMaskedFlag() or
160 getEndWireHit().getAutomatonCell().hasMaskedFlag()) {
161
163 }
164}
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:76
void adjustFitLine() const
Adjusts the contained fit line to touch such that it touches the first and third hit.
Definition CDCFacet.cc:61
ParameterLine2D getStartToEndLine() const
Getter for the tangential line from the first to the third hit.
Definition CDCFacet.cc:94
CDCRecoHit2D getEndRecoHit2D() const
Getter for the third reconstructed hit.
Definition CDCFacet.cc:120
ROOT::Math::XYVector getEndRecoPos2D() const
Getter for the reconstructed position at the third hit on the fit line.
Definition CDCFacet.cc:81
CDCRecoHit2D getMiddleRecoHit2D() const
Getter for the second reconstructed hit.
Definition CDCFacet.cc:115
CDCFacet()=default
Default constructor for ROOT.
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition CDCFacet.h:131
UncertainParameterLine2D m_fitLine
Memory for a line fit to the three contained hits.
Definition CDCFacet.h:138
void setAndForwardMaskedFlag() const
Sets the masked flag of the facet's automaton cell and of the three contained wire hits.
Definition CDCFacet.cc:148
void unsetAndForwardMaskedFlag() const
Unset the masked flag of the facet's automaton cell and of the three contained wire hits.
Definition CDCFacet.cc:140
const UncertainParameterLine2D & getFitLine() const
Getter for the contained line fit information.
Definition CDCFacet.h:62
CDCRecoHit2D getStartRecoHit2D() const
Getter for the first reconstructed hit.
Definition CDCFacet.cc:110
void invalidateFitLine()
Clear all information in the fit.
Definition CDCFacet.cc:66
CDCTangent getStartToEnd() const
Getter for the tangential line including the hits from the first to the third hit.
Definition CDCFacet.cc:130
CDCFacet reversed() const
Constructs the reverse triple from this one.
Definition CDCFacet.cc:53
CDCTangent getMiddleToEnd() const
Getter for the tangential line including the hits from the second to the third hit.
Definition CDCFacet.cc:135
ROOT::Math::XYVector getStartRecoPos2D() const
Getter for the reconstructed position at the first hit on the fit line.
Definition CDCFacet.cc:71
AutomatonCell m_automatonCell
Memory for the cellular automaton cell associated with the facet.
Definition CDCFacet.h:141
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:156
ParameterLine2D getStartToMiddleLine() const
Getter for the tangential line from the first to the second hit.
Definition CDCFacet.cc:86
CDCTangent getStartToMiddle() const
Getter for the tangential line including the hits from the first to the second hit.
Definition CDCFacet.cc:125
ParameterLine2D getMiddleToEndLine() const
Getter for the tangential line from the second to the third hit.
Definition CDCFacet.cc:102
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.