8#include <tracking/ckf/general/filters/NonIPCrossingStateFilter.dcl.h>
10#include <tracking/trackingUtilities/eventdata/trajectories/CDCTrajectory2D.h>
11#include <tracking/trackingUtilities/geometry/VectorUtil.h>
12#include <tracking/trackingUtilities/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>
21#include <Math/Vector2D.h>
22#include <Math/Vector3D.h>
29 template <
class AllStateFilter>
32 if (std::isnan(AllStateFilter::operator()(pair))) {
36 const auto& previousStates = pair.first;
37 auto* state = pair.second;
39 const RecoTrack* cdcTrack = previousStates.front()->getSeed();
40 B2ASSERT(
"Path without seed?", cdcTrack);
42 const SpacePoint* spacePoint = state->getHit();
43 B2ASSERT(
"Path without hit?", spacePoint);
45 const genfit::MeasuredStateOnPlane& firstMeasurement = [&state, &previousStates]() {
46 if (state->mSoPSet()) {
47 return state->getMeasuredStateOnPlane();
49 B2ASSERT(
"Previous state was not fitted?", previousStates.back()->mSoPSet());
50 return previousStates.back()->getMeasuredStateOnPlane();
54 const ROOT::Math::XYZVector& position =
static_cast<ROOT::Math::XYZVector
>(firstMeasurement.getPos());
55 const ROOT::Math::XYZVector& momentum =
static_cast<ROOT::Math::XYZVector
>(firstMeasurement.getMom());
60 const ROOT::Math::XYZVector& hitPosition = spacePoint->
getPosition();
61 const ROOT::Math::XYVector origin(0, 0);
63 const double deltaArcLengthHitOrigin = trajectory2D.calcArcLength2DBetween(VectorUtil::getXYVector(hitPosition), origin);
64 const double deltaArcLengthTrackHit = trajectory2D.calcArcLength2D(VectorUtil::getXYVector(hitPosition));
74 template <
class AllStateFilter>
78 "The direction where the extrapolation will happen.");
81 template <
class AllStateFilter>
The Module parameter list class.
typename AllStateFilter::Object Object
The object to filter.
TrackingUtilities::EForwardBackward m_param_direction
Direction parameter converted from the string parameters.
std::string m_param_directionAsString
Parameter for the distance given to the framework (can not handle EForwardBackward directly)
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.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
TrackingUtilities::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.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the direction parameter.
TrackingUtilities::EForwardBackward fromString(const std::string &directionString)
Helper function to turn a direction string into a valid forward backward information.
constexpr bool arcLengthInRightDirection(double arcLength2D, TrackingUtilities::EForwardBackward forwardBackward)
Given the calculated arc length between a start point and an end point, checks if the travelled path ...
Abstract base class for different kinds of events.