diff --git a/Detector/UT/include/Detector/UT/DeUTSensor.h b/Detector/UT/include/Detector/UT/DeUTSensor.h index 3cece986b7468bf9210af5cc6f85072adadad73c..c270a565c513a00bca8afff6227dde4fbef640aa 100644 --- a/Detector/UT/include/Detector/UT/DeUTSensor.h +++ b/Detector/UT/include/Detector/UT/DeUTSensor.h @@ -97,6 +97,12 @@ namespace LHCb::Detector::UT { return ( strip >= firstStrip() ) && strip < nStrip() + firstStrip(); } LineTraj trajectory( unsigned int strip, double offset ) const { + if ( dd4hep::_toInt( "WithCorrectedP0Parameter" ) && !isStrip( strip ) ) { + throw std::out_of_range( + fmt::format( "DeUTSector::createTraj: strip out of range, given {strip}, expect [{first}, {last}]", + fmt::arg( "strip", strip ), fmt::arg( "first", firstStrip() ), + fmt::arg( "last", firstStrip() + nStrip() - 1 ) ) ); + } const double arclen = ( ( xInverted() && getStripflip() ) ? ( nStrip() - offset - strip - ( firstStrip() + 1 ) % 2 ) : ( offset + strip - firstStrip() ) ) * diff --git a/Detector/UT/src/DeUT.cpp b/Detector/UT/src/DeUT.cpp index d9b1d77ed1f207f4386bf6ed4f151b99e9d306c1..324019272f7281dc74d549e2026bd1dcbc899f20 100644 --- a/Detector/UT/src/DeUT.cpp +++ b/Detector/UT/src/DeUT.cpp @@ -236,10 +236,18 @@ LHCb::Detector::UT::detail::DeUTSectorObject::DeUTSectorObject( const dd4hep::De { // cacheInfo auto thisSector = DeUTSector{this}; - auto firstTraj = thisSector.createTraj( thisSector.firstStrip(), 0 ); - // if ( m_stripflip && xInverted() ) firstTraj = createTraj( m_nStrip, 0 ); - if ( thisSector.stripflip() && thisSector.xInverted() ) - firstTraj = thisSector.createTraj( thisSector.nStrip() + thisSector.firstStrip(), 0 ); + auto firstTraj = thisSector.trajectoryFirstStrip(); + if ( thisSector.stripflip() && thisSector.xInverted() ) { + if ( dd4hep::_toInt( "WithCorrectedP0Parameter" ) ) { + // use CORRECT p0 parameter since 2025 data taking (>2024-v00.00) + dd4hep::printout( dd4hep::DEBUG, "UT::cacheInfo", "With correct p0 parameter" ); + firstTraj = thisSector.trajectoryLastStrip(); + } else { + // use WRONG p0 parameter before 2025 data taking (<=2024-v00.00) + dd4hep::printout( dd4hep::DEBUG, "UT::cacheInfo", "With wrong p0 parameter" ); + firstTraj = thisSector.createTraj( thisSector.nStrip() + thisSector.firstStrip(), 0 ); + } + } // get the start and end point. for piecewise trajectories, we // effectively make an approximation by a straight line. diff --git a/compact/components/UT/2024-v00.00/parameters.xml b/compact/components/UT/2024-v00.00/parameters.xml index 3c30e6ccb341be203ac604b1598677059f7e41bf..975c1670eb3c4f960285be6466bf360b3c9de27e 100644 --- a/compact/components/UT/2024-v00.00/parameters.xml +++ b/compact/components/UT/2024-v00.00/parameters.xml @@ -17,6 +17,10 @@ + + + + diff --git a/compact/components/UT/trunk/parameters.xml b/compact/components/UT/trunk/parameters.xml index ec30eddb29d86aaccd0e0cd0fd42e3521c881152..7d976324fd96db7a689a39a07745ce2c1162f424 100644 --- a/compact/components/UT/trunk/parameters.xml +++ b/compact/components/UT/trunk/parameters.xml @@ -17,6 +17,10 @@ + + + +