Belle II Software development
OffOriginExtension Class Reference

Class performs extension (adding new hits) of given candidate using conformal transformation w.r.t point on the trajectory. More...

#include <OffOriginExtension.h>

Inheritance diagram for OffOriginExtension:
BaseCandidateReceiver

Public Member Functions

 OffOriginExtension (std::vector< const TrackingUtilities::CDCWireHit * > allAxialWireHits, double levelPrecision=9)
 Constructor.
 
void operator() (const std::vector< const TrackingUtilities::CDCWireHit * > &inputWireHits, void *qt) final
 Main entry point for the post processing call from the QuadTreeProcessor.
 
std::vector< const TrackingUtilities::CDCWireHit * > roadSearch (const std::vector< const TrackingUtilities::CDCWireHit * > &wireHits)
 Perform transformation for set of given hits; reference position taken as POCA of the fitted trajectory.
 
std::vector< const TrackingUtilities::CDCWireHit * > getHitsWRTtoRefPos (const TrackingUtilities::Vector2D &refPos, float curv, float theta)
 Get hits which are compatible with given trajectory.
 
const std::vector< TrackingUtilities::CDCTrack > & getTracks () const
 Get the collected tracks.
 

Protected Attributes

std::vector< const TrackingUtilities::CDCWireHit * > m_allAxialWireHits
 Pool of all axial hits from which the road search may select additional hits.
 
std::vector< TrackingUtilities::CDCTrackm_tracks
 Collected tracks.
 

Private Attributes

double m_levelPrecision
 Precision level for the width of the off origin hough search.
 

Detailed Description

Class performs extension (adding new hits) of given candidate using conformal transformation w.r.t point on the trajectory.

Definition at line 28 of file OffOriginExtension.h.

Constructor & Destructor Documentation

◆ OffOriginExtension()

OffOriginExtension ( std::vector< const TrackingUtilities::CDCWireHit * > allAxialWireHits,
double levelPrecision = 9 )
explicit

Constructor.

Definition at line 27 of file OffOriginExtension.cc.

29 : BaseCandidateReceiver(std::move(allAxialWireHits))
30 , m_levelPrecision(levelPrecision)
31{
32}
BaseCandidateReceiver(std::vector< const TrackingUtilities::CDCWireHit * > allAxialWireHits)
Constructor.
double m_levelPrecision
Precision level for the width of the off origin hough search.

Member Function Documentation

◆ getHitsWRTtoRefPos()

std::vector< const CDCWireHit * > getHitsWRTtoRefPos ( const TrackingUtilities::Vector2D & refPos,
float curv,
float theta )

Get hits which are compatible with given trajectory.

Parameters
refPosdefines 2D reference position with respect to which transformation will be performed
curvcurvarute of the track trajectory
thetaangle between x-axis and vector to the center of the circle which represents trajectory
Returns
vector of CDCWireHit objects which satisfy legendre transformation with respect to the given parameters

Definition at line 99 of file OffOriginExtension.cc.

100{
101 float thetaPrecision = M_PI / (pow(2., m_levelPrecision + 1));
102 float curvPrecision = 0.15 / (pow(2., m_levelPrecision));
103
105 YSpan curvSpan{curv - curvPrecision, curv + curvPrecision};
106 LookupTable<Vector2D> thetaSpan(&Vector2D::Phi, 1, theta - thetaPrecision, theta + thetaPrecision);
107
108 AxialHitQuadTreeProcessor qtProcessor(refPos, curvSpan, &thetaSpan);
109 qtProcessor.seed(m_allAxialWireHits);
110
111 std::vector<const CDCWireHit*> newWireHits = qtProcessor.getAssignedItems();
112 return newWireHits;
113}
std::vector< const TrackingUtilities::CDCWireHit * > m_allAxialWireHits
Pool of all axial hits from which the road search may select additional hits.
static Vector2D Phi(const double phi)
Constructs a unit vector with azimuth angle equal to phi.
Definition Vector2D.h:82

◆ getTracks()

const std::vector< CDCTrack > & getTracks ( ) const
inherited

Get the collected tracks.

Definition at line 41 of file BaseCandidateReceiver.cc.

42{
43 return m_tracks;
44}
std::vector< TrackingUtilities::CDCTrack > m_tracks
Collected tracks.

◆ operator()()

void operator() ( const std::vector< const TrackingUtilities::CDCWireHit * > & inputWireHits,
void * qt )
finalvirtual

Main entry point for the post processing call from the QuadTreeProcessor.

Reimplemented from BaseCandidateReceiver.

Definition at line 34 of file OffOriginExtension.cc.

36{
37 // Unset the taken flag and let the postprocessing decide
38 for (const CDCWireHit* wireHit : inputWireHits) {
39 (*wireHit)->setTakenFlag(false);
40 }
41
42 std::vector<const CDCWireHit*> candidateHits = roadSearch(inputWireHits);
46 true);
47}
std::vector< const TrackingUtilities::CDCWireHit * > roadSearch(const std::vector< const TrackingUtilities::CDCWireHit * > &wireHits)
Perform transformation for set of given hits; reference position taken as POCA of the fitted trajecto...
static void addCandidateFromHits(const std::vector< const TrackingUtilities::CDCWireHit * > &foundAxialWireHits, const std::vector< const TrackingUtilities::CDCWireHit * > &allAxialWireHits, std::vector< TrackingUtilities::CDCTrack > &axialTracks, bool withPostprocessing=true)
Create CDCTrack using CDCWireHit hits and store it in the list. Then call the postprocessing on it.

◆ roadSearch()

std::vector< const CDCWireHit * > roadSearch ( const std::vector< const TrackingUtilities::CDCWireHit * > & wireHits)

Perform transformation for set of given hits; reference position taken as POCA of the fitted trajectory.

Definition at line 50 of file OffOriginExtension.cc.

51{
52 const CDCKarimakiFitter& fitter = CDCKarimakiFitter::getNoDriftVarianceFitter();
53 CDCTrajectory2D trackTrajectory2D = fitter.fit(wireHits);
54
55 double chi2 = trackTrajectory2D.getChi2();
56 Vector2D refPos = trackTrajectory2D.getGlobalPerigee();
57
58 // change sign of the curvature; should be the same as the charge of the candidate
59 double curv = trackTrajectory2D.getCurvature();
60
61 // theta is the vector normal to the trajectory at the perigee
62 double theta = trackTrajectory2D.getGlobalCircle().phi0() + M_PI_2;
63
64 // Hide the current hits from the road search
65 for (const CDCWireHit* hit : wireHits) {
66 hit->getAutomatonCell().setTakenFlag(true);
67 }
68
69 std::vector<const CDCWireHit*> newWireHits = getHitsWRTtoRefPos(refPos, curv, theta);
70
71 // Unhide the current hits from the road search
72 for (const CDCWireHit* hit : wireHits) {
73 hit->getAutomatonCell().setTakenFlag(false);
74 }
75
76 if (newWireHits.size() == 0) return wireHits;
77
78 std::vector<const CDCWireHit*> combinedWireHits;
79
80 for (const CDCWireHit* hit : wireHits) {
81 combinedWireHits.push_back(hit);
82 }
83
84 for (const CDCWireHit* hit : newWireHits) {
85 combinedWireHits.push_back(hit);
86 }
87
88 CDCTrajectory2D combinedTrajectory2D = fitter.fit(wireHits);
89 double combinedChi2 = combinedTrajectory2D.getChi2();
90
91 if (combinedChi2 < chi2 * 2.) {
92 return combinedWireHits;
93 }
94
95 return wireHits;
96}
static const CDCKarimakiFitter & getNoDriftVarianceFitter()
Static getter for a general fitter that does not use the drift length variances.
std::vector< const TrackingUtilities::CDCWireHit * > getHitsWRTtoRefPos(const TrackingUtilities::Vector2D &refPos, float curv, float theta)
Get hits which are compatible with given trajectory.
PerigeeCircle getGlobalCircle() const
Getter for the circle in global coordinates.
double getChi2() const
Getter for the chi2 value of the circle fit.
Vector2D getGlobalPerigee() const
Getter for the closest approach on the trajectory to the global origin.
double getCurvature() const
Getter for the curvature as seen from the xy projection.
double phi0() const
Getter for the azimuth angle of the direction of flight at the perigee.

Member Data Documentation

◆ m_allAxialWireHits

std::vector<const TrackingUtilities::CDCWireHit*> m_allAxialWireHits
protectedinherited

Pool of all axial hits from which the road search may select additional hits.

Definition at line 39 of file BaseCandidateReceiver.h.

◆ m_levelPrecision

double m_levelPrecision
private

Precision level for the width of the off origin hough search.

Definition at line 53 of file OffOriginExtension.h.

◆ m_tracks

std::vector<TrackingUtilities::CDCTrack> m_tracks
protectedinherited

Collected tracks.

Definition at line 42 of file BaseCandidateReceiver.h.


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