Commit dd2c65a6 authored by Ben Couturier's avatar Ben Couturier
Browse files

Merge branch 'cherry-pick-86b866d1' into 'master'

Merge branch 'track-fit-workshop-jadevrie' into 'master'

See merge request !115
parents a76d88d9 2f20d8e1
Pipeline #3613706 passed with stage
in 26 seconds
......@@ -261,7 +261,12 @@ StatusCode SoTrackCnv::createRep( DataObject* aObject, IOpaqueAddress*& aAddr )
// double test1 = nodes_[in]->residual();
// double test2 = nodes_[in]->errMeasure();
double chi = nodes_[in]->residual() / nodes_[in]->errResidual();
double chi = nodes_[in]->visit_r<double>(
[&]( LHCb::FitNode::DimInfos<LHCb::Enum::nDim::Type::one>& ) {
// return d.residual(nodes_[in])[0] / d.errResidual(nodes_[in])[0][0];
return nodes_[in]->residual() / nodes_[in]->errResidual();
},
[]( ... ) -> double { throw std::logic_error( "2D measurements not supported by Panoramix" ); } );
double abs_chi = fabs( chi );
// fix colours for measurement display
double M_r = 0.0, M_g = 1.0, M_b = 0.0;
......@@ -312,7 +317,11 @@ StatusCode SoTrackCnv::createRep( DataObject* aObject, IOpaqueAddress*& aAddr )
magneticFieldSvc->fieldVector( cstate.position(), bfield )
.ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
LHCb::StateTraj stateTraj = LHCb::StateTraj( nodes_[in]->refVector(), bfield );
const auto& traj = meas.trajectory();
const auto& traj = meas.visit(
[]( const LHCb::Measurement::VP2D& ) -> LHCb::LineTraj<double> {
throw std::logic_error( "2D measurements not supported by Panoramix" );
},
[]( const auto& m ) -> LHCb::LineTraj<double> { return m.trajectory; } );
double s1 = 0.0;
double s2 = traj.arclength( stateTraj.position( s1 ) );
poca->minimize( stateTraj, s1, traj, s2, distance, 20 * Gaudi::Units::mm )
......@@ -389,7 +398,11 @@ StatusCode SoTrackCnv::createRep( DataObject* aObject, IOpaqueAddress*& aAddr )
magneticFieldSvc->fieldVector( cstate.position(), bfield )
.ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
LHCb::StateTraj stateTraj = LHCb::StateTraj( nodes_[in]->refVector(), bfield );
const auto& traj = meas.trajectory();
const auto& traj = meas.visit(
[]( const LHCb::Measurement::VP2D& ) -> LHCb::LineTraj<double> {
throw std::logic_error( "2D measurements not supported by Panoramix" );
},
[]( const auto& m ) -> LHCb::LineTraj<double> { return m.trajectory; } );
double s1 = 0.0;
double s2 = traj.arclength( stateTraj.position( s1 ) );
poca->minimize( stateTraj, s1, traj, s2, distance, 20 * Gaudi::Units::mm )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment