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

Weight operator() (const 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.
 
Weight operator() (const CDCRecoHit2D *recoHit2D, const HoughBox *houghBox)
 Checks if the two dimensional reconstructed hit is contained in a phi0 curv hough space.
 
Weight operator() (const CDCWireHit *wireHit, const HoughBox *houghBox)
 Checks if the wire hit is contained in a phi0 curv hough space.
 
Weight operator() (CDCRLWireHit &rlTaggedWireHit, const HoughBox *houghBox)
 Checks if the wire hit is contained in a phi0 curv hough space.
 
ERightLeft containsRightOrLeft (const HoughBox &houghBox, const CDCWire &wire, double driftLength, ERightLeft rlInfo=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 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 35 of file StereoHitContained.h.

Member Typedef Documentation

◆ HoughBox

using HoughBox = typename AInBox::HoughBox

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

Definition at line 42 of file StereoHitContained.h.

Member Function Documentation

◆ contains()

bool contains ( const HoughBox houghBox,
const 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 156 of file StereoHitContained.h.

157 {
158 const Vector2D& pos2D = wire.getRefPos2D();
159 //const Vector2D& pos2D = wire.getWirePos2DAtZ(0);
160 const Vector2D& movePerZ = wire.getMovePerZ();
161 ILayer iCLayer(wire.getICLayer());
162 //B2INFO("movePerZ = " << movePerZ);
163 const ESign distSign = this->getDistanceSign(houghBox,
164 pos2D.x(), pos2D.y(),
165 signedDriftLength,
166 movePerZ.x(), movePerZ.y(),
167 iCLayer);
168 const bool isIn = distSign == ESign::c_Zero;
169 return isIn;
170 }
ESign
Enumeration for the distinct sign values of floating point variables.
Definition: ESign.h:27

◆ containsRightOrLeft()

ERightLeft containsRightOrLeft ( const HoughBox houghBox,
const CDCWire wire,
double  driftLength,
ERightLeft  rlInfo = 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 136 of file StereoHitContained.h.

140 {
141 bool isRightIn = rlInfo != ERightLeft::c_Left and contains(houghBox, wire, driftLength);
142 bool isLeftIn = rlInfo != ERightLeft::c_Right and contains(houghBox, wire, -driftLength);
143
144 if (isRightIn and isLeftIn) {
145 return ERightLeft::c_Unknown;
146 } else if (isRightIn) {
147 return ERightLeft::c_Right;
148 } else if (isLeftIn) {
149 return ERightLeft::c_Left;
150 } else {
151 return ERightLeft::c_Invalid;
152 }
153 }
bool contains(const HoughBox &houghBox, const CDCWire &wire, double signedDriftLength)
Checks if a wire hit at a signed drift length is contained in the hough space part.

◆ operator()() [1/4]

Weight operator() ( 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 111 of file StereoHitContained.h.

113 {
114 const CDCWire& wire = rlTaggedWireHit.getWire();
115 const ERightLeft rlInfo = rlTaggedWireHit.getRLInfo();
116 const double driftLength = rlTaggedWireHit.getRefDriftLength();
117
118 ERightLeft newRLInfo =
119 containsRightOrLeft(*houghBox, wire, driftLength, rlInfo);
120
121 rlTaggedWireHit.setRLInfo(newRLInfo);
122 return isValid(newRLInfo) ? 1.0 + std::abs(newRLInfo) * m_rlWeightGain : NAN;
123 }
float m_rlWeightGain
Weight gain for a hit which right left passage hypotheses could be uniquely resolved.
ERightLeft containsRightOrLeft(const HoughBox &houghBox, const CDCWire &wire, double driftLength, ERightLeft rlInfo=ERightLeft::c_Unknown)
Checks if a wire hit at a drift length is contained in the hough space part It investigates both righ...
bool isValid(EForwardBackward eForwardBackward)
Check whether the given enum instance is one of the valid values.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:25

◆ operator()() [2/4]

Weight operator() ( const 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 74 of file StereoHitContained.h.

76 {
77 const CDCWire& wire = recoHit2D->getWire();
78 const double signedDriftLength = recoHit2D->getSignedRefDriftLength();
79 bool isIn = contains(*houghBox, wire, signedDriftLength);
80 ERightLeft rlInfo = recoHit2D->getRLInfo();
81 return isIn ? 1.0 + isValid(rlInfo) * m_rlWeightGain : NAN;
82 }

◆ operator()() [3/4]

Weight operator() ( const 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 47 of file StereoHitContained.h.

49 {
50 size_t nHits = segment2D->size();
51 auto weightOfHit = [this, &houghBox](const Weight & totalWeight,
52 const CDCRecoHit2D & recoHit2D) -> Weight {
53 Weight hitWeight = this->operator()(&recoHit2D, houghBox);
54 return std::isnan(hitWeight) ? totalWeight : totalWeight + hitWeight;
55 };
56
57 Weight totalWeight = std::accumulate(segment2D->begin(),
58 segment2D->end(),
59 static_cast<Weight>(0.0),
60 weightOfHit);
61
62 // Require a efficiency of 66%
63 constexpr const Weight minEfficiency = 2.0 / 3;
64 if (totalWeight > nHits * minEfficiency) {
65 return totalWeight;
66 } else {
67 return NAN;
68 }
69 }
Weight operator()(const CDCSegment2D *segment2D, const HoughBox *houghBox)
Checks if more than 66% of the hits in this segment are contained in the phi0 curv hough space Return...

◆ operator()() [4/4]

Weight operator() ( const 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 90 of file StereoHitContained.h.

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

◆ setRLWeightGain() [1/2]

float setRLWeightGain ( ) const
inline

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

Definition at line 178 of file StereoHitContained.h.

179 { return m_rlWeightGain; }

◆ setRLWeightGain() [2/2]

void setRLWeightGain ( float  rlWeightGain)
inline

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

Definition at line 174 of file StereoHitContained.h.

175 { m_rlWeightGain = rlWeightGain;}

Member Data Documentation

◆ m_rlWeightGain

float m_rlWeightGain = 0
private

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

Definition at line 183 of file StereoHitContained.h.


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