10#include <framework/datastore/StoreArray.h>
11#include <framework/gearbox/Const.h>
12#include <mdst/dataobjects/TrackFitResult.h>
13#include <mdst/dataobjects/V0.h>
14#include <tracking/dataobjects/V0ValidationVertex.h>
15#include <tracking/dataobjects/RecoTrack.h>
16#include <genfit/Track.h>
18#include <Math/Vector3D.h>
23 class MeasuredStateOnPlane;
40 friend class V0FitterTest_GetTrackHypotheses_Test;
41 friend class V0FitterTest_EnableValidation_Test;
42 friend class V0FitterTest_InitializeCuts_Test;
46 V0Fitter(
const std::string& trackFitResultsName =
"",
const std::string& v0sName =
"",
47 const std::string& v0ValidationVerticesName =
"",
48 const std::string& recoTracksName =
"",
49 const std::string& copiedRecoTracksName =
"CopiedRecoTracks",
50 bool enableValidation =
false);
54 double vertexChi2CutOutside,
55 std::tuple<double, double> invMassRangeKshort,
56 std::tuple<double, double> invMassRangeLambda,
57 std::tuple<double, double> invMassRangePhoton);
92 unsigned int& hasInnerHitStatus, ROOT::Math::XYZVector& vertexPos,
93 const bool forceStore);
120 const int trackPDG,
const ROOT::Math::XYZVector& vertexPosition);
136 bool fitGFRaveVertex(genfit::Track& trackPlus, genfit::Track& trackMinus, genfit::GFRaveVertex& vertex);
140 const ROOT::Math::XYZVector& vertexPosition);
144 bool extrapolateToVertex(genfit::MeasuredStateOnPlane& stPlus, genfit::MeasuredStateOnPlane& stMinus,
145 const ROOT::Math::XYZVector& vertexPosition,
unsigned int& hasInnerHitStatus);
149 const genfit::MeasuredStateOnPlane& msop,
const double Bz,
151 const int sharedInnermostCluster);
The ParticleType class for identifying different particle types.
This is the Reconstruction Event-Data Model 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.
V0Fitter class to create V0 mdst's from reconstructed tracks.
bool m_useOnlyOneSVDHitPair
false only if the V0Fitter mode is 3
void setFitterMode(int fitterMode)
set V0 fitter mode.
RecoTrack * copyRecoTrackAndFit(RecoTrack *origRecoTrack, const int trackPDG)
Create a copy of RecoTrack and fit the Track.
StoreArray< V0ValidationVertex > m_validationV0s
V0ValidationVertex (output, optional).
StoreArray< RecoTrack > m_copiedRecoTracks
RecoTrack used to refit tracks (output)
bool m_forcestore
true only if the V0Fitter mode is 1
void initializeCuts(double beamPipeRadius, double vertexChi2CutOutside, std::tuple< double, double > invMassRangeKshort, std::tuple< double, double > invMassRangeLambda, std::tuple< double, double > invMassRangePhoton)
Initialize the cuts which will be applied during the fit and store process.
RecoTrack * copyRecoTrack(RecoTrack *origRecoTrack)
Create a copy of RecoTrack.
bool m_validation
Validation flag.
std::pair< Const::ParticleType, Const::ParticleType > getTrackHypotheses(const Const::ParticleType &v0Hypothesis) const
Get track hypotheses for a given v0 hypothesis.
StoreArray< V0 > m_v0s
V0 (output).
int checkSharedInnermostCluster(const RecoTrack *recoTrackPlus, const RecoTrack *recoTrackMinus)
Compare innermost hits of daughter pairs to check if they are the same (shared) or not.
TrackFitResult * buildTrackFitResult(const genfit::Track &track, const RecoTrack *recoTrack, const genfit::MeasuredStateOnPlane &msop, const double Bz, const Const::ParticleType &trackHypothesis, const int sharedInnermostCluster)
Build TrackFitResult of V0 Track and set relation to genfit Track.
StoreArray< TrackFitResult > m_trackFitResults
TrackFitResult (output).
bool fitAndStore(const Track *trackPlus, const Track *trackMinus, const Const::ParticleType &v0Hypothesis, bool &isForceStored, bool &isHitRemoved)
Fit V0 with given hypothesis and store if fit was successful.
double m_beamPipeRadius
Radius where inside/outside beampipe is defined.
bool vertexFitWithRecoTracks(const Track *trackPlus, const Track *trackMinus, RecoTrack *recoTrackPlus, RecoTrack *recoTrackMinus, const Const::ParticleType &v0Hypothesis, unsigned int &hasInnerHitStatus, ROOT::Math::XYZVector &vertexPos, const bool forceStore)
fit V0 vertex using RecoTrack's as inputs.
std::tuple< double, double > m_invMassRangePhoton
invariant mass cut for Photon.
bool removeInnerHits(RecoTrack *prevRecoTrack, RecoTrack *recoTrack, const int trackPDG, const ROOT::Math::XYZVector &vertexPosition)
Remove inner hits from RecoTrack at once.
std::string m_recoTracksName
RecoTrackColName (input).
bool extrapolateToVertex(genfit::MeasuredStateOnPlane &stPlus, genfit::MeasuredStateOnPlane &stMinus, const ROOT::Math::XYZVector &vertexPosition)
Extrapolate the fit results to the perigee to the vertex.
double m_vertexChi2CutOutside
Chi2 cut outside beampipe.
StoreArray< RecoTrack > m_recoTracks
RecoTrack (input)
bool fitGFRaveVertex(genfit::Track &trackPlus, genfit::Track &trackMinus, genfit::GFRaveVertex &vertex)
Fit the V0 vertex.
int m_v0FitterMode
0: store V0 at the first vertex fit, regardless of inner hits, 1: remove hits inside the V0 vertex po...
std::tuple< double, double > m_invMassRangeKshort
invariant mass cut for Kshort.
std::tuple< double, double > m_invMassRangeLambda
invariant mass cut for Lambda.
Abstract base class for different kinds of events.