8#include <tracking/ckf/pxd/filters/relations/InterceptDistancePXDPairFilter.h>
9#include <tracking/trackFindingCDC/filters/base/Filter.icc.h>
11#include <tracking/dataobjects/RecoTrack.h>
12#include <tracking/dataobjects/PXDIntercept.h>
14#include <pxd/geometry/SensorInfo.h>
15#include <vxd/geometry/SensorInfoBase.h>
16#include <vxd/geometry/GeoCache.h>
18#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
19#include <framework/core/ModuleParamList.templateDetails.h>
22using namespace TrackFindingCDC;
24TrackFindingCDC::Weight
30 const CKFToPXDState::stateCache& fromStateCache = fromState.
getStateCache();
31 const CKFToPXDState::stateCache& toStateCache = toState.
getStateCache();
33 B2ASSERT(
"You have filled the wrong states into this!", toStateCache.isHitState);
35 const unsigned int layerDiff = abs(fromStateCache.geoLayer - toStateCache.geoLayer);
37 float phiDiff =
deltaPhi(fromStateCache.phi, toStateCache.phi);
50 if (not fromStateCache.isHitState) {
54 const float scaleInvPt =
56 if (relatedIntercepts.size() > 0) {
58 for (
const auto& intercept : relatedIntercepts) {
59 const VxdID& fromStateSensorID(intercept.getSensorID());
65 const auto& interceptGlobalPoint = sensorInfo.
pointToGlobal({intercept.getCoorU(), intercept.getCoorV(), 0});
66 phiDiff =
deltaPhi(interceptGlobalPoint.Phi(), toStateCache.phi);
78 const float dR = fromStateCache.perp - toStateCache.perp;
79 const float dZ = fromStateCache.perp / tan(fromStateCache.theta) - toStateCache.perp / tan(toStateCache.theta);
80 const float cosThetaSeedhit = dZ /
sqrt(dR * dR + dZ * dZ);
103 "Threshold on pT to apply inverse pT scale on cut value.",
106 "Cut in phi for the difference between PXDIntercept from RecoTrack on the same layer and current hit-based state.",
109 "Cut in eta for the difference between PXDIntercept from RecoTrack on the same layer and current hit-based state.",
112 "Cut in phi for the difference between RecoTrack information and current hit-based state.",
115 "Cut in eta for the difference between RecoTrack information and current hit-based state.",
131 float dphi = phi1 - phi2;
132 while (dphi > M_PI) dphi -= 2. * M_PI;
133 while (dphi < -M_PI) dphi += 2. * M_PI;
144 if (abs(cosTheta) < 1)
return -0.5 * log((1.0 - cosTheta) / (1.0 + cosTheta));
146 B2INFO(
"AngularDistancePXDPairFilter::cosTheta >=1 : " << cosTheta);
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.
float deltaPhi(float phi1, float phi2)
Calculate delta phi.
double m_param_EtaHitHitCut
Filter potential relations in eta between hit states.
float deltaEtaFromTheta(float theta1, float theta2)
Calculate delta eta from theta.
double m_param_EtaRecoTrackToHitCut
Filter potential relations in eta between seed states (based on RecoTracks) and hit states.
double m_param_PhiHitHitCut
Filter potential relations in phi between hit states.
double m_param_PhiOverlapHitHitCut
Filter potential relations in phi between hit states in ladder overlap.
double m_param_EtaOverlapHitHitCut
Filter potential relations in eta between hit states in ladder overlap.
double m_param_PhiInterceptToHitCut
Filter potential relations in phi between seed states (based on PXDIntercepts) and hit states.
double m_param_EtaInterceptToHitCut
Filter potential relations in eta between seed states (based on PXDIntercepts) and hit states.
double m_param_PtThresholdTrackToHitCut
Threshold to apply inverse pT dependent cut [GeV].
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters.
double m_param_PhiRecoTrackToHitCut
Filter potential relations in phi between seed states (based on RecoTracks) and hit states.
float convertThetaToEta(float cosTheta)
Convert theta to eta (pseudorapidity)
std::string m_param_PXDInterceptsName
Name of the PXDIntercepts StoreArray.
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.
PXDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an PXD ...
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
This is the Reconstruction Event-Data Model Track.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a point from local to global coordinates.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getLayerNumber() const
Get the layer id.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.