8#include <tracking/ckf/general/filters/NonIPCrossingStateFilter.dcl.h>
10#include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
11#include <tracking/trackFindingCDC/geometry/Vector3D.h>
12#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
14#include <tracking/ckf/general/utilities/SearchDirection.h>
16#include <tracking/spacePointCreation/SpacePoint.h>
17#include <tracking/dataobjects/RecoTrack.h>
19#include <framework/core/ModuleParamList.h>
26 template <
class AllStateFilter>
29 if (std::isnan(AllStateFilter::operator()(pair))) {
33 const auto& previousStates = pair.first;
34 auto* state = pair.second;
36 const RecoTrack* cdcTrack = previousStates.front()->getSeed();
37 B2ASSERT(
"Path without seed?", cdcTrack);
39 const SpacePoint* spacePoint = state->getHit();
40 B2ASSERT(
"Path without hit?", spacePoint);
42 const genfit::MeasuredStateOnPlane& firstMeasurement = [&state, &previousStates]() {
43 if (state->mSoPSet()) {
44 return state->getMeasuredStateOnPlane();
46 B2ASSERT(
"Previous state was not fitted?", previousStates.back()->mSoPSet());
47 return previousStates.back()->getMeasuredStateOnPlane();
60 const double deltaArcLengthTrackHit = trajectory2D.
calcArcLength2D(hitPosition.
xy());
70 template <
class AllStateFilter>
73 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"direction"), m_param_directionAsString,
74 "The direction where the extrapolation will happen.");
77 template <
class AllStateFilter>
81 m_param_direction =
fromString(m_param_directionAsString);
The Module parameter list class.
typename AllStateFilter::Object Object
The object to filter.
This is the Reconstruction Event-Data Model Track.
short int getChargeSeed() const
Return the charge seed stored in the reco track. ATTENTION: This is not the fitted charge.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
const B2Vector3D & getPosition() const
return the position vector in global coordinates
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.
double calcArcLength2DBetween(const Vector2D &fromPoint, const Vector2D &toPoint) const
Calculate the travel distance between the two given positions Returns the travel distance on the traj...
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
A three dimensional vector.
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
TrackFindingCDC::Weight operator()(const Object &pair) final
Main function testing the object for the direction.
void initialize() final
Copy the string direction parameter to the enum.
TrackFindingCDC::EForwardBackward fromString(const std::string &directionString)
Helper function to turn a direction string into a valid forward backward information.
constexpr bool arcLengthInRightDirection(double arcLength2D, TrackFindingCDC::EForwardBackward forwardBackward)
Given the calculated arc length between a start point and an end point, checks if the travelled path ...
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the direction parameter.
Abstract base class for different kinds of events.