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>
19#include <Math/Vector2D.h>
28 namespace TrackFindingCDC {
36 template<
class AInBox>
52 size_t nHits = segment2D->size();
53 auto weightOfHit = [
this, &houghBox](
const TrackingUtilities::Weight & totalWeight,
55 TrackingUtilities::Weight hitWeight = this->
operator()(&recoHit2D, houghBox);
56 return std::isnan(hitWeight) ? totalWeight : totalWeight + hitWeight;
59 TrackingUtilities::Weight totalWeight = std::accumulate(segment2D->begin(),
61 static_cast<TrackingUtilities::Weight
>(0.0),
65 constexpr const TrackingUtilities::Weight minEfficiency = 2.0 / 3;
66 if (totalWeight > nHits * minEfficiency) {
81 bool isIn =
contains(*houghBox, wire, signedDriftLength);
82 TrackingUtilities::ERightLeft rlInfo = recoHit2D->
getRLInfo();
96 const double driftLength = wireHit->getRefDriftLength();
99 return isValid(rlInfo) ? 1.0 + std::abs(rlInfo) *
m_rlWeightGain : NAN;
117 const TrackingUtilities::ERightLeft rlInfo = rlTaggedWireHit.
getRLInfo();
120 TrackingUtilities::ERightLeft newRLInfo =
124 return isValid(newRLInfo) ? 1.0 + std::abs(newRLInfo) *
m_rlWeightGain : NAN;
141 TrackingUtilities::ERightLeft rlInfo = TrackingUtilities::ERightLeft::c_Unknown)
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);
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;
153 return TrackingUtilities::ERightLeft::c_Invalid;
160 const ROOT::Math::XYVector& pos2D = wire.
getRefPos2D();
162 const ROOT::Math::XYVector& movePerZ = wire.
getMovePerZ();
165 const TrackingUtilities::ESign distSign = this->getDistanceSign(houghBox,
166 pos2D.x(), pos2D.y(),
168 movePerZ.x(), movePerZ.y(),
170 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.
signed short ILayer
The type of the layer ids enumerating layers within a superlayer.
Abstract base class for different kinds of events.