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>
21using namespace TrackFindingCDC;
23TrackFindingCDC::Weight
29 const CKFToPXDState::stateCache& fromStateCache = fromState.
getStateCache();
30 const CKFToPXDState::stateCache& toStateCache = toState.
getStateCache();
32 B2ASSERT(
"You have filled the wrong states into this!", toStateCache.isHitState);
34 if (not fromStateCache.isHitState) {
38 genfit::MeasuredStateOnPlane measuredStateOnPlane =
41 bool extrapolationSuccessful =
true;
43 measuredStateOnPlane.extrapolateToCylinder(
c_PXDLayerRadii[toStateCache.geoLayer - 1]);
45 B2DEBUG(20,
"ToPXDCKF CylinderDistancePXDPairFilter: extrapolation to cylinder of layer " << toStateCache.geoLayer <<
46 " with radius of " <<
c_PXDLayerRadii[toStateCache.geoLayer - 1] <<
" failed");
47 extrapolationSuccessful =
false;
50 if (extrapolationSuccessful) {
51 const ROOT::Math::XYZVector& positionOnCylinder = ROOT::Math::XYZVector(measuredStateOnPlane.getPos());
53 float phiDiff = positionOnCylinder.Phi() - toStateCache.phi;
54 while (phiDiff > M_PI) phiDiff -= 2. * M_PI;
55 while (phiDiff < -M_PI) phiDiff += 2. * M_PI;
56 const float thetaDiff = positionOnCylinder.Theta() - toStateCache.theta;
65 float phiDiff = fromStateCache.phi - toStateCache.phi;
66 while (phiDiff > M_PI) phiDiff -= 2. * M_PI;
67 while (phiDiff < -M_PI) phiDiff += 2. * M_PI;
68 const float thetaDiff = fromStateCache.theta - toStateCache.theta;
79 if (fromStateCache.geoLayer == toStateCache.geoLayer and
80 fromStateCache.sensorID.getSensorNumber() == toStateCache.sensorID.getSensorNumber()) {
86 float phiDiff = fromStateCache.phi - toStateCache.phi;
87 while (phiDiff > M_PI) phiDiff -= 2. * M_PI;
88 while (phiDiff < -M_PI) phiDiff += 2. * M_PI;
89 const float thetaDiff = fromStateCache.theta - toStateCache.theta;
102 "Does this CKF extrapolate the tracks backward or forward?",
104 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"cylinderExtrapolationToHitPhiCut"),
106 "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.",
108 moduleParamList->
addParameter(TrackFindingCDC::prefixed(prefix,
"cylinderExtrapolationToHitThetaCut"),
110 "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.",
113 "Cut in phi for the difference between RecoTrack information and current hit-based state.",
116 "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...
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.