Belle II Software development
|
KinkFitter class to create Kink mdst's objects from reconstructed tracks. More...
#include <KinkFitter.h>
Public Member Functions | |
KinkFitter (const std::string &trackFitResultsName="", const std::string &kinksName="", const std::string &recoTracksName="", const std::string &copiedRecoTracksName="RecoTracksKinkTmp") | |
Constructor for the KinkFitter. | |
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 | setFitterMode (const unsigned char fitterMode) |
set kink fitter mode. | |
bool | fitAndStore (const Track *trackMother, const Track *trackDaughter, short filterFlag) |
Fit kink with cardinal hypothesis and store it if the fit was successful. | |
Private Member Functions | |
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. | |
bool | splitRecoTrack (const RecoTrack *recoTrackSplit, short &recoTrackIndexMother, short &recoTrackIndexDaughter) |
Split track into two based on |chi2/ndf - 1|. | |
unsigned int | combineTracksAndFit (const Track *trackMother, const Track *trackDaughter) |
Combine daughter and mother tracks in one and fit. | |
int | findHitPositionForReassignment (const RecoTrack *recoTrack, ROOT::Math::XYZVector &vertexPos, int direction) |
Find hit position closest to the vertex. | |
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 | refitRecoTrackAfterReassign (RecoTrack *recoTrackMotherRefit, RecoTrack *recoTrackDaughterRefit, const RecoTrack *recoTrackMother, const RecoTrack *recoTrackDaughter) |
Try to fit new RecoTracks after hit reassignment. | |
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 * | 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. | |
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 | |
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. | |
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. | |
TrackFitResult * | buildTrackFitResult (RecoTrack *recoTrack, const genfit::MeasuredStateOnPlane &msop, const double Bz, const Const::ParticleType trackHypothesis) |
Build TrackFitResult of the Kink Track. | |
void | errMatrixForKFit (ROOT::Math::PxPyPzEVector &fourMomentum, TMatrixDSym &covMatrix6, TMatrixDSym &errMatrix7) |
Prepare the error matrix for the kFit. | |
Private Attributes | |
std::string | m_recoTracksName |
RecoTrackColName (input). | |
StoreArray< RecoTrack > | m_recoTracks |
RecoTrack (input) | |
StoreArray< TrackFitResult > | m_trackFitResults |
TrackFitResult (output). | |
StoreArray< Kink > | m_kinks |
Kink (output). | |
double | m_vertexDistanceCut |
cut on the distance at the found vertex. | |
double | m_vertexChi2Cut |
Chi2 cut. | |
double | m_precutDistance |
Preselection cut on distance between ending points of two tracks used in prefilter. | |
unsigned char | m_kinkFitterMode |
fitter mode from 0 to 15 written in bits: | |
bool | m_kinkFitterModeHitsReassignment |
fitter mode 1st bit | |
bool | m_kinkFitterModeFlipAndRefit |
fitter mode 2nd bit | |
bool | m_kinkFitterModeCombineAndFit |
fitter mode 3rd bit | |
bool | m_kinkFitterModeSplitTrack |
fitter mode 4th bit | |
StoreArray< RecoTrack > | m_copiedRecoTracks |
RecoTrack used to refit tracks. | |
genfit::MeasuredStateOnPlane | m_stMotherBuffer |
buffer for the MeasuredStateOnPlane of mother obtained in the vertex fit | |
genfit::MeasuredStateOnPlane | m_stDaughterBuffer |
buffer for the MeasuredStateOnPlane of daughter obtained in the vertex fit | |
RecoTrack * | m_motherKinkRecoTrackCache |
cache for the RecoTrack of mother used to find the best vertex | |
RecoTrack * | m_daughterKinkRecoTrackCache |
cache for the RecoTrack of daughter used to find the best vertex | |
KinkFitter class to create Kink mdst's objects from reconstructed tracks.
To use this class, give the kinkFitter a mother and a daughter charged track and call the fitAndStore function. In case of track splitting, the mother and daughter should be the same particle.
kinkFitter.fitAndStore(B2TrackMother, B2TrackDaughter, filterFlag);
Definition at line 32 of file KinkFitter.h.
KinkFitter | ( | const std::string & | trackFitResultsName = "" , |
const std::string & | kinksName = "" , |
||
const std::string & | recoTracksName = "" , |
||
const std::string & | copiedRecoTracksName = "RecoTracksKinkTmp" |
||
) |
Constructor for the KinkFitter.
trackFitResultsName | Belle2::TrackFitResult StoreArray name. |
kinksName | Kink StoreArray name. |
recoTracksName | RecoTrack StoreArray name. |
copiedRecoTracksName | RecoTrack StoreArray name (used for track refitting). |
m_recoTracks
register m_copiedRecoTracks
relation : m_recoTracks <--> m_copiedRecoTracks
Definition at line 44 of file KinkFitter.cc.
|
private |
Build TrackFitResult of the Kink Track.
Build TrackFitResult of Kink Track.
recoTrack | input RecoTrack |
msop | MeasuredStateOnPlane extrapolated to the vertex (mother and daughter) or IP (mother) |
Bz | z component of the magnetic field at vertex or IP |
trackHypothesis | track hypothesis |
Definition at line 115 of file KinkFitter.cc.
Combine daughter and mother tracks in one and fit.
combine daughter and mother tracks and fit the result to check for clones
Definition at line 469 of file KinkFitter.cc.
|
private |
Copy RecoTrack to a separate StoreArray and reassign CDC hits according to delta.
motherRecoTrack | mother RecoTrack |
daughterRecoTrack | daughter RecoTrack |
motherFlag | true if creating mother, false if creating daughter |
delta | the position of the threshold to reassign the hits, starting from the end positive if mother hits are reassigned to daughter, negative if vice-versa |
Definition at line 193 of file KinkFitter.cc.
|
private |
Create a RecoTrack in a separate StoreArray based on one to be split.
splitRecoTrack | RecoTrack to be split |
motherFlag | true if creating mother, false if creating daughter |
delta | the position of the threshold to split the hits, starting from the end |
Definition at line 515 of file KinkFitter.cc.
|
private |
Flip and refit the daughter track.
recoTrack | recoTrack to flip and refit |
momentumSeed | momentum seed (with the initial sign) |
positionSeed | position seed |
timeSeed | time seed |
Definition at line 358 of file KinkFitter.cc.
|
private |
Refit the daughter track blocking hits if required.
recoTrack | recoTrack to refit |
momentumSeed | momentum seed |
positionSeed | position seed |
timeSeed | time seed |
blockInnerStereoHits | block the hits in the first stereo layer and all before |
useAnotherFitter | use ordinary KalmanFilter |
Definition at line 391 of file KinkFitter.cc.
|
private |
Prepare the error matrix for the kFit.
fourMomentum | four momentum of the track state to be used in kFit |
covMatrix6 | covariance matrix of the track state to be used in kFit |
errMatrix7 | error matrix of the track state to be prepared and used in kFit |
Definition at line 1412 of file KinkFitter.cc.
|
private |
Extrapolate the fit results to the perigee to the kink vertex.
Extrapolate the states to the fitted vertex. If the vertex is inside one of the tracks, bits are set.
If the vertex is inside one of the tracks, bits in reassignHitStatus are set.
stMother | mother MeasuredStateOnPlane |
stDaughter | daughter MeasuredStateOnPlane |
vertexPosition | vertex tracks to be extrapolated to |
reassignHitStatus | bits to be set in case of vertex being inside one of the tracks |
Definition at line 92 of file KinkFitter.cc.
|
private |
Find hit position closest to the vertex.
recoTrack | RecoTrack |
vertexPos | vertex |
direction | direction (+1 for daughter track, -1 for mother track). Should be +-1 |
Definition at line 135 of file KinkFitter.cc.
Fit kink with cardinal hypothesis and store it if the fit was successful.
Fit and store kink.
If the corresponding flag is set, try to reassign hits between mother and daughter tracks. If the corresponding flag is set, try to flip and refit daughter track. If the corresponding flag is set, try to combine mother and daughter track and fit the resulting track. If the corresponding flag is set, try to split the track candidate selected by KinkFinderModule.
trackMother | mother Track |
trackDaughter | daughter Track (in case of splitting the same as trackMother) |
filterFlag | filter with which track pair was selected Filter 1: Distance between first point of the daughter and last point of the mother < m_precutDistance (majority). Filter 2: Distance between last point of the daughter and last point of the mother < m_precutDistance (wrong daughter sign). Filter 3: Distance between the daughter Helix extrapolation to last point of the mother and last point of the mother < m_precutDistance (lost layers for daughter, second largest contribution). Filter 4: 2D distance between first point of the daughter and last point of the mother < m_precutDistance2D (bad daughter resolution recovered by hit reassignment). Filter 5: 2D distance between last point of the daughter and last point of the mother < m_precutDistance2D (bad daughter resolution and wrong daughter sign, almost no events). Filter 6: Distance between the daughter Helix extrapolation to last point of the mother and last point of the mother < m_precutDistance2D (lost layers for daughter combined with bad daughter resolution, can be recovered by refit). Filter 7: Track to split selected among mother candidates. Filter 8: Track to split selected among daughter candidates. Filter 9: Track to split selected among tracks not passing mother/daughter criteria. |
If the fitterMode requires, tries to reassign hits between daughter and mother tracks. If the fitterMode requires, tries to flip and refit the tracks.
Definition at line 828 of file KinkFitter.cc.
void initializeCuts | ( | const double | vertexDistanceCut, |
const double | vertexChi2Cut, | ||
const double | precutDistance | ||
) |
Initialize the cuts which will be applied during the fit and store process.
vertexDistanceCut | Cut on distance between tracks at the Kink vertex. |
vertexChi2Cut | Cut on Chi2 for the Kink vertex. |
precutDistance | Preselection cut on distance between ending points of two tracks used in KinkFinderModule. |
Definition at line 82 of file KinkFitter.cc.
|
private |
check if the refit of filter 6 daughter tracks improves the distance between mother and daughter
check if the refit of daughter track for filterFlag 6 (mother end point and daughter Helix extrapolation close in 2D) improves the 3D distance between mother and daughter
recoTrackDaughterRefit | refitted daughter recoTrack |
motherPosLast | position of the mother state at last hit |
Definition at line 447 of file KinkFitter.cc.
|
private |
Try to fit new RecoTracks after hit reassignment.
recoTrackMotherRefit | mother track after reassignment |
recoTrackDaughterRefit | daughter track after reassignment |
recoTrackMother | initial mother track |
recoTrackDaughter | initial daughter track |
Definition at line 311 of file KinkFitter.cc.
void setFitterMode | ( | const unsigned char | fitterMode | ) |
set kink fitter mode.
fitterMode | from 0 to 15 in binary: 1st bit: reassign hits (1 is On, 0 is Off) 2nd bit: flip tracks with close end points (1 is On, 0 is Off) 3rd bit: fit both tracks as one (1 is On, 0 is Off) 4th bit: track splitting (1 is On, 0 is Off) |
Definition at line 68 of file KinkFitter.cc.
|
private |
Split track into two based on |chi2/ndf - 1|.
For the best split position search, use binary search.
recoTrackSplit | RecoTrack to be split |
recoTrackIndexMother | index of the created mother RecoTrack in m_copiedRecoTracks |
recoTrackIndexDaughter | index of the created daughter RecoTrack in m_copiedRecoTracks |
Definition at line 612 of file KinkFitter.cc.
|
private |
Fit kink vertex using RecoTrack's as inputs.
Fit kink vertex using RecoTracks as inputs.
Return true (false) if the vertex fit has done well (failed). If the vertex is inside one of the RecoTracks, bits in reassignHitStatus are set.
recoTrackMother | RecoTrack of mother |
recoTrackDaughter | RecoTrack of daughter |
reassignHitStatus | store a result of this function. if the daughter(mother) track has hits inside the Kink vertex position, 0x1(0x2) bit is set. |
vertexPos | store a result of this function. The fitted vertex position is stored. |
distance | store a distance between tracks at the decay vertex |
vertexPosSeed | a seed of the vertex position |
Calculates distance at the fitted vertex. Checks if the reassignment of the hits is required.
Definition at line 1280 of file KinkFitter.cc.
|
private |
RecoTrack used to refit tracks.
Definition at line 282 of file KinkFitter.h.
|
private |
cache for the RecoTrack of daughter used to find the best vertex
Definition at line 286 of file KinkFitter.h.
|
private |
fitter mode from 0 to 15 written in bits:
1st bit: reassign hits (1 is On, 0 is Off) 2nd bit: flip tracks with close end points (1 is On, 0 is Off) 3rd bit: fit both tracks as one (1 is On, 0 is Off) 4th bit: combined track candidate splitting (1 is On, 0 is Off)
Definition at line 271 of file KinkFitter.h.
|
private |
fitter mode 3rd bit
Definition at line 278 of file KinkFitter.h.
|
private |
fitter mode 2nd bit
Definition at line 277 of file KinkFitter.h.
|
private |
fitter mode 1st bit
Definition at line 276 of file KinkFitter.h.
|
private |
fitter mode 4th bit
Definition at line 279 of file KinkFitter.h.
|
private |
Kink (output).
Definition at line 262 of file KinkFitter.h.
|
private |
cache for the RecoTrack of mother used to find the best vertex
Definition at line 285 of file KinkFitter.h.
|
private |
Preselection cut on distance between ending points of two tracks used in prefilter.
here it is needed in isRefitImproveFilter6 function
Definition at line 267 of file KinkFitter.h.
|
private |
RecoTrack (input)
Definition at line 258 of file KinkFitter.h.
|
private |
RecoTrackColName (input).
Definition at line 257 of file KinkFitter.h.
|
private |
buffer for the MeasuredStateOnPlane of daughter obtained in the vertex fit
Definition at line 284 of file KinkFitter.h.
|
private |
buffer for the MeasuredStateOnPlane of mother obtained in the vertex fit
Definition at line 283 of file KinkFitter.h.
|
private |
TrackFitResult (output).
Definition at line 261 of file KinkFitter.h.
|
private |
Chi2 cut.
Definition at line 266 of file KinkFitter.h.
|
private |
cut on the distance at the found vertex.
Definition at line 265 of file KinkFitter.h.