From 1a109a8b81473cbfc1fdbce37b75ad54a2f97800 Mon Sep 17 00:00:00 2001 From: Salvatore Aiola Date: Mon, 22 Feb 2021 11:32:19 +0100 Subject: [PATCH] Add option to use the state provider instead of the track trajectory in the DecayTreeFitter --- Phys/DecayTreeFitter/DecayTreeFitter/Fitter.h | 10 ++++++---- Phys/DecayTreeFitter/src/Configuration.h | 4 ++-- Phys/DecayTreeFitter/src/Fitter.cpp | 18 ++++++++++-------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Phys/DecayTreeFitter/DecayTreeFitter/Fitter.h b/Phys/DecayTreeFitter/DecayTreeFitter/Fitter.h index 7a331cdda..9c1090bc0 100644 --- a/Phys/DecayTreeFitter/DecayTreeFitter/Fitter.h +++ b/Phys/DecayTreeFitter/DecayTreeFitter/Fitter.h @@ -59,15 +59,17 @@ namespace DecayTreeFitter { public: // ======================================================================== /// constructor from the particle (decay head) - Fitter( const LHCb::Particle& bc, const bool forceFitAll = true, const ITrackStateProvider* extrapolator = 0 ); + Fitter( const LHCb::Particle& bc, const bool forceFitAll = true, const ITrackStateProvider* extrapolator = 0, + const bool useTrackTraj = true ); /// constructor from the particle (decay head) - Fitter( const LHCb::Particle& bc, const ITrackStateProvider* extrapolator, const bool forceFitAll = true ); + Fitter( const LHCb::Particle& bc, const ITrackStateProvider* extrapolator, const bool forceFitAll = true, + const bool useTrackTraj = true ); /// constructor from the particle (decay head) and primary vertex Fitter( const LHCb::Particle& bc, const LHCb::VertexBase& pv, const bool forceFitAll = true, - const ITrackStateProvider* extrapolator = 0 ); + const ITrackStateProvider* extrapolator = 0, const bool useTrackTraj = true ); /// constructor from the particle (decay head) and primary vertex Fitter( const LHCb::Particle& bc, const LHCb::VertexBase& pv, const ITrackStateProvider* extrapolator, - const bool forceFitAll = true ); + const bool forceFitAll = true, const bool useTrackTraj = true ); /// destructor ~Fitter(); // destructor // ======================================================================== diff --git a/Phys/DecayTreeFitter/src/Configuration.h b/Phys/DecayTreeFitter/src/Configuration.h index 8e8a1e4ae..c0c8ded07 100644 --- a/Phys/DecayTreeFitter/src/Configuration.h +++ b/Phys/DecayTreeFitter/src/Configuration.h @@ -16,8 +16,8 @@ struct ITrackStateProvider; namespace DecayTreeFitter { class Configuration { public: - Configuration( bool forceFitAll = true, const ITrackStateProvider* stateprovider = 0 ) - : m_forceFitAll( forceFitAll ), m_stateprovider( stateprovider ), m_useTrackTraj( true ) {} + Configuration( bool forceFitAll = true, const ITrackStateProvider* stateprovider = 0, bool useTrackTraj = true ) + : m_forceFitAll( forceFitAll ), m_stateprovider( stateprovider ), m_useTrackTraj( useTrackTraj ) {} const ITrackStateProvider* stateProvider() const { return m_stateprovider; } diff --git a/Phys/DecayTreeFitter/src/Fitter.cpp b/Phys/DecayTreeFitter/src/Fitter.cpp index bc43d416b..4c3b5b7fe 100644 --- a/Phys/DecayTreeFitter/src/Fitter.cpp +++ b/Phys/DecayTreeFitter/src/Fitter.cpp @@ -44,7 +44,8 @@ namespace DecayTreeFitter { // ========================================================================== // constructor from the particle (decay head) // ========================================================================== - Fitter::Fitter( const LHCb::Particle& bc, const bool forceFitAll, const ITrackStateProvider* extrapolator ) + Fitter::Fitter( const LHCb::Particle& bc, const bool forceFitAll, const ITrackStateProvider* extrapolator, + const bool useTrackTraj ) : m_particle( &bc ) , m_decaychain( 0 ) , m_fitparams( 0 ) @@ -53,7 +54,7 @@ namespace DecayTreeFitter { , m_niter( -1 ) , m_errCode( 0 ) , m_extrapolator( const_cast( extrapolator ) ) { - Configuration config( forceFitAll, extrapolator ); + Configuration config( forceFitAll, extrapolator, useTrackTraj ); // build the tree m_decaychain = new DecayChain( bc, config ); // allocate the fit parameters @@ -62,7 +63,8 @@ namespace DecayTreeFitter { // ========================================================================== // constructor from the particle (decay head) // ========================================================================== - Fitter::Fitter( const LHCb::Particle& bc, const ITrackStateProvider* extrapolator, const bool forceFitAll ) + Fitter::Fitter( const LHCb::Particle& bc, const ITrackStateProvider* extrapolator, const bool forceFitAll, + const bool useTrackTraj ) : m_particle( &bc ) , m_decaychain( 0 ) , m_fitparams( 0 ) @@ -71,7 +73,7 @@ namespace DecayTreeFitter { , m_niter( -1 ) , m_errCode( 0 ) , m_extrapolator( const_cast( extrapolator ) ) { - Configuration config( forceFitAll, extrapolator ); + Configuration config( forceFitAll, extrapolator, useTrackTraj ); // build the tree m_decaychain = new DecayChain( bc, config ); // allocate the fit parameters @@ -81,7 +83,7 @@ namespace DecayTreeFitter { // constructor from the particle (decay head) and primary vertex // ========================================================================== Fitter::Fitter( const LHCb::Particle& bc, const LHCb::VertexBase& pv, const bool forceFitAll, - const ITrackStateProvider* extrapolator ) + const ITrackStateProvider* extrapolator, const bool useTrackTraj ) : m_particle( &bc ) , m_decaychain( 0 ) , m_fitparams( 0 ) @@ -93,7 +95,7 @@ namespace DecayTreeFitter { , m_extrapolator( const_cast( extrapolator ) ) // { - Configuration config( forceFitAll, extrapolator ); + Configuration config( forceFitAll, extrapolator, useTrackTraj ); m_decaychain = new DecayChain( bc, pv, config ); m_fitparams = new FitParams( m_decaychain->dim() ); } @@ -101,7 +103,7 @@ namespace DecayTreeFitter { // constructor from the particle (decay head) and primary vertex // ========================================================================== Fitter::Fitter( const LHCb::Particle& bc, const LHCb::VertexBase& pv, const ITrackStateProvider* extrapolator, - const bool forceFitAll ) + const bool forceFitAll, const bool useTrackTraj ) : m_particle( &bc ) , m_decaychain( 0 ) , m_fitparams( 0 ) @@ -113,7 +115,7 @@ namespace DecayTreeFitter { , m_extrapolator( const_cast( extrapolator ) ) // { - Configuration config( forceFitAll, extrapolator ); + Configuration config( forceFitAll, extrapolator, useTrackTraj ); m_decaychain = new DecayChain( bc, pv, config ); m_fitparams = new FitParams( m_decaychain->dim() ); } -- GitLab