 |
Belle II Software
release-05-02-19
|
12 #include <tracking/trackFindingCDC/findlets/base/Findlet.h>
13 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
14 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory3D.h>
15 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
16 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectorySZ.h>
18 #include <tracking/trackFindingCDC/utilities/Algorithms.h>
19 #include <tracking/trackFindingCDC/utilities/Functional.h>
20 #include <tracking/trackFindingCDC/numerics/WeightComperator.h>
22 #include <tracking/ckf/cdc/entities/CDCCKFState.h>
23 #include <tracking/ckf/cdc/entities/CDCCKFPath.h>
24 #include <tracking/ckf/cdc/filters/states/CDCStateFilterFactory.h>
26 #include <tracking/trackFindingCDC/filters/base/ChooseableFilter.h>
28 #include <tracking/trackFindingCDC/utilities/StringManipulation.h>
29 #include <framework/core/ModuleParamList.h>
36 class CDCCKFStateFilter :
public TrackFindingCDC::Findlet<const CDCCKFState, CDCCKFState> {
52 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"maximalHitCandidates"),
55 m_preFilter.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(prefix,
"pre"));
56 m_basicFilter.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(prefix,
"basic"));
57 m_extrapolationFilter.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(prefix,
"extrapolation"));
58 m_finalSelection.exposeParameters(moduleParamList, TrackFindingCDC::prefixed(prefix,
"final"));
62 void apply(
const CDCCKFPath& path, std::vector<CDCCKFState>& nextStates)
override
67 TrackFindingCDC::Weight weight;
69 B2DEBUG(100,
"On layer: " << (lastState.
isSeed() ? -1 : lastState.
getWireHit()->getWire().getICLayer()));
72 B2DEBUG(100,
"Checking layer: " << nextState.getWireHit()->getWire().getICLayer());
75 nextState.setWeight(weight);
76 if (std::isnan(weight)) {
77 B2DEBUG(100,
"Fails PreFilter");
85 nextState.setWeight(weight);
86 if (std::isnan(weight)) {
87 B2DEBUG(100,
"Fails BasicFilter");
93 nextState.setWeight(weight);
94 if (std::isnan(weight)) {
95 B2DEBUG(100,
"Fails ExtrapolationFilter");
101 reconstruct(nextState, thisTrajectory, nextState.getArcLength());
104 nextState.setWeight(weight);
105 if (std::isnan(weight)) {
106 B2DEBUG(100,
"Fails FinalFilter");
111 B2DEBUG(100,
"Starting with " << nextStates.size() <<
" possible hits");
113 TrackFindingCDC::erase_remove_if(nextStates,
116 B2DEBUG(100,
"Now have " << nextStates.size());
127 TrackFindingCDC::ChooseableFilter<CDCStateFilterFactory>
m_preFilter;
129 TrackFindingCDC::ChooseableFilter<CDCStateFilterFactory>
m_basicFilter;
145 if (wireHit->isAxial()) {
146 recoPos2D = wireHit->reconstruct2D(trajectory2D);
152 const double z = trajectorySZ.
mapSToZ(arcLength);
157 const double driftLength = wireHit->getRefDriftLength();
160 recoPos2D = wirePos2DAtZ + disp2D;
164 const double z = trajectorySZ.
mapSToZ(arcLength);
165 const double distanceToHit = trajectory2D.
getDist2D(recoPos2D);
double normalizeTo(const double toLength)
Normalizes the vector to the given length.
Functor factory turning a binary functor and two functors into a new functor which executes the binar...
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Convenvience wrapper to setup a Chooseable filter from a specific factory object.
TrackFindingCDC::CDCTrajectory3D getTrajectory() const
Helper method to get trajectory from the trackState.
TrackFindingCDC::ChooseableFilter< CDCStateFilterFactory > m_extrapolationFilter
Extrapolation Filter (after Kalman extrapolation)
size_t m_maximalHitCandidates
Parameter: max number of candidates.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
Linear trajectory in sz space.
Vector2D getClosest(const Vector2D &point) const
Calculates the closest approach on the trajectory to the given point.
void addProcessingSignalListener(ProcessingSignalListener *psl)
Register a processing signal listener to be notified.
Particle trajectory as it is seen in xy projection represented as a circle.
Vector2D getWirePos2DAtZ(const double z) const
Gives the xy projected position of the wire at the given z coordinate.
double mapSToZ(const double s=0) const
Translates the travel distance to the z coordinate.
double getArcLength() const
Return the arc-length along the tracjectory to the hit.
void reconstruct(CDCCKFState &state, const TrackFindingCDC::CDCTrajectory3D &trajectory, const double lastArcLength) const
Helper function to reconstruct the arc length and the hit distance of a state according to the trajec...
CDCTrajectory2D getTrajectory2D() const
Getter for the two dimensional trajectory.
TrackFindingCDC::ChooseableFilter< CDCStateFilterFactory > m_finalSelection
Final Selection Filter (after Kalman update)
CDCTrajectorySZ getTrajectorySZ() const
Getter for the sz trajectory.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
void setReconstructedZ(double reconstructedZ)
Set state Z information.
Abstract base class for different kinds of events.
std::vector< CDCCKFState > CDCCKFPath
Shortcut for the collection of CDC CKF-algorithm states.
TrackFindingCDC::ChooseableFilter< CDCStateFilterFactory > m_basicFilter
Basic Filter (uses helix extrapolation)
void setArcLength(double arcLength)
Set the arc-length along the tracjectory to the hit.
void setHitDistance(double hitDistance)
Set hit distance to the trajectory.
CDCCKFStateFilter()
Add all sub findlets.
void apply(const CDCCKFPath &path, std::vector< CDCCKFState > &nextStates) override
Apply the findlet and do the state selection.
Class representing a sense wire in the central drift chamber.
double getDist2D(const Vector2D &point) const
Calculates the distance from the point to the trajectory as seen from the xy projection.
Define states for CKF algorithm, which can be seed track or CDC wire hit.
Class representing a hit wire in the central drift chamber.
The Module parameter list class.
Functor factory from the functional composition of two functors.
bool isSeed() const
Returns true if the state corresponds to the seed track.
double calcArcLength2D(const Vector2D &point) const
Calculate the travel distance from the start position of the trajectory.
Particle full three dimensional trajectory.
const TrackFindingCDC::CDCWireHit * getWireHit() const
Get CDCWireHit corresponding to the state.
TrackFindingCDC::ChooseableFilter< CDCStateFilterFactory > m_preFilter
Pre Filter.