![]() |
Belle II Software
release-05-02-19
|
V0Fitter class to create V0 mdst's from reconstructed tracks. More...
#include <V0Fitter.h>
Public Member Functions | |
V0Fitter (const std::string &trackFitResultsName="", const std::string &v0sName="", const std::string &v0ValidationVerticesName="", const std::string &recoTracksName="", const std::string &copiedRecoTracksName="CopiedRecoTracks", bool enableValidation=false) | |
Constructor for the V0Fitter. More... | |
void | initializeCuts (double beamPipeRadius, double vertexChi2CutOutside) |
Initialize the cuts which will be applied during the fit and store process. | |
void | setFitterMode (int fitterMode) |
set V0 fitter mode. More... | |
bool | fitAndStore (const Track *trackPlus, const Track *trackMinus, const Const::ParticleType &v0Hypothesis) |
Fit V0 with given hypothesis and store if fit was successful. More... | |
std::pair< Const::ParticleType, Const::ParticleType > | getTrackHypotheses (const Const::ParticleType &v0Hypothesis) const |
Get track hypotheses for a given v0 hypothesis. | |
Private Member Functions | |
bool | vertexFitWithRecoTracks (const Track *trackPlus, const Track *trackMinus, RecoTrack *recoTrackPlus, RecoTrack *recoTrackMinus, const Const::ParticleType &v0Hypothesis, unsigned int &hasInnerHitStatus, TVector3 &vertexPos, const bool forceStore) |
fit V0 vertex using RecoTrack's as inputs. More... | |
RecoTrack * | copyRecoTrack (RecoTrack *origRecoTrack, const int trackPDG) |
Create a copy of RecoTrack. More... | |
bool | removeInnerHits (RecoTrack *origRecoTrack, RecoTrack *recoTrack, const int trackPDG, unsigned int &nRemoveHits) |
Remove inner hits from RecoTrack. More... | |
bool | rejectCandidate (genfit::MeasuredStateOnPlane &stPlus, genfit::MeasuredStateOnPlane &stMinus) |
Starting point: point closest to axis where either track is defined This is intended to reject tracks that curl away before meeting, there are corner cases where this could throw away legitimate candidates, namely where one track makes a full circle through the detector without hitting any detectors then making it past Rstart without hitting the detector there – while still being part of the V0. More... | |
bool | fitGFRaveVertex (genfit::Track &trackPlus, genfit::Track &trackMinus, genfit::GFRaveVertex &vertex) |
Fit the V0 vertex. More... | |
bool | extrapolateToVertex (genfit::MeasuredStateOnPlane &stPlus, genfit::MeasuredStateOnPlane &stMinus, const TVector3 &vertexPosition) |
Extrapolate the fit results to the perigee to the vertex. | |
bool | extrapolateToVertex (genfit::MeasuredStateOnPlane &stPlus, genfit::MeasuredStateOnPlane &stMinus, const TVector3 &vertexPosition, unsigned int &hasInnerHitStatus) |
Extrapolate the fit results to the perigee to the vertex. More... | |
double | getBzAtVertex (const TVector3 &vertexPosition) |
Getter for magnetic field in z direction at the vertex position. | |
TrackFitResult * | buildTrackFitResult (const genfit::Track &track, const RecoTrack *recoTrack, const genfit::MeasuredStateOnPlane &msop, const double Bz, const Const::ParticleType &trackHypothesis) |
Build TrackFitResult of V0 Track and set relation to genfit Track. | |
Private Attributes | |
bool | m_validation |
Validation flag. | |
std::string | m_recoTracksName |
RecoTrackColName (input). | |
StoreArray< RecoTrack > | m_recoTracks |
RecoTrack (input) | |
StoreArray< TrackFitResult > | m_trackFitResults |
TrackFitResult (output). | |
StoreArray< V0 > | m_v0s |
V0 (output). | |
StoreArray< V0ValidationVertex > | m_validationV0s |
V0ValidationVertex (output, optional). | |
StoreArray< RecoTrack > | m_copiedRecoTracks |
RecoTrack used to refit tracks (output) | |
double | m_beamPipeRadius |
Radius where inside/outside beampipe is defined. | |
double | m_vertexChi2CutOutside |
Chi2 cut outside beampipe. | |
int | m_v0FitterMode |
bool | m_forcestore |
0: store V0 at the first vertex fit, regardless of inner hits, 1: remove hits inside the V0 vertex position, 2: mode 1 + don't use SVD hits if there is only one available SVD hit-pair (default) | |
bool | m_useOnlyOneSVDHitPair |
true only if the V0Fitter mode is 1 | |
Friends | |
class | V0FitterTest_GetTrackHypotheses_Test |
class | V0FitterTest_EnableValidation_Test |
class | V0FitterTest_InitializeCuts_Test |
V0Fitter class to create V0 mdst's from reconstructed tracks.
To use this class, give the V0Fitter a positive and a negative charged track and call the fitAndStore function.
v0Fitter.fitAndStore(B2TrackPositive, B2TrackNegative, V0HypothesisParticleType);
Definition at line 32 of file V0Fitter.h.
V0Fitter | ( | const std::string & | trackFitResultsName = "" , |
const std::string & | v0sName = "" , |
||
const std::string & | v0ValidationVerticesName = "" , |
||
const std::string & | recoTracksName = "" , |
||
const std::string & | copiedRecoTracksName = "CopiedRecoTracks" , |
||
bool | enableValidation = false |
||
) |
Constructor for the V0Fitter.
m_recoTracks
register m_copiedRecoTracks
relation : m_recoTracks <--> m_copiedRecoTracks
Definition at line 34 of file V0Fitter.cc.
Create a copy of RecoTrack.
origRecoTrack | original RecoTrack |
trackPDG | signed PDG used for the track fit hypothesis |
original track information
only a positive PDG number is allowed for the input
fit newRecoTrack
check fit status of original track
Definition at line 436 of file V0Fitter.cc.
|
private |
Extrapolate the fit results to the perigee to the vertex.
used in the fitAndStore function.
If the daughter tracks have hits inside the V0 vertex, bits in the hasInnerHiStatus variable are set.
if tracks have hits inside the V0 vertex position, bits in hasInnerHitStatus are set.
initialize
extrapolate the first (innermost) hit to the V0 vertex position the value will be positive (negative) if the direction of the extrapolation is (counter)momentum-wise
plus track has hits inside the V0 vertex.
minus track has hits inside the V0 vertex.
This shouldn't ever happen, but I can see the extrapolation code trying several windings before giving up, so this happens occasionally. Something more stable would perhaps be desirable.
Definition at line 144 of file V0Fitter.cc.
bool fitAndStore | ( | const Track * | trackPlus, |
const Track * | trackMinus, | ||
const Const::ParticleType & | v0Hypothesis | ||
) |
Fit V0 with given hypothesis and store if fit was successful.
remove hits inside the V0 vertex position
Existence of corresponding RecoTrack already checked at the module level;
hasInnerHitStatus: 0x1: plus track has hits inside the V0 vertex. 0x2: minus track has hits inside the V0 vertex.
fitted vertex position
Try V0 vertex fit. If the fit fails, return false. If hasInnerHitStatus evaluated in the vertexFitWithRecoTracks function results to be 0 (no hits inside the V0 vertex position in both tracks), TrackFitResult and V0 objects are build and stored, and then terminate this function with returning true. If hasInnerHitStatus!=0, objects are not stored and the tracks are refitted with removing inner hit later.
If one or two tracks have hits inside the V0 vertex. (0x1(0x2) bit in hasInnerHitStatus represents plus(minus)-track), redo vertex fit after refitting the track(s) with removing innermost hit in the track(s). Repeat until all the inner hits are removed or the vertex fit fails.
PDG code (positive number) used as the track hypothesis in the track fitting.
positive number
positive number
If the track has a hit inside the V0 vertex position, use refitted RecoTrack with removing inner hits in the next V0 vertex fit. Else, use the original RecoTrack.
for plus-charged track
if the track refit fails, break out of this loop and revert back to the original vertex fit with the original tracks.
for minus-charged track
if the track refit fails, break out of this loop and revert back to the original vertex fit with the original tracks.
V0 vertex fit
if vertex fit fails, break out of this loop and revert back to the original vertex fit with the original tracks.
end of the while loop
if failflag==true, revert back to the original vertex fit with the original tracks.
Definition at line 209 of file V0Fitter.cc.
|
private |
Fit the V0 vertex.
trackPlus | |
trackMinus | |
vertex | Result of the fit is returned via reference. |
Definition at line 111 of file V0Fitter.cc.
|
private |
Starting point: point closest to axis where either track is defined This is intended to reject tracks that curl away before meeting, there are corner cases where this could throw away legitimate candidates, namely where one track makes a full circle through the detector without hitting any detectors then making it past Rstart without hitting the detector there – while still being part of the V0.
Unlikely, I didn't find a single example in MC. On the other hand it rejects impossible candidates.
stPlus | MeasuredStateOnPlane of positively-charged daughter |
stMinus | MeasuredStateOnPlane of negatively-charged daughter |
Definition at line 93 of file V0Fitter.cc.
|
private |
Remove inner hits from RecoTrack.
Hits are removed from the minus-end of the momentum direction. For SVD hits, remove U- and V- hit pair at once. Input RecoTrack is fitted in the funcion. If track fit fails, return false.
origRecoTrack | original RecoTrack |
recoTrack | input RecoTrack, updated in this function |
trackPDG | signed PDG used for the track fit hypothesis |
nRemoveHits | the number of removed hits. This can be incremented in the function if the outermost removed hit is an SVD U-hit. |
original track information
only a positive PDG number is allowed for the input
disable inner hits
true for sorted info.
N removed hits should not exceed N hits in the track
if the last removed hit is a SVD U-hit, remove the next hit (SVD V-hit as the pair) in addition note: for the SVD pair hits, U-hit should be first and the V-hit the next in the sorted RecoHitInformation array.
N removed hits should not exceed N hits in the track
if N of remaining SVD hit-pair is only one, don't use the SVD hits
SVD U-hit
SVD V-hit
fit recoTrack
check fit status of original track
Definition at line 460 of file V0Fitter.cc.
void setFitterMode | ( | int | fitterMode | ) |
|
private |
fit V0 vertex using RecoTrack's as inputs.
Fit V0 vertex using RecoTracks as inputs.
Return true (false) if the vertex fit has done well (failed). If RecoTracks have hits inside the fitted V0 vertex position, bits in hasInnerHitStatus are set. If there are no inside hits, store the V0 to the DataStore.
trackPlus | Track of positively-charged daughter |
trackMinus | Track of negatively-charged daughter |
recoTrackPlus | RecoTrack of positively-charged daughter |
recoTrackMinus | RecoTrack of negatively-charged daughter |
v0Hypothesis | ParticleType used in vertex fitting |
hasInnerHitStatus | store a result of this function. if the plus(minus) track has hits inside the V0 vertex position, 0x1(0x2) bit is set. |
vertexPos | store a result of this function. the fitted vertex position is stored. |
forceStore | if true, store the fitted V0 to the DataStore even if there are some inside hits. |
Store V0 and TrackFitResults if hasInnerHitStatus==0 or forceStore==true.
make a clone, not use the reference so that the genfit::Track and its TrackReps will not be altered.
make a clone, not use the reference so that the genfit::Track and its TrackReps will not be altered.
If existing, pass to the genfit::Track the correct cardinal representation
The two vectors should always have the same size, and this never happen
make a clone, not use the reference so that the genfit::MeasuredStateOnPlane and its TrackReps will not be altered.
Update the tracks (genfit::MeasuredStateOnPlane) after vertex fitGFRaveVertex() looks not to give any changes to the input genfit::Track's (I'm not sure..) make a clone, not use the reference so that the genfit::MeasuredStateOnPlane and its TrackReps will not be altered.
Apply cuts. We have one set of cuts inside the beam pipe, the other outside.
store V0
To build the trackFitResult, use the magnetic field at the origin; the helix is extrapolated to the IP in a constant magnetic field and material effects are neglected so that the vertexing tool executed on the MDST object will find again this vertex position
Reconstruct invariant mass.
Definition at line 310 of file V0Fitter.cc.