8#include <tracking/trackFindingCDC/findlets/minimal/AxialTrackCreatorSegmentHough.h>
10#include <tracking/trackFindingCDC/hough/perigee/StandardBinSpec.h>
12#include <tracking/trackFindingCDC/fitting/CDCRiemannFitter.h>
13#include <tracking/trackFindingCDC/fitting/CDCObservations2D.h>
15#include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
16#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
18#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
20#include <framework/core/ModuleParamList.templateDetails.h>
23using namespace TrackFindingCDC;
27 return "Generates axial tracks from segments using a hough space over phi0 impact and curvature for the spares case.";
31 const std::string& prefix)
33 moduleParamList->
addParameter(prefixed(prefix,
"minNHits"),
35 "Absolute minimal number of hits to make an axial track.",
38 moduleParamList->
addParameter(prefixed(prefix,
"minFractionNHits"),
40 "Minimal number of hits as a fraction of the total hits in the event.",
43 moduleParamList->
addParameter(prefixed(prefix,
"maxLevel"),
45 "Level of divisions in the hough space.",
48 moduleParamList->
addParameter(prefixed(prefix,
"curvBounds"),
50 "Curvature bounds of the hough space.",
53 moduleParamList->
addParameter(prefixed(prefix,
"impactBounds"),
55 "Impact parameter bounds of the hough space.",
58 moduleParamList->
addParameter(prefixed(prefix,
"discretePhi0Width"),
60 "Width of the phi0 bins at the lowest level of the hough space.",
63 moduleParamList->
addParameter(prefixed(prefix,
"discretePhi0Overlap"),
65 "Overlap of the phi0 bins at the lowest level of the hough space.",
68 moduleParamList->
addParameter(prefixed(prefix,
"discreteImpactWidth"),
70 "Width of the impact bins at the lowest level of the hough space.",
73 moduleParamList->
addParameter(prefixed(prefix,
"discreteImpactOverlap"),
75 "Overlap of the impact bins at the lowest level of the hough space.",
78 moduleParamList->
addParameter(prefixed(prefix,
"discreteCurvWidth"),
80 "Width of the curvature bins at the lowest level of the hough space.",
83 moduleParamList->
addParameter(prefixed(prefix,
"discreteCurvOverlap"),
85 "Overlap of the curvature bins at the lowest level of the hough space.",
126 std::vector<CDCTrack>& tracks)
130 size_t nAxialHits = 0;
131 std::vector<const CDCSegment2D*> ptrAxialSegments;
132 ptrAxialSegments.reserve(segments.size());
135 if (segment.getStereoKind() == EStereoKind::c_Axial) {
136 ptrAxialSegments.push_back(&segment);
137 nAxialHits += segment.size();
146 using Candidate = std::pair<HoughBox, std::vector<const CDCSegment2D*> >;
147 std::vector<Candidate> candidates =
m_houghTree->findBest(minWeight);
149 for (
const Candidate& candidate : candidates) {
153 const HoughBox& foundHoughBox = candidate.first;
154 const std::vector<const CDCSegment2D*>& foundSegments = candidate.second;
163 const std::array<DiscreteCurv, 2>& curvs = foundHoughBox.getBounds<
DiscreteCurv>();
164 float lowerCurv = *(curvs[0]);
165 float upperCurv = *(curvs[1]);
177 track.sortByArcLength2D();
180 if (track.empty())
continue;
184 track.setStartTrajectory3D(startTrajectory3D);
189 track.setEndTrajectory3D(endTrajectory3D);
191 tracks.push_back(std::move(track));
The Module parameter list class.
static const int c_curvDivisions
Fixed parameter: Number of divisions in the curv direction.
void initialize() final
Initialize the findlet before event processing.
double m_param_minNHits
Parameter: Absolute minimal number of hits to make an axial track.
void apply(const std::vector< CDCSegment2D > &segments, std::vector< CDCTrack > &tracks) final
Generates the tracks from the given segments into the output argument.
int m_param_discreteImpactWidth
Parameter: Width of the impact bins at the lowest level of the hough space.
std::string getDescription() final
Short description of the findlet.
int m_param_discretePhi0Width
Parameter: Width of the phi0 bins at the lowest level of the hough space.
std::unique_ptr< SimpleSegmentPhi0ImpactCurvHoughTree > m_houghTree
The hough space tree search.
std::vector< float > m_param_curvBounds
Parameter: Curvature bounds of the hough space.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
double m_param_minFractionNHits
Parameter: Minimal number of hits as a fraction of the total hits in the event.
static const int c_impactDivisions
Fixed parameter: Number of divisions in the impact direction.
int m_param_discreteImpactOverlap
Parameter: Overlap of the impact bins at the lowest level of the hough space.
int m_param_discreteCurvOverlap
Parameter: Overlap of the curvature bins at the lowest level of the hough space.
int m_param_maxLevel
Parameter: Level of divisions in the hough space.
static const int c_phi0Divisions
Fixed parameter: Number of divisions in the phi0 direction.
void terminate() final
Cleanup the findlet after event processing.
int m_param_discreteCurvWidth
Parameter: Width of the curvature bins at the lowest level of the hough space.
int m_param_discretePhi0Overlap
Parameter: Overlap of the phi0 bins at the lowest level of the hough space.
std::vector< float > m_param_impactBounds
Parameter: Impact parameter bounds of the hough space.
Class serving as a storage of observed drift circles to present to the Riemann fitter.
std::size_t appendRange(const CDCSegment2D &segment2D)
Appends all reconstructed hits from the two dimensional segment.
Class representing a two dimensional reconstructed hit in the central drift chamber.
Class representing a three dimensional reconstructed hit.
const Vector3D & getRecoPos3D() const
Getter for the 3d position of the hit.
static CDCRecoHit3D reconstruct(const CDCRecoHit2D &recoHit2D, const CDCTrajectory2D &trajectory2D)
Reconstructs the three dimensional hit from the two dimensional and the two dimensional trajectory.
Class implementing the Riemann fit for two dimensional trajectory circle.
static const CDCRiemannFitter & getFitter()
Static getter for a general Riemann fitter.
A reconstructed sequence of two dimensional hits in one super layer.
Class representing a sequence of three dimensional reconstructed hits.
Particle trajectory as it is seen in xy projection represented as a circle.
void reverse()
Reverses the trajectory in place.
double getCurvature() const
Getter for the curvature as seen from the xy projection.
Particle full three dimensional trajectory.
double setLocalOrigin(const Vector3D &localOrigin)
Setter for the origin of the local coordinate system.
void initialize() override
Receive and dispatch signal before the start of the event processing.
void terminate() override
Receive and dispatch Signal for termination of the event processing.
Type to have values not based on discrete positions from an array.
Strategy to construct discrete curve points from discrete overlap specifications.
DiscreteCurv::Array constructArray() const
Construct the array of discrete curve positions.
int getNOverlap() const
Getter for the overlap in discrete number of positions.
Representation for a discrete position in an array of discrete positions.
Strategy to construct discrete impact points from discrete overlap specifications.
double getOverlap() const
Getter for the overlap in real impact to investigate the value that results from the discrete overlap...
Strategy to construct discrete phi0 points from discrete overlap specifications.
DiscretePhi0::Array constructArray() const
Construct the array of discrete phi0 positions.
int getNOverlap() const
Getter for the overlap in discrete number of positions.
typename InBox::HoughBox HoughBox
Type of the hough box.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
static ESign common(ESign n1, ESign n2)
Check if two values have a common sign.
Abstract base class for different kinds of events.