[0KRunning with gitlab-runner 17.8.3 (690ce25c)[0;m [0K on runners-k8s-default-runners-c4c985b47-hgpqw Z8Jooa6tn, system ID: r_s2aRmI3ucu0J[0;m [0K feature flags: FF_USE_ADVANCED_POD_SPEC_CONFIGURATION:true[0;m [0K[36;1mResolving secrets[0;m[0;m section_start:1742924681:prepare_executor [0K[0K[36;1mPreparing the "kubernetes" executor[0;m[0;m [0KUsing Kubernetes namespace: gitlab[0;m [0KUsing Kubernetes executor with image registry.cern.ch/docker.io/library/python:3.10 ...[0;m [0KUsing attach strategy to execute scripts...[0;m section_end:1742924681:prepare_executor [0Ksection_start:1742924681:prepare_script [0K[0K[36;1mPreparing environment[0;m[0;m [0KUsing FF_USE_POD_ACTIVE_DEADLINE_SECONDS, the Pod activeDeadlineSeconds will be set to the job timeout: 1h0m0s...[0;m [0;33mWARNING: Advanced Pod Spec configuration enabled, merging the provided PodSpec to the generated one. This is a beta feature and is subject to change. Feedback is collected in this issue: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/29659 ...[0;m Waiting for pod gitlab/runner-z8jooa6tn-project-401-concurrent-0-xqbf8ifp to be running, status is Pending Waiting for pod gitlab/runner-z8jooa6tn-project-401-concurrent-0-xqbf8ifp to be running, status is Pending ContainersNotReady: "containers with unready status: [build helper]" ContainersNotReady: "containers with unready status: [build helper]" Running on runner-z8jooa6tn-project-401-concurrent-0-xqbf8ifp via runners-k8s-default-runners-c4c985b47-hgpqw... section_end:1742924688:prepare_script [0Ksection_start:1742924688:get_sources [0K[0K[36;1mGetting source from Git repository[0;m[0;m [32;1mFetching changes...[0;m Initialized empty Git repository in /builds/lhcb/Rec/.git/ [32;1mCreated fresh repository.[0;m [32;1mChecking out 9b69506b as detached HEAD (ref is refs/merge-requests/4306/head)...[0;m [32;1mSkipping Git submodules setup[0;m section_end:1742924702:get_sources [0Ksection_start:1742924702:restore_cache [0K[0K[36;1mRestoring cache[0;m[0;m [32;1mChecking cache for default-non_protected...[0;m Downloading cache from https://s3.cern.ch/swarmcache/swarmcache/project/401/default-non_protected[0;m ETag[0;m="18f5c5344585515b043fcd5fd2e83ad3" [32;1mSuccessfully extracted cache[0;m section_end:1742924703:restore_cache [0Ksection_start:1742924703:step_script [0K[0K[36;1mExecuting "step_script" stage of the job script[0;m[0;m [32;1m$ # INFO: Lowering limit of file descriptors for backwards compatibility. ffi: https://cern.ch/gitlab-runners-limit-file-descriptors # collapsed multi-line command[0;m [32;1m$ python -m venv ${CI_PROJECT_DIR}/.cache/pre-commit-venv # collapsed multi-line command[0;m Collecting pre-commit Downloading pre_commit-4.2.0-py2.py3-none-any.whl (220 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 220.7/220.7 kB 7.1 MB/s eta 0:00:00 Collecting nodeenv>=0.11.1 Downloading nodeenv-1.9.1-py2.py3-none-any.whl (22 kB) Collecting virtualenv>=20.10.0 Downloading virtualenv-20.29.3-py3-none-any.whl (4.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.3/4.3 MB 86.9 MB/s eta 0:00:00 Collecting identify>=1.0.0 Downloading identify-2.6.9-py2.py3-none-any.whl (99 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.1/99.1 kB 56.9 MB/s eta 0:00:00 Collecting cfgv>=2.0.0 Downloading cfgv-3.4.0-py2.py3-none-any.whl (7.2 kB) Collecting pyyaml>=5.1 Downloading PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (751 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 751.2/751.2 kB 125.2 MB/s eta 0:00:00 Collecting distlib<1,>=0.3.7 Downloading distlib-0.3.9-py2.py3-none-any.whl (468 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 469.0/469.0 kB 131.6 MB/s eta 0:00:00 Collecting filelock<4,>=3.12.2 Downloading filelock-3.18.0-py3-none-any.whl (16 kB) Collecting platformdirs<5,>=3.9.1 Downloading platformdirs-4.3.7-py3-none-any.whl (18 kB) Installing collected packages: distlib, pyyaml, platformdirs, nodeenv, identify, filelock, cfgv, virtualenv, pre-commit Successfully installed cfgv-3.4.0 distlib-0.3.9 filelock-3.18.0 identify-2.6.9 nodeenv-1.9.1 platformdirs-4.3.7 pre-commit-4.2.0 pyyaml-6.0.2 virtualenv-20.29.3 [notice] A new release of pip is available: 23.0.1 -> 25.0.1 [notice] To update, run: pip install --upgrade pip From https://gitlab.cern.ch/lhcb/Rec * branch master -> FETCH_HEAD [32;1m$ if ! pre-commit run --show-diff-on-failure --from-ref FETCH_HEAD --to-ref HEAD ; then # collapsed multi-line command[0;m test inputs use TestFileDB...........................(no files to check)Skipped trim trailing whitespace.................................................Failed - hook id: trailing-whitespace - exit code: 1 - files were modified by this hook Fixing Pr/PrVeloUT/src/PrUTMagnetTool.cpp fix end of files.........................................................Passed check yaml...........................................(no files to check)Skipped check for added large files..............................................Passed clang-format.............................................................Failed - hook id: clang-format - files were modified by this hook clang-format (non-standard extensions)...............(no files to check)Skipped ruff.................................................(no files to check)Skipped ruff-format..........................................(no files to check)Skipped All changes made by hooks: diff --git a/Pr/PrVeloUT/src/PrUTMagnetTool.cpp b/Pr/PrVeloUT/src/PrUTMagnetTool.cpp index c25395137e..b62e15bf60 100644 --- a/Pr/PrVeloUT/src/PrUTMagnetTool.cpp +++ b/Pr/PrVeloUT/src/PrUTMagnetTool.cpp @@ -58,7 +58,7 @@ namespace LHCb::Pr { // calculate z of half Bdl std::array<float, np + 1> bdlTmp; - int n = 0; + int n = 0; while ( z < zStop ) { aPoint.SetY( y ); @@ -66,227 +66,225 @@ namespace LHCb::Pr { bField = magnet.fieldVector( aPoint ); Bdl += dy * bField.z() - dz * bField.y(); - - if ( zStart > 100.f * Gaudi::Units::cm ) - bdlTmp[n++] = Bdl; - } - z += dz; - y += dy; + + if ( zStart > 100.f * Gaudi::Units::cm ) bdlTmp[n++] = Bdl; } + z += dz; + y += dy; + } - float bdlhalf = std::abs( Bdl ) / 2.; + float bdlhalf = std::abs( Bdl ) / 2.; - for ( unsigned int i = 5; i < n - 5; i++ ) { - if ( std::abs( bdlTmp[i] ) > bdlhalf ) { - float zrat = ( Bdl / 2. - bdlTmp[i - 1] ) / ( bdlTmp[i] - bdlTmp[i - 1] ); - zHalfBdl = zStart + (i - 0.5f + zrat) * dz; - break; - } + for ( unsigned int i = 5; i < n - 5; i++ ) { + if ( std::abs( bdlTmp[i] ) > bdlhalf ) { + float zrat = ( Bdl / 2. - bdlTmp[i - 1] ) / ( bdlTmp[i] - bdlTmp[i - 1] ); + zHalfBdl = zStart + ( i - 0.5f + zrat ) * dz; + break; } - - return { Bdl, zHalfBdl }; } - } // namespace - - const UTMagnetTool::Cache& UTMagnetTool::cache() const { - return m_cache.get( getConditionContext( Gaudi::Hive::currentContext() ) ); + return { Bdl, zHalfBdl }; } - StatusCode UTMagnetTool::initialize() { - return ConditionAccessorHolder::initialize().andThen( [&]() { - addConditionDerivation( { LHCb::standard_geometry_top, LHCb::Det::Magnet::det_path, DeUTDetLocation::location() }, - m_cache.key(), - [&]( const LHCb::Detector::DeLHCb& lhcb, const DeMagnet& magnet, - const DeUTDetector& utdet ) { return makeCache( lhcb, magnet, utdet ); } ); - } ); +} // namespace + +const UTMagnetTool::Cache& UTMagnetTool::cache() const { + return m_cache.get( getConditionContext( Gaudi::Hive::currentContext() ) ); +} + +StatusCode UTMagnetTool::initialize() { + return ConditionAccessorHolder::initialize().andThen( [&]() { + addConditionDerivation( { LHCb::standard_geometry_top, LHCb::Det::Magnet::det_path, DeUTDetLocation::location() }, + m_cache.key(), + [&]( const LHCb::Detector::DeLHCb& lhcb, const DeMagnet& magnet, + const DeUTDetector& utdet ) { return makeCache( lhcb, magnet, utdet ); } ); + } ); +} + +//========================================================================= +// Callback function for cache creation +//========================================================================= +UTMagnetTool::Cache UTMagnetTool::makeCache( const LHCb::Detector::DeLHCb& lhcb, const DeMagnet& magnet, + const DeUTDetector& utdet ) const { + UTMagnetTool::Cache c; + + prepareBdlTables( magnet, utdet, c ); + + prepareDeflectionTables( *lhcb.geometry(), magnet, c ); + + // check whether B=0 + auto bdl = f_bdl( magnet, 0., 0., 400. * Gaudi::Units::mm, c.zCenterUT ); + c.noField = ( std::abs( bdl.BdlTrack ) < 10e-4 ); + + if ( c.noField ) { + info() << " No B field detected." << endmsg; + // override computed values with hardcoded constants + c.dist2mom = s_averageDist2mom_NoB; + c.zMidField = s_zMidField_NoB; + } else { + c.zMidField = c.lutZHalfBdl->getInterpolatedValue( { 0.05, 0.0, 0.0 } ); } - //========================================================================= - // Callback function for cache creation - //========================================================================= - UTMagnetTool::Cache UTMagnetTool::makeCache( const LHCb::Detector::DeLHCb& lhcb, const DeMagnet& magnet, - const DeUTDetector& utdet ) const { - UTMagnetTool::Cache c; - - prepareBdlTables( magnet, utdet, c ); - - prepareDeflectionTables( *lhcb.geometry(), magnet, c ); - - // check whether B=0 - auto bdl = f_bdl( magnet, 0., 0., 400. * Gaudi::Units::mm, c.zCenterUT ); - c.noField = ( std::abs( bdl.BdlTrack ) < 10e-4 ); - - if ( c.noField ) { - info() << " No B field detected." << endmsg; - // override computed values with hardcoded constants - c.dist2mom = s_averageDist2mom_NoB; - c.zMidField = s_zMidField_NoB; - } else { - c.zMidField = c.lutZHalfBdl->getInterpolatedValue( { 0.05, 0.0, 0.0 } ); + return c; +} + +//========================================================================= +// prepareBdlTables +//========================================================================= +void UTMagnetTool::prepareBdlTables( const DeMagnet& magnet, const DeUTDetector& utdet, UTMagnetTool::Cache& c ) const { + + if ( msgLevel( MSG::DEBUG ) ) debug() << "Start generation of VeloUT Bdl LUTs" << endmsg; + // prepare table with Bdl integrations + // Bdl integral depends on 3 track parameters + // slopeY - y slope of the track + // zOrigin - z of track intersection with z axis (in YZ projection) + // zVeloEnd - z of the track at which slopeY is given + // slopeY zOrigin zVeloEnd + // m_zCenterUT is a normalization plane which should be close to middle of UT. + // It is used to normalize dx deflection at different UT layers. + // No need to update with small UT movement up to +- 5 cm. + + c.zCenterUT = 2484.6; + float zCenterUT = 0.; + + assert( utdet.layerSizeOK() ); + unsigned il = 0; + utdet.applyToAllLayers( [&il, &zCenterUT, &c]( DeUTLayer const& layer ) { + if ( ( il < c.zLayers.size() ) ) { + float zlay = layer.z(); + c.zLayers[il++] = zlay; + zCenterUT += zlay; } - - return c; + } ); + zCenterUT /= c.zLayers.size(); + + if ( std::abs( c.zCenterUT - zCenterUT ) > 50. ) { + warning() << "Calculated center of UT station far away from nominal value: " << zCenterUT << " wrt nominal " + << c.zCenterUT << endmsg; + warning() << " Calculated value taken: " << zCenterUT << endmsg; + c.zCenterUT = zCenterUT; } - - //========================================================================= - // prepareBdlTables - //========================================================================= - void UTMagnetTool::prepareBdlTables( const DeMagnet& magnet, const DeUTDetector& utdet, - UTMagnetTool::Cache& c ) const { - - if ( msgLevel( MSG::DEBUG ) ) debug() << "Start generation of VeloUT Bdl LUTs" << endmsg; - // prepare table with Bdl integrations - // Bdl integral depends on 3 track parameters - // slopeY - y slope of the track - // zOrigin - z of track intersection with z axis (in YZ projection) - // zVeloEnd - z of the track at which slopeY is given - // slopeY zOrigin zVeloEnd - // m_zCenterUT is a normalization plane which should be close to middle of UT. - // It is used to normalize dx deflection at different UT layers. - // No need to update with small UT movement up to +- 5 cm. - - c.zCenterUT = 2484.6; - float zCenterUT = 0.; - - assert( utdet.layerSizeOK() ); - unsigned il = 0; - utdet.applyToAllLayers( [&il, &zCenterUT, &c]( DeUTLayer const& layer ) { - if ( ( il < c.zLayers.size() ) ) { - float zlay = layer.z(); - c.zLayers[il++] = zlay; - zCenterUT += zlay; + // warning: layers a-priori not in order of increasing z! + std::sort( c.zLayers.begin(), c.zLayers.end() ); + + for ( int i = 0; i < 10; i++ ) { + for ( int j = 0; j < 10; j++ ) { + for ( int k = 0; k < 30; k++ ) { + auto offset = ( i * 10 + j ) * 30 + k; + float var0 = c.lutBdl->min( 0 ) + k * c.lutBdl->delta( 0 ); + float var1 = c.lutBdl->min( 1 ) + j * c.lutBdl->delta( 1 ); + float var2 = c.lutBdl->min( 2 ) + i * c.lutBdl->delta( 2 ); + auto bdl = f_bdl( magnet, var0, var1, var2, c.zCenterUT ); + c.lutBdl->table()[offset] = bdl.BdlTrack; + c.lutZHalfBdl->table()[offset] = bdl.zHalfBdlTrack; } - } ); - zCenterUT /= c.zLayers.size(); - - if ( std::abs( c.zCenterUT - zCenterUT ) > 50. ) { - warning() << "Calculated center of UT station far away from nominal value: " << zCenterUT << " wrt nominal " - << c.zCenterUT << endmsg; - warning() << " Calculated value taken: " << zCenterUT << endmsg; - c.zCenterUT = zCenterUT; } - // warning: layers a-priori not in order of increasing z! - std::sort( c.zLayers.begin(), c.zLayers.end() ); - - for (int i=0; i<10; i++) { - for (int j=0; j<10; j++) { - for (int k=0; k<30; k++) { - auto offset = (i * 10 + j) * 30 + k; - float var0 = c.lutBdl->min(0) + k * c.lutBdl->delta(0); - float var1 = c.lutBdl->min(1) + j * c.lutBdl->delta(1); - float var2 = c.lutBdl->min(2) + i * c.lutBdl->delta(2); - auto bdl = f_bdl(magnet, var0, var1, var2, c.zCenterUT); - c.lutBdl->table()[offset] = bdl.BdlTrack; - c.lutZHalfBdl->table()[offset] = bdl.zHalfBdlTrack; - } - } - } - - /*c.lutBdl->fillTable( [&]( LHCb::span<const float, 3> var ) { - return f_bdl( magnet, var[0], var[1], var[2], c.zCenterUT ).BdlTrack; - } ); - - c.lutZHalfBdl->fillTable( [&]( LHCb::span<const float, 3> var ) { - return f_bdl( magnet, var[0], var[1], var[2], c.zCenterUT ).zHalfBdlTrack; - } );*/ - - if ( msgLevel( MSG::DEBUG ) ) debug() << "Generation of VeloUT Bdl LUTs finished" << endmsg; } - //========================================================================= - // prepareDeflectionTables - //========================================================================= - - void UTMagnetTool::prepareDeflectionTables( IGeometryInfo const& geometry, const DeMagnet& magnet, - UTMagnetTool::Cache& c ) const { - - if ( msgLevel( MSG::DEBUG ) ) debug() << "Start generation of VeloUT deflection LUTs" << endmsg; - - // tmp state - LHCb::State tmpState; - float qpBeg = 1. / ( 10. * Gaudi::Units::GeV ); - tmpState.setState( 0., 0., 0., 0., 0., qpBeg ); - // set dummy covariance matrix - Gaudi::TrackSymMatrix cov = Gaudi::TrackSymMatrix(); - cov( 0, 0 ) = 0.1; - cov( 1, 1 ) = 0.1; - cov( 2, 2 ) = 0.1; - cov( 3, 3 ) = 0.1; - cov( 4, 4 ) = 0.1; - tmpState.setCovariance( cov ); - - // determine normalization factors for deflections in different UT layers - // wrt center of UT - auto dxLay = [&]( LHCb::span<const float, 2> lutVar ) { - auto idLay = int( lutVar[0] + 0.000001 ); - auto dydzBeg = lutVar[1]; - auto zLay = c.zLayers[idLay]; - - if ( msgLevel( MSG::DEBUG ) ) { - debug() << lutVar[0] << " " << lutVar[1] << " " - << " idlay " << idLay << " " << c.zLayers.size() << " zlay" << zLay << " " << endmsg; - } - - tmpState.setState( 0., 0., 0., 0., dydzBeg, qpBeg ); + /*c.lutBdl->fillTable( [&]( LHCb::span<const float, 3> var ) { + return f_bdl( magnet, var[0], var[1], var[2], c.zCenterUT ).BdlTrack; + } ); + + c.lutZHalfBdl->fillTable( [&]( LHCb::span<const float, 3> var ) { + return f_bdl( magnet, var[0], var[1], var[2], c.zCenterUT ).zHalfBdlTrack; + } );*/ + + if ( msgLevel( MSG::DEBUG ) ) debug() << "Generation of VeloUT Bdl LUTs finished" << endmsg; +} + +//========================================================================= +// prepareDeflectionTables +//========================================================================= + +void UTMagnetTool::prepareDeflectionTables( IGeometryInfo const& geometry, const DeMagnet& magnet, + UTMagnetTool::Cache& c ) const { + + if ( msgLevel( MSG::DEBUG ) ) debug() << "Start generation of VeloUT deflection LUTs" << endmsg; + + // tmp state + LHCb::State tmpState; + float qpBeg = 1. / ( 10. * Gaudi::Units::GeV ); + tmpState.setState( 0., 0., 0., 0., 0., qpBeg ); + // set dummy covariance matrix + Gaudi::TrackSymMatrix cov = Gaudi::TrackSymMatrix(); + cov( 0, 0 ) = 0.1; + cov( 1, 1 ) = 0.1; + cov( 2, 2 ) = 0.1; + cov( 3, 3 ) = 0.1; + cov( 4, 4 ) = 0.1; + tmpState.setCovariance( cov ); + + // determine normalization factors for deflections in different UT layers + // wrt center of UT + auto dxLay = [&]( LHCb::span<const float, 2> lutVar ) { + auto idLay = int( lutVar[0] + 0.000001 ); + auto dydzBeg = lutVar[1]; + auto zLay = c.zLayers[idLay]; + + if ( msgLevel( MSG::DEBUG ) ) { + debug() << lutVar[0] << " " << lutVar[1] << " " + << " idlay " << idLay << " " << c.zLayers.size() << " zlay" << zLay << " " << endmsg; + } - LHCb::State stalin_mid = tmpState; - LHCb::State stapar_mid = tmpState; - // extrapolate state to middle of UT - // extrapolate state to middle of UT - StatusCode sc1 = - m_linear->propagate( stalin_mid, c.zCenterUT, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); - StatusCode sc2 = - m_parabolic->propagate( stapar_mid, c.zCenterUT, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); + tmpState.setState( 0., 0., 0., 0., dydzBeg, qpBeg ); - if ( sc1.isFailure() || sc2.isFailure() ) { ++m_ExtrapolationFailed; } + LHCb::State stalin_mid = tmpState; + LHCb::State stapar_mid = tmpState; + // extrapolate state to middle of UT + // extrapolate state to middle of UT + StatusCode sc1 = + m_linear->propagate( stalin_mid, c.zCenterUT, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); + StatusCode sc2 = + m_parabolic->propagate( stapar_mid, c.zCenterUT, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); - float ratio = 0.; - LHCb::State stalin_lay = tmpState; - LHCb::State stapar_lay = tmpState; + if ( sc1.isFailure() || sc2.isFailure() ) { ++m_ExtrapolationFailed; } - StatusCode sc3 = m_linear->propagate( stalin_lay, zLay, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); - StatusCode sc4 = m_parabolic->propagate( stapar_lay, zLay, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); + float ratio = 0.; + LHCb::State stalin_lay = tmpState; + LHCb::State stapar_lay = tmpState; - if ( sc3.isFailure() || sc4.isFailure() ) { - ++m_ExtrapolationFailed; - } else { - auto dx_mid = stapar_mid.x() - stalin_mid.x(); - auto dx_lay = stapar_lay.x() - stalin_lay.x(); - if ( std::abs( dx_mid ) > 1.e-8 ) ratio = dx_mid / dx_lay; - } - return ratio; - }; + StatusCode sc3 = m_linear->propagate( stalin_lay, zLay, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); + StatusCode sc4 = m_parabolic->propagate( stapar_lay, zLay, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); - c.lutDxLay->fillTable( dxLay ); - - // distance to momentum table (depends on y slope only) - auto dxToMom = [&]( LHCb::span<const float, 1> var ) { - tmpState.setState( 0., 0., 0., 0., var[0], qpBeg ); - LHCb::State stalin_mid = tmpState; - LHCb::State stapar_mid = tmpState; - // extrapolate state to middle of UT - StatusCode sc1 = - m_linear->propagate( stalin_mid, c.zCenterUT, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); - StatusCode sc2 = - m_parabolic->propagate( stapar_mid, c.zCenterUT, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); - - float dx2mom = 0.; - if ( sc1.isFailure() || sc2.isFailure() ) { - ++m_ExtrapolationFailed; - } else { - float dx = stapar_mid.x() - stalin_mid.x(); - if ( std::abs( dx ) > 1e-8 ) dx2mom = qpBeg / dx; - } - return dx2mom; - }; + if ( sc3.isFailure() || sc4.isFailure() ) { + ++m_ExtrapolationFailed; + } else { + auto dx_mid = stapar_mid.x() - stalin_mid.x(); + auto dx_lay = stapar_lay.x() - stalin_lay.x(); + if ( std::abs( dx_mid ) > 1.e-8 ) ratio = dx_mid / dx_lay; + } + return ratio; + }; + + c.lutDxLay->fillTable( dxLay ); + + // distance to momentum table (depends on y slope only) + auto dxToMom = [&]( LHCb::span<const float, 1> var ) { + tmpState.setState( 0., 0., 0., 0., var[0], qpBeg ); + LHCb::State stalin_mid = tmpState; + LHCb::State stapar_mid = tmpState; + // extrapolate state to middle of UT + StatusCode sc1 = + m_linear->propagate( stalin_mid, c.zCenterUT, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); + StatusCode sc2 = + m_parabolic->propagate( stapar_mid, c.zCenterUT, geometry, LHCb::Tr::PID::Pion(), magnet.fieldGrid() ); + + float dx2mom = 0.; + if ( sc1.isFailure() || sc2.isFailure() ) { + ++m_ExtrapolationFailed; + } else { + float dx = stapar_mid.x() - stalin_mid.x(); + if ( std::abs( dx ) > 1e-8 ) dx2mom = qpBeg / dx; + } + return dx2mom; + }; - c.lutDxToMom->fillTable( dxToMom ); + c.lutDxToMom->fillTable( dxToMom ); - // determine distToMomentum parameter - c.dist2mom = c.lutDxToMom->getValue( { 0.05 } ); + // determine distToMomentum parameter + c.dist2mom = c.lutDxToMom->getValue( { 0.05 } ); - if ( msgLevel( MSG::DEBUG ) ) debug() << "Generation of VeloUT deflection LUTs finished" << endmsg; - } + if ( msgLevel( MSG::DEBUG ) ) debug() << "Generation of VeloUT deflection LUTs finished" << endmsg; +} } // namespace LHCb::Pr //**************************************************************************** Generating patch file... 0001-pre-commit-fixes.patch ======================================= You can apply these changes with: curl https://gitlab.cern.ch/lhcb/Rec/-/jobs/53287440/artifacts/raw/0001-pre-commit-fixes.patch | git am ======================================= section_end:1742924708:step_script [0Ksection_start:1742924708:upload_artifacts_on_failure [0K[0K[36;1mUploading artifacts for failed job[0;m[0;m [32;1mUploading artifacts...[0;m 0001-pre-commit-fixes.patch: found 1 matching artifact files and directories[0;m Uploading artifacts as "archive" to coordinator... 201 Created[0;m id[0;m=53287440 responseStatus[0;m=201 Created token[0;m=glcbt-64 section_end:1742924709:upload_artifacts_on_failure [0Ksection_start:1742924709:cleanup_file_variables [0K[0K[36;1mCleaning up project directory and file based variables[0;m[0;m section_end:1742924710:cleanup_file_variables [0K[31;1mERROR: Job failed: command terminated with exit code 1 [0;m