10#include <framework/datastore/StoreArray.h>
11#include <framework/gearbox/Const.h>
12#include <mdst/dataobjects/TrackFitResult.h>
13#include <mdst/dataobjects/Kink.h>
14#include <tracking/dataobjects/RecoTrack.h>
15#include <tracking/trackFitting/fitter/base/TrackFitter.h>
42 KinkFitter(
const std::string& trackFitResultsName =
"",
const std::string& kinksName =
"",
43 const std::string& recoTracksName =
"",
44 const std::string& copiedRecoTracksName =
"RecoTracksKinkTmp");
52 void initializeCuts(
const double vertexDistanceCut,
const double vertexChi2Cut,
const double precutDistance);
110 bool splitRecoTrack(
const RecoTrack* recoTrackSplit,
short& recoTrackIndexMother,
short& recoTrackIndexDaughter);
136 ROOT::Math::XYZVector& vertexPos,
149 const bool motherFlag,
const int delta);
171 const ROOT::Math::XYZVector& momentumSeed,
172 const ROOT::Math::XYZVector& positionSeed,
173 const double& timeSeed);
186 const ROOT::Math::XYZVector& momentumSeed,
187 const ROOT::Math::XYZVector& positionSeed,
188 const double& timeSeed,
189 const bool blockInnerStereoHits =
false,
const bool useAnotherFitter =
false);
216 unsigned int& reassignHitStatus,
217 ROOT::Math::XYZVector& vertexPos,
double& distance,
218 ROOT::Math::XYZVector vertexPosSeed = ROOT::Math::XYZVector(0, 0, 0));
230 bool extrapolateToVertex(genfit::MeasuredStateOnPlane& stMother, genfit::MeasuredStateOnPlane& stDaughter,
231 const ROOT::Math::XYZVector& vertexPosition,
unsigned int& reassignHitStatus);
250 void errMatrixForKFit(ROOT::Math::PxPyPzEVector& fourMomentum, TMatrixDSym& covMatrix6,
251 TMatrixDSym& errMatrix7);
The ParticleType class for identifying different particle types.
KinkFitter class to create Kink mdst's objects from reconstructed tracks.
bool splitRecoTrack(const RecoTrack *recoTrackSplit, short &recoTrackIndexMother, short &recoTrackIndexDaughter)
Split track into two based on |chi2/ndf - 1|.
bool refitRecoTrackAfterReassign(RecoTrack *recoTrackMotherRefit, RecoTrack *recoTrackDaughterRefit, const RecoTrack *recoTrackMother, const RecoTrack *recoTrackDaughter)
Try to fit new RecoTracks after hit reassignment.
StoreArray< RecoTrack > m_copiedRecoTracks
RecoTrack used to refit tracks.
genfit::MeasuredStateOnPlane m_stMotherBuffer
buffer for the MeasuredStateOnPlane of mother obtained in the vertex fit
bool vertexFitWithRecoTracks(RecoTrack *recoTrackMother, RecoTrack *recoTrackDaughter, unsigned int &reassignHitStatus, ROOT::Math::XYZVector &vertexPos, double &distance, ROOT::Math::XYZVector vertexPosSeed=ROOT::Math::XYZVector(0, 0, 0))
Fit kink vertex using RecoTrack's as inputs.
StoreArray< Kink > m_kinks
Kink (output).
bool m_kinkFitterModeCombineAndFit
fitter mode 3rd bit
RecoTrack * m_motherKinkRecoTrackCache
cache for the RecoTrack of mother used to find the best vertex
double m_vertexDistanceCut
cut on the distance at the found vertex.
RecoTrack * copyRecoTrackForRefit(const RecoTrack *recoTrack, const ROOT::Math::XYZVector &momentumSeed, const ROOT::Math::XYZVector &positionSeed, const double &timeSeed, const bool blockInnerStereoHits=false, const bool useAnotherFitter=false)
Refit the daughter track blocking hits if required.
double m_vertexChi2Cut
Chi2 cut.
bool fitAndStore(const Track *trackMother, const Track *trackDaughter, short filterFlag)
Fit kink with cardinal hypothesis and store it if the fit was successful.
StoreArray< TrackFitResult > m_trackFitResults
TrackFitResult (output).
int findHitPositionForReassignment(const RecoTrack *recoTrack, ROOT::Math::XYZVector &vertexPos, int direction)
Find hit position closest to the vertex.
RecoTrack * m_daughterKinkRecoTrackCache
cache for the RecoTrack of daughter used to find the best vertex
bool extrapolateToVertex(genfit::MeasuredStateOnPlane &stMother, genfit::MeasuredStateOnPlane &stDaughter, const ROOT::Math::XYZVector &vertexPosition, unsigned int &reassignHitStatus)
Extrapolate the fit results to the perigee to the kink vertex.
double m_precutDistance
Preselection cut on distance between ending points of two tracks used in prefilter.
std::string m_recoTracksName
RecoTrackColName (input).
TrackFitResult * buildTrackFitResult(RecoTrack *recoTrack, const genfit::MeasuredStateOnPlane &msop, const double Bz, const Const::ParticleType trackHypothesis)
Build TrackFitResult of the Kink Track.
bool m_kinkFitterModeSplitTrack
fitter mode 4th bit
bool m_kinkFitterModeHitsReassignment
fitter mode 1st bit
RecoTrack * copyRecoTrackAndSplit(const RecoTrack *splitRecoTrack, const bool motherFlag, const unsigned int delta)
Create a RecoTrack in a separate StoreArray based on one to be split.
StoreArray< RecoTrack > m_recoTracks
RecoTrack (input)
bool isRefitImproveFilter6(const RecoTrack *recoTrackDaughterRefit, const ROOT::Math::XYZVector &motherPosLast)
check if the refit of filter 6 daughter tracks improves the distance between mother and daughter
RecoTrack * copyRecoTrackForFlipAndRefit(const RecoTrack *recoTrack, const ROOT::Math::XYZVector &momentumSeed, const ROOT::Math::XYZVector &positionSeed, const double &timeSeed)
Flip and refit the daughter track.
RecoTrack * copyRecoTrackAndReassignCDCHits(RecoTrack *motherRecoTrack, RecoTrack *daughterRecoTrack, const bool motherFlag, const int delta)
Copy RecoTrack to a separate StoreArray and reassign CDC hits according to delta.
bool m_kinkFitterModeFlipAndRefit
fitter mode 2nd bit
unsigned char m_kinkFitterMode
fitter mode from 0 to 15 written in bits:
void initializeCuts(const double vertexDistanceCut, const double vertexChi2Cut, const double precutDistance)
Initialize the cuts which will be applied during the fit and store process.
void errMatrixForKFit(ROOT::Math::PxPyPzEVector &fourMomentum, TMatrixDSym &covMatrix6, TMatrixDSym &errMatrix7)
Prepare the error matrix for the kFit.
genfit::MeasuredStateOnPlane m_stDaughterBuffer
buffer for the MeasuredStateOnPlane of daughter obtained in the vertex fit
void setFitterMode(const unsigned char fitterMode)
set kink fitter mode.
unsigned int combineTracksAndFit(const Track *trackMother, const Track *trackDaughter)
Combine daughter and mother tracks in one and fit.
This is the Reconstruction Event-Data Model Track.
Values of the result of a track fit with a given particle hypothesis.
Class that bundles various TrackFitResults.
Abstract base class for different kinds of events.