10#include <framework/datastore/StoreArray.h>
11#include <framework/gearbox/Const.h>
12#include <mdst/dataobjects/Track.h>
13#include <mdst/dataobjects/TrackFitResult.h>
14#include <mdst/dataobjects/V0.h>
15#include <tracking/dataobjects/V0ValidationVertex.h>
16#include <tracking/dataobjects/RecoTrack.h>
17#include <genfit/Track.h>
18#include <genfit/GFRaveVertex.h>
40 genfit::MeasuredStateOnPlane
state;
52 const genfit::AbsTrackRep* rep)
57 const auto* fitStatus = recoTrk->
getGenfitTrack().getFitStatus(rep);
58 pValue = fitStatus->getPVal();
59 Ndf = fitStatus->getNdf();
73 NewV0Fitter(
const std::string& trackFitResultsName =
"",
74 const std::string& v0sName =
"",
75 const std::string& v0ValidationVerticesName =
"",
76 const std::string& recoTracksName =
"",
77 const std::string& copiedRecoTracksName =
"CopiedRecoTracks",
78 bool enableValidation =
false);
90 const std::tuple<double, double>& invMassRangeKshort,
91 const std::tuple<double, double>& invMassRangeLambda,
92 const std::tuple<double, double>& invMassRangePhoton);
113 bool& isForceStored,
bool& isHitRemoved);
181 bool fitGFRaveVertex(genfit::Track& trackPlus, genfit::Track& trackMinus, genfit::GFRaveVertex& vertex);
191 int extrapolateToVertex(genfit::MeasuredStateOnPlane& statePlus, genfit::MeasuredStateOnPlane& stateMinus,
192 const genfit::GFRaveVertex& vertex);
The ParticleType class for identifying different particle types.
static const ParticleType invalidParticle
Invalid particle, used internally.
Improved V0 fitter class.
void setFitterMode(int fitterMode)
Setter for the fitter mode.
StoreArray< V0ValidationVertex > m_validationV0s
V0ValidationVertex collection (optional)
StoreArray< RecoTrack > m_copiedRecoTracks
copied RecoTracks collection
FittedTrack m_trkPlus
positively charged track data of last successfully fitted vertex
bool m_validation
validation flag
StoreArray< V0 > m_v0s
V0s collection.
double m_vertexDistanceCut
cut on the transverse radius
double m_vertexChi2Cut
Chi2 cut.
StoreArray< TrackFitResult > m_trackFitResults
TrackFitResults collection.
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.
int extrapolateToVertex(genfit::MeasuredStateOnPlane &statePlus, genfit::MeasuredStateOnPlane &stateMinus, const genfit::GFRaveVertex &vertex)
Extrapolation of both tracks to the vertex.
double m_momentum
momentum of last successfully fitted vertex
ErrorStatus
Error status codes returned by the vertexFit method.
@ c_NoTrackRepresentation
no track representation for given PDG code
@ c_NotSelected
fitted vertex not passing the cuts
@ c_VertexFitFailed
vertex fit failed
@ c_ExtrapolationFailed
track extrapolation failed
bool setCardinalRep(genfit::Track &gfTrack, int pdgCode)
Sets cardinal representation of a given genfit track and PDG code.
std::string m_recoTracksName
name of the RecoTracks collection
const TrackFitResult * saveTrackFitResult(const FittedTrack &trk, int sharedInnermostCluster)
Append track fit result to the collection.
int isInnermostClusterShared(const RecoTrack *recoTrackPlus, const RecoTrack *recoTrackMinus)
Returns bit flags indicating that the innermost cluster is shared between both tracks.
const genfit::AbsTrackRep * getTrackRepresentation(const RecoTrack *recoTrack, int pdgCode)
Returns track representation for a given PDG code.
std::map< int, std::pair< double, double > > m_invMassCuts
invariant mass cuts, key = abs(PDG)
StoreArray< RecoTrack > m_recoTracks
RecoTracks collection.
genfit::GFRaveVertex m_fittedVertex
last successfully fitted vertex
static std::pair< Const::ParticleType, Const::ParticleType > getTrackHypotheses(const Const::ParticleType &v0Hypothesis)
Returns daughter particle types for a given V0 hypothesis.
bool fitGFRaveVertex(genfit::Track &trackPlus, genfit::Track &trackMinus, genfit::GFRaveVertex &vertex)
Genfit Rave vertex fit called by vertexFit method.
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.
double m_invMass
invariant mass of last successfully fitted vertex
int m_fitterMode
fitter mode
FittedTrack m_trkMinus
negatively charged track data of last successfully fitted vertex
EInnerHitBits
Bits used to signal that track has hits inside the V0 vertex.
@ c_BitTrackMinus
negative track has inner hits
@ c_BitTrackPlus
positive track has inner hits
int vertexFit(const RecoTrack *recoTrackPlus, const RecoTrack *recoTrackMinus, int pdgTrackPlus, int pdgTrackMinus, const Const::ParticleType &v0Hypothesis)
Performs a vertex fit.
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.
This is the Reconstruction Event-Data Model Track.
const genfit::Track & getGenfitTrack() const
Returns genfit track.
Accessor to arrays stored in the data store.
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.
Structure to save track data of the last successful iteration.
void set(const RecoTrack *recoTrk, const Const::ParticleType &hypo, const genfit::MeasuredStateOnPlane &mSoP, const genfit::AbsTrackRep *rep)
Sets the data members.
double pValue
p-value of track fit
genfit::MeasuredStateOnPlane state
measured state at first hit, extrapolated to fitted vertex
Const::ParticleType ptype
particle type of the V0 track
const RecoTrack * recoTrack
reco track
int Ndf
degrees-of-freedom of track fit