8#include <tracking/ckf/pxd/filters/relations/CylinderDistancePXDPairFilter.h>
9#include <tracking/trackFindingCDC/filters/base/Filter.icc.h>
11#include <tracking/dataobjects/RecoTrack.h>
13#include <pxd/geometry/SensorInfo.h>
14#include <vxd/geometry/SensorInfoBase.h>
15#include <vxd/geometry/GeoCache.h>
17#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
18#include <framework/core/ModuleParamList.templateDetails.h>
23using namespace TrackFindingCDC;
25TrackFindingCDC::Weight
31 const CKFToPXDState::stateCache& fromStateCache = fromState.
getStateCache();
32 const CKFToPXDState::stateCache& toStateCache = toState.
getStateCache();
34 B2ASSERT(
"You have filled the wrong states into this!", toStateCache.isHitState);
36 if (not fromStateCache.isHitState) {
40 genfit::MeasuredStateOnPlane measuredStateOnPlane =
43 bool extrapolationSuccessful =
true;
45 measuredStateOnPlane.extrapolateToCylinder(
c_PXDLayerRadii[toStateCache.geoLayer - 1]);
47 B2DEBUG(20,
"ToPXDCKF CylinderDistancePXDPairFilter: extrapolation to cylinder of layer " << toStateCache.geoLayer <<
48 " with radius of " <<
c_PXDLayerRadii[toStateCache.geoLayer - 1] <<
" failed");
49 extrapolationSuccessful =
false;
52 if (extrapolationSuccessful) {
53 const ROOT::Math::XYZVector& positionOnCylinder = ROOT::Math::XYZVector(measuredStateOnPlane.getPos());
55 float phiDiff = positionOnCylinder.Phi() - toStateCache.phi;
56 while (phiDiff > M_PI) phiDiff -= 2. * M_PI;
57 while (phiDiff < -M_PI) phiDiff += 2. * M_PI;
58 const float thetaDiff = positionOnCylinder.Theta() - toStateCache.theta;
67 float phiDiff = fromStateCache.phi - toStateCache.phi;
68 while (phiDiff > M_PI) phiDiff -= 2. * M_PI;
69 while (phiDiff < -M_PI) phiDiff += 2. * M_PI;
70 const float thetaDiff = fromStateCache.theta - toStateCache.theta;
81 if (fromStateCache.geoLayer == toStateCache.geoLayer and
88 float phiDiff = fromStateCache.phi - toStateCache.phi;
89 while (phiDiff > M_PI) phiDiff -= 2. * M_PI;
90 while (phiDiff < -M_PI) phiDiff += 2. * M_PI;
91 const float thetaDiff = fromStateCache.theta - toStateCache.theta;
104 "Does this CKF extrapolate the tracks backward or forward?",
106 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"cylinderExtrapolationToHitPhiCut"),
108 "Cut in phi for the difference between extrapolated position of the Seed to a cylinder with the radius of the ToState layer and the ToState.",
110 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"cylinderExtrapolationToHitThetaCut"),
112 "Cut in theta for the difference between extrapolated position of the Seed to a cylinder with the radius of the ToState layer and the ToState.",
115 "Cut in phi for the difference between RecoTrack information and current hit-based state.",
118 "Cut in theta for the difference between RecoTrack information and current hit-based state.",
const Seed * getSeed() const
Return the track this state is related to.
Specialized CKF State for extrapolating into the PXD.
const struct stateCache & getStateCache() const
Get the cached data of this state.
const std::array< double, 2 > c_PXDLayerRadii
PXD layer radii.
double m_param_RecoTrackToHitPhiCut
Filter potential relations in phi between seed states (based on RecoTracks) and hit states.
bool m_param_isBackwardCKF
Is backward or forward ToPXDCKF?
double m_param_CylinderExtrapolationToHitPhiCut
Filter potential relations in phi between seed states (based on MeasuredStateOnPlane) and hit states.
double m_param_CylinderExtrapolationToHitThetaCut
Filter potential relations in theta between seed states (based on MeasuredStateOnPlane) and hit state...
double m_param_HitHitThetaCut
Filter potential relations in theta between hit states.
double m_param_HitHitPhiCut
Filter potential relations in phi between hit states.
double m_param_RecoTrackToHitThetaCut
Filter potential relations in theta between seed states (based on RecoTracks) and hit states.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters.
TrackFindingCDC::Weight operator()(const std::pair< const CKFToPXDState *, const CKFToPXDState * > &relation) override
Return the weight based on azimuthal-angle separation.
The Module parameter list class.
This is the Reconstruction Event-Data Model Track.
const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlaneFromLastHit(const genfit::AbsTrackRep *representation=nullptr) const
Return genfit's MeasuredStateOnPlane for the last hit in a fit useful for extrapolation of measuremen...
const genfit::MeasuredStateOnPlane & getMeasuredStateOnPlaneFromFirstHit(const genfit::AbsTrackRep *representation=nullptr) const
Return genfit's MeasuredStateOnPlane for the first hit in a fit useful for extrapolation of measureme...
baseType getSensorNumber() const
Get the sensor id.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.