10#include <tracking/trackingUtilities/findlets/base/Findlet.h>
11#include <tracking/trackingUtilities/geometry/Vector2D.h>
12#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectory3D.h>
13#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectory2D.h>
14#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectorySZ.h>
16#include <tracking/trackingUtilities/utilities/Algorithms.h>
17#include <tracking/trackingUtilities/utilities/Functional.h>
18#include <tracking/trackingUtilities/numerics/WeightComperator.h>
20#include <tracking/ckf/cdc/entities/CDCCKFState.h>
21#include <tracking/ckf/cdc/entities/CDCCKFPath.h>
22#include <tracking/ckf/cdc/filters/states/CDCStateFilterFactory.h>
24#include <tracking/trackingUtilities/filters/base/ChooseableFilter.dcl.h>
26#include <tracking/trackingUtilities/utilities/StringManipulation.h>
27#include <framework/core/ModuleParamList.h>
50 moduleParamList->
addParameter(TrackingUtilities::prefixed(prefix,
"maximalHitCandidates"),
53 m_preFilter.exposeParameters(moduleParamList, TrackingUtilities::prefixed(prefix,
"pre"));
54 m_basicFilter.exposeParameters(moduleParamList, TrackingUtilities::prefixed(prefix,
"basic"));
55 m_extrapolationFilter.exposeParameters(moduleParamList, TrackingUtilities::prefixed(prefix,
"extrapolation"));
56 m_finalSelection.exposeParameters(moduleParamList, TrackingUtilities::prefixed(prefix,
"final"));
71 TrackingUtilities::Weight weight;
73 B2DEBUG(29,
"On layer: " << (lastState.
isSeed() ? -1 : lastState.
getWireHit()->getWire().getICLayer()));
76 B2DEBUG(29,
"Checking layer: " << nextState.getWireHit()->getWire().getICLayer());
79 nextState.setWeight(weight);
80 if (std::isnan(weight)) {
81 B2DEBUG(29,
"Fails PreFilter");
89 nextState.setWeight(weight);
90 if (std::isnan(weight)) {
91 B2DEBUG(29,
"Fails BasicFilter");
97 nextState.setWeight(weight);
98 if (std::isnan(weight)) {
99 B2DEBUG(29,
"Fails ExtrapolationFilter");
105 reconstruct(nextState, thisTrajectory, nextState.getArcLength());
108 nextState.setWeight(weight);
109 if (std::isnan(weight)) {
110 B2DEBUG(29,
"Fails FinalFilter");
115 B2DEBUG(29,
"Starting with " << nextStates.size() <<
" possible hits");
117 TrackingUtilities::erase_remove_if(nextStates,
120 B2DEBUG(29,
"Now have " << nextStates.size());
122 std::sort(nextStates.begin(), nextStates.end(), TrackingUtilities::GreaterWeight());
149 if (wireHit->isAxial()) {
150 recoPos2D = wireHit->reconstruct2D(trajectory2D);
156 const double z = trajectorySZ.
mapSToZ(arcLength);
161 const double driftLength = wireHit->getRefDriftLength();
164 recoPos2D = wirePos2DAtZ + disp2D;
168 const double z = trajectorySZ.
mapSToZ(arcLength);
169 const double distanceToHit = trajectory2D.
getDist2D(recoPos2D);
TrackingUtilities::ChooseableFilter< CDCStateFilterFactory > m_preFilter
Pre Filter.
size_t m_maximalHitCandidates
Parameter: max number of candidates.
void reconstruct(CDCCKFState &state, const TrackingUtilities::CDCTrajectory3D &trajectory, const double lastArcLength) const
Helper function to reconstruct the arc length and the hit distance of a state according to the trajec...
TrackingUtilities::ChooseableFilter< CDCStateFilterFactory > m_extrapolationFilter
Extrapolation Filter (after Kalman extrapolation)
void setMaximalHitCandidates(size_t maximalHitCandidates)
Set maximal hit candidates for state filtering.
TrackingUtilities::ChooseableFilter< CDCStateFilterFactory > m_basicFilter
Basic Filter (uses helix extrapolation)
void apply(const CDCCKFPath &path, std::vector< CDCCKFState > &nextStates) override
Apply the findlet and do the state selection.
TrackingUtilities::ChooseableFilter< CDCStateFilterFactory > m_finalSelection
Final Selection Filter (after Kalman update)
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
CDCCKFStateFilter()
Add all sub findlets.
Define states for CKF algorithm, which can be seed track or CDC wire hit.
void setHitDistance(double hitDistance)
Set hit distance to the trajectory.
double getArcLength() const
Return the arc-length along the tracjectory to the hit.
void setReconstructedZ(double reconstructedZ)
Set state Z information.
void setArcLength(double arcLength)
Set the arc-length along the tracjectory to the hit.
const TrackingUtilities::CDCWireHit * getWireHit() const
Get CDCWireHit corresponding to the state.
TrackingUtilities::CDCTrajectory3D getTrajectory() const
Helper method to get trajectory from the trackState.
bool isSeed() const
Returns true if the state corresponds to the seed track.
Class representing a sense wire in the central drift chamber.
ROOT::Math::XYVector getWirePos2DAtZ(const double z) const
Gives the xy projected position of the wire at the given z coordinate.
The Module parameter list class.
Particle trajectory as it is seen in xy projection represented as a circle.
double calcArcLength2D(const Vector2D &point) const
Calculate the travel distance from the start position of the trajectory.
Vector2D getClosest(const Vector2D &point) const
Calculates the closest approach on the trajectory to the given point.
double getDist2D(const Vector2D &point) const
Calculates the distance from the point to the trajectory as seen from the xy projection.
Particle full three dimensional trajectory.
CDCTrajectory2D getTrajectory2D() const
Getter for the two dimensional trajectory.
CDCTrajectorySZ getTrajectorySZ() const
Getter for the sz trajectory.
Linear trajectory in sz space.
double mapSToZ(const double s=0) const
Translates the travel distance to the z coordinate.
Class representing a hit wire in the central drift chamber.
Convenvience wrapper to setup a Chooseable filter from a specific factory object.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Interface for a minimal algorithm part that wants to expose some parameters to a module.
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
double normalizeTo(const double toLength)
Normalizes the vector to the given length.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
std::vector< CDCCKFState > CDCCKFPath
Shortcut for the collection of CDC CKF-algorithm states.
Abstract base class for different kinds of events.
Functor factory from the functional composition of two functors.