10#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
11#include <tracking/trackFindingCDC/eventdata/hits/CDCRLWireHit.h>
12#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
14#include <tracking/trackFindingCDC/topology/CDCWire.h>
16#include <tracking/trackFindingCDC/numerics/ESign.h>
17#include <tracking/trackFindingCDC/numerics/Weight.h>
26 namespace TrackFindingCDC {
34 template<
class AInBox>
50 size_t nHits = segment2D->size();
51 auto weightOfHit = [
this, &houghBox](
const Weight & totalWeight,
53 Weight hitWeight = this->
operator()(&recoHit2D, houghBox);
54 return std::isnan(hitWeight) ? totalWeight : totalWeight + hitWeight;
57 Weight totalWeight = std::accumulate(segment2D->begin(),
59 static_cast<Weight
>(0.0),
63 constexpr const Weight minEfficiency = 2.0 / 3;
64 if (totalWeight > nHits * minEfficiency) {
79 bool isIn =
contains(*houghBox, wire, signedDriftLength);
93 const CDCWire& wire = wireHit->getWire();
94 const double driftLength = wireHit->getRefDriftLength();
97 return isValid(rlInfo) ? 1.0 + std::abs(rlInfo) *
m_rlWeightGain : NAN;
122 return isValid(newRLInfo) ? 1.0 + std::abs(newRLInfo) *
m_rlWeightGain : NAN;
141 bool isRightIn = rlInfo != ERightLeft::c_Left and
contains(houghBox, wire, driftLength);
142 bool isLeftIn = rlInfo != ERightLeft::c_Right and
contains(houghBox, wire, -driftLength);
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;
151 return ERightLeft::c_Invalid;
163 const ESign distSign = this->getDistanceSign(houghBox,
164 pos2D.
x(), pos2D.
y(),
166 movePerZ.
x(), movePerZ.
y(),
168 const bool isIn = distSign == ESign::c_Zero;
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
const CDCWire & getWire() const
Getter for the wire the oriented hit associated to.
void setRLInfo(const ERightLeft rlInfo)
Setter for the right left passage information.
ERightLeft getRLInfo() const
Getter for the right left passage information.
Class representing a two dimensional reconstructed hit in the central drift chamber.
const CDCWire & getWire() const
Getter for the wire the reconstructed hit associated to.
double getSignedRefDriftLength() const
Getter for the drift length at the wire reference position signed with the right left passage hypothe...
ERightLeft getRLInfo() const
Getter for the right left passage information.
A reconstructed sequence of two dimensional hits in one super layer.
Class representing a hit wire in the central drift chamber.
Class representing a sense wire in the central drift chamber.
Vector2D getMovePerZ() const
Getter for the vector describing the nominal positional change in the xy plane per unit z.
ILayer getICLayer() const
Getter for the continuous layer id ranging from 0 - 55.
const Vector2D & getRefPos2D() const
Getter for the wire reference position for 2D tracking Gives the wire's reference position projected ...
Predicate class to check for the containment of axial and stereo hits in some hough space part.
Weight operator()(CDCRLWireHit &rlTaggedWireHit, const HoughBox *houghBox)
Checks if the wire hit is contained in a phi0 curv hough space.
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.
typename AInBox::HoughBox HoughBox
The hough box which represents the hough space part to be investigated.
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...
float m_rlWeightGain
Weight gain for a hit which right left passage hypotheses could be uniquely resolved.
Weight operator()(const CDCWireHit *wireHit, 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 righ...
Weight operator()(const CDCRecoHit2D *recoHit2D, const HoughBox *houghBox)
Checks if the two dimensional reconstructed hit is contained in a phi0 curv hough space.
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.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double x() const
Getter for the x coordinate.
double y() const
Getter for the y coordinate.
ESign
Enumeration for the distinct sign values of floating point variables.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Abstract base class for different kinds of events.