10#include <tracking/trackingUtilities/eventdata/segments/CDCSegment2D.h>
11#include <tracking/trackingUtilities/eventdata/hits/CDCRLWireHit.h>
12#include <tracking/trackingUtilities/eventdata/hits/CDCWireHit.h>
14#include <cdc/topology/CDCWire.h>
16#include <tracking/trackingUtilities/numerics/ESign.h>
17#include <tracking/trackingUtilities/numerics/Weight.h>
26 namespace TrackFindingCDC {
34 template<
class AInBox>
50 size_t nHits = segment2D->size();
51 auto weightOfHit = [
this, &houghBox](
const TrackingUtilities::Weight & totalWeight,
53 TrackingUtilities::Weight hitWeight = this->
operator()(&recoHit2D, houghBox);
54 return std::isnan(hitWeight) ? totalWeight : totalWeight + hitWeight;
57 TrackingUtilities::Weight totalWeight = std::accumulate(segment2D->begin(),
59 static_cast<TrackingUtilities::Weight
>(0.0),
63 constexpr const TrackingUtilities::Weight minEfficiency = 2.0 / 3;
64 if (totalWeight > nHits * minEfficiency) {
79 bool isIn =
contains(*houghBox, wire, signedDriftLength);
80 TrackingUtilities::ERightLeft rlInfo = recoHit2D->
getRLInfo();
94 const double driftLength = wireHit->getRefDriftLength();
97 return isValid(rlInfo) ? 1.0 + std::abs(rlInfo) *
m_rlWeightGain : NAN;
115 const TrackingUtilities::ERightLeft rlInfo = rlTaggedWireHit.
getRLInfo();
118 TrackingUtilities::ERightLeft newRLInfo =
122 return isValid(newRLInfo) ? 1.0 + std::abs(newRLInfo) *
m_rlWeightGain : NAN;
139 TrackingUtilities::ERightLeft rlInfo = TrackingUtilities::ERightLeft::c_Unknown)
141 bool isRightIn = rlInfo != TrackingUtilities::ERightLeft::c_Left and
contains(houghBox, wire, driftLength);
142 bool isLeftIn = rlInfo != TrackingUtilities::ERightLeft::c_Right and
contains(houghBox, wire, -driftLength);
144 if (isRightIn and isLeftIn) {
145 return TrackingUtilities::ERightLeft::c_Unknown;
146 }
else if (isRightIn) {
147 return TrackingUtilities::ERightLeft::c_Right;
148 }
else if (isLeftIn) {
149 return TrackingUtilities::ERightLeft::c_Left;
151 return TrackingUtilities::ERightLeft::c_Invalid;
163 const TrackingUtilities::ESign distSign = this->getDistanceSign(houghBox,
164 pos2D.
x(), pos2D.
y(),
166 movePerZ.
x(), movePerZ.
y(),
168 const bool isIn = distSign == TrackingUtilities::ESign::c_Zero;
Class representing a sense wire in the central drift chamber.
const ROOT::Math::XYVector & getRefPos2D() const
Getter for the wire reference position for 2D tracking Gives the wire's reference position projected ...
ROOT::Math::XYVector 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.
Predicate class to check for the containment of axial and stereo hits in some hough space part.
typename AInBox::HoughBox HoughBox
The hough box which represents the hough space part to be investigated.
TrackingUtilities::Weight operator()(TrackingUtilities::CDCRLWireHit &rlTaggedWireHit, const HoughBox *houghBox)
Checks if the wire hit is contained in a phi0 curv hough space.
float m_rlWeightGain
Weight gain for a hit which right left passage hypotheses could be uniquely resolved.
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 righ...
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 Return...
TrackingUtilities::Weight operator()(const TrackingUtilities::CDCWireHit *wireHit, const HoughBox *houghBox)
Checks if the wire 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.
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.
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.
float setRLWeightGain() const
Getter for the gain in weight for hits which rl passage could be uniquly resolved.
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 CDC::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 CDC::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.
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.
signed short ILayer
The type of the layer ids enumerating layers within a superlayer.
Abstract base class for different kinds of events.