11#include <tracking/trackFindingVXD/variableExtractors/VariableExtractor.h>
12#include <tracking/dataobjects/RecoTrack.h>
13#include <tracking/spacePointCreation/SpacePointTrackCand.h>
15#include <genfit/MeasuredStateOnPlane.h>
16#include <Math/Vector3D.h>
17#include <TMatrixDSym.h>
55 m_variables.at(
"PXD_QI") = isnan(pxdQI) ? 0. : pxdQI;
62 m_variables.at(
"CDC_QI") = isnan(cdcQI) ? 0. : cdcQI;
106 const ROOT::Math::XYZVector* svdTrackVector,
107 const ROOT::Math::XYZVector* cdcTrackVector)
109 if (not(svdTrackVector and cdcTrackVector)) {
118 m_variables.at(prefix +
"_diff_Z") = fabs(cdcTrackVector->Z() - svdTrackVector->Z());
119 m_variables.at(prefix +
"_diff_Pt") = fabs(cdcTrackVector->Rho() - svdTrackVector->Rho());
120 m_variables.at(prefix +
"_diff_Theta") = fabs(cdcTrackVector->Theta() - svdTrackVector->Theta());
121 m_variables.at(prefix +
"_diff_Phi") = fabs(cdcTrackVector->Phi() - svdTrackVector->Phi());
122 m_variables.at(prefix +
"_diff_Mag") = fabs(cdcTrackVector->R() - svdTrackVector->R());
123 m_variables.at(prefix +
"_diff_Eta") = fabs(cdcTrackVector->Eta() - svdTrackVector->Eta());
135 genfit::MeasuredStateOnPlane svdTrackStateOnPlane;
136 genfit::MeasuredStateOnPlane cdcTrackStateOnPlane;
141 cdcTrackStateOnPlane.extrapolateToCylinder(
m_CDC_wall_radius, center, direction);
142 svdTrackStateOnPlane.extrapolateToPlane(cdcTrackStateOnPlane.getPlane());
143 }
catch (genfit::Exception
const& e) {
145 B2WARNING(
"SubRecoTrackExtractor: SVDRecoTrack and/or CDCRecoTrack extrapolation to the CDCwall failed!\n"
146 <<
"-->" << e.what());
154 const ROOT::Math::XYZVector svdTrackPositionOnPlaneAtCDCWall = ROOT::Math::XYZVector(svdTrackStateOnPlane.getPos());
155 const ROOT::Math::XYZVector svdTrackMomentumOnPlaneAtCDCWall = ROOT::Math::XYZVector(svdTrackStateOnPlane.getMom());
156 const ROOT::Math::XYZVector cdcTrackPositionOnPlaneAtCDCWall = ROOT::Math::XYZVector(cdcTrackStateOnPlane.getPos());
157 const ROOT::Math::XYZVector cdcTrackMomentumOnPlaneAtCDCWall = ROOT::Math::XYZVector(cdcTrackStateOnPlane.getMom());
162 const TMatrixDSym invCovariance = (svdTrackStateOnPlane.getCov() + cdcTrackStateOnPlane.getCov()).Invert();
163 TVectorD stateDifference = cdcTrackStateOnPlane.getState() - svdTrackStateOnPlane.getState();
164 stateDifference *= invCovariance;
165 const float chi2 = stateDifference * (cdcTrackStateOnPlane.getState() - svdTrackStateOnPlane.getState());
168 }
catch (genfit::Exception
const& e) {
170 B2WARNING(
"SubRecoTrackExtractor: Matrix is singular!\n"
171 <<
"-->" << e.what());
186 genfit::MeasuredStateOnPlane svdTrackStateOnPlane;
187 genfit::MeasuredStateOnPlane cdcTrackStateOnPlane;
192 cdcTrackStateOnPlane.extrapolateToLine(linePoint, lineDirection);
193 svdTrackStateOnPlane.extrapolateToLine(linePoint, lineDirection);
194 }
catch (genfit::Exception
const& e) {
196 B2WARNING(
"SubRecoTrackExtractor: SVDRecoTrack and/or CDCRecoTrack extrapolation to POCA failed!\n"
197 <<
"-->" << e.what());
204 const ROOT::Math::XYZVector svdTrackPositionOnPlaneAtPOCA = ROOT::Math::XYZVector(svdTrackStateOnPlane.getPos());
205 const ROOT::Math::XYZVector svdTrackMomentumOnPlaneAtPOCA = ROOT::Math::XYZVector(svdTrackStateOnPlane.getMom());
206 const ROOT::Math::XYZVector cdcTrackPositionOnPlaneAtPOCA = ROOT::Math::XYZVector(cdcTrackStateOnPlane.getPos());
207 const ROOT::Math::XYZVector cdcTrackMomentumOnPlaneAtPOCA = ROOT::Math::XYZVector(cdcTrackStateOnPlane.getMom());
A mixin class to attach a name to an object. Based on class with same name in CDC package.
This is the Reconstruction Event-Data Model Track.
bool wasFitSuccessful(const genfit::AbsTrackRep *representation=nullptr) const
Returns true if the last fit with the given representation was successful.
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...
float getQualityIndicator() const
Get the quality index attached to this RecoTrack given by one of the reconstruction algorithms....
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...
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
Storage for (VXD) SpacePoint-based track candidates.
Abstract base class for different kinds of events.