8#include <tracking/ckf/cdc/filters/states/ExtrapolateAndUpdateCDCStateFilter.h>
10#include <tracking/trackingUtilities/numerics/ERightLeft.h>
11#include <tracking/trackingUtilities/geometry/VectorUtil.h>
12#include <cdc/dataobjects/CDCRecoHit.h>
14#include <tracking/ckf/cdc/entities/CDCCKFState.h>
15#include <tracking/ckf/cdc/entities/CDCCKFPath.h>
17#include <tracking/trackingUtilities/utilities/StringManipulation.h>
19#include <framework/core/ModuleParamList.h>
21#include <Math/Vector3D.h>
26 TrackingUtilities::ERightLeft setRLInfo(
const genfit::MeasuredStateOnPlane& mSoP,
CDCCKFState& state)
28 const auto& mom = ROOT::Math::XYZVector(mSoP.getMom());
29 const auto& wire = state.
getWireHit()->getWire();
31 const auto& trackPosition = ROOT::Math::XYZVector(mSoP.getPos());
32 const auto& hitPosition = wire.getWirePos3DAtZ(trackPosition.z());
34 ROOT::Math::XYZVector trackPosToWire{hitPosition - trackPosition};
35 TrackingUtilities::ERightLeft rlInfo = VectorUtil::isRightOrLeftOf(VectorUtil::getXYVector(trackPosToWire),
36 VectorUtil::getXYVector(mom));
43ExtrapolateAndUpdateCDCStateFilter::ExtrapolateAndUpdateCDCStateFilter()
52 moduleParamList->
getParameter<std::string>(TrackingUtilities::prefixed(prefix,
"direction")).setDefaultValue(
"forward");
61 genfit::MeasuredStateOnPlane mSoP = lastState.
getTrackState();
64 CDCRecoHit recoHit(wireHit->getHit(),
nullptr);
73 B2ASSERT(
"Should be exactly two measurements", measurements.size() == 2);
75 const auto& rightLeft = setRLInfo(mSoP, state);
77 if (rightLeft == TrackingUtilities::ERightLeft::c_Right) {
83 delete measurements[0];
84 delete measurements[1];
87 setRLInfo(mSoP, state);
90 }
catch (
const genfit::Exception& e) {
Define states for CKF algorithm, which can be seed track or CDC wire hit.
void setTrackState(const genfit::MeasuredStateOnPlane &trackState)
Store genfit Measured state on plane.
void setRLinfo(const TrackingUtilities::ERightLeft &rl)
Set right-left info for the hit.
double getChi2() const
Get state chi2.
const TrackingUtilities::CDCWireHit * getWireHit() const
Get CDCWireHit corresponding to the state.
void setChi2(double chi2)
Set set chi2.
const genfit::MeasuredStateOnPlane & getTrackState() const
Get genfit track state (but first check if already present)
This class is used to transfer CDC information to the track fit.
std::vector< genfit::MeasurementOnPlane * > constructMeasurementsOnPlane(const genfit::StateOnPlane &state) const override
build MeasurementsOnPlane
genfit::SharedPlanePtr constructPlane(const genfit::StateOnPlane &state) const override
Methods that actually interface to Genfit.
KalmanStepper< 1 > m_updater
Kalman filter updater.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
Advancer m_extrapolator
Kalman filter extrapolator.
TrackingUtilities::Weight operator()(const BaseCDCStateFilter::Object &pair) final
Extrapolate along the path (pair.first) to the CDC wireHit-state (pair.second). Return 1/chi2 if Ok,...
The Module parameter list class.
Class representing a hit wire in the central drift chamber.
void addProcessingSignalListener(ProcessingSignalListener *psl)
std::pair< const CDCCKFPath *, CDCCKFState * > Object
ModuleParam< T > & getParameter(const std::string &name) const
Returns a reference to a parameter.
std::vector< CDCCKFState > CDCCKFPath
Shortcut for the collection of CDC CKF-algorithm states.
Abstract base class for different kinds of events.