Belle II Software development
StereoHitContained< AInBox > Class Template Reference

Predicate class to check for the containment of axial and stereo hits in some hough space part. More...

#include <StereoHitContained.h>

Inheritance diagram for StereoHitContained< AInBox >:

Public Types

using HoughBox = typename AInBox::HoughBox
 The hough box which represents the hough space part to be investigated.
 

Public Member Functions

TrackingUtilities::Weight operator() (const TrackingUtilities::CDCSegment2D *segment2D, const HoughBox *houghBox)
 Checks if more than 66% of the hits in this segment are contained in the phi0 curv hough space Returns the sum of the individual hit weights in this case.
 
TrackingUtilities::Weight operator() (const TrackingUtilities::CDCRecoHit2D *recoHit2D, const HoughBox *houghBox)
 Checks if the two dimensional reconstructed hit is contained in a phi0 curv hough space.
 
TrackingUtilities::Weight operator() (const TrackingUtilities::CDCWireHit *wireHit, const HoughBox *houghBox)
 Checks if the wire hit is contained in a phi0 curv hough space.
 
TrackingUtilities::Weight operator() (TrackingUtilities::CDCRLWireHit &rlTaggedWireHit, const HoughBox *houghBox)
 Checks if the wire hit is contained in a phi0 curv hough space.
 
TrackingUtilities::ERightLeft containsRightOrLeft (const HoughBox &houghBox, const CDC::CDCWire &wire, double driftLength, TrackingUtilities::ERightLeft rlInfo=TrackingUtilities::ERightLeft::c_Unknown)
 Checks if a wire hit at a drift length is contained in the hough space part It investigates both right left passage hypotheses.
 
bool contains (const HoughBox &houghBox, const CDC::CDCWire &wire, double signedDriftLength)
 Checks if a wire hit at a signed drift length is contained in the hough space part.
 
void setRLWeightGain (float rlWeightGain)
 Setter for the gain in weight for hits which rl passage could be uniquly resolved.
 
float setRLWeightGain () const
 Getter for the gain in weight for hits which rl passage could be uniquly resolved.
 

Private Attributes

float m_rlWeightGain = 0
 Weight gain for a hit which right left passage hypotheses could be uniquely resolved.
 

Detailed Description

template<class AInBox>
class Belle2::TrackFindingCDC::StereoHitContained< AInBox >

Predicate class to check for the containment of axial and stereo hits in some hough space part.

The hough space is parameterised as a template parameter and is a basic objected that has been broadened by a sweep in the directions of interested.

Definition at line 37 of file StereoHitContained.h.

Member Typedef Documentation

◆ HoughBox

template<class AInBox>
using HoughBox = typename AInBox::HoughBox

The hough box which represents the hough space part to be investigated.

Definition at line 44 of file StereoHitContained.h.

Member Function Documentation

◆ contains()

template<class AInBox>
bool contains ( const HoughBox & houghBox,
const CDC::CDCWire & wire,
double signedDriftLength )
inline

Checks if a wire hit at a signed drift length is contained in the hough space part.

Definition at line 158 of file StereoHitContained.h.

159 {
160 const ROOT::Math::XYVector& pos2D = wire.getRefPos2D();
161 //const ROOT::Math::XYVector& pos2D = wire.getWirePos2DAtZ(0);
162 const ROOT::Math::XYVector& movePerZ = wire.getMovePerZ();
163 CDC::ILayer iCLayer(wire.getICLayer());
164 //B2INFO("movePerZ = " << movePerZ);
165 const TrackingUtilities::ESign distSign = this->getDistanceSign(houghBox,
166 pos2D.x(), pos2D.y(),
167 signedDriftLength,
168 movePerZ.x(), movePerZ.y(),
169 iCLayer);
170 const bool isIn = distSign == TrackingUtilities::ESign::c_Zero;
171 return isIn;
172 }

◆ containsRightOrLeft()

template<class AInBox>
TrackingUtilities::ERightLeft containsRightOrLeft ( const HoughBox & houghBox,
const CDC::CDCWire & wire,
double driftLength,
TrackingUtilities::ERightLeft rlInfo = TrackingUtilities::ERightLeft::c_Unknown )
inline

Checks if a wire hit at a drift length is contained in the hough space part It investigates both right left passage hypotheses.

The evaluation can be limited by the optional rlInfo parameter, for instance when one passage hypothese could already be ruled out.

Returns
  • ERightLeft::c_Unknown if both right and left are still possible.
  • ERightLeft::c_Left if only left is still possible.
  • ERightLeft::c_Right if only right is still possible.
  • ERightLeft::c_Invalid if non of the orientations is possible.

Definition at line 138 of file StereoHitContained.h.

142 {
143 bool isRightIn = rlInfo != TrackingUtilities::ERightLeft::c_Left and contains(houghBox, wire, driftLength);
144 bool isLeftIn = rlInfo != TrackingUtilities::ERightLeft::c_Right and contains(houghBox, wire, -driftLength);
145
146 if (isRightIn and isLeftIn) {
147 return TrackingUtilities::ERightLeft::c_Unknown;
148 } else if (isRightIn) {
149 return TrackingUtilities::ERightLeft::c_Right;
150 } else if (isLeftIn) {
151 return TrackingUtilities::ERightLeft::c_Left;
152 } else {
153 return TrackingUtilities::ERightLeft::c_Invalid;
154 }
155 }

◆ operator()() [1/4]

template<class AInBox>
TrackingUtilities::Weight operator() ( const TrackingUtilities::CDCRecoHit2D * recoHit2D,
const HoughBox * houghBox )
inline

Checks if the two dimensional reconstructed hit is contained in a phi0 curv hough space.

Returns 1.0 if it is contained, returns NAN if it is not contained.

Definition at line 76 of file StereoHitContained.h.

78 {
79 const CDC::CDCWire& wire = recoHit2D->getWire();
80 const double signedDriftLength = recoHit2D->getSignedRefDriftLength();
81 bool isIn = contains(*houghBox, wire, signedDriftLength);
82 TrackingUtilities::ERightLeft rlInfo = recoHit2D->getRLInfo();
83 return isIn ? 1.0 + isValid(rlInfo) * m_rlWeightGain : NAN;
84 }
bool isValid(EForwardBackward eForwardBackward)
Check whether the given enum instance is one of the valid values.

◆ operator()() [2/4]

template<class AInBox>
TrackingUtilities::Weight operator() ( const TrackingUtilities::CDCSegment2D * segment2D,
const HoughBox * houghBox )
inline

Checks if more than 66% of the hits in this segment are contained in the phi0 curv hough space Returns the sum of the individual hit weights in this case.

Else returns NAN.

Definition at line 49 of file StereoHitContained.h.

51 {
52 size_t nHits = segment2D->size();
53 auto weightOfHit = [this, &houghBox](const TrackingUtilities::Weight & totalWeight,
54 const TrackingUtilities::CDCRecoHit2D & recoHit2D) -> TrackingUtilities::Weight {
55 TrackingUtilities::Weight hitWeight = this->operator()(&recoHit2D, houghBox);
56 return std::isnan(hitWeight) ? totalWeight : totalWeight + hitWeight;
57 };
58
59 TrackingUtilities::Weight totalWeight = std::accumulate(segment2D->begin(),
60 segment2D->end(),
61 static_cast<TrackingUtilities::Weight>(0.0),
62 weightOfHit);
63
64 // Require a efficiency of 66%
65 constexpr const TrackingUtilities::Weight minEfficiency = 2.0 / 3;
66 if (totalWeight > nHits * minEfficiency) {
67 return totalWeight;
68 } else {
69 return NAN;
70 }
71 }

◆ operator()() [3/4]

template<class AInBox>
TrackingUtilities::Weight operator() ( const TrackingUtilities::CDCWireHit * wireHit,
const HoughBox * houghBox )
inline

Checks if the wire hit is contained in a phi0 curv hough space.

Returns 1.0 if it is contained, returns NAN if it is not contained. Accepts if either the right passage hypothesis or the left passage hypothesis is in the hough box.

Definition at line 92 of file StereoHitContained.h.

94 {
95 const CDC::CDCWire& wire = wireHit->getWire();
96 const double driftLength = wireHit->getRefDriftLength();
97
98 TrackingUtilities::ERightLeft rlInfo = containsRightOrLeft(*houghBox, wire, driftLength);
99 return isValid(rlInfo) ? 1.0 + std::abs(rlInfo) * m_rlWeightGain : NAN;
100 }

◆ operator()() [4/4]

template<class AInBox>
TrackingUtilities::Weight operator() ( TrackingUtilities::CDCRLWireHit & rlTaggedWireHit,
const HoughBox * houghBox )
inline

Checks if the wire hit is contained in a phi0 curv hough space.

If the wire hit was already determined to be right or left of all tracks in a wider hough hough box up the hierarchy only evaluate for that orientation. If one of the right left passage hypothesis can be ruled out in this hough box signal so by tagging it. Note the that the CDCRLWireHit is obtained as non-const reference to be able to write back the new right left passage hypothesis. Returns 1.0 if it is contained, returns NAN if it is not contained. Accepts if either the right passage hypothesis or the left passage hypothesis is in the hough box.

Definition at line 113 of file StereoHitContained.h.

115 {
116 const CDC::CDCWire& wire = rlTaggedWireHit.getWire();
117 const TrackingUtilities::ERightLeft rlInfo = rlTaggedWireHit.getRLInfo();
118 const double driftLength = rlTaggedWireHit.getRefDriftLength();
119
120 TrackingUtilities::ERightLeft newRLInfo =
121 containsRightOrLeft(*houghBox, wire, driftLength, rlInfo);
122
123 rlTaggedWireHit.setRLInfo(newRLInfo);
124 return isValid(newRLInfo) ? 1.0 + std::abs(newRLInfo) * m_rlWeightGain : NAN;
125 }

◆ setRLWeightGain() [1/2]

template<class AInBox>
float setRLWeightGain ( ) const
inline

Getter for the gain in weight for hits which rl passage could be uniquly resolved.

Definition at line 180 of file StereoHitContained.h.

181 { return m_rlWeightGain; }

◆ setRLWeightGain() [2/2]

template<class AInBox>
void setRLWeightGain ( float rlWeightGain)
inline

Setter for the gain in weight for hits which rl passage could be uniquly resolved.

Definition at line 176 of file StereoHitContained.h.

177 { m_rlWeightGain = rlWeightGain;}

Member Data Documentation

◆ m_rlWeightGain

template<class AInBox>
float m_rlWeightGain = 0
private

Weight gain for a hit which right left passage hypotheses could be uniquely resolved.

Definition at line 185 of file StereoHitContained.h.


The documentation for this class was generated from the following file: