Belle II Software development
|
Improved V0 fitter class. More...
#include <NewV0Fitter.h>
Classes | |
struct | FittedTrack |
Structure to save track data of the last successful iteration. More... | |
Public Member Functions | |
NewV0Fitter (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. | |
void | initializeCuts (double vertexDistanceCut, double vertexChi2Cut, const std::tuple< double, double > &invMassRangeKshort, const std::tuple< double, double > &invMassRangeLambda, const std::tuple< double, double > &invMassRangePhoton) |
Initialization of cuts applied during the fit and store process. | |
void | setFitterMode (int fitterMode) |
Setter for the fitter mode. | |
bool | fitAndStore (const Track *trackPlus, const Track *trackMinus, const Const::ParticleType &v0Hypothesis, bool &isForceStored, bool &isHitRemoved) |
Fit V0 with given hypothesis and store results if fit is successful. | |
Static Public Member Functions | |
static std::pair< Const::ParticleType, Const::ParticleType > | getTrackHypotheses (const Const::ParticleType &v0Hypothesis) |
Returns daughter particle types for a given V0 hypothesis. | |
Private Types | |
enum | ErrorStatus { c_NoTrackRepresentation = -4 , c_VertexFitFailed = -3 , c_ExtrapolationFailed = -2 , c_NotSelected = -1 } |
Error status codes returned by the vertexFit method. More... | |
enum | EInnerHitBits { c_BitTrackPlus = 0x1 , c_BitTrackMinus = 0x2 } |
Bits used to signal that track has hits inside the V0 vertex. More... | |
Private Member Functions | |
int | vertexFit (const RecoTrack *recoTrackPlus, const RecoTrack *recoTrackMinus, int pdgTrackPlus, int pdgTrackMinus, const Const::ParticleType &v0Hypothesis) |
Performs a vertex fit. | |
const genfit::AbsTrackRep * | getTrackRepresentation (const RecoTrack *recoTrack, int pdgCode) |
Returns track representation for a given PDG code. | |
bool | setCardinalRep (genfit::Track &gfTrack, int pdgCode) |
Sets cardinal representation of a given genfit track and PDG code. | |
bool | fitGFRaveVertex (genfit::Track &trackPlus, genfit::Track &trackMinus, genfit::GFRaveVertex &vertex) |
Genfit Rave vertex fit called by vertexFit method. | |
int | extrapolateToVertex (genfit::MeasuredStateOnPlane &statePlus, genfit::MeasuredStateOnPlane &stateMinus, const genfit::GFRaveVertex &vertex) |
Extrapolation of both tracks to the vertex. | |
RecoTrack * | copyRecoTrack (const RecoTrack *origRecoTrack, const genfit::MeasuredStateOnPlane &state) |
Make a copy of reco track. | |
const RecoTrack * | removeHitsAndRefit (const RecoTrack *origRecoTrack, const RecoTrack *lastRecoTrack, const Const::ParticleType &ptype) |
Remove track inner hits and refit the track. | |
int | isInnermostClusterShared (const RecoTrack *recoTrackPlus, const RecoTrack *recoTrackMinus) |
Returns bit flags indicating that the innermost cluster is shared between both tracks. | |
const TrackFitResult * | saveTrackFitResult (const FittedTrack &trk, int sharedInnermostCluster) |
Append track fit result to the collection. | |
Private Attributes | |
std::string | m_recoTracksName |
name of the RecoTracks collection | |
StoreArray< RecoTrack > | m_recoTracks |
RecoTracks collection. | |
StoreArray< TrackFitResult > | m_trackFitResults |
TrackFitResults collection. | |
StoreArray< V0 > | m_v0s |
V0s collection. | |
StoreArray< V0ValidationVertex > | m_validationV0s |
V0ValidationVertex collection (optional) | |
StoreArray< RecoTrack > | m_copiedRecoTracks |
copied RecoTracks collection | |
double | m_vertexDistanceCut = 0 |
cut on the transverse radius | |
double | m_vertexChi2Cut = 0 |
Chi2 cut. | |
std::map< int, std::pair< double, double > > | m_invMassCuts |
invariant mass cuts, key = abs(PDG) | |
int | m_fitterMode = 1 |
fitter mode | |
bool | m_validation = false |
validation flag | |
genfit::GFRaveVertex | m_fittedVertex |
last successfully fitted vertex | |
double | m_momentum = 0 |
momentum of last successfully fitted vertex | |
double | m_invMass = 0 |
invariant mass of last successfully fitted vertex | |
FittedTrack | m_trkPlus |
positively charged track data of last successfully fitted vertex | |
FittedTrack | m_trkMinus |
negatively charged track data of last successfully fitted vertex | |
Improved V0 fitter class.
Definition at line 30 of file NewV0Fitter.h.
|
private |
Bits used to signal that track has hits inside the V0 vertex.
Enumerator | |
---|---|
c_BitTrackPlus | positive track has inner hits |
c_BitTrackMinus | negative track has inner hits |
Definition at line 139 of file NewV0Fitter.h.
|
private |
Error status codes returned by the vertexFit method.
Definition at line 128 of file NewV0Fitter.h.
NewV0Fitter | ( | 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.
trackFitResultsName | name of the StoreArray TrackFitResults |
v0sName | name of the StoreArray V0s |
v0ValidationVerticesName | name of the StoreArray V0ValidationVertex |
recoTracksName | name of the StoreArray RecoTracks |
copiedRecoTracksName | name of the StoreArray of copied RecoTracks |
enableValidation | on true store additional data for validation |
Definition at line 27 of file NewV0Fitter.cc.
|
private |
Make a copy of reco track.
origRecoTrack | source |
state | measured state for the track fit seeding |
Definition at line 396 of file NewV0Fitter.cc.
|
private |
Extrapolation of both tracks to the vertex.
On success the return value indicates if tracks have inner hits (see EInnerHitBits).
statePlus | measured state of positively charged track from which the extrapolation is performed [in/out] |
stateMinus | measured state of negatively charged track from which the extrapolation is performed [in/out] |
vertex | vertex |
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 286 of file NewV0Fitter.cc.
bool fitAndStore | ( | const Track * | trackPlus, |
const Track * | trackMinus, | ||
const Const::ParticleType & | v0Hypothesis, | ||
bool & | isForceStored, | ||
bool & | isHitRemoved | ||
) |
Fit V0 with given hypothesis and store results if fit is successful.
trackPlus | positively charged track |
trackMinus | negatively charged track |
v0Hypothesis | V0 hypothesis |
isForceStored | true if V0 is forced to store when hit removal failed [out] |
isHitRemoved | true if inner hits have been removed (or at least tried to be removed) [out] |
Initialize status flags and result storage
Get related recoTracks
PDG codes actually used in track fitting
initial vertex fit
try to refit tracks by removing inner hits and refit the vertex
Usually this procedure converges in up to 3 iterations (mostly in a single iteration), but for a small fraction of track pairs it does not converge at all, so we set the limit at 5.
save the results
Definition at line 83 of file NewV0Fitter.cc.
|
private |
Genfit Rave vertex fit called by vertexFit method.
trackPlus | positively charged genfit track |
trackMinus | negatively charged genfit track |
vertex | fitted vertex [out] |
Definition at line 254 of file NewV0Fitter.cc.
|
static |
Returns daughter particle types for a given V0 hypothesis.
v0Hypothesis | V0 hypothesis |
Definition at line 67 of file NewV0Fitter.cc.
|
private |
Returns track representation for a given PDG code.
recoTrack | track |
pdgCode | PDG code |
Definition at line 229 of file NewV0Fitter.cc.
void initializeCuts | ( | double | vertexDistanceCut, |
double | vertexChi2Cut, | ||
const std::tuple< double, double > & | invMassRangeKshort, | ||
const std::tuple< double, double > & | invMassRangeLambda, | ||
const std::tuple< double, double > & | invMassRangePhoton | ||
) |
Initialization of cuts applied during the fit and store process.
vertexDistanceCut | cut on the transverse radius to cut-off vertices within the beam pipe |
vertexChi2Cut | cut on the vertex chi^2 |
invMassRangeKshort | selection mass window for Ks |
invMassRangeLambda | selection mass window for Lambda |
invMassRangePhoton | selection mass window for converted gamma |
Definition at line 53 of file NewV0Fitter.cc.
|
private |
Returns bit flags indicating that the innermost cluster is shared between both tracks.
Bit 0 is set if U cluster is shared, bit 1 is set if V cluster is shared, and both if shared cluster is PXD.
recoTrackPlus | positively charged track |
recoTrackMinus | negatively charged track |
Definition at line 409 of file NewV0Fitter.cc.
|
private |
Remove track inner hits and refit the track.
On success return the refitted one, otherwise return the track of last iteration (or the original one if no hits need to be removed).
origRecoTrack | original track |
lastRecoTrack | track at last hit-removal iteration |
ptype | particle type for refit |
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 308 of file NewV0Fitter.cc.
|
private |
Append track fit result to the collection.
trk | track data |
sharedInnermostCluster | bit flags of shared innermost clusters |
Definition at line 463 of file NewV0Fitter.cc.
|
private |
Sets cardinal representation of a given genfit track and PDG code.
gfTrack | genfit track [in/out] |
pdgCode | PDG code |
Definition at line 239 of file NewV0Fitter.cc.
|
inline |
Setter for the fitter mode.
0: store V0 at the first vertex fit, regardless of inner hits 1: remove hits inside the V0 vertex position (default) 2: mode 1 + don't use SVD hits if there is only one available SVD hit-pair
fitterMode | fitter mode |
Definition at line 101 of file NewV0Fitter.h.
|
private |
Performs a vertex fit.
On success the return value indicates if tracks have inner hits or not (see EInnerHitBits). On failure it returns ErrorStatus code.
recoTrackPlus | positively charged track |
recoTrackMinus | negatively charged track |
pdgTrackPlus | PDG code used in the fit of positively charged track (closest mass to V0 daughter) |
pdgTrackMinus | PDG code used in the fit of negatively charged track (closest mass to V0 daughter) |
v0Hypothesis | V0 hypothesis |
Definition at line 165 of file NewV0Fitter.cc.
|
private |
copied RecoTracks collection
Definition at line 236 of file NewV0Fitter.h.
|
private |
last successfully fitted vertex
Definition at line 247 of file NewV0Fitter.h.
|
private |
fitter mode
Definition at line 242 of file NewV0Fitter.h.
|
private |
invariant mass of last successfully fitted vertex
Definition at line 249 of file NewV0Fitter.h.
|
private |
invariant mass cuts, key = abs(PDG)
Definition at line 240 of file NewV0Fitter.h.
|
private |
momentum of last successfully fitted vertex
Definition at line 248 of file NewV0Fitter.h.
|
private |
RecoTracks collection.
Definition at line 232 of file NewV0Fitter.h.
|
private |
name of the RecoTracks collection
Definition at line 231 of file NewV0Fitter.h.
|
private |
TrackFitResults collection.
Definition at line 233 of file NewV0Fitter.h.
|
private |
negatively charged track data of last successfully fitted vertex
Definition at line 251 of file NewV0Fitter.h.
|
private |
positively charged track data of last successfully fitted vertex
Definition at line 250 of file NewV0Fitter.h.
|
private |
V0s collection.
Definition at line 234 of file NewV0Fitter.h.
|
private |
validation flag
Definition at line 243 of file NewV0Fitter.h.
|
private |
V0ValidationVertex collection (optional)
Definition at line 235 of file NewV0Fitter.h.
|
private |
Chi2 cut.
Definition at line 239 of file NewV0Fitter.h.
|
private |
cut on the transverse radius
Definition at line 238 of file NewV0Fitter.h.